Yann Quinsat
email: yann.quinsat@ens-cachan.fr

Lorène Dubreuil

Claire Lartigue

A novel approach for in-situ detection of machining defects

Keywords: In-situ Measurement, Calibration, Stereocorrelation, Inspection Process Planning

Integrating inspection procedures in the machining process contributes to process optimization. The use of in-situ measurement allows a better reactivity for corrective actions. However, to be highly efficient, Machining and Inspection Process Planning must reach a high level of integration. It is here essential to focus on the compromise measurement time vs precision: the time dedicated to inspection must be limited, but not to the detriment of measurement quality. A measurement process for in-situ machining defect detection is proposed based on a stereo-DIC. The proposed method allows the direct comparison between images of the machined part and the CAD model by means of a CADmodel based calibration method which links the camera frame to the CAM frame. Therefore, starting from a meshed-model representation of the part, local regions of interest are defined corresponding to the projection of each facet onto the two images. An optimization of each facet configuration is then performed in order to minimize a cross-correlation coefficient, and the obtained facet displacement is used to detect machining defects. The robustness of the method is assessed through an illustration of measurement in the machine-tool environment.

Introduction

Machining process monitoring is an essential challenge for the control of production costs and of the quality of manufactured parts. The process-setting stage generally requires 100% inspection of the first manufactured parts. Inspection procedures are increasingly integrated in the machining process. Associated benefits include high speed of inspection, measurement flexibility, on-machine inspection, and the possibility of 100% inspection [START_REF] Chen | Vision-based automated inspection system in computer integrated manufacturing[END_REF]. In the context of integrated inspection, three types of measurement can be differentiated: in-situ measurement, in-process measurement, and onmachine measurement [START_REF] Vacharanukul | In-process dimensional inspection sensors[END_REF]. In-situ measurement encompasses all the measurement techniques which are performed in the machine environment, more particularly in-process measurement, and on-machine measurement. During in-process measurement, the manufacturing process is not stopped, and inspection is carried out simultaneously with part machining. In this case, the measurement is not necessarily the geometry of the part but can be another characteristic such as cutting forces, spindle vibrations, and so on. On the other hand, on-machine measurement is performed while the part is still located in the machinetool but while the machining process is stopped. Here, the machine-tool holds the sensor, classically a touch probe, and allows sensor displacements as on classical Coordinate Measuring Machines (CMM) [START_REF] Mears | Quality and inspection of machining operations: Cmm integration to the machine tool[END_REF]. For insitu measurement of geometry, non-contact techniques are more and more used, as they represent a good compromise between rapidity and resolution. For instance, they are used to control roughness defects during turning [START_REF] Shahabi | Simulation and measurement of surface roughness via grey scale image of tool in finish turning[END_REF], to measure geometrical deviations during 3axis milling [START_REF] Poulhaon | Simulation-based adaptative toolpath generation in milling processes[END_REF] or to monitor 3D surface topography during polishing [START_REF] Quinsat | In situ non-contact measurements of surface roughness[END_REF].

Whatever the sensor used, in-situ measurement enables rapid decision making regarding the part's geometrical conformity, as the measurement stage is performed during the manufacturing phase. A direct link exists between Computed-Aided Inspection (CAI) and Computer-Aided Manufacturing (CAM), which can lead to a complete integrated manufacturing process [START_REF] Chen | Vision-based automated inspection system in computer integrated manufacturing[END_REF]. However, a high level of integration requires the process planning to be changed in order to adapt to the specificity of in-situ measurements. In their approach, Cho and Seo. [START_REF] Cho | Inspection planning strategy for the on-machine measurement process based on cad/cam/cai integration[END_REF] present an inspection process planning strategy for on-machine measurement of sculptured surfaces using a touch probe. They base their approach on the concept of CAD/CAM/CAI integration, meaning that CAD/CAM data are integrated into the CAI process.

In particular, they propose to use cutter contact points to define measuring-point locations in order to avoid inspection errors induced by cusp heights. Lee et al. [START_REF] Lee | A computeraided inspection planning system for on-machine measurement part i: Global inspection planning[END_REF] and Cho et al. [START_REF] Cho | A computeraided inspection planning system for on-machine measurement part ii: Local inspection planning[END_REF] base their approach on features and on two main steps: a global step and a local step. The global step gathers and orders all the features prior to the measurement step, during which the probe trajectories are defined for each feature. More recently, Zhao [START_REF] Zhao | Step-nc enabled on-line inspection in support of closed-loop machining[END_REF][START_REF] Zhao | A PLM-Based Multi-Sensor Integration Measurement System for Geometry Processing[END_REF] developed a data model foron-machine inspection using a touch probe using STEP-NC format. The main drawback associated with in-situ measurement is that the machine is unavailable during the measurement phase. This can lead to a loss of productivity. As a result, Machining and Inspection Process Planning (MIPP) turns out to be the key point to reach a high level of integration. It thus becomes essential to focus on the compromise measurement time vs precision. Therefore, we propose to decompose the measurement operation into two steps. The first step, referred to as pre-measurement, aims at determining and locating potential defects without necessarily quantifying them. If defects are detected during the pre-measurement stage, then the measurement operation is started to quantify the defects before correcting the machining process. As the pre-measurement acts as a decision-support tool, a vision-based system is adopted because it can easily be implemented within the machine-tool environment and can acquired data swiftly.

This paper is organized as follows. The next section presents our approach for Machining and Inspection Process Planning (MIPP) based on in-situ measurements. A SySml formalism is adopted to clearly bring out resources, data and data exchanges. Integration of inspection within the manufacturing process leads to new challenges, such as adapting manufacturing and inspection plans so as not to penalize production time and nor, consequently, total costs. The originality of the process planning we propose is to include a step of pre-measurement to localize defects before the measurement step, which can thus be initiated if needed. Section 3 is dedicated to the description of this premeasurement step, which is performed based on vision, and uses stereo-DIC (Digital Image Correlation). The novel method we develop takes advantage of the CADmodel based calibration method that makes the manufacturing and measurement frames coincide. A point that may also be emphasized is the use of a tessellated representation of the CAD model to define wise regions of interest for stereo-DIC. Finally, in section 4 we assess the method, through a test case performed in real machine-tool environment.

Machining and Inspection process planning

Process planning translates information into the process plan which specifies how the product is manufactured. This includes the definition of operations, operation sequences, set-up instructions, and step-by-step work instructions. In order to make more effective use of in-situ measurement, we propose to model all process resources, including resources linked to inspection process.

Data description

Systems, resources and data exchanges are modeled using the Systems Modeling Language (SysML), as it is well-adapted for system engineering applications. The system we consider is the whole manufacturing process including machining and in-situ measurement operations. In SysML, a block can be a system, a device, software or data. The block diagramm describes the main relationships between blocks. Therefore, the differences between the machining process with off-line measurement and the one with in-situ measurement can be illustrated through block diagramms as it is displayed in figure 2. The CAD model results from the expression of the design intents into the part geometry, generally as a set of features, along with dimensional and geometrical specifications associated with functional surfaces (GD&T). The CAD model is the starting point of the process.

The CAM model enables the representation of the different part states throughout the whole process. It includes the machining features, which correspond to geometrical features and to associated machining processes. Intermediate states can be represented by inprocess models that generally consist of a polyhedral mesh, resulting from NC-simulation, definition of the resources (tool, fixtures, and machine-tools), and manufacturing tolerances. The machining plan provides ordered operation sequences, step-by-step work instructions, including dimensions related to each individual operation, machining parameters, and set-up instructions. The measurement plan plays the same role as the machining plan for measuring operations. The actual part consists of the machined features that can be related to the machining features of the CAM model, and to the features of the CAD model. Each machined feature presents various geometrical deviations that must be measured. The machine-tool, defined as a poly-articulated structure, allows part manufacturing. Tools, holders, and set-ups are generally associated to the machine-tool.

The dedicated measuring machine is the same element as the machine-tool, but for measuring operations with sensors instead of tools. In-situ measurement reduces the number of blocks from 7 to 5 by removing the dedicated measuring machine and by merging machining and measuring plans (figure 2(b)). Data exchanges are thus facilitated, and machining and measuring operations can be performed during the same phase using the same part set-up and, as a result, in the same reference frame, which is an interesting advantage, as we will see later. With the sysML model, it becomes possible to identify the components, their sub-components and how data flow between them. Such a modeling also brings out relevant parameters for an effective and efficient manufacturing process. Two key points are thus highlighted to enhance in-situ measurement efficiency. First, the measurement plan does not only rely on the CAD model, but also depends on the CAM model, and more precisely on the in-process model (obtained at the end of each machining operation). Secondly, and as a consequence, measurement results have to be directly linked to the CAM model.

Activity description

Considering the previous modeling, the sequencing of machining and measurement operations can be represented through an activity diagram as displayed in figure 4. Our approach brings out three activities in the machine-tool. The first operation, as usual, is the machining operation. It is followed by in-situ measurement, which verifies the conformity at the end of the machining operation. The last activity corresponds to possible corrective operations in case of non conformity.

The measurement step requires the selection of a sensor according to the characteristic to be evaluated. The issue of sensor selection has been addressed in previous studies [START_REF] Dubreuil | Multi-sensor approach for multi-scale machining defect detection[END_REF][START_REF] Mehdi-Souzani | A knowledge database of qualified digitizing systems for the selection of the best system according to the application[END_REF] with the aim of finding the most appropriate sensor depending on capacity and quality criteria (resolution, acquisition time, trueness, noise, etc) well-adapted to the defect to be measured. One major difficulty in making the best choice is to predict the defect location and its scale (micro or macrodefect). On the other hand, as in-situ measurement makes the machine-tool unavailable for machining during measurement phases, measurement time can become highly penalizing on productivity. Therefore, we propose to add an operation specifically dedicated to defect detection before the measurement (figure 4). This operation, called pre-measurement, aims at determining and locating potential areas of deviations without necessarily quantifying them. To be efficient, this premeasurement step can be performed using a visionbased system, acting as a decision-support tool. The measurement operation is only started if the system detects deviations on the part due to the machining operation. The choice of a stereo-vision system is motivated by its simplicity of implementation within the machinetool environment, and its rapidity to acquire data (or images). The method we propose for image processing relies on stereo-digital image correlation (Stereo-DIC). Its originality lies in the use of the CAD model, or the in-process model, to support image correlation. Furthermore, the simple analysis of correlation scores enables the detection and the location of machining defects.

Stereo-vision system for in-situ detection of part defects

The stereo-vision system is an analysis tool for deciding whether the measurement operation is necessary or not. The system we propose, which consists of 2 cameras, is located in the machine-tool environment and allows simple on-machine measurements (figure 5). Classically, stereo-vision system gives the possibility of re-constructing a 3D part from a pair of corresponding images. 3D point coordinates are calculated from their relative position in two image pairs thanks to the calibration. Once two images of the part are acquired, it is necessary to match corresponding points on the two images. For this purpose, Stereo-DIC is used in our study. As previously said, measurement operations must be highly efficient so as not to alter process productivity. To answer this issue, the proposed method takes advantages of the CAD model for both system calibration and image correlation.

3.1 Calibration principle [START_REF] Dubreuil | Calibration based on part set-up measurement for on-machine inspection using vision[END_REF] Calibration aims at identifying the model parameters that define the relationship between the coordinates of a 2D point, expressed in the picture frame R p , and the coordinates of a 3D point expressed in the reference frame R w .

  u v 1   Rp = A.D.P.T.     X Y Z 1     Rw = M.T.     X Y Z 1     Rw (1)
Based on the pinhole model (Fig. 6), the relationship between R p and R w results from the combination of the geometric transformations A, D, P , and T as defined in (Eq. 1). The matrix A corresponds to the affine transformation from the "center" picture frame R r to the picture frame R p .The transformation P is a perspective projection of R c , the frame attached to the camera, into the retinal plane R r . The transformation D corresponds to camera distortions. The parameters associated with the matrices A, D, and P correspond to the internal calibration parameters also called the intrinsic parameters: the focal f c , the picture center position C cu and C cv , the pixel size s p , the pixel number n p , and the distortion parameters k i (for i = 1 to 5).

The transformation T between the reference frame R w and the camera frame R c corresponds to the combination of a rotation R(3 * 3) and of a translation t. T , and can be described thanks to a homogeneous matrix. Its parameters are called extrinsic parameters.

To be efficient, in-situ vision must be performed in the same reference frame than that of the machining operation. This implies that the measurement frame and the CAM frame coincide, and as a result, the calibration of the vision system must be carried out in the CAM frame. For this purpose, in a previous study, we proposed a CAD model-based approach for calibrating a vision-system [START_REF] Dubreuil | Calibration based on part set-up measurement for on-machine inspection using vision[END_REF]. In this approach, the reference frame is the CAM frame R w = R CAM . During in-situ vision, intrinsic parameters are fixed and do not vary. Therefore, the transformation M = A.D.P between R p and R c is completely defined, and the objective is to identify the extrinsic parameters i.e. the elements of the transformation matrix T . The method proposed in [START_REF] Dubreuil | Calibration based on part set-up measurement for on-machine inspection using vision[END_REF] uses a correspondence between a set of 3D features of the setup CAD model and the corresponding 2D features in the image of the actual machining set-up to determine the matrix T using the least-square method. Once the correspondence is established, the transformation G between R p and R CAM is known, and T is simply given by:

T = M -1 .G (2)
The calibration so defined directly links the camera frame R c to the CAM frame R CAM . A way to assess the quality of calibration is to evaluate the noise of calibration [START_REF] Lavest | Computer Vision -ECCV'98: 5th European Conference on Computer Vision[END_REF]. This evaluation relies on the calculation of the residual vector V :

V = (I -J • (J T • J) -1 • J) • E(Φ) (3)
Where Φ is the vector of the intrinsic parameters to be identified, E(Φ) is the error vector, and J = ∂E ∂Φ Φ . It is thus possible to calculate an estimation of the calibration noise according to the system redundancy r, i.e the difference between the number of independent equations and the number of unknowns:

σ 2 0 = V T • V r (4)
Fig. 6 Pinhole model Légende Extracted feature from picture 3D feature projected on picture (before calibration) 3D feature projected on picture (after calibration) Fig. 7 Calibration from set-up measurement in real environment from [START_REF] Dubreuil | Calibration based on part set-up measurement for on-machine inspection using vision[END_REF] It is worth noting that the calibration noise is defined for each camera, which means a noise, expressed in pixels, is thus associated with both images, the right and the left. For instance, in our approach, calibration is performed using the set-up represented in figure 7. The estimation of the calibration noise using equation 4 provides respectively σ l 0 = 1.64 pixel for the left camera and σ r 0 = 1.68 pixel for the right camera. As it will be highlighted, the defect detection method detailed in the next section is very dependent on this parameter, reflecting calibration quality.

Stereo-DIC for defect detection

The method we propose to detect and localize part defects relies on the stereo-Digital Image Correlation principle (Stereo-DIC). The aim is to determine areas of the part being machined that do not correspond to the CAD model (or in-process model) using stereo-DIC. The originality or our approach lies in the use of the CAD model to define the cross-correlation coefficient between the two images.

Calculation of the cross-correlation coefficient

Each camera of the stereo-vision system gives a 2D image of part surface. Prior to 3D surface reconstruction, it is necessary to define correspondence between the two images. Stereo-DIC methods provide some solutions to this issue, also called image matching problem. As it is not possible to find the correspondence of a single pixel in one image in a second image, the idea is to find the correspondence of a small neighborhood around the pixel of interest, referred to as Region Of Interest (ROI). DIC algorithms compare the gray-levels of ROI in the two images using a cross-correlation coefficient that accounts for the similarity of the 2 ROI. Commonly, the ROI is rectangular and identical for the 2 images. These methods are largely used for measuring surface displacements under mechanical loads. In these cases, the shape of the ROI may differ from one image to the other, in order to take the possible deformation of the ROI during measurement into account [START_REF] Sutton | Image Correlation for Shape, Motion and Deformation Measurements: Basic Concepts,Theory and Applications[END_REF]. As far as stereo-DIC is concerned, it is worth noting that the part surface projection onto the two image-planes does not necessarily have the same geometry. The shape of each ROI must thus be adapted to the projected surface portion so that the calculation of the correlation coefficient can consistent [START_REF] Harvent | Shape measurement using a multiple-view Digital Image Correlation (DIC) method: application to the inspection of large-scale aerospace structures[END_REF][START_REF] Harvent | Shape measurement using a new 3d-dic algorithm that preserves sharp edges[END_REF]. The originality of the proposed method is the use of the CAD-model to define the shape of each ROI. More particularly, the CADmodel is meshed through a STL format. Considering that calibration is carried out (see section 3.1), each triangular facet of the mesh can be projected onto the image-plane of each camera (figure 9). The projection provides triangles of different sizes and orientations depending on the location and orientation of each facet relatively to each optical axis (figures 9(a) and 9(c)). Nevertheless, the shape of the facet is preserved and can be used as a ROI adapted to the local shape of the part.

Therefore, each 3D facet of the meshed CAD model is considered as a ROI. Projections of the considered ROI can then be compared without additional deformation, as is classical performed, and the cross-correlation coefficient can be easily calculated. In order to improve similarity evaluation, the ROI is sampled to provide a relatively significant number of evaluation points. Let us consider a facet F i , and the n evaluation points X i,j (figure 9(b)); the cross-correlation coefficient for F i is calculated as follows:

χ 2 i = n j=1 f l (x l i,j ) -f r (x r i,j ) 2 (5)
where x l i,j and x r i,j represent the projection of X i,j on the images, respectively, left and right, and f l (x l i,j ) i is similar to a SSD (Sum of Squared Differences) coefficient. It is used here to detect possible deviations between the machined part and its CAD-model. Indeed,if the coefficient χ 2 i is low, the measured part locally matches its CAD-model, and the part does not present local deviations. On the opposite, if a local deviation exists, the coefficient χ 2 i will be higher. This analysis can be carried out for all the visible areas of the part, and as a result, provides a cartography of the regions presenting deviations relatively to the CAD model. To illustrate our we propose to measure a test part with a predefined defect. The part is a plane surface, limited by a circle, and it is meshed as proposed in figure 10(b). The part actually machined consists of a truncated cone with a very high apex anglefigure 10(a)), so that the machined part is close to its model but presents a predictable region of defects (figure 12(a)). As a consequence, the correlation coefficient, computed from equation 5 for the left and right images of the part (figure 11), should be low on the middle region corresponding to the planar portion (in blue in figure 12(a)) and, on the opposite, high on the conical region (in red and purple in figure 12(a)). During machining, the part is positioned on the set-up that supports the system calibration. In other words, the CAM frame is attached to the part set-up (figure 10(a)). At the end of machining, the part, still located on its set-up, is measured using the stereo-vision system. Our approach is thus applied for each facet of the model, and the values of the calculated correlation coefficients are reported in figure 12(b). As expected, facets of the middle region present a low coefficient. But for the conical region, no significant trend is observable : some facets have a high coefficient and others do not. This can be explained by the combination of two main factors. The first one is obviously the presence of the defect itself. But variations of the correlation coefficient also likely result from calibration errors. Indeed, due to calibration errors, the projection of the facet in each image-plane is not perfectly located.Therefore, in each image-plane, the considered ROI is lightly shifted from its ideal position, and this provides some errors in the correlation coefficient calculation. As detailed in the previous section, (see 3.1), calibration errors can be expressed through the calibration noise σ 0 associated with each camera (equation 4). Searching regions of high correlation coefficient is then not a sufficient condition to identify regions of defects. It is necessary to optimize the position and orientation of each facet in order to minimize the correlation coefficient. After optimization, regions of deviations will be identified by thresholding the displacements based on the calibration noise coefficient.

Studied Mesh

Optimization of facet configuration

Each facet F i is characterized by the position of its barycentre X Bi (in the CAM frame) and its normal vector (defining its orientation) n i (figure 13). Let us consider the small displacement of the facet F i , denoted dB i [START_REF] Bourdet | The concept of the small displacement torsor in metrology[END_REF]. This displacement accounts for the rigid body movement of the facet, combination of a translation T = [du i dv i dw i ] t and three rotations dα i , dβ i , dγ i , which are assumed to be small enough to linearize the corresponding rotation matrix at the first order. Let us consider an evaluation point X i,j , and x l i,j and x r i,j its projections on the left and right images respectively figures 9(b)). Associated displacements are denoted dx l i,j and dx r i,j . Using equation 5, the crosscorrelation coefficient can thus be calculated as follows:

dB i = [dα i dβ i dγ i du i dv i dw i ] t (6)
χ 2 i = n j=1 f l (x l i,j + dx l i,j ) -f r (x r i,j + dx r i,j ) 2 (7)
The linearization at the first order of the previous equation leads to the following function to be optimized:

χ 2 lin,i = n j=1 f l (x l i,j ) + [G l ](x l i,j ) -f r (x r i,j ) -[G r ](x r i,j ) 2 (8)
with G l,r (x l,r i,j ) = ∇f l,r • dx l,r i,j (x l,r i,j )

and

dx l,r = ∂x l,r i,j ∂X i,j • ∂X i,j ∂B i • dB i (10)
The optimization problem is solved using the Newton-Raphson method for which the small displacements dB i are calculated at each iteration. The application of the approach to the previous part clearly highlights a decrease in the correlation coefficient for all the facets (figure 14(b)). Some variations are still present mainly due to an observed heterogeneity in the lighting during the measurement. The method provides a new position and a new orientation of each facet, which minimize the correlation coefficient. This new configuration thus induces a shift of its projection into each image-plane relatively to the initial configuration, and it becomes possible to define the facet displacement, expressed in pixels, in each image-plane, D l i and D r i . The displacement is defined here as the maximum of each facet vertex displacement. The study of the displacements in each image will help us detect region of defects, as explained next. Our method to identify regions of defects relies on the calibration noise, which can be assimilated to the measurement resolution. As aforementioned, the calibration noise is denoted σ l 0 for the left camera, and σ d for the right camera. If D l i (respectively D d i ) is greater than the calibration noise (respectively σ l 0 and σ r 0 ) then the zone of the part corresponding to the facet presents a defect. On the opposite, if the displacement is lesser than the calibration noise, then the result is in the calibration uncertainty , and it may be assumed that the part does not present a defect. This method is applied to the previous part. Estimated displacements are displayed in figures 15(b) and 15(a). Displacements are thus compared to the calibration noise. Results reported in (figure 15(c)) clearly brings out the region of defects. When this region is compared to the expected results (exterior of the red line corresponding to the conical region of the part), a very good matching is observed. This highlights the relevancy of our method for locating regions of defects using Stereo-DIC. The next section is dedicated to the assessment of the approach in real conditions with the comparison to another measuring system. ). The bottom of each groove is defined with different profiles (figure 17). Grooves 1 and 3 are uniform with a constant depth of 0.1 mm and 3 mm respectively. Groove 2 and 4 present different slopes. All these grooves are designed in order to test the ability of the stereo-vision system to discriminate various magnitudes of defects. In addition, another more common measuring system is used to detect and measure deviations.This on machine system consists of the Zephyr laser-plane sensor2 mounted in the spindle of the machine tool with a dedicated set-up and a standard HSK 63A tool holder attachment (see figure 18). The application of our approach consists of the following steps:

Detection of machining defects

1. Machining of the nominal part 2. Machining of the grooves corresponding to the defects to be measured 3. Measurement of the part using the laser-plane sensor 4. Calibration of the stereo-vision system using the CAD-based appraoch (shooting of 2 pictures) 5. Defect detection using our stereo-DIC approach Only one sensor orientation is used to measure the part surface in order to avoid overlapping errors and to reduce deviations due to orientation changes [START_REF] Bešić | Accuracy improvement of laser line scanning for feature measurements on CMM[END_REF]. Furthermore, the system assessment through the QualiPSo protocol [START_REF] Mehdi-Souzani | A knowledge database of qualified digitizing systems for the selection of the best system according to the application[END_REF] gives a measurement noise of 13 µm and a measurement accuracy of 1.3 µm/m. Once the surface is measured, the digitized point cloud and the CAD-model are registered based on the Iterative Closest Point algorithm,and deviations are thus calculated. Results are reported in figure 19. Grooves 1 to 4 are displayed from left to right.

Due to its low depth (0.1 mm depth), the presence of groove 1 is not quite observable. The depth value of groove 3 is greater than the one expected at 3 mm. This is likely due to registration errors or uncertainties related to the machining process. The slope of groove 2 and the slope change in groove 4 are clearly visible.

Stereo-vision measurement and stereo-DIC analysis

The measurement is performed using two 14.4 Mpixels Cameras. Left and right images are reported in figure Our approach is applied considering a planar nominal part limited by a 140 mm diameter disk. The average mesh size is about 2 mm. After stereo-DIC application, the estimated displacements are displayed in figures 21(b) and 21(a). Results are quite comparable to those obtained using a laser-plane sensor. In particular, results show that grooves 2 to 4 are identified as defect areas on a large part (figure 21(c)). These results are consistent with the measurements performed using the laser-plan sensor. Nevertheless, the borders of the defect zones are less clearly defined than when using the laser sensor. This is due to the mesh size which should be smaller. For these specific zones, a finer description of the part (refined meshing) should lead to a better identification.

However, area boundaries are poorly identified. This is understandable given that the groove edges are vertical walls, which are not defined in the nominal model. Another explanation comes from visibility. In fact, in a real environment, some portions of the groove edge are only observed by one camera. This observation shows the limitations of the proposed method. Indeed, our method is based on small successive displacements of a nominal shape using the Newton-Raphson algorithm, and to be efficient, the geometry of the measured defect should be close enough from its nominal model.

Groove 1 and the parts of grooves 2 and 4 in the shadow are not detected. This is due to experimental conditions. Indeed, due to the relatively distant position of the cameras, the useful area of each image (figure 20(a)), and therefore the number of pixels, is reduced. This could be corrected by using more adapted lens so that the image only covers the part. Other ways of improvement are possible such as decreasing the mesh size or using a higher resolution projector. Nevertheless, these improvements will increase calculation time but this may be compensated by the determination of the displacement for each facet with GPU computation. Another source of errors comes from the identification of the set-up configuration in the machine-tool frame relatively to the CAD-model frame. These errors lead to residual errors which can be observed in the lower left. This could be simply corrected by carrying out a reference machining on the part. However, our approach is promising as it gives a good idea of the defect location, and can be used during the pre-measurement step.

Conclusion

Integrating inspection procedures in the machining process contributes to process optimization. However, to be highly efficient, Machining and Inspection Process Planning must reach a high level of integration which can be achieved by the use of in-situ measurement. In this paper, we proposed an approach for MIPP based on in-situ measurements. Integrating inspection procedures during the manufacturing process leads to new challenges, such as adapting manufacturing and inspection plans so as not to penalize production costs. The originality of the process planning we propose is to include a step of pre-measurement to localize defects without necessarily quantifying them before the measurement step itself.For the step of pre-measurement, a vision-based system is adopted in this work for its simplicity of implementation within the machine-tool environment, and its rapidity to acquire images. The novel method we develop for defect detection relies on stereo-DIC. The originality is the use of a tessellated representation of the CAD model to define regions of interest in the two images. First applications have highlighted the relevance of our approach but have also brought out some key points. First, the calibration noise is a significant parameter that acts as the resolution of our measuring system. Then, measuring conditions must be controlled. In particular, the relative configuration camera/part must be chosen so as shadow areas are limited. Moreover, the resolution of the pattern projected onto the part must be consistent with the order of magnitude of the defect to be identified. Finally, an initial step of frame registration must be performed, probably using the machining of a reference plane, in order to align the actual machine-tool frame with the CAM frame. All these points represent improvements that will be addressed in future work.

Fig. 1

 1 Fig.1Context of in-situ measurement[START_REF] Dubreuil | Calibration based on part set-up measurement for on-machine inspection using vision[END_REF]

Fig. 2

 2 Fig. 2 Description of the different inspection processes

Fig. 3

 3 Fig. 3 Modeling of the Machining/Inspection process plan

Fig. 4

 4 Fig. 4 SysML activity diagram

Fig. 8

 8 Fig. 8 Definition of the Region Of Interest (ROI) using the CAD model

  Fig. 9 Calculation of the cross-correlation coefficient from the sampled ROI

Fig. 10

 10 Fig. 10 Description of the test part

Fig. 11

 11 Fig. 11 Left and right pictures of the test part

Fig. 12

 12 Fig. 12 Predictable and measured residual

Fig. 13

 13 Fig. 13 Optimization of the facet displacement

Fig. 14

 14 Fig. 14 Maps of the correlation coefficient

  (a) Estimation of the facet displacements D g i (in pixels) in the left camera (b) Estimation of the facet displacements D d i (in pixels) ine the rigth camera (c) Defect detection in blue

Fig. 15

 15 Fig. 15 Displacements (in pixels) and identified regions of defects

Fig. 17

 17 Fig. 17 Description of the grooves

Fig. 18

 18 Fig. 18 Description of the in-situ measurement system with Zephyr laser-plane sensor

-

Fig. 19

 19 Fig. 19 Measured deviations (mm) with laser-plane sensor

  Fig. 20 Description of the studied part

  (a) Estimation of the facet displacements D g i (in pixels) in the left camera (b) Estimation of the facet displacements D d i (in pixels) in the right camera (c) Defect detection in blue

Fig. 21

 21 Fig. 21 Displacements(in pixels) and identified regions of defects

www.kreon3d.com


Maël Pouget

Olha Nahorna

Thomas Hueber

Gérard Bailly

Adaptive Latency for Part-of-Speech Tagging in Incremental Text-to-Speech Synthesis

Keywords: Incremental speech synthesis, natural language processing, classification, TTS, part-of-speech

Incremental text-to-speech systems aim at synthesizing a text 'on-the-fly', while the user is typing a sentence. In this context, this article addresses the problem of the part-of-speech tagging (POS, i.e. lexical category) which is a critical step for accurate grapheme-to-phoneme conversion and prosody estimation. Here, the main challenge is to estimate the POS of a given word without knowing its 'right context' (i.e. the following words which are not available yet). To address this issue, we propose a method based on a set of decision trees estimating online whether a given POS tag is likely to be modified when more right-contextual information becomes available. In such a case, the synthesis is delayed until POS stability is guaranteed. This results in delivering the synthetic voice in word chunks of variable length. Objective evaluation on French shows that the proposed method is able to estimate POS tags with more than a 92% accuracy (compared to a non-incremental system) while minimizing the synthesis latency (between 1 and 4 words). Perceptual evaluation (ranking test) is then carried in the context of HMM-based speech synthesis. Experimental results show that the word grouping resulting from the proposed method is rated more acceptable than word-by-word incremental synthesis.

Introduction

Text-to-speech (TTS) systems are now able to produce very high-quality synthetic voice. They can be used as a substitute voice by people with severe communication disorders (such as patients with Parkinson's disease or ALS). However, TTS-based communication lacks interactivity since the synthesis is generally triggered on a per-sentence basis. Therefore, the listener (i.e. the communication partner) has to wait for a complete sentence to be typed down. This increases drastically the communication latency and often results in some frustration for both the listener and the system user. Incremental TTS (iTTS) [START_REF] Edlund | Incremental speech synthesis[END_REF][START_REF] Schlangen | A general, abstract model of incremental dialogue processing[END_REF][START_REF] Baumann | The INPROTK 2012 release[END_REF] aims at improving this interactivity issue by delivering the synthetic voice 'on-the-fly' (i.e. while the user is typing the target sentence) with almost the same quality as a conventional (i.e. non incremental) TTS.

The main challenge in iTTS is to perform the two main steps of a conventional TTS, that are text analysis (often referred to as natural language processing, NLP) and waveform generation, when considering only a limited lookahead. In other word, the iTTS paradigm assumes that the synthesis of a given word can rely only on its 'left-context' (i.e. the words before it) and that almost no 'right-context' (i.e. the words after it) is available. In our previous study [START_REF] Pouget | HMM training strategy for incremental speech synthesis[END_REF], we focused on the wave-Figure 1: Overview of the proposed iTTS architecture with adaptive latency for robust online POS-tagging form generation step in the context of HMM-based speech synthesis. We proposed a method for building HMM voices using models trained with limited and adaptive lookahead. In this paper, we focus on the text analysis step, and in particular on Part-Of-Speech (POS) tagging. This step consists in assigning a lexical category to each word (e.g. noun, verb, etc.), based on both morphological analysis and syntactic constraints, i.e. its relationship with left-and right-adjacent words in the sentence. POS-tagging is critical for grapheme-to-phoneme conversion but also for prosody estimation since the syntactic structure of the sentence is actually derived from the POS tags.

In [START_REF] Beuck | Decision Strategies in Incremental PoS Tagging[END_REF], Beuck et al. propose four strategies for performing POS-tagging incrementally, in the context of NLP. These strategies as well as their use in the context of iTTS can be briefly summarized as follows:

• estimating POS tags using left-context only. In iTTS, this results in a zero delay for delivering the synthetic voice but some POS tags may be inaccurate.

• considering a fixed size lookahead (typically 2 or 3 words) for disambiguating POS tags. In iTTS, this results in a constant latency but likely more accurate POS tags.

• recalculating the POS of a given word already tagged when more right-context becomes available (a system allowing such behavior is referred by the authors as a non-monotonic system). In iTTS, the synthesis has to be postponed until the POS tag can no longer be modified. As discussed later, this is the core idea of the iTTS architecture proposed in this article.

• considering multiple hypothesis for each new available word. In iTTS, this will require to propagate such ambiguities to the signal processing module. This approach seems interesting but is not considered in the present study.

In line with the third strategy, we propose a method for estimating POS tags accurately in the context of iTTS while minimizing the lookahead (and thus maximizing the reactivity of the synthesizer). The proposed method (described in Section 2) is based on a set of decision trees estimating online whether a given POS tag is likely to be modified when more right-contextual information becomes available. Each decision tree models the stability of a POS tag for a given left-context and a given lookahead. In the present study, we consider an adaptive lookahead between 0 and 2 words. The synthesis of a word is triggered as soon as the stability of its related POS-tag is guaranteed. This results in delivering the synthetic voice in word chunks of variable length (i.e. adaptive latency). A general overview of the proposed architecture for a so-called "adaptivelatency iTTS" is presented in Figure 1. The proposed method is evaluated both objectively and perceptively, in the context of our HMM-based iTTS system for French [START_REF] Pouget | HMM training strategy for incremental speech synthesis[END_REF] (Section 3).

Proposed method 2.1. POS-tagging in incremental TTS

Many approaches have been proposed in the literature to address automatic POS-tagging in conventional (i.e. nonincremental) TTS (see [START_REF] Manning | Foundations of statistical natural language processing[END_REF], ch. 10 and [START_REF] Toutanova | Enriching the knowledge sources used in a maximum entropy part-of-speech tagger[END_REF] for reviews). Modern taggers are almost all based on the two following steps: (1) the extraction of one or several hypothesis for each word considered separately from its context and (2) a global optimization which aims at alleviating ambiguities by making use of the large-span context. POS-tagger such as TnT [START_REF] Brants | TnT: a statistical part-of-speech tagger[END_REF] or Festival [START_REF] Taylor | The Architecture of the Festival Speech Synthesis System[END_REF] use second order Markov models with states representing the tags and outputs (i.e. observations) representing the words (and thus state transition probabilities modeling pairs of tags). The POS-tagger used in this study for French language, called COMPOST [START_REF] Bailly | Compost : un serveur de synthèse de parole multilingue[END_REF], is based on the same approach. Following the formulation used in [START_REF] Brants | TnT: a statistical part-of-speech tagger[END_REF], the most likely tag sequence [ĉ1, . . . , ĉT ] associated with the word sequence [w1, . . . , wT ] of length T is defined such as:

arg max [c 1 ,...,c T ] {[ T t=1 P (ct|ct-1, ct-2)P (wt|ct)]P (cT +1|cT )} (1)
where c-1, c0, and cT +1 are beginning/end sentence markers, P (wt|ct) is related to tag estimation without taking into account any contextual information and P (ct|ct-1, ct-2) refers to a 3-gram model providing prior information on the current tag ct given the tags of the two previous words (ct-1 and ct-2). These probabilities can be derived from relative frequencies estimated on large text corpora. In the framework of Markov modeling, Equation ( 1) is typically solved using the Viterbi algorithm.

Such formulation assumes that the final tag cT +1 is known without any ambiguity (as well as c-1 and c0). In conventional TTS, it often corresponds to a "End-of-sentence" marker such as a period. However, such assumption can not be made when processing the input text incrementally. Thus, the POS-tagging technique needs to be adapted. Here, we propose to solve (1) for the word sequence [w1, . . . , wt] each time a new word wt is made available (e.g. when the user presses the space bar), using the forward-backward rather than the Viterbi algorithm. The associated tag ct is defined as the one that maximizes the forward probabilities αt(j, k) = P (c1, . . . , ct-1 = j, ct = k|w1, . . . , wt) over all the possible N tags. This forward probability can be calculated using the well-known recursive expression:

αt(j, k) = N i=1 αt-1(i, j)P (ct = k|ct-1 = j, ct-2 = i) (2)
assuming that word wt-2 was given the tag i and a transition between states j and k at times t -1 and t. Each previous word w k of [w1, . . . , wt-1] is then tagged by calculating the posterior probabilities:

P (c k = k|w1, . . . , wt) = N j=1 α k (j, k)β k (j, k) (3)
with β k (j, k) the backward probability given by:

βt(j, k) = N i=1 βt+1(i, j)P (ct = k|ct+1 = j, ct+2 = i) (4)

Evaluation of POS tag stability using decision trees

The POS-tagging procedure presented in the previous section is sub-optimal since an uncertainty remains on the final tag ct. Indeed, its online estimation relies only on the left-context and therefore may sometimes be incorrect. Moreover, if ct is incorrect, the backward propagation may influence in a bad way the tags further left (i.e. [c1, . . . , ct-1]). To alleviate this potential negative effect, we propose a method for estimating the stability of a POS tag, in a given (syntactic) context, that it how it is likely to be modified when more right-context becomes available.

The proposed method is based on a set of 3 binary decision trees. Each decision tree models the stability of a POS tag for a given lookahead (i.e. right-context) of 0,1,or 2 words. Input features are composed of a sequence of 3 consecutive tags [ct-2, ct-1, ct] calculated incrementally, together with their associated probabilities [P (ct-2 = i|w1, . . . , wt), P (ct-1 = j|w1, . . . , wt), P (ct = k|w1, . . . , wt)] given by Equation (3). The output feature is a binary value indicating if the POS tag calculated incrementally matches the one estimated from the complete left and right context. In other word, for each tree, the set of yes/no questions partitions the training set regarding the following rules: where L is the considered lookahead and T the number of words in each training sentence. Note that c-1 and c0 are set as an explicit Beginning-of-Sentence class with a probability equal to 1. As an example, let us consider the French sentence "Cet été, les enfants vont à la mer" ("This summer, the children will go to the sea"). Training input observations are built by successively sending the following chunks to the POS-tagger: "Cet", "Cet été,", "Cet été, les", "Cet été, les enfants", "Cet été, les enfants vont", etc. and by storing the successive POS tags for each word, with their respective probabilities.

Adaptive latency iTTS

As already mentioned, a POS-tagging error can have important consequences on the grapheme-to-phoneme conversion as well as on the prosody. With this consideration in mind, we propose a new iTTS architecture in which the synthesis of a given word wt is delayed until the stability of its associated POS-tag (determined using the procedure describe in Section 2.1) is guaranteed. This stability is assessed using the decision trees presented in Section 2.2. The proposed algorithm for triggering the synthesis is presented in Algorithm 1. This procedure results in delivering the synthetic voice in word chunks of variable length, introducing a variable latency but maximizing the POS-tagging accuracy. The maximum latency which can be obtained using this procedure is 3 words. This happens when a given POS tag is still classified as "unstable" even when considering a 2-words lookahead.

Data: [wt-

Experiments

Objective evaluation

The proposed method was evaluated in the context of our incremental HMM-based speech synthesis system [START_REF] Pouget | HMM training strategy for incremental speech synthesis[END_REF], which is based on the NLP front-end COMPOST [START_REF] Bailly | Compost : un serveur de synthèse de parole multilingue[END_REF] and the HTS toolkit [START_REF] Tokuda | Speech Synthesis Based on Hidden Markov Models[END_REF]. The corpus used for training the decision trees was extracted from the two French books "Notre-Dame de Paris", by Victor Hugo and "Le tour du monde en 80 jours", by Jules Verne. This corpus consists in 20154 sentences (290801 words).

The corpus was divided into a training set (2/3 of the corpus : 13436 sentences, around 193000 words) and a testing set (1/3 of the corpus : 6718 sentences, around 98000 words). The training of the decision trees was done using Matlab (classregtree package). First, we evaluated the performance for each of the 3 decision trees considered independently. That is, their ability to evaluate whether a POS tag is likely to be modified when considering more right-context (i.e. a lookahead of 0, 1, or 2 words). The performance was measured by calculating the accuracy (Acc), defined as

Acc = (T P + T N )/(T P + T N + F P + F N )
where TP, TN, FP, and FN are respectively true positives, true negatives, false positives and false negatives. Results are presented in Figure 2.

First, let us discuss the performance in terms of POS tag correctness as a function of the lookahead (that is the raw performance of the NLP front-end COMPOST considered in this study). With no lookahead, around 40% of the POS tag are badly estimated (i.e. (T N + F P )/(T P + F N + T N + F P )). As expected, the performance increases with the lookahead, with 9% of error when considering 1 word, and less than 2% when considering 2 words. These results show that (1) POStags can be accurately estimated online when considering at least a lookahead of two words, (2) a new strategy was in fact needed to achieve lower latency. Let us now discuss the ability of the decision trees to evaluate the stability of a POS tag. With no lookahead, the stability of the POS tag was correctly assessed in 92% of the cases (i.e. (T P + T N )/(T P + T N + F N + F P )). Among these decisions, in 37% of the cases, it was rightly decided to postpone the synthesis since the stability of the POS was not guaranteed (T N ). On the contrary, in 55% of the cases, the POS tag was considered to be stable so that the synthesis could be triggered confidently (T P ). In 8% of the cases, the stability of the POS tag was wrongly assessed, resulting either in a synthesis triggered too soon and with an erroneous POS tag (F P ) or with an unnecessary latency (F N ). As expected, the number of such errors (i.e. F P + F N ) decreases when the lookahead increases, with ∼ 4% for a 1-word lookahead and ∼ 2% for a 2-word lookahead.

Then, we evaluated the performance of the complete system, that is when the 3 decision trees are used jointly as shown in Algorithm 1 (in other words, the decision of the "no lookahead tree" conditions the decision of the "1-word lookahead tree", etc.). Figure 3 displays the distribution of the test data as a function of the delay needed to guarantee the POS tag stability. For each considered lookahead (0, 1 and 2, resulting in a maximum latency of 3 words), we also represent the remaining errors (F P , in yellow), that is the amount of words for which the synthesis has been wrongly triggered instead of being delayed. In 60% of the cases, the synthesis is triggered immediately (no lookahead) with 92% of the POS tag correctly estimated. In more than 30% of the cases, a lookahead of 1-word is needed to estimate the POS-tag with 95.4% accuracy. Finally, in 5% of the cases, the synthesis is delayed by at least 2-words (with more than 97.7% accuracy). When considering the combined accuracy of all decisions performed with a maximum latency of 3 words, the proposed adaptive latency approach performs a robust online POS-tagging with ∼ 90% correlation with respect to the non incremental tagging.

Perceptual evaluation

The proposed iTTS system with adaptive latency delivers the synthetic voice in groups of words (between 1 and 4 words). This may result in a singular word grouping (i.e prosodic phrasing). To assess the quality of this grouping, we conducted a perceptual evaluation based on a ranking test. A set of 14 sentences extracted from the Combescure corpus [START_REF] Combescure | listes de dix phrases phonétiquement équilibrées[END_REF] was synthesized using our HMM-based iTTS system for French [START_REF] Pouget | HMM training strategy for incremental speech synthesis[END_REF] and 4 different strategies of word grouping (resulting in a total of 56 stimuli to rank):

• "WG1: One word per group" which corresponds to a word-by-word synthesis using no lookahead (e.g "Thissummer, -the -children -etc.") • "WG2: Random word grouping" obtained by replacing the output of each decision tree by a random binary value. This strategy is used as a reference condition (e.g "This -summer, the -children -etc."). • "WG3: Expert-based word grouping" where 3 human experts were asked to delimit manually the most natural boundaries of each prosodic phrase, based on the semantic (e.g "This summer, -the children -will go -to the sea"). • "WG4: Adaptive latency iTTS" which is the word grouping resulting from the proposed method (e.g "This summer, -the children will -go to -the sea").

The duration of the silence between each word group is constrained so that the 4 versions of each sentence have all the same length (with minimum silence duration between each word chunk set arbitrarily to 300 ms). The listening test was done online by 20 native speakers of French, with no particular expertise in speech processing. The participants were asked to do the test in a quiet environment, with headphones. The presentation order of the stimuli was randomized for each participant. For each sentence, the participant were asked to score the different stimuli on a Mean-Opinion-Score (MOS) scale ranging from 1 to 5 (a set of 5 labels "very bad, bad, middle, good, very good" was nevertheless displayed in order to help the subject in the ranking process). The participant was allowed to play each stimulus several times. The statistical significance of the ranking score was assessed using Beta regression, considering the position of the stimulus on the scale as the variable to explain, the word grouping strategy as the explanatory variable (4-level factor), and both the subject ID and sentence ID as random effects (an Anova test was not suitable since the variable to explain was bounded). As expected, the most natural word grouping is the one proposed by human experts (WG3), which can indeed rely on highlevel semantic knowledge. Interestingly, the "one word per group" strategy (i.e. the strategy that leads to the most reactive system) was considered less acceptable than the random grouping (which was the reference condition). This result shows the importance of prosodic phrasing in incremental text-to-speech, where a tradeoff between reactivity and naturalness have to be found. Finally, and more importantly, the proposed adaptivelatency iTTS was ranked second. It was assessed significantly Figure 4: Results of the perceptual listening test. Mean position on the X-axis of ranked samples with standard deviations, averaged across the listeners, for each word grouping strategy ("one word per group" (WG1), "random" (WG2), "expert" (WG3) and "adaptive-latency iTTS" (WG4, proposed method)(*** denotes statistical significance)

. better than the random grouping (and word-by-word synthesis), but also significantly lower than the expert-based strategy. This demonstrates the interest of the proposed approach while letting some room for improvements. To illustrate a possible limitation of the proposed method, let us focus on one stimulus which was ranked as "bad" by most listeners: the sentence "Il arrive en retard en ce moment" ("he arrives late these days"). For this stimulus, the expert-based word grouping (WG3) was "Il arrive -en retard -en ce moment" whereas the word grouping resulting from the analysis of POS tag stability gave "Il arriveen retard en -ce moment". This result in a non-natural prosodic phrasing, notably due to the third chunk "en retard en". It corresponds to the POS sequence "Preposition Noun Preposition" which is not a common prosodic unit in French. Therefore, the proposed word grouping strategy based on the sole POS-tag stability is an interesting but perfectible approach.

Conclusions and Perspectives

This article introduced a method for robust POS-tagging in the context of incremental Text-to-speech synthesis. The core idea is to assess 'on-the-fly' whether a POS tag in a given leftcontext is likely to be modified when more right-context becomes available, and if yes, to postpone the synthesis. This results in a new iTTS architecture where the synthetic voice is delivered in word chunks of variable length. Objective evaluation showed that almost 90% accuracy of true positives can be obtained with a adaptive lookahead between 0 and 3 words, for French.

Although demonstrating the pertinence of this morphosyntactic parsing for effective incremental speech synthesis, the perceptual evaluation of the resulting prosodic phrasing led to contrasting results. Future work will focus on improving this prosodic phrasing. Among other perspectives, we will notably combine the proposed approach with the predictive incremental parsing technique, recently proposed in [START_REF] Beuck | Predictive incremental parsing and its evaluation[END_REF]. Finally, as an incremental TTS synthesizer is primarily designed for casual conversation, we will also evaluate the performance of the proposed adaptive latency POS-tagger on other kind of text data, such as text-messages or tweets.

Figure 2 :

 2 Figure 2: Objective evaluation of the decision trees (considered independently) estimating the stability of a POS tag as a function of the lookahead (for left to right: 0, 1, and 2 words).

Figure 3 :

 3 Figure 3: Distribution of the test words as a function of the lookahead needed to guarantee the stability of the associated POS tags.

  2, wt-1, wt], [ct-2, ct-1, ct] waiting list : Typed words, not synthesized yet. if wt-3 is in waiting list then Synthesize(wt-3) if wt-2 is in waiting list then

if IsStable(ct-2) (2-word lookahead) then Synthesize(wt-2) else Put wt-2, wt-1, wt in waiting list return; if wt-1 is in waiting list then if IsStable(ct-1) (1-word lookahead) then Synthesize(wt-1) else Put wt-1, wt in waiting list return; if wt is in waiting list then if IsStable(ct) (0-word lookahead) then Synthesize(wt) else Put wt in waiting list return; Algorithm 1: Proposed algorithm for scheduling the incremental synthesis of chunks of words based on the stability of the POS-tagging.

Acknowledgments

This work was funded by the project SpeakRightNow (AGIR program, Université Joseph Fourier, http://www.gipsalab.fr/projet/SpeakRightNow/). The authors would like to thank Sylvain Gerber for his help in the statistical analyses.