Dr Mr Jerome Gaillard

Frederique Lhomme

Mr Patrice Belin

Mr. Kamel Mr Xavier Ibene

Mr Dominique Loudahi

Mme Anna Morvan

Mr Laurent Stanko

Mr Fleury

Marty Nicholas

Dr Laurent Barrallier

Dr Sebastien Jegou

Dr Saptarshee Mitra

Dr Mohamed Kbibou

Ali Gazanfar

Dr Shah

Mr Mr Sijie Thingcheng Hu

Mr. Chao Li

Mme Louise Zhang

Mme Lisa Eschard

Mr. XIKUN Germain

Mr Zou

H Théophile Calloc'

Grazyna Mme

Mme Cauquil

Laurence

Hassan Chouhad

Mohamed El Mansori
email: mohamed.elmansori@ensam.eu

Ricardo Knoblauch

Cosimi Corleto

Mohamed M Bukkapatnam

Satish Et

Enseignant chercheur, MSMP M Ricardo Knoblauch

Ricardo Jury

Professeur M Arnaud Gotlieb

M Hassan Zahouani

M Roberto

Martins De Souza

M Mohamed

E L Mansori

M Satish

Ingénieur M Cosimi Corleto

DDSMA: Data Driven Smart Manufacturing Approach

Keywords: smart machining, proactive quality control, artificial intelligence, chromatic confocal, on-machine metrology AI: Artificial Intelligence ANN: Artificial Neural Networks AR: Auto Regressive ARIMA: Auto Regressive Integrated Moving Average BLR: Bayesian Linear Regression BP: Back Propagation BackScattered Electrons CAD: Compter Aided Chromatic Confocal CCD: Charge Coupled Device CCI: Chromatic Confocal Imagery CCM: Chromatic Confocal Microscopy CNC: Computer Numerical Control CNN: Convolution Neural Network CFDA: Corrected Differential Equation Algorithm Future Pyramid Network GB: Gradient Boosting ICP: Iterative Closest Point RBF: Radial Basis Function RCNN: Regional Convolutional Neural Network chromatic confocal, deep learning, defect detection, machine learning segmentation smart machining, proactive quality control, artificial intelligence, chromatic confocal, on-machine metrology

between MSMP laboratory in Aix En Provence, STIL MARPOSS company and TEES of Texas A&M university. Doing this PhD thesis has allowed me to learn and to earn an experience of life that I couldn't imagine. Especially evolving in the mindset, personal perspectives and professional culture. These changes wouldn't have been acquired without the support and the interactions that I have with many people.

Résumé:

Dans l'industrie de fabrication traditionnelle, la métrologie est un élément essentiel de sanction de la qualité en bout de la chaîne de production. L'innovant dans le concept de la fabrication intelligente conduit à un repositionnement de la métrologie qui devient proactive au coeur même de la production pour fabriquer dès le départ une première pièce conforme. L'objet de cette thèse est donc de proposer une approche méthodologique pour le développement d'un système proactif, augmenté par des modèles d'intelligence artificielle IA, de contrôle en usinage de la conformité d'un produit à un cahier des charges et de caractériser ses défauts. Pour cela, une première étude sur l'aspect de surface a été réalisée en recueillant des images à haute résolution de fils de cuivre revêtus et découpés pouvant présenter des défauts. Les images, prises par un système de vision par ordinateur basé sur l'imagerie confocale chromatique, ont été utilisées pour générer différents modèles d'intelligence artificielle. Ce traitement consiste à faire de la segmentation et de la classification des défauts observés. En comparant la précision et le temps de traitement des modèles d'IA, l'apprentissage par transfert utilisant le modèle de mobile-net a montré de meilleures performances. Afin d'élargir l'étude de l'évaluation de la qualité de surface, des mesures de profil de surface sur machine-outil ont été effectuées à l'aide de capteurs confocaux chromatiques sans contact. Deux approches ont été réalisées : i) le fraisage de l'aluminium sans signature d'usure d'outil de coupe et ii) le fraisage du titane en tenant compte de la signature de l'usure de l'outil de coupe. Dans les deux configurations de coupe, les paramètres d'usinage, les profils de rugosité de surface et les efforts d'enlèvement de matière ont été enregistrés pour construire une base de données pour l'entraînement des modèles de prédiction par apprentissage automatique. Les résultats ont montré que le modèle XGboost a présenté la meilleure performance de prédiction et ce pour les deux scénarios. En considérant le temps de coupe dans le fraisage du titane, le modèle de prévision moyenne mobile autorégressive intégrée a été appliqué pour suivre l'évolution de la rugosité en fonction de l'usure de l'outil.

Mots clés : usinage intelligent, contrôle qualité proactif, intelligence artificielle, confocal chromatique, métrologie sur machine.

i

Table of contents

List of figures

List of tables

Introduction

The manufacturing industry plays an important role in the world economy, it represents 20% of GDP and is considered to be the basis of wealth even inside a service-oriented economy [START_REF] Wegener | Dawn of new machining concepts: Compensated, intelligent, bioinspired[END_REF].

It covers the manufacturing of diverse parts or products, ranging from low quality requirements products to high precision ones. No matter the type of manufactured part, there is always a risk of having manufacturing-related defects and non-conformity. Among different part quality criteria, the quality of manufactured surfaces represents a very significant aspect to be controlled. For manufacturing processes based on material removing, the surface generated will contain the signature of the manufacturing operation which is represented by its topography. In addition, the generation of defects such as scratches, pits, protrusions, and stains, can also occur during a manufacturing process, Figure 1. These two aspects, surface topography and defects, are decisive for determining the quality of a manufactured surface. To avoid having manufactured parts with unacceptable surface quality, production lines usually have Quality Control (QC) systems. And despite the emergence of industry overall digitalization and application of AI algorithms to support different areas of technology, manual surface inspection methods are still largely performed by quality inspectors in production lines. Even though this also-called "sanction metrology" exhibits disadvantages such as: low efficiency, high labor intensity, low accuracy, low real-time performance, unneglectable risk of out-of-tolerance parts that must be scrapped, and the incapacity of satisfying the continuously increasing quality standards of the manufacturing industry [START_REF] Lou | Hierarchical decision making for proactive quality control: System development for defect reduction in automotive coating operations[END_REF]- [START_REF] Bettayeb | Quality control planning to prevent excessive scrap production[END_REF].

Objectives

To overcome the above-mentioned issues, this thesis aims to build the framework of a QC system that instead of detecting surface quality non-conformity for later correction, the system performs a proactive QC by forecasting the surface quality unconformity and by changing the machine-related parameters so that the part surface is manufactured with acceptable quality. To develop such complex system, this work proposes the following steps: i) investigation on the sensoring method and generation of a database sufficiently representative in terms of manufacturing parameters and surface quality outcomes; ii) an investigation on AI modelling for quality prediction; and iii) an investigation on AI modelling capable of determining the feedback action for the machine-tool to avoid manufacturing "bad-quality" part. Only the steps i) and ii) are under the scope of the present work. And since an AI modelling approach is very dependent on the nature of data and sensor, the steps i) and ii) are here investigated together, but divided in two different quality-related approaches: surface defects, and surface topography.

For the defect approach, a computer vision system based on Chromatic Confocal (CC) highresolution camera was utilized for analyzing defects on the surface of laser-machined copper rods. Since it is difficult in the industry to have a massive database of high-resolution images of different types of defects for the same given part, it is proposed in this work the training of AI models using smart data instead of big data. Differently from big data, smart data here is considered a limited dataset of images that contains the most relevant types of defects and allows the model to have a reasonable generalization. The AI approach is done firstly to perform defect segmentation by extracting features of the images using an edge detector, and then by applying segmentation with three different Machine-Learning (ML) algorithms: Decision Trees (DT), Random Forest (RF), and Multi-Layer Perceptron. Then, for defect classification, a Convolutional Neural Network (CNN) model is tested, as well as Transfer Learning (TL) by retraining a CNN-based model using a significant smaller dataset. Finally, the MaskRCNN is tested for defect localization.

For the surface topography approach, this work proposes the use of CC point sensors to perform non-contact measurement of roughness profiles. Since a proactive QC would require the acquisition of surface topography during the manufacturing process, the CC point sensors were installed inside a machine-tool to investigate the applicability of such technology "on-machine" by comparing measurements performed inside the machine-tool with measurements performed "ex-situ" (done outside the machine-tool, in a metrology room). Concerning the AI modelling for surface topography, since the goal is to have a model capable of predicting topography quality, a solid and multi-variable experimental dataset needs to be generated. For that, hundreds of cutting experiments were carried out with the measurement of the machining forces during the cuts, as well as the posterior non-contact and "on-machine" measurement of the roughness profiles of the machined surfaces. The material selected for the cutting experiments was aluminum, because of its machinability that makes it possible the neglecting of the tool wear for a reasonably short cutting time. The parameters of the cutting process such as cutting speed, feed rate, and cutting depth are also included in the dataset for the AI approach. The goal is to develop a ML model that is capable of predicting the surface roughness, and can be applied later on in a production line. In order to acquire a model with small prediction error, some of ML algorithms for regression are investigated using two different architectures, and then a comparison of their performances is done.

In order to expand the roughness prediction AI approach to consider the tool wear progression during the cutting process, a third experimental dataset was generated. This time, titanium was selected as workpiece material, since it exhibits a significantly high wear rate over a short cutting time. In this final approach, a time series forecasting algorithm called Auto Regressive Integrated Moving Average (ARIMA) is investigated to determine its applicability when predicting future values of surface roughness based on the previous values, as it changes as the tool wear progresses over the cutting time.

Research questions

This work proposes to answer the following research questions.

 Based on the most used and open-access AI libraries, which AI algorithms and methods have higher performances for the detection of surface defects present in the proposed dataset?  Which one is the fastest and most accurate that could be implemented in the future in a system with limited processing capacity?  Is it feasible to achieve a significant generalization of defect classification using only smart data?  Is it possible to perform CC roughness measurements inside a harsh environment of a CNC machine-tool to have afterwards a ML model capable of predicting roughness with validation error below or near to 10%?  Can ML algorithms learn the presumably non-linear correlation between cutting parameters, machining forces and surface roughness?  Taking into account the tool wear and cutting time, can a forecasting model predict and follow the future evolution of surface roughness?

Thesis roadmap

Chapter1 provides the literature review about the research that has been conducted for defect detection using images, and then the prediction of roughness in the milling process, followed by Chapter 2 which describes the development that has been done to develop AI models for classification and localization of defects that are present on the surface of copper rods. Chapter 3 is devoted to the AI-based roughness prediction in milled aluminum surfaces using data collected from on-machine measurements of surface roughness and machining forces. The prediction of surface roughness is investigated using two different architectures: Neural Networks (NN) and ensemble methods. Their errors, processing time are analyzed and compared in order to determine which model is better suitable for being deployed in a future proactive QC. Finally, Chapter 4 is focused on adding the tool wear as variable that it influences the surface roughness. For that, a forecasting AI model is applied to a database composed of surface roughness, cutting parameters, machine forces, cutting time and tool wear is investigated the cutting time and tool wear progression.

Chapter 1: Literature review

Introduction

This chapter is a bibliographic synthesis about on-machine metrology and the different measurement methods literature applications. Then, the smart manufacturing paradigm and the need to build proactive QC of the surface of machined parts, either detecting the defects or predicting the surface roughness is introduced. Finally, the theoretical background of the datadriven decision models, the basics about machine learning algorithms, and the methods used in this thesis for defect classification and roughness prediction are summarized.

Surface online metrology

In a production line, different types of measurements are performed throughout the manufacturing of a part. Each machine is arranged according to the line set up in the factory as it is shown in the Figure 2, where different measuring stations are placed in different locations, and the environmental conditions (temperature, vibration and humidity) exhibit different levels of control. The traditional metrology, here denoted as ex-situ¸ is usually performed in an isolated chamber where the environment is controlled. When the measurement is performed directly at the shop floor, the type of metrology is called in-situ. This latter can be further divided in three categories: in-line/on-line, when the part is measured inside the manufacturing line; off-line, when the part is measured outside the manufacturing line; and on-machine, when the metrology is carried out directly inside the manufacturing machine. In addition, on-machine metrology can again be divided to three categories: in process (measurement in parallel with the manufacturing of the part), pre-process (measurement before the execution of the process), and post-process (the measurement is carried out after the process) [5]. [5] When it comes to on-machine metrology, this technique can be performed using either the contact-type method or non-contact type, when the sensor is usually distant from the measured object. Different technologies of on-line metrology are used in industry: optical instruments, One of the most appealing types of on-machine metrology in terms of surface quality of machined parts is done using optical sensors, because they permit the supervision of surface quality of machined parts in real-time with high efficiency [6], [START_REF] Jiang | On-Machine Metrology for Hybrid Machining[END_REF]. The non-contact nature of optical sensors is especially advantageous because it avoids inherent defects that might be caused by contact-type metrology, such as scratches caused by the probe of a contactprofilometer. In addition, it allows reducing the time consumed to take the manufactured parts to a metrology room, then deciding either to continue on the machining or to change the parameters. Another advantage is avoiding the deterioration of the parts during the transport to the measuring stations. By keeping the original status of the surface, if there are any undesired patterns on the surface such as defects or bad roughness, further correction actions can be applied directly without losing the exact position of the part.

Since in the present work, measurements of surface topography with non-contact devices are carried out, the next subchapter will focus particularly on this measuring method.

Contact and non-contact surface topography metrology

The contact measurement instruments are characterized by their ability to give measurements on the scale from microscopic to nanometric. The limitations of such instruments are: significantly long measurement time, generation of negative effects on the surface of particularly smooth samples, and fragility of the probe head. On the other hand, with optical methods of measuring surface topography, measurements can be performed in a short-period of time and without any influence on the object's surface under measurement.

In the literature several works have been done to benefit from the advantages of CC microscopy, and also to try to improve its limitations, especially the one related to the accurate localization of Z-height as a function of wavelength [START_REF] Luo | Fiber-based chromatic confocal microscope with Gaussian fitting method[END_REF], the model adopted after the data processing and after the calculation of the correlation between wavelength and Z-displacement it is the Gaussian model. C. Chen et al [START_REF] Chen | Accurate and efficient height extraction in chromatic confocal microscopy using corrected fitting of the differential signal[END_REF], have developed a corrected differential equation algorithm (CFDA), the accuracy of this algorithm is close to that of the Gaussian algorithm, but it has good performance in terms of computation time. Minoni et al. [START_REF] Minoni | Chromatic confocal setup for displacement measurement using a supercontinuum light source[END_REF] tried to introduce other sources of white light as super-continuous light with a spatial filter to have a wide range of wavelength from 500 nm to 900nm, for the extraction of the altitude Z with respect to the acquired wavelength, the Gaussian algorithm was used.

In the literature, some research works are referred to on-machine metrology for machining using different optical instruments such as an interferometer, which was used inside an ultra-precision diamond turning machine [START_REF] Li | Development and Application of Interferometric On-Machine Surface Measurement for Ultraprecision Turning Process[END_REF]; Chromatic Confocal (CC) sensor as it is presented in Figure 3, in which the proposed on-machine and non-contact measurement exhibited a good agreement with the probe-contact method [START_REF] Zou | Non-contact on-machine measurement using a chromatic confocal probe for an ultra-precision turning machine[END_REF]. The CC sensor has been installed inside a machine tool to control the effects of different manufacturing processes, such as ultra-precision turning [START_REF] Zou | Non-contact on-machine measurement using a chromatic confocal probe for an ultra-precision turning machine[END_REF] and grinding process [START_REF] Keferstein | Process monitoring in non-circular grinding with optical sensor[END_REF], on the quality of the produced surfaces. The non-contact method is applied for measurement on-machine (during part's manufacturing)

in the research of Andersson et al. [START_REF] Andersson | Determination of wear volumes by chromatic confocal measurements during twin-disc tests with cast iron and steel[END_REF], they used the CC pencil to have the surface topography of twin disks during their contacts in order to calculate the volume of wear of the metal-coated on the disks. Quinsat et al. [START_REF] Quinsat | In situ non-contact measurements of surface roughness[END_REF] introduced a method to obtain the in-situ roughness (on the machining machine, without detaching the manufactured part) of several manufacturing

(a) (b)

processes, the characterization of the spherical or aspherical surface shapes was performed by Zou et al [START_REF] Zou | Non-contact on-machine measurement using a chromatic confocal probe for an ultra-precision turning machine[END_REF] and El Hayek et al [START_REF] El-Hayek | 3D measurement and characterization of ultra-precision aspheric surfaces[END_REF].

Zou et al. [START_REF] Zou | Non-contact on-machine measurement using a chromatic confocal probe for an ultra-precision turning machine[END_REF] presented an integration of CC probe (CL1 MG140 STIL) into an ultra-precision diamond turning machine, to reconstruct a 3D spherical surface, after data processing, a correlation of CC measurements with stylus (Talysurf PGI 1240) measurements was deduced.

El Hayek et al. [START_REF] El-Hayek | 3D measurement and characterization of ultra-precision aspheric surfaces[END_REF] extracted and compared the performance of 3 algorithms L-BFGS, LM and ICP applied on data measured with the CC and a profilometer with simulation data.

From other optical instruments, an interferometer was used by Han et al. [START_REF] Han | Investigation of influence factors on surface roughness of micro-scale features[END_REF] to measure the roughness after micro extrusion of the samples under different forming loads and micro-groove size. Zahouani et al. [START_REF] Zahouani | Identification of manufacturing signature by 2D wavelet decomposition[END_REF] exploited measurements from interferometer to study the manufacturing process's signature with a multiresolution analysis of surface topography.

Smart machining

Smart machining refers a machining process that is capable of autonomously adjusting its parameters during the machining process to accomplish a predetermined objective. This new approach aims to overcome errors that might be present during conventional machining processes, such as chatter, geometric errors, elastic and thermal deformation, etc. Smart machining can be developed by interactions of different systems. For instance: machine-tools, sensors and controller networks, simulation-based designs, big data and cloud-based systems, as well as smart control algorithms. By implementing the smart machining concept, one can automatically optimize process parameters in real time to achieve optimum processing performance and product quality. Many factors affect the final product quality during machining operations, such as workpiece properties, machine tool characteristics, cutting tool, and cutting conditions [START_REF] Kim | Smart Machining Process Using Machine Learning: A Review and Perspective on Machining Industry[END_REF], [START_REF] Mekid | Beyond intelligent manufacturing: A new generation of flexible intelligent NC machines[END_REF].

Expanded from the smart machining concept, it is also important to mention the Smart manufacturing (SM) term, which refers to a new manufacturing method that includes the complex practice of generating and applying data-driven manufacturing intelligence throughout a product's manufacturing lifecycle [START_REF] Davis | Smart Manufacturing[END_REF]- [START_REF] Tao | Data-driven smart manufacturing[END_REF]. With SM, manufacturing machines are fully connected via wireless networks, monitored by sensors, and controlled by advanced computational intelligence to improve product quality, system productivity and sustainability while reducing costs [START_REF] Yao | Smart manufacturing based on cyberphysical systems and beyond[END_REF], [START_REF] Wang | Deep learning for smart manufacturing: Methods and applications[END_REF]. These fully-connected systems are also referred in the literature as Cyber-Physical Systems (CPS), which are systems that contain a variety of interconnected sensors in the hardware level and are capable of sharing their data with models for processing and making at the end the decision based on the learning outcomes. Learning from data can be done either locally with high performance computers, or with cloud-based system [START_REF] Babiceanu | Manufacturing operations, internet of things, and big data: Towards predictive manufacturing systems[END_REF], [START_REF] Babiceanu | Big Data and virtualization for manufacturing cyberphysical systems: A survey of the current status and future outlook[END_REF].

Learning from collected data will allow predicting and avoiding undesirable outcomes.

Moreover, it is expected from these systems to be able to act before the occurrence of the malfunctions by applying changes that reduces the errors to get finally the preferred outcomes.

The data driven smart manufacturing approach (DDSMA) highlights the possibility of making efficient and intelligent systems in different levels of manufacturing. One of the manufacturing applications in which DDSMA can be implemented is the machining. Therefore, it will pave the way to acquire smart processes with online monitoring of machining. The main aspects of machining processes monitoring and optimization are categorized by [START_REF] Davis | Smart Manufacturing[END_REF] as:

1) Surface integrity monitoring, which is about the quality control of the surface condition using the roughness parameters or defect detection; 2) Tool condition, which is mostly about the tool wear; 3) Machine dynamics and stability; and 4) Sustainability.

Quality control of surface integrity

Traditionally, the monitoring of surface integrity is done outside the manufacturing line, in a dedicated metrology station. By following specific quality standards, a metrologist or QC operator gives a final report about the conformity of a product. Since the result is given by a human, its judgment is a source of error. In addition, the traditional quality control method is significantly time-consuming and usually does not offer the possibility of improving the part's surface quality in a real production line. Based on these drawbacks of traditional QC, ideas for on-machine surface integrity monitoring are currently very promising. The proposition of a proactive QC aims to guarantee a real-time feedback to the machine tool to produce the desired surface closer to predefined specifications.

Defect detection

Machined mechanical parts might exhibit defects caused by malfunction of the machine tool, external unexpected behaviors, or the part's material. Surface defects cease to fulfil the functionality that the mechanical part is supposed to guarantee. Therefore, quality control must be done before delivering any final product to ensure that it is in conformity to standards and to prevent problems in terms of customer and the subsequent processes of production [START_REF] Özseven | Surface Defect Detection and Quantification with Image Processing Methods CHAPTER 3 Surface Defect Detection and Quantification with Image Processing Methods[END_REF].

Surface defects can be detected using advanced algorithms like deep learning embedded on machine vision systems with image-processing. The detection and localization of defects using a data-driven learning approach allows further improvement and correction of the manufacturing process by feeding back the algorithms' output to change the machining parameters into the ones that will result in better surface quality.

The automatic detection of defects in high-resolution images requires a significantly high computation performance. For instance, images must be firstly pre-processed, then the filtering, segmentation and thresholding are performed. Several basic image-processing algorithms can be employed in each part of this pre-processing. Another alternative, is to exploit the capability of neural network algorithms to extract numerous features from a large number of images. In this case, the pre-processing functions will be nested in the hidden layers of the Artificial Neural Networks (ANN). The image acquisition system can be also equipped with a high-quality illumination source, for example, to avoid some image pre-processing steps such as noise reduction or contrast enhancement.

When it comes to image-based surface inspection of mechanical parts, two types of cameras can be employed: line scan camera and area scan camera. The first one is used to take continuous images with very high-resolution, which are recorded on a single row of pixels. It is ideal for taking images of an object in motion at high-speed. The limitation of this type of camera is the necessity of an additional acquisition equipment for image reconstruction of a surface. The second type of the camera is used to take surface images of a static object, and since it contains a large matrix of pixels, it does not represent a practical solution for moving objects.

Surface roughness prediction

The quality assessment of manufactured parts is usually divided in a) macro-geometrical parameters, which refers to deviations of dimension, form and position; and b) surface quality.

Since the quality assessment of both surface and geometry depends on the measuring device capabilities, the clear distinction between them is not always clearly definable. However, the DIN 4287 offers a general system for organizing the structural deviations of a surface, Figure The presented structural deviations start from 1 st order on following a reducing geometric scale concerning the causes behind them: 1 st order deviation is attributed to systematic errors (e.g. wrong positioning of part inside machine tool); 3 rd order is attributed to the penetration between tool and workpiece (e.g. kinematic roughness associated with turning); and 5 th order is rendered visible by structural properties on the surface (e.g. grain boundaries become visible in highprecision machining of metallic optical mirrors). The surface quality of a mechanical part is defined by its roughness parameters, being Ra is the most used roughness parameter in the industry for part's surface quality specification [START_REF] Klocke | Manufacturing processes 1[END_REF].

The roughness represents the irregularities of a surface that result from the applied cutting conditions, friction marks caused by the tool wear, different chip-formation modes, tool geometry, and cutting fluid…etc [START_REF] Klocke | Manufacturing processes 1[END_REF]- [START_REF] Petropoulos | Surface texture characterization and evaluation related to machining[END_REF]. Due to these reasons, values of surface roughness parameters vary significantly when machining the same material with different processes. From any executed machining process, predicting the roughness is feasible using a data-driven model that can learn the correlation between the parameters that directly influence the surface roughness [START_REF] Benardos | Predicting surface roughness in machining: A review[END_REF]. Yet, it is tedious and costly (obtaining the physical measures, collecting data, post-processing…etc) to build a database with all the factors that influence the surface roughness as detailed in Figure 5.

Figure 5: The most parameters that influence the roughness [START_REF] Benardos | Predicting surface roughness in machining: A review[END_REF] Prediction of surface roughness of machined parts is however done by modelling the physical behavior of the manufacturing process, which allows establishing the correlation between various cutting factors, environment factors, and the surface properties. Machine learning modelling is an effective data driven solution that has been used for surface roughness prediction in milling process. Quintana et al. [START_REF] Quintana | Surface roughness monitoring application based on artificial neural networks for ball-end milling operations[END_REF] developed a surface roughness monitoring application based on artificial neural network for a vertical ball end milling. Geometrical cutting factors, dynamic factors, part geometries, lubricants, materials and machine tools were all considered as inputs of the neural network; and surface roughness was measured with a stylus after all the experiments. Benardos et al. [START_REF] Benardos | Prediction of surface roughness in CNC face milling using neural networks and Taguchi's design of experiments[END_REF] presented a Neural Network (NN) modelling approach to predict Ra in CNC face milling. The inputs factors considered were the depth of cut, the feed rate per tooth, the cutting speed, the radial engagement and wear of the cutting tool, the usage of cutting fluid (dry cuts or cuts with lubricant), and the three components of the cutting force. Using a NN with Lavenberg-Marquardt algorithm, the most influential factors found were the feed rate per tooth, the component Fx of the cutting force (in the feed direction of the face milling process), and the use of cutting fluid. Li and Tian [START_REF] Li | An effective PSO-LSSVM-based approach for surface roughness prediction in high-speed precision milling[END_REF] proposed a surface roughness prediction model for high-speed precision milling that uses the Least Squares Support Vector Machine (LSSVM) with cutting parameters and tool wear as inputs. This model's performance was compared with the response surface method, and it has been calculated that the errors of the LSSVM model were the lowest for the case. Also, for predicting surface roughness in milling, Markopoulos et al [START_REF] Markopoulos | On the use of back propagation and radial basis function neural networks in surface roughness prediction[END_REF] compared two types of NN: the backpropagation networks, and the radial basis function networks. The model inputs were the cutting parameters and the vibration. The first network was examined with three different algorithms: the steepest descent, Levenberg-Marquardt and Bayesian, whereas in the second

Surface Roughness

network was done using the Radial Basis Function (RBF). It has been concluded that the RBF was faster, more stable and exhibited lower error in the training data. Although it did not show the smallest error on the testing, the Back Propagation (BP) network with Bayesian method has given the lowest mean squared error in their study.

On the other hand, Kong et al [START_REF] Kong | Bayesian linear regression for surface roughness prediction[END_REF] applied four Bayesian Linear Regression (BLR) models for the surface roughness prediction in down milling process. The Principal Component Analysis (PCA) was used to perform feature extraction from the vibration signals. The new extracted feature vectors with three cutting parameters were used as inputs for the models. Comparing to other algorithms, the standard BLR with support of Kernel PCA showed better performance of predicting Ra. Although the above mentioned works resulted in rather good model performances, they were all built based on roughness measurements performed with contacttype profilometers. This way, in addition to the present work's proposition of having noncontact profilometers inside the machine-tool, there is also room for improvement of AI model performance by using ensemble methods, which is a method capable of generating at the end a model with minimum error by reducing it in the weak models that were trained before. Having a model with a better performance guarantees a stronger generalization and the possibility of deploying the system into an on-line QC.

There are also other works outside milling process, such as Ulas et al. [START_REF] Ulas | Surface roughness prediction of machined aluminum alloy with wire electrical discharge machining by different machine learning algorithms[END_REF], which proposed a roughness prediction model for surfaces cut with Wire Electrical Discharge Machining (WEDM). They used ML algorithms in order to reduce cost and cutting time, and found out that the weighted extreme learning machine W-ELM algorithm had the best performance with a RMSE error equal to 0.036 and R² of 0.972. The combined dataset contained four different WEDM parameters, with surface roughness measured by a contact profilometer.

Another research area worth mentioning is about using computer vision systems used to extract surface roughness. For instance, Tsai et al. [START_REF] Tsai | Surface roughness classification for castings[END_REF] proposed a method to infer roughness based on images taken from parts machined by turning process. They used Fourier transform applied to the images, and after feature extraction, two neural network models were developed to predict the value of roughness according to two camera orientations. Similarly, [START_REF] Kamguem | Surface Roughness Estimation of Turned Parts from Optical Image Measurements and Wavelet Decomposition[END_REF] used discrete wavelet decomposition for feature extraction of optical microscope images, and the neural network model calculated roughness estimation without knowing the cutting parameters.

Dhanasekar et al. [START_REF] Dhanasekar | Evaluation of surface roughness based on monochromatic speckle correlation using image processing[END_REF] processed the speckle pattern images with the autocorrelation method.

They found a correlation between the roughness values before and after processing measured by a stylus and those estimated by the speckle pattern calculation. Patel et al. [START_REF] Patel | Modeling and prediction of surface roughness using multiple regressions: A noncontact approach[END_REF] developed a mathematical relationship using multiple regression modelling between image texture features of machined surfaces and the Ra measured by a contact-type surface profilometer. From their results, it has been concluded that the features extracted via images taken by a camera can effectively estimate the real value of surface roughness Ra. The error of their linear regression model was about 2 %.

Table 1 summarizes the literature review done on prediction of Ra in milling using different AI approaches. In all referred works, contact-type measurement was the only method applied.

Authors

Data-driven decision models

The above-mentioned literature showed highly dependency on variety of data-driven models. This section briefly describes the methods and the theoretical background of AI-based methods used in this thesis, for both studied application: surface defect detection and surface roughness prediction.

Data post processing

Real world data are presented in many different types, such as: texts, images, signals, and tables…etc; these types are classified into two clusters: (1) structured data, such as machine cutting parameters, spindle current, temperature…etc, which are organized in tables or matrices with predefined and arranged columns, therefore they can be analyzed easily; [START_REF] Lou | Hierarchical decision making for proactive quality control: System development for defect reduction in automotive coating operations[END_REF] unstructured data, such as videos, images, etc. This latter is mostly found in the digital world, and contains more information that needs to be extracted. Each type of data requires a specific kind of preprocessing to prepare it in an organized way that can be used for learning algorithms.

Developing a data-driven system for online QC in manufacturing systems is challenging, especially because the data acquired from a manufacturing process environment. For instance, materials' properties and production parameters, could be massive and require a solid data structuring for efficient data post-processing analysis [START_REF] Wang | Deep learning for smart manufacturing: Methods and applications[END_REF]. However, smart data methodology might be a promising solution for an online QC [START_REF] García-Gil | Enabling Smart Data: Noise filtering in Big Data classification[END_REF], [START_REF] Lareyre | Artificial Intelligence in Vascular Surgery: Moving from Big Data to Smart Data[END_REF].

The data acquired from vision systems are usually presented in digital forms such as images and videos. These data might contain noises caused by the surrounding environment of the system or by its internal components. The data can also be exported in an extension that is not ready to be analyzed. Therefore, preprocessing the data is often necessary before using them inside an ML algorithm. Examples of data-preprocessing related to imagery are resizing and cropping of images [START_REF] Bacioiu | Automated defect classification of Aluminium 5083 TIG welding using HDR camera and neural networks[END_REF].

According to Luengo et al. [START_REF] Luengo | Big Data Preprocessing[END_REF], big data is an appealing topic that deals with the knowledge extraction process, in which vast amounts of data are analyzed, processed, interpreted, and cleaned in order to be accessed in a structured way. This transformation is the difference between "big" and "smart" data. Therefore, smart data (or intelligent data) is an approach to data processing, consisting in extracting from the gigantic mass of data provided by big data the most relevant information to conduct defect identification. Indeed, traditionally, data is first collected, converted, placed in a database, and processed in waves. However, with this approach, data is usually out of date when it is finally analyzed. Thanks to the smart data approach, also known as scarce data analysis, data is analyzed directly at the source to enable immediate decisions to be made. Processing time is reduced and the term "Smart" refers to the intelligence of this concept, and the fact that this approach is often linked to sensors with multiresolution. In addition, the notion of intelligence is based on the fact that less data is processed, because statistical models are responsible for determining which the relevant variables, namely the most correlated.

Depending on the application, the available data might be too small for a meaningful analysis; or it might be previously labeled or not. In both cases, by performing a rotation of the images or adding noise to them, it is possible to significantly increase the amount of data before using it to train an ML model [START_REF] Ferguson | Detection and segmentation of manufacturing defects with convolutional neural networks and transfer learning[END_REF], [START_REF] Zhang | Weld image deep learning-based on-line defects detection using convolutional neural networks for Al alloy in robotic arc welding[END_REF]. This method is called data augmentation, and it must consider an eventual issue of overfitting the learning model. As it depends on the case base, such as for letters recognition, rotation of the images would change the meaning of the word in the image.

Another alternative to the problem of not having labeled data is the application of unsupervised ML algorithms, which are another type of ML algorithm that represents an excellent solution to create models from unlabeled data.

Feature extraction

Feature extraction means finding the combination of features that gives a new subset of features which contains the majority of the information in the raw data [START_REF] Abellan-Nebot | A review of machining monitoring systems based on artificial intelligence process models[END_REF]. The objective of this step in the pipeline of making a decision system is to reduce the dimension of the original data by keeping as much of the relevant information, thus reducing the model complexity which is caused by the curse of dimensionality, reducing the processing time consumed to provide the final decision and improve model's accuracy. In addition, it helps to a better visualization of data with the most informative variables.

Learning methods for pattern recognition aim to find meaningful information hidden inside the data. Thus, to get significant knowledge from it, such as object localization and segmentation, letters or voice recognition; features that describe and characterize each element of the subject of interest must be extracted before the classification/clustering phase. A domain expert must handcraft this feature extraction and identification before any training of ML models [START_REF] Wang | Deep learning for smart manufacturing: Methods and applications[END_REF].

One way to avoid this phase is employing DL methods, which do not require pre-extraction of features because it performs a deep pattern recognition from a big amount of data using nonlinear functions of the hidden layers. If the amount of available data is insufficient, data augmentation methods can be employed to increase the data for training NN algorithms.

Feature selection

Feature selection has the same goals as to the feature extraction. Except that this step comes to discard the features which are irrelevant or redundant [START_REF] Abellan-Nebot | A review of machining monitoring systems based on artificial intelligence process models[END_REF], by calculating the correlation using filter method [START_REF] Liao | Classification of welding flaw types with fuzzy expert systems[END_REF] or using other methods [START_REF] Abellan-Nebot | A review of machining monitoring systems based on artificial intelligence process models[END_REF], [START_REF] Valavanis | Multiclass defect detection and classification in weld radiographic images using geometric and texture features[END_REF]. After applying the feature extraction, each feature from the new subset of features can be given a percentage of importance and the quantity of information related to the problem that needs to be solved.

Principal component analysis

PCA is one of the factor analysis methods developed by Pearson [START_REF] Pearson | LIII. On lines and planes of closest fit to systems of points in space[END_REF] in 1901, and is defined as statistical method for dimension reduction used to transform data from high-dimensional space into a lower dimensional one [START_REF] Chiarello | Data science for engineering design: State of the art and future directions[END_REF]. The approach of PCA is to condense the information held in the space R in a lower dimensional subspace by trying to minimize the loss of information, i.e. the loss of variability. This approach involves searching for new principal components obtained as linear combinations of the initial variables. It helps find the linear correlation between variables in the original matrix, then build a new set of components, which are the eigenvectors that represent the combination of the correlated variables weighted by eigenvalues [START_REF] Kong | Bayesian linear regression for surface roughness prediction[END_REF], [START_REF] Rathore | Determination of optimum parameters for surface roughness in CNC turning by using GRA-PCA[END_REF].

Figure 7 illustrates the dispersion of the data after reducing the original data's dimension with three dimensions into two dimensions. It is mandatory to choose the axis that gives the maximum variance and therefore, they contains the most important information quantity.

Feature extraction algorithm

Chapter 1: Literature review 29 ML represents a subfield of Artificial intelligence, which is about algorithms with a target to perform better on a specific task to solve a problem by learning from data. There are different types of learning [START_REF] Kang | Machine learning applications in production lines: A systematic literature review[END_REF].

(1) Supervised learning which is concerning learning from an already labelled data. It means that the target or the output is already given to the algorithm with the related inputs.

(2) Unsupervised learning is defined as getting the knowledge from unlabeled data by finding hidden patterns in the input data. The most known application of this kind of learning is the clustering of the data observation or samples, into clusters that have closer similarities and same characteristics.

(3) Semi-supervised is the combination of the two previous mentioned types. The data for learning has a part where the inputs and the output are known, the other part are data without output.

(4) Reinforcement learning is a dynamic learning using an agent that tries to learn to solve a challenge from an environment. Based on the action, the agent gets positive or negative rewards depending on the final goal that has to be done. Therefore, when the agent retries to start from 2D view from above the ball 2D view from the side the beginning to solve the issue, it must do it perfectly without getting negative rewards.

Figure 8: The subfields of machine learning and their applications [START_REF] Krzyk | Coding Deep Learning for Beginners[END_REF].

Types of problems that can be solved by ML algorithms are depicted in Figure 8 and detailed as follows:

Classification: usually the target is represented by discrete values, it is a task where the algorithm tries to find a separator/classifier based on the variables in the data. Examples of classification applications are: image classification (defect/no-defect), fraud detection, patient classification (positive/negative)…etc. In most of data used to train a classifier, it has to be balanced in order to avoid the overfitting.

Regression: the targets are continuous values; the algorithm has to find the trend in the data that can be used to predict future target from new unknown inputs.

Dimensionality reduction: this task aims to reduce the variables to determine the most representative ones that will exhibit a high percentage of information quantity. This task can be considered as a feature extraction, it helps to perform an efficient big data visualization, data compression, etc.

Clustering: the algorithms have to divide the data observations into homogeneous clusters, in which each individual shares the same characteristics of the others that belongs to the same group. DT [START_REF] Quinlan | 4.5_ Programs for Machine Learning[END_REF] is one of the ML algorithms classified as supervised learning since it is trained with a dataset that contains labeled observations. Its hierarchical structure, shown in Figure 9, is described as follows:

-the first node (root node) represents the variable or the attribute that contains high-quantity information considering all samples of the data;

-the branches describe the different possibilities or values for the attribute;

-The leaves are their equivalent targets. The entropy measure helps to calculate the quantity of information of an attribute; and based on that, each branch node generates rules of a subset of the dataset. The entropy I is calculated by:

𝐈(𝐒) = -∑ 𝒑 𝒊 𝒎 𝒊=𝟏 𝒍𝒐𝒈 𝟐 𝒑 𝒊 [𝑏𝑖𝑡𝑠] (1)
Where pi represents the probability that a set S belongs to one of the class states.

If a hypothetical dataset D is partitioned into subsets D1, D2, D3 … Dn, depending on the cases that can be taken from an attribute, the expected information that can be given by the subset of the attribute X is given by:

𝑰 𝑿 (𝑫) = ∑ |𝑫 𝒊 | 𝑫 𝒏 𝒊=𝟏 𝑰(𝑫 𝒊 ) (2)
Therefore, the equation of the gain criterion that measures the quantity of information given by the attribute X is: Finding the maximum gain given by an attribute allows the construction of the first node and the other branches. RF [START_REF] Ho | Random decision forests[END_REF], [START_REF] Breiman | ST4_Method_Random_Forest[END_REF] is one of the ensemble techniques that is based on the training of many DTs, where each tree is trained using a random subset of the original dataset, given by the bootstrap method (see Figure 9). The best classifier is the tree that exhibits an error closest to the average value of errors of all trained trees.

𝒈𝒂𝒊𝒏(𝑿) = 𝑰(𝑫) -𝑰 𝑿 (𝑫) (3)

Multi-Layer Perceptron (MLP)

Proposed in 1958 by Rosenblatt, the perceptron was the first model created that represents the human brain's cognitive functionality. Later, in 1969, [START_REF] Minsky | Perceptrons, Expanded Edition An Introduction to Computational Geometry[END_REF] found out that this model could learn only linearly separable data and could not resolve a nonlinear problem as shown for the case of XOR logical function. However, in 1985, Rumelhart et al. [START_REF] Rumelhart | Feature discovery by competitive learning[END_REF] found that adding a layer to a simple perceptron permits resolving the nonlinear separation issue.

The MLP, also called NN, is considered as an approximation of a function, as it is stated in the Universal approximation theorem [START_REF] Hornik | Multilayer feedforward networks are universal approximators[END_REF], [START_REF] Cybenko | Approximation by superpositions of a sigmoidal function[END_REF]: any function can be approximated by a NN that maps inputs onto determined outputs with weights and by applying an activation function that yields a non-linear transformation. Its structure is schematically presented in Figure 9.

Model performances evaluation:

While training, the prediction results from any model, either classification model or regression model, must be evaluated to validate its capacity for resolving the studied decision problem.

Therefore, various evaluation methods are exploited for each type of ML tasks. In this thesis, the most used evaluation methods were the accuracy for classification and for regression task, the Mean Absolute Error (MAE) which is calculated by eq. 4, the Root Mean Squared Error (RMSE) eq.5. The evaluation metrics were used in order to have an overall conclusion about the performance of the compared algorithms.

𝑀𝐴𝐸 = 1 𝑛 ∑|𝑦 -𝑦 * | (4) 𝑅𝑀𝑆𝐸 = √ ∑ (𝑦 𝑖 -𝑦 * 𝑖 ) 2 𝑁 𝑖=1 𝑁 (5)
Where y represents the real measured roughness, and y* is the roughness predicted by the model. N is the total number of the observation or samples.

MAE is a metric used to evaluate the performances of regression model. It is the absolute difference between the actual and predicted values [START_REF] Sizemore | Application of machine learning to the prediction of surface roughness in diamond machining[END_REF].

RMSE tends to be the most used metrics to judge the model quality. This metric is more sensitive to outliers than the MAE [START_REF] Hyndman | Another look at measures of forecast accuracy[END_REF], [START_REF] Pontius | Components of information for multiple resolution comparison between maps that share a real variable[END_REF]. It is the squared root of the average between each predicted value and the expected true value.

Accuracy:

The accuracy is a significant indicator of the model capacity to predict new targets in the future.

It represents the proportion of observations in the test set correctly classified by the model [START_REF] Clemente | Assessing classification methods for churn prediction by composite indicators[END_REF].

It is calculated from the confusion matrix shown below in

Cross-Validation:

Cross-validation is a statistical technique that consists of partitioning data sets into subsets, training the data on one subset and using the other subset to evaluate the model's performance. This technique is only used for checking the model performance, it can't be exploited to acquire the model with the highest record. In order to validate the ability of the algorithm to provide convenient prediction after deploying the model, the trained model must be validated using various data arrangement.

There are four types of cross-validation:

 Holdout method: the dataset is divided into two parts (a set for training and another for testing).  K-fold cross validation.  Leave-one-out cross-validation: is a specific case of K-fold cross validation where k equals the number of observations in the dataset.  Bootstrap Methods.

The most popular K-fold cross-validation technique it involves randomly dividing dataset into k groups or folds of approximately equal size. The first fold is kept for testing and the model is trained on the k-1 folds. The process is repeated K times and each time a different fold or group of data points is used for validation [START_REF] Berrar | Cross-validation[END_REF].

Machine learning for regression

Regression algorithms are considered the most adequate machine learning methods for predicting an output variable represented by real continuous values. Through the learning from the training and test data, regression models can be generated by the determination of the weights of the equation that will describe the mathematical relationship between the dependent variable y (the target) and the independent variables (inputs X1, X2, X3, … Xn), as described by eq. 7:

𝑦 = 𝑎 0 + ∑ 𝛽𝑖. 𝑋𝑖 𝑛 𝑖=1 (7)
Where 𝛽𝑖 are the indexed weights.

In the following subsections, the theory behind ensemble algorithms is presented, together with ANN algorithms which were also applied in many research works.

Boosting

Boosting is one type of ensemble methods about training many "weak models" sequentially.

Each model is trained with the original dataset that is weighted. The weights are adjusted according to the error of the previous prediction results. As it is shown in Figure 10, the adjustment is done by allocating larger weights to the false predicted outputs, lower for the good ones, and getting at the end the best model with better performance by either summing up, averaging or voting on all the predicted output of each weak learner. Usually, the weak learners are decision trees.

The most popular boosting algorithm is Adaptive Boosting (called AdaBoost, because it adjusts adaptively to weak learners' errors [START_REF] Freund | A Decision-Theoretic Generalization of On-Line Learning and an Application to Boosting[END_REF]). The algorithm starts by giving to all observation equal weights 𝑤 𝑖 = 1 𝑛 , where n represents the total number of observations and i=1,2…, n. Afterwards, a loop over a set of weak models is executed, which contains the following steps:

(1) Fitting the weak model h using data weighted by wi.

(2) Computing the error Ɛ given by eq. 8:

Ɛ= ∑ 𝑫 𝒕 (𝒊) 𝒊:𝒉 𝒕 (𝒙𝒊)≠𝒚𝒊 (8)
Which is the sum of the weighted wrong predictions.

(3) Calculating the coefficient using eq. 9:

𝜶 𝒕 = 𝟏 𝟐 𝐥𝐧 𝟏-Ɛ 𝒕 Ɛ 𝒕 (9)
(4) Updating the weights using the eq. 10 the first initialized divided by a normalization factor Z and then scaled by an exponential factor, which depends on the predicted outputs.

𝑫 𝒕+𝟏 (𝒊) = 𝐃 𝟏 (𝐢) 𝒁 𝒕

. 𝒆 -𝜶 𝒕 𝒉 𝒕 (𝒙)𝒚(𝒙) [START_REF] Minoni | Chromatic confocal setup for displacement measurement using a supercontinuum light source[END_REF] The final model is given using the combination of all weak models ht weighted by α coefficients: Where yi refers to the observed real values, and 𝝆 refers to the predicted values. The eq. 12 means that it gives the predicted value that minimizes the sum of the loss. Finding the optimal value by using the sum of the derivatives of the loss, will give at the end 𝑭 𝟎 (𝒙) equal to the average of the observed values.

𝑯(𝒙) = 𝒔𝒊𝒈𝒏 (∑ 𝜶 𝒕 . 𝒉 𝒕 (𝒙) 𝑻 𝒕=𝟏 ) (11)
Then next step is a loop for m=1 to M to make 𝒉 𝒎 (weak learners, mostly regression trees), calculating first the residuals rim using eq. 13 (where i is the sample number, m is the tree to be build), which represents the derivative of the loss function with respect to the predicted values

F(xi)

.

𝑟 𝒊𝒎 = -[ 𝝏 𝑳(𝒚 𝒊 , 𝑭(𝒙 𝒊 ) 𝝏 𝑭(𝒙 𝒊 ) ] 𝑭(𝒙)=𝑭 𝒎-𝟏 (𝒙) , 𝒊 = 𝟏, … , 𝑵 (13)
Next step is updating the multiplier ρ.

𝝆 𝒎 = 𝒂𝒓𝒈𝒎𝒊𝒏 𝝆 ∑ 𝑳(𝒚 𝒊 , 𝑭 𝒎-𝟏 (𝒙 𝒊 ) + 𝝆) [START_REF] Andersson | Determination of wear volumes by chromatic confocal measurements during twin-disc tests with cast iron and steel[END_REF] 𝑵 𝒊=𝟏 At the end, the final model is the result of updating the previous models using the gradient of the loss.

𝑭 𝒎 (𝒙) = 𝑭 𝒎-𝟏 (𝒙) + 𝝆 𝒎 𝒉(𝒙) (15) RF [START_REF] Breiman | Random forests[END_REF] is a Bagging algorithm based on training many weak models on bootstrapped subsets (extracted small samples with replacement) from the original data. Each subset is then trained with a decision tree. Afterwards, a random selection of m features from p features is applied, followed by a split of the root node using the feature that gives the best split (the maximum quantity of information about the output). At the end, the output is the result given from all trees. In a regression problem, the final model of RF is the average results from all the trees.

Neural networks are represented by neurons, which are the main components of the layers. In each supervised task, the goal is to find the mathematical relationship between the inputs and the output (s). In NN, the hidden layers are the intermediates that help finding this relationship.

In images, the hidden layer represents a feature extractor, it grant to extract automatically the typical features of an object from the original images.

The information is forward propagated in the NN. The error is calculated in the output layer, and then backpropagated through the network to calculate the weight updates.

Updating the weights using eq. 17 with gradient descent algorithm in order to get the global minimum is done based on the following equations:

𝑤 𝑖𝑗 ← 𝑤 𝑖𝑗 + ∆𝑤 𝑖𝑗 ( 17
)
where ∆𝑤 𝑖𝑗 = -𝜂 𝜕𝐸 𝜕𝑤 𝑖𝑗 [START_REF] Zahouani | Identification of manufacturing signature by 2D wavelet decomposition[END_REF] 𝜼 is the learning rate, it determines the rate of changing the weight per iteration. It must be a low value, which therefore will help the output to converge to an optimized solution.

The error E is commonly written as the sum of the squared error of the difference between the predicted values and the ground truth values as it is depicted in the eq.19:

𝐸 = 1 2
(𝑦 𝑡 -𝑦 𝑝𝑟𝑒𝑑 ) 2 ; 𝑎𝑛𝑑 𝑦 𝑝𝑟𝑒𝑑 = ∑ 𝑤 𝑖𝑗 . 𝑥 𝑖 𝑖 𝑓𝑜𝑟 𝑙𝑖𝑛𝑒𝑎𝑟 𝑟𝑒𝑔𝑟𝑒𝑠𝑠𝑖𝑜𝑛 [START_REF] Kim | Smart Machining Process Using Machine Learning: A Review and Perspective on Machining Industry[END_REF] The gradient of the error with respect the weight is given by eq.20 Where 𝜹 = 𝒚 𝒕 -𝒚 𝒑𝒓𝒆𝒅 , 𝑖𝑡 𝑖𝑠 𝑡ℎ𝑒 𝑟𝑒𝑠𝑖𝑑𝑢𝑎𝑙

Then the updated weight based on the delta rule and the gradient descent [START_REF] Kim | MATLAB Deep Learning: With Machine Learning[END_REF] is written in eq.21:

𝑤 𝑖𝑗 ← 𝑤 𝑖𝑗 + 𝜂 𝛿𝑥 𝑖 [START_REF] Davis | Smart Manufacturing[END_REF] With the backpropagation algorithm, the error in the hidden node is computed using the transpose of the weight matrix related to the hidden layer multiplied by the error of the output layer.

𝐸 ℎ = 𝑊 ℎ𝑖𝑑𝑑𝑒𝑛 𝑇 * 𝐸 (22)
As a summary, the process of learning in NN using backpropagation is as follows:

1. initialization of the weights;

2. training of the input data in order to get the outputs, then computation of the error E between the real target and the predicted output;

3. propagation of the error backwards and calculation of the error in the hidden layer;

4. Adjustment of the weights. ),

where wj is the weight, and 𝝋 is the activation function applied to fire each node hi, the activation function used in this work is the Rectified Linear Unit (ReLU) eq.23:

𝑅(𝑧) = max(0, 𝑧) (23)
It will output the input directly if it is positive, otherwise, it will output zero.

At the end the NN has to find the weights which will gives the Ra as in eq.24:

Ra= 𝜑(∑ 𝑤𝑖 * (𝑤1. 𝑓𝑒𝑒𝑑 + 𝑤2. 𝑣𝑐 + 𝑤3. 𝑎𝑝 + 𝑤4. 𝐹𝑧 + 𝑤5. 𝐹𝑎 6 𝑖=0

)

Where Fa is the active force corresponds to the sum of Fx and Fy which are given by force sensor, and Fz is the force component in the z axis of the sensor table. providing the final model to learn the hidden patterns that characterize the targets wanted from the image. More details about CNN and a proposed interactive visualization can be found in the paper of Wang et al. [START_REF] Wang | CNN Explainer: Learning Convolutional Neural Networks with Interactive Visualization[END_REF]. On the other hand, CNN algorithms usually require a higher amount of data. For a binary classification such as defect detection, the data must be balanced by having a number of images that represent the defect class nearly equal to the quantity of nodefect. To overcome that, some researchers apply data enhancement techniques like data augmentation (image rotation or noise addition), so the network can learn more features from data and return results with higher accuracy [START_REF] Ferguson | Detection and segmentation of manufacturing defects with convolutional neural networks and transfer learning[END_REF], [START_REF] Zhang | Weld image deep learning-based on-line defects detection using convolutional neural networks for Al alloy in robotic arc welding[END_REF], [START_REF] Hanbay | Fabric defect detection systems and methods-A systematic literature review[END_REF], [START_REF] Wen | Vision-based surface inspection system for bearing rollers using convolutional neural networks[END_REF].

The use of DL and parallel computing (with Graphics Processing Units GPUs) has given excellent results on segmentation and classification of defects of high-resolution images with a CNN architecture designed with two networks: one for the segmentation and the other one for classification [START_REF] Tabernik | Segmentation-based deep-learning approach for surface-defect detection[END_REF]. CNN has also been successfully employed to detect welding defects [START_REF] Bacioiu | Automated defect classification of Aluminium 5083 TIG welding using HDR camera and neural networks[END_REF] and for online QC of robotic arc welding of Aluminum alloy parts [START_REF] Zhang | Weld image deep learning-based on-line defects detection using convolutional neural networks for Al alloy in robotic arc welding[END_REF].

Autoencoders

Auto-encoders are unsupervised learning neural networks that help to return the input data in the output layer by transferring it to latent representation, which is then reconstructed to give finally the input data [START_REF] Wang | Deep learning for smart manufacturing: Methods and applications[END_REF], [START_REF] Kotsiopoulos | Machine Learning and Deep Learning in smart manufacturing: The Smart Grid paradigm[END_REF]- [START_REF] Zocca | Python Deep Learning[END_REF]. These types of algorithms are mainly used for dimensionality reduction [START_REF] Holden | Reducing the Dimensionality of[END_REF], and denoising, where the latent representation is taken as input for another algorithm or another neural network stage [START_REF] Dong | Small defect detection using convolutional neural network features and random forests[END_REF]. RNN is another type of neural network used for sequential data. RNN deals with variable length sequences by defining a recurrence relation over these sequences [START_REF] Zocca | Python Deep Learning[END_REF]. It can be used for data forecasting of time series data, language processing, or signal processing (speech recognition).

They are better for modeling data with non-linear relationships, although they are not suited for long-term data sequences due to gradient vanishing. A variant of RNN called Long-Term Short Memory (LSTM) is used to deal with long-term data sequence.

Defect detection methods

Methods for detecting defects on images have been detailed by [START_REF] Kumar | Computer-Vision-Based Fabric Defect Detection: A Survey[END_REF]- [START_REF] Ngan | Automated fabric defect detection-A review[END_REF], statistical methods, spectral, and methods based on machine learning models. After detecting and locating the areas of interest, features of the defect need to be extracted to do classification using machine learning algorithms, and finally the automatic defect detection can be deployed. The main area of research is related to the choice of machine learning algorithms according to the criteria of accuracy and computation time.

Statistical approach

These are methods based on the time domain analysis and characterization of the spatial distribution in grey level by extracting the mean, variance, standard deviation…etc. Then afterward, varieties of mathematical functions can be employed, such as autocorrelation, cooccurrence, Mathematical Morphology, fractal method...etc.

 Autocorrelation :

This technique is characterized by performing a correlation function between an image and a reoriented copy of itself [START_REF] Douda | Electronic Letters on Computer Vision and Image Analysis[END_REF]. It allows to examining the repeated structures [START_REF]Fabric Defect DeTection And Classification Using Image Analysis[END_REF], [START_REF] Hanbay | Fabric defect detection systems and methods-A systematic literature review[END_REF].

It is possible to measure surface roughness after image analysis of speckle pattern of two types of processes: grinding and milling with the autocorrelation function. Dhanasekar et al. [START_REF] Dhanasekar | Evaluation of surface roughness based on monochromatic speckle correlation using image processing[END_REF] concluded that the shape of the autocorrelation function was changed according to the roughness. The autocorrelation method is employed for texture analysis and fabric defect detection in the textile field, as investigated in the works [START_REF]Fabric Defect DeTection And Classification Using Image Analysis[END_REF]- [START_REF] Zhu | Yarn-Dyed fabric defect detection based on autocorrelation function and GLCM[END_REF].

 The mathematical morphology :

The morphological method allows the recovery of nearby pixels to do smoothing and noise reduction on binary images or grey-scale images. The basic operations of this method are: i) dilation, in which the contours of an area of interest are condensed by additional pixels; and ii) erosion operation, which consists of eliminating the pixels around the area of interest [START_REF] Ngan | Automated fabric defect detection-A review[END_REF], [START_REF]Fabric Defect DeTection And Classification Using Image Analysis[END_REF], [START_REF] Hanzaei | Automatic detection and classification of the ceramic tiles' surface defects[END_REF].

 Co-occurrence Matrix:

This method provides texture characterization by applying a statistical study of the dependence between pixel intensities.

The co-occurrence approach is negatively affected by the noise, which requires performing some filtering steps. This approach exhibits two disadvantages: it shows poor performance when processing images of high resolution. Although the accuracy can be increased by applying a wavelet transform, it requires significant computing time [START_REF] Hanbay | Fabric defect detection systems and methods-A systematic literature review[END_REF].

Spectral approach

This approach includes spatial/frequency analysis, wavelet analysis, Gabor transform and Fourier transform  Fourier transform:

Fourier transform is a technique applied to analyze stationary signals from the time domain to the frequency domain. It is used for spatial/frequency characterization of textured images [START_REF] Tsai | Surface roughness classification for castings[END_REF],

[93]- [START_REF] Tsai | A fast regularity measure for surface defect detection[END_REF]. A high-energy spectrum presents the dominant texture in an image.

Tsai et al. [START_REF] Tsai | Automated surface inspection for directional textures[END_REF] exploited the Fourier transform to remove a repetitive texture pattern from the fabric which is considered a defect-free character. After that, the image is reconstructed from the inverse transform. In the manufacturing field of textiles, during the inspection of images taken from fabrics, one can notice the presence of textures. This is why the analysis with Fourier transform is applicable and several research works have been carried out for the detection of defects on tissue images as detailed in the review work of Hanbay et al. [START_REF] Hanbay | Fabric defect detection systems and methods-A systematic literature review[END_REF].

 Wavelets:

Wavelets are mathematical functions, sometimes considered as mathematical microscopes [START_REF] Mansori | On concept of process signature in analysis of multistage surface formation[END_REF],

used to process non-stationary signals and images. They usually can perform a spatial/frequency analysis better than the Fourier transform as they can localize the appearance of anomalies in spatial and frequency space. There are different functions for the wavelet analysis, and selecting the most suitable mother function for the multiresolution decomposition of an image is one of the most stimulating challenges at the moment. [START_REF] Mezghani | Identification of relevant wavelet functions for multiscale characterization of manufactured surfaces using a genetically optimized neural network[END_REF]  Gabor Filters:

Gabor filters are capable of performing spatial and frequency analysis. They are complex sinusoidal functions modulated by a Gaussian function [START_REF] Ma | Fast Surface Defect Detection Using Improved Gabor Filters[END_REF]. In a specified region of interest of an image, they can perform specific frequency analysis in a particular direction [START_REF] Belgacem | Applying a Set of Gabor Filter to 2D-Retinal Fundus Image to Detect the Optic Nerve Head (ONH)[END_REF]. The Gabor complex function consists of two parts: a real part and imaginary part. The real part is symmetric and is used to extract features symmetric with respect to the center, such as lines. The other one, the imaginary part, is antisymmetric and is used for edge detection.

Conclusions

This bibliographic synthesis highlighted the presence of numerous research works that treat the on-machine surface measurement using non-contact sensors, the prediction of surface roughness in milling and other manufacturing processes, and the defect detection in images.

The literature showed numerous ideas to study the surface topography of the manufactured parts. Some of these are about using optical sensors to measure the surface roughness in a metrology station, and others are about developing a vision system to detect surface defects.

Various approaches are proposed in terms of pre-processing the data after collection from sensors, in order to extract significant amount of information that would grant a higher performance of the trained decision model. Depending on the studied application and the amount of data, a reasonable choice of algorithms should be justified. The use of smart data that provides relevant information will significantly reduce the processing time for training, and avoid the redundancy of information, reducing the likelihood of having overfitting.

Based on the presented literature review, this thesis will initially deal with defect detection from For the prediction of roughness, it was noticed that not many research works used the ensemble method. However, they have remarkable performance either in processing time or model accuracy. Moreover, they give a stable and general model that can be deployed in a ready-touse system. Therefore, the ensemble methods were employed and compared with the NN to predict surface roughness in the milling process.

The next chapter is about AI-based defect detection using high-resolution images taken from a computer vision system. The goal is to propose an online defect detection approach and determine which method is the fastest and most accurate.

Chapter 2: Defect detection and classification

Despite the recent advances of data-processing and vision systems, there is a necessity of training AI algorithms to combine them with the mentioned technologies, which is a complex task and requires several sub-steps to be accomplished. For instance, to train or employ a defect detection and classification method, images must be first preprocessed: filtering, segmentation, and thresholding of the raw data. Subsequently, there is a feature extraction phase, which can be done manually using for example edge detection algorithms to get the desired characteristics from the images; or it can be done automatically inside the layers of a Neural Network (NN)

using Deep Learning (DL) algorithms. Once the feature extraction is done, the classification of the images can be executed so that the final decision concerning rejection or acceptance can be given by the system.

Although there are some works in the literature concerning the use of AI algorithms for defectdetection, their applicability on building an online QC system for real-case scenarios is easily blocked by different aspects that are present in production lines. For instance, performing detection of small-sized defects usually requires the use of high-resolution images that are not available in the shop floor. Besides, the post-processing of a massive high-quality image database can be time-consuming, and consequently, it would require more of data engineering solutions. The application of data enhancement techniques combined with smart data methodology is a practical solution for collecting just relevant data that ensures the rapid and automatic defect classification and is in the end an effective solution for the QC problem. In this sense, the present work aims to cover a topic that has not been found in the literature so far:

the application of defect-detection Machine Learning (ML) algorithms on smart-data composed of high-resolution images taken using Chromatic Confocal Imagery (CCI).

The general objective of this work is to investigate the applicability of combining AI algorithms with current metrology (CCI) by introducing a large degree of consistency in data-processing and characterization. This objective is part of the development of an online QC system for the detection of sub-millimeter defects generated by the laser-machining process that is employed on the surface of cooper rods coated with a polymer. The overall system for this online QC is depicted in Figure 12, where the focus of the present work is highlighted. To enable the development of an online QC system, this work proposes an investigation using different combinations of image segmentations and ML algorithms on high-resolution images taken using CCI on laser-machined parts from an industrial production line. The approach of studying surface defect detection starts with the application of 3 different ML algorithms for defect segmentation on features extracted from the Sobel filter, which is an algorithm for edge detection. The extracted features are taken from the selected pixels of the annotated regions on the training image. For defect classification, an experiment is performed using a DL algorithm, which grants to skip the manual feature extraction since it has already been executed inside the hidden layers by convolution operations. And finally, a Transfer Learning (TL) algorithm is performed with retraining the mobilenet-v1 model [START_REF] Howard | MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications[END_REF], which is a model that has been previously trained with a large variety of objects. By doing so, an increase in the accuracy of the defect classification model is expected.

The database used in this work for training, validating, and testing the models was previously built by selecting the most representative images from a large database composed of multiresolution images. Based on the accuracy results obtained with different ML and TL methods applied to this database, this work also aims to show the feasibility of having accurate ML classifiers trained on a small amount of data, in other words, smart data. For that, a TL method will be employed by using a model that was previously trained on a large number of images that are not related to this work. By doing so, the model can extract a significant variety of features that characterize different objects and can be fine-tuned by a rather small quantity of data for a new application.

Experimental methodology

Copper rods used in electrical engines are coated with electrically insulating material. To weld them with other components, a region of the insolation layer must be removed by laser machining, which is a process based on the formation of grooves on the to-be-treated surface by vaporization owing to heating caused by a moving laser beam. By overlapping the grooves, it is possible to remove layers of coating material and thus to shape functional electrical rods for subsequent welding. However, the polarization-induced mechanism creates surface defects when selectively removing a groove. In addition, depending on the laser-machining conditions, the vaporization reaction becomes rapid enough for an appreciable removal of the coated material (i.e., unworn coated surface). Therefore, residual coating material eventually stays on the surface, which generates a performance defect of the component in terms of electrical conductivity. In this sense, a QC must be carried out to ensure that the surface is flawless, and thus to prevent any additional manufacturing costs and save production time.

The specimens investigated in this study have surfaces designated as non-defective or defective based on very fine discrimination from the production-line quality standard. A schematic depiction of the laser-machined section showing the effect of beam polarization on the groove shape is presented in Figure 13. Each specimen has in total 4 surfaces that can be measured using different methods of image acquisition.

To better understand the generation of defects, a big data composed of images of such surfaces has been previously acquired from the manufacturing line to identify the critical features of unacceptable defects using optical, scanning electron microscopy, and chromatic confocal imagery. From this pool of data, the four most representative laser-machined specimens are analyzed and presented in this work.

Measurements with OM, SEM and CCI

These four specimens are analyzed with three different technologies: OM (Optical Microscope), Scanning Electron Microscope (SEM), and CCI. The goal of the analysis is to define what is going to be considered a "defective" and "non-defective" surface in this study. In addition, it is also intended to evaluate the quality of the CCI measurement in terms of capability of showing surface details. In other words, if there are important surface details measurable by SEM and OM, but invisible for CCI. The investigation done with OM was carried out using an OLYMPUS BX41M, objective lens of 5x and exposure time of 60 µs. The region of interest is illuminated by white light, and a CCD camera is used to acquire RGB images.

For the SEM analysis, two modes were employed: BSE (BackScattered Electrons) and EBSD (Electron BackScattered Diffraction). The measurements were carried out using a FEG JEOL JSM-7001F. First, the extremities of a specimen are painted with an electrically conductive material, then the specimen is placed inside the chamber, and vacuum is done inside it. The surface of the specimen is then subjected to electron beams with power up to 15KV. Since the detected backscattered electrons using the BSE mode depends on the atomic number of the element, light-colored areas in this analysis will correspond to copper (atomic number 29). On the other hand, dark-colored regions will correspond to the other elements with an atomic number lower than 29. An analysis of energy-dispersive X-ray using the EBSD mode was also carried out to characterize the chemical elements presented on the specimen's surface.

Chromatic Confocal Imagery

Chromatic Confocal Microscopy (CCM) is a well-known optical technique for non-contact measurement of surface topography [START_REF] Quinsat | In situ non-contact measurements of surface roughness[END_REF], [START_REF] El-Hayek | 3D measurement and characterization of ultra-precision aspheric surfaces[END_REF], [START_REF] Niese | Application of a chromatic confocal measurement system as new approach for in-line wet film thickness determination in continuous oral film manufacturing processes[END_REF]. Fundamentally, the output of a CCM sensor is the measurement of the distance between the surface and the sensor. By the combination of this measured distance and the corresponding position of the sensor along a preset line, the topography profile of the surface is obtained. The combination of many profiles measured in parallel lines allows a surface topography analysis.

To perform a CCM measurement, two different devices are mounted together: an optical probe and a vision system. The optical probe is a device that contains lenses with different refraction indexes to create the effect of chromatic aberration. By doing so, the diffraction of white light to monochromatic wavelengths is arranged linearly through an optical axis by their focal points.

The spacing between the focal points represents the axial resolution of the sensor. The acquisition of surface profiles is performed by the extraction of the spectrum intensity of the wavelength scattered by the surface point. The centroid of the spectrum, which corresponds to the point of maximum intensity, and its equivalent pixel on the spectrometer graph are converted to a distance using a calibration table.

The MC2 ® vision system used in this work is a microscope under development that combines a chromatic confocal head with a 4K high-resolution camera. The head produces a white line spot on the inspected surface, which is coming from a linear illumination source. The white light coming from the source is scattered into monochromatic lights, and each of its wavelengths represents a specific distance. The nanometric axial resolution that is produced by the chromatic aberration of the objective lens represents the depth of field.

Industrial partner of the present work, the company STIL has developed three optical heads to be used with the MC2 ® vision system: DeepView ® , MicroView ® , and WireView ® . The properties of each optical head are shown in Table 3, with their main feature in bold. As illustrated in Table 3, the optical head DeepView ® is mostly used for applications where the sensor must be slightly away from the specimen, due to its larger working distance. The optical head WireView ® is mainly used for inspection of surfaces that exhibit higher inclination (angle between surface normal vector and optical head longitudinal axis ≤ 46°). And MicroView ® is mostly used for measuring preferably flat surfaces due to its shorter depth of field compared to the others.

DeepView ® 4K WireView ® 4K MicroView ® 4K Line Length [mm] 4.
To verify the capability of using CCI technology for defect detection, a large database of multiresolution images was previously generated using different optical heads. In total, three different optical heads were investigated to determine if they are capable of capturing such submillimeter defects, and also to identify which one is more suitable for the ML algorithms in terms of higher accuracy, since each sensor exhibits a different resolution and contrast.

Moreover, the sensors have different working distances, which let us investigate presumable distances that might be found in a production line. From this CCI database, the same 4 most representative specimens from the OM/SEM analysis were selected to form a small database.

These four specimens were scanned with an exposure time of 60 µs, step resolutions of 1.23 µm, 1.00 µm, and 1.23 µm, using respectively DeepView ® (DV), WireView ® (WV), and MicroView ® (MV). Each measured area exhibits approximately the following dimensions: 14 mm x 2 mm. Data with ".SUR" extension were acquired and preprocessed with MountainsMap Software to subtract the signal that is reflected by the objective (called "dark").

Implementation of Artificial Intelligence

In Figure 14 is summarized how the copper rod specimens were analyzed and data were acquired from the vision machine system. On the left is the MC2 ® machine connected to a computer equipped with a CameraLink acquisition card. After acquisition, images are preprocessed using MountainsMap commercial software to generate the dataset of gray-scale images. The dataset is then used in two different investigations: a) "Direct defect classification with CNN and TL", which is about training/applying CNN algorithms and a TL method to analyze the resulting accuracy for defect classification; b) "Segmentation with Weka plugin", which is about training/applying 3 different ML algorithms (DT, RF and MLP) to analyze their resulting accuracy and processing time. In both situations, the goal is to find the AI approaches that exhibit better performance and thus are most suitable to be integrated later on in a production line with AI-based QC system. After training, the generated classifier is ready to be applied to new images. Images taken from 3 specimens using 3 different CCI sensors are fed to the already trained classifier, which gives as result binary segmented images that exhibit in white color the defective regions of the analyzed surface. A classifier is then ran 10 times for a single image dataset, so the average processing time can be measured. The application of 3 ML models on 3 image datasets captured with different CCI sensors results in 9 combinations of tests. All test images are resized to 1586x1120 before being used in the models. To apply the TL model, the data acquired from the CCI systems were separated into two classes:

defect and no defect. The TL model was retrained on images acquired by two optical heads; it is designed to get an input image size of 224x224 pixels and to use 50% of the models' width.

The model was retrained on a computer with CPU i7-6700HQ 2.6 GHz, graphical card GeForce GTX 960M, and 16 GB in RAM. For validation, the TL model was employed on the same database used to test the CNN model (composed of 28 images from OM and WV). Based on Figure 18, it can be seen that the elements that are mostly present on the analyzed surface are Copper and Carbon. The first one corresponds to the specimen material itself, and the latter corresponds to the residual isolating organic resin.

Results and discussion

Measurements with CCI

Four specimens were scanned using DeepView ® , WireView ®, and MicroView ® respectively.

One image of each specimen inspected by the DeepView ® is presented in Figure 19, together with the measurement settings. Therefore, for online integration of the vision system in a manufacturing line, it is more important to consider the values of the working distance and depth of field of the optical heads. The processing time from each combination of classifier and image acquisition optical head is shown in Table 4 In Figure 24 are presented the accuracy curves of the CNN model over 500 epochs. By comparing them, the model trained with DV images (Figure 24) exhibited an accuracy of the validation data that is close to the training accuracy. The best average accuracy is equal to 98.7% as shown in Table 6. Therefore, the model is assumed to be overfitting on just this kind of dataset. Based on this assumption, the same model has been trained on images from DV+MV.

The resulting accuracies of the validation data related to the model trained with DV+MV dataset exhibited a decrease for all data settings (Table 6) when compared to the resulting accuracies of the model trained with DV dataset. This can be explained by the fact that the quantity of MV images is not equal to the quantity of DV images. Nevertheless, the average accuracy achieved using 40% of validation data over 500 epochs was 84.9%.

In Table 7 are presented the results of defect-classification performed on completely new testing data that were taken using WV and OM. The highest accuracy achieved was 0.64, which corresponds to the model trained with DV, BS=10, and VD=40%. The highest-accuracy model found by the testing data agrees with the one obtained by the validation data presented in Table 6.

DV

Defect classification using TL

The retraining using 500 epochs has taken approximately 4 minutes, and this is related to processing all images of the database. The average evaluation time of the model with 10 trials applied on new test images, that are not included in the training database, was equal to 1.58 seconds.

In Figure 25 Unlike the DV+MV CNN model that did not show good results when applied to the test data (Table 7), the TL trained on DV+MV achieved an accuracy of 64.3%. This can be explained by the fact that the TL model was previously trained on a large database, which allowed it to learn different features by performing object detection and classification.

Defect detection and localization

The framework MaskRCNN

The Mask-RCNN [START_REF] He | Mask R-CNN[END_REF] is an instance segmentation framework that contains several steps of image post-processing, which allows at the end to locate and detect objects. It is classified as a supervised learning algorithm. It is a product of combining the Faster RCNN [START_REF] Ren | Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks[END_REF] algorithm, which is based on Residual Network algorithm, and the Future Pyramid Network FPN [START_REF] Li | Weighted feature pyramid networks for object detection[END_REF],

which is a multiresolution algorithm for feature extraction from different scales. Before training, the input images must be annotated by the targets that the algorithm should learn and which will be detected on new data excluded from the database of training inputs. Each object detected in an image will be rounded by a mask. Objects with similar features are given different segmentation colors depending on the extracted pixels.

The MaskRCNN has an architecture of two stages: the first one generates proposals given by the region proposal network RPN [START_REF] He | Mask R-CNN[END_REF] (a small network that results proposals which may contains objects) which were applied on the feature map (the most relevant extracted features in the image), the second stage works on finding the classes and generating the bounding boxes and it outputs also the masks for each region of interest ROIs (proposed by the RPN).

Due to the bounding box refinement step in the RPN, the ROI boxes have different sizes. Then, ROI Pooling is employed, which is in the simplest form considered like cropping and resizing functions.

Experiments and results

The first experiment performed for the detection of defects using computer vision system was the exploitation of images collected with the MC2 DV sensor. In the second one, the learning database is filled with images from MC2 MV. The collected images from the CCI contain dark areas that represent a non-measured zone which needs to be removed in order to prevent the model from considering them as defect regions. Therefore, cropping was applied to have images just of the specimen surface.

For the annotation of the images, the application of VGG Image Annotator (VIA) [START_REF] Dutta | The VIA annotation software for images, audio and video[END_REF] was performed. VIA is characterized by its simplicity, since the exported JSON (JavaScript Object Annotation) is the best adaptable file in the Mask-RCNN code. In Figure 26 In a second experiment, again with the VGG software, an annotation with polygons was performed on the images. The same procedure performed in the first experiment is performed in this second investigation. The result of defect detection in this second experiment as shown in Figure 28, is more accurate than that of the first. However, the masking does not perfectly surrounds the whole region of defect. As shown in Figure 29, the defect is represented by several masks. The suitable solution for these two problems is to have a large amount of training images with several typical defects or to increase the data with different techniques.

(a) (b)

Figure 29: Defect localization by polygon labeling of one surface defect

Conclusion

The purpose of this work was to investigate the accuracy and computing time when applying different combinations of image segmentations and ML algorithms on images taken using CCI.

The important conclusions drawn from the present work are summarized as follows:

1. From the comparative study between using SEM, OM and the CCI, the detection of residual parts of carbon on the copper surface could be successfully controlled by a computer vision system with the integration of machine learning algorithms in the CCI.

2. Segmentation of the collected images using the Weka plugin has given an investigation of three different machine learning algorithms. The Decision Tree algorithm proved to be more suitable for fast and accurate segmentation of defects exhibited by the images taken with STIL optical heads.

3. Classification of defects using CNN applied on images from CCI has given better accuracy results when compared to DT, RF, and MLP. 5. The use of a small amount of data rather than big data for training the AI algorithms successfully generated an accurate generalization for defect classification of surface images. Based on this result, the small database used in this work can be referred as smart data.

6. Localization of defects using the MaskRCNN framework showed admissible defect segmentation and classification from images labeled with polygon annotation.

However, due to insufficient images with defects, masking and localizing defects by the framework is inaccurate. Therefore, a large amount of images with various types of manufacturing defects are recommended to build an accurate defect localization model.

Chapter 3: Roughness prediction

Abstract

Moving manufacturing towards industry 4.0 requires the integration of sensors on-machines.

By doing so, it is possible to monitor online the manufacturing process using the data acquired from the sensors and then feed into artificial intelligence models for further reactions or process adjustment, such as adjusting automatically the cutting parameters after prediction of surface quality. In this chapter, an investigation of the feasibility of on-machine roughness measurement using a non-contact sensor was performed on milled aluminum surfaces. Later on, a dataset with cutting parameters, forces, and Ra was used to analyze first the effect of each cutting parameter on Ra, then their effect on the machining forces. Moreover, the same dataset was employed to train machine learning models to perform Ra prediction, such as the Neural Network NN, XGboost, Gradient Boosting (GB), AdaBoost, and Random Forest (RF). Due to the stochastic nature of NN, different results were found for same model applied on fixed test data. Whereas, ensemble methods showed significant stable results when their final models were applied on test data. The XGBoost has exhibited lowest error when applied on real test data with 5.8 % of error.

Introduction

Intelligent manufacturing requires the automation of the entire production chain. For that, manufacturing machines must be embedded with various sensors that provide data of several physical quantities (temperature, vibration, surface condition, etc.) to create intelligent models capable of knowing the multiple relationships existing between the process variables. Such models can, for example, allow a proactive QC to be performed on-machine. This way, one can avoid using the traditional sanction metrology, which is done by moving the manufactured part to an ex-situ metrology instrument. The integration of a non-contact optical sensor on-machine is a promising measurement method that will guarantee the acquisition of the surface condition during manufacturing. It will also permit the application of process correction to meet the surface roughness specification, thus, reducing part scrapping in production. Applying this online process-monitoring using data-driven models solution will lead the way to traditional manufacturing to move towards smart manufacturing.

Based on the works cited in the chapter1, CC sensors have been integrated inside CNC (computer numerical control) machines for surface roughness measurements after the milling process. The data from these sensors were used together with the cutting parameters to set up a dataset to build a prediction model of surface roughness.

Based on the literature review described in the chapter1, no data-driven ML approach that uses non-contact surface roughness measurement inside a machine-tool could be found. To explore this research gap, this chapter aims to build the baseline for a smart machining process capable of predicting surface quality and, based on a robust and accurate AI-algorithm, to act accordingly to correct the machining process, preventing thus part scrapping. For that, this work uses on-machine measurements using a CC sensor (instead of a contact-type profilometer), then combines the measured data from embedded sensors, to build an efficient data-driven prediction model. The main goal is to monitor the surface quality of machined parts using embedded sensors inside the machine-tool combined with the adequate machine learning method with high performance. Then, the deployed model will assure the prediction of Ra of the surface that is expected to be manufactured, knowing just the cutting parameters. By doing so, optimal adjustment of these latter would make the machine manufacture a part with the desired surface quality as defined in the specification.

Surface roughness

Surface roughness is the most crucial indicator of surface quality [START_REF] Rifai | Evaluation of turned and milled surfaces roughness using convolutional neural network[END_REF]; it directly impacts the functionality of the surface. Its assessment must be done by calculating many parameters clustered in three groups: amplitude parameters, spacing parameters, and hybrid parameters. Ra is one of the amplitude parameters mainly used to characterize the surface quality. Defined in the norm ISO 4287 [112] as the arithmetic mean deviation of the irregularities from the center line of the profile, it is a statistical value that follows the mathematical definition described in eq.25. Numerous factors will affect the roughness of manufactured surfaces, such as the cutting tool properties, machining parameters, workpiece properties, and cutting conditions. Tool material, shape, and nose radius are considered cutting tool properties. The workpiece geometry, surface integrity, and hardness represent the workpiece properties. Vibration and cutting forces are the cutting conditions [START_REF] Benardos | Predicting surface roughness in machining: A review[END_REF]. After the machining process, the surface of the parts contains the signature of the used process. This signature will allow understanding the physics behind the generated surfaces. This chapter focuses on the machining parameters, such as the cutting speed, feed rate, cutting depth, and cutting forces. The effect of these parameters on surface roughness has been analyzed.

𝑹 𝒂 = 1 𝐿 ∫ |𝑍(𝑥) ⅆ𝑥| 𝐿 0 (25)
Where Z(x) is the profile height measured from the profile center line at the x position and L is the length of the profile. Figure 31 represents an example of surface topography generated by a machining process, exhibiting some surface flaws, waviness, and roughness. The surface roughness profile shows the result given by a profilometer, from which surface roughness parameters are usually extracted, such as Ra, Rsk, Rdq, Rku…etc Figure 31: Surface topography generated by the machining process contains waviness, roughness and surface flaws [113].

Aside from Ra, Rsk (Skewness) is a parameter used to distinguish between two profiles that exhibit the same Ra value but not necessarily the same profile aspect. The skewness of a profile is the third central moment of profile amplitude probability density function (eq. 26). It is to characterize the symmetry degree of the profile about the center line [START_REF] Gadelmawla | Roughness parameters[END_REF]. Surfaces "empty" of material with high peaks gives a positive skewness, whereas the negative skewness represents the surfaces "filled" of material without the existence of many peaks [START_REF] Petropoulos | Surface texture characterization and evaluation related to machining[END_REF]. An Rsk equal to zero denotes symmetrical height distribution, for example.

𝑅 𝑠𝑘 = 1 𝑅 𝑞 3 1 𝐿 ∫ 𝑍(𝑥) 3 ⅆ𝑥 𝐿 0 ( 26
)
Where Rq is the root mean square roughness, and represents the standard deviation of the height distribution (eq. [START_REF] Özseven | Surface Defect Detection and Quantification with Image Processing Methods CHAPTER 3 Surface Defect Detection and Quantification with Image Processing Methods[END_REF].

𝑅 𝑞 = √ 1 𝐿 ∫ 𝑍(𝑥) 2 ⅆ𝑥 𝐿 0 (27)
Rku (Kurtosis) is the fourth central moment of the profile amplitude probability density function (eq. 28). Profiles with sharp shapes showing high peaks and low valleys would give an Rku > 3, and the distribution is called "Leptokurtoic". On the other hand, a profile with Rku < 3 is named "Platykurtoic", and it exhibits low peaks and low valleys [START_REF] Gadelmawla | Roughness parameters[END_REF].

𝑅 𝑘𝑢 = 1 𝑅 𝑞 4 1 𝐿 ∫ 𝑍(𝑥) 4 ⅆ𝑥 𝐿 0 ( 28
)
Rdq is a hybrid roughness parameter, defined as the root mean square of the ordinate slopes dZ/dX within the sampling length [112] (eq.29). The slope is calculated from two successive points of the profile. A low value is usually found from smooth surfaces, while higher values can be found in rough surfaces with microroughness [115].

Materials and methods

Experimental setup

The approach of this research work is based on validating the concept of integrating a noncontact sensor inside a CNC machine-tool. Measuring surface topography after the machining and then using the generated data to investigate different ML methods and to understand the correlation between the process-related variables and the resulted roughness parameters.

Concerning the machining, a series of surface milling operations were performed on aluminum After finishing 25 lines of cut (one complete surfacesee Figure 33), every single Cut # region is measured six times using a CC sensor installed in the tool holder. Since the cuts were performed following a radial path with an increment of 360/25 = 14.4° in rotation, the cuts are superposed. To avoid analyzing a surface cut with a mix of different cutting conditions, only a portion of each cut region is analyzed. This region exhibits a "triangle-shape". As shown in Table 10, three commercial chromatic confocal sensors (STIL, Marposs Group, France) were employed to develop an in-situ roughness measurement system. Each of these sensors was integrated inside a DMG CTX gamma1250TC 5-axis machining center Figure 32, to measure the profiles of two standards, and to collect data for further analysis. The goal is to verify and choose the most accurate and adequate sensor for in-situ measurement and to create a dataset that will help build a prediction model of surface roughness.

Chromatic confocal sensor

CC technology is mainly used for the non-contact measurement of surface topography. It is a non-destructive measurement method that is not significantly affected by the surrounding light during the measurement. It is one of the optical sensors used in precision and ultra-precision machines to ensure performing on-machine measurement. Thus, reducing the time between machining and quality control of the workpieces [START_REF] Jiang | Precision Surface measurement[END_REF], [START_REF] Fang | Manufacturing and measurement of freeform optics[END_REF].

The chromatic confocal principle is based on adjusting an undesirable effect in optics, which is named the chromatic aberration. An arrangement of several lenses with different refraction indices builds what is called "the objective". The main goal of the objective is to ideally generate a dispersion of the white light source into monochromatic wavelengths along the optical axis, as shown in Figure 34. When an object is present inside the measuring range of the probe, a single wavelength focuses on its surface. Only the wavelength focused on the surface passes through a spatial filter (pinhole that corresponds to the diameter of the optical fiber, 50µm). In the end, this wavelength will be represented by a spectral intensity. The spectrometer performs the spectral decoding (position of the quasi-monochromatic beam on the chargecoupled device CCD linear array). Table 10 presents the properties of the 3 CC sensors used in this work. The lateral resolution determines the minimum distance between two surface's points that can be distinguished; the working distance represents the acceptable distance between the head of the sensor and the surface where the measurements can be acquired; the numerical aperture is the largest slope angle on the surface that can be measured and affects the optical resolution; the max sample slope is the angle between the surface slope and the surface normal (the ray perpendicular to the surface); and the spot size is the area of the surface measured as the instrument scans [START_REF] Leach | Optical Measurement of Surfacte Topography[END_REF].

Model

Force components

One of the factors that might affect the surface quality is the forces related to the cutting process.

For that, a Kistler 3-axis dynamometer 9257A with a charge amplifier Kistler 5019B was employed to measure the forces of the cutting process: the active force (Fa), and the passive force (Fz). The measurement of the machining forces will help analyzing the effect of the input cutting parameters on the resulting surface roughness and their relationship with the two force components.

The acquisition of the force signals was made using LABVIEW. Three force components Fx, Fy and Fz were measured. Afterward, they were post-processed with NI DIAdem software to obtain the active and the passive forces Fa and Fz, respectively, as shown in Figure 35. The active force Fa corresponds to the sum of Fx and Fy, as given by eq.30:

𝐹 𝑎 = √𝐹 𝑓 2 + 𝐹 𝑓𝑁 2 (30)
From Fa and Fz the specific forces Fa' and Fz' are calculated in order to provide variables that are normalized, therefore more comparable. For that, the forces Fa and Fz [N] are divided by the volume of material machined over time, the Material Removal Rate (MRR):

𝐹′ 𝑎 = 𝐹 𝑎 𝑀𝑅𝑅 [ 𝑁. 𝑠 𝑚𝑚 3 ] (31) 𝐹′ 𝑧 = 𝐹 𝑧 𝑀𝑅𝑅 [ 𝑁. 𝑠 𝑚𝑚 3 ] (32) 𝑀𝑅𝑅 = 𝐴 𝑐 𝐿 • 𝑎 𝑝 • 𝑣 𝑓 1000 [ 𝑚𝑚 3 𝑠 ] ( 33
)
Where vf is the feed speed in (mm/min), Ac is the cut area that is related to the first 15 mm of a cut (L = 15 mm). Since the cuts are performed in sequence, the cut #1 exhibits a different cut area compared to the others cuts. The cut area for the first three cuts is shown in Figure 36, in which 𝐴 𝑐 𝑖 is the cut area of the cut # 𝑖, for 𝑖 = 1, . . . , 25. Figure 37 shows the CAD design and actual setup of the force sensor installed inside the machine-tool together with the workpiece. Some holes were made in the disc to fix the sensor table using screws. However, since only the first 15 mm of the cuts was measured in terms of surface roughness and forces, the holes in the disc did not affect the results in this work. discrepancies of the profiles in terms of shape, height, and distance between profile peaks. Then, a quantitative analysis was performed by comparing the average measured roughness parameters Ra, Rz, and RSm.

Tool feed direction

Tool rotation

Fx

Concerning the machined aluminum parts shown in Figure 33, after performing the milling operations, the surface of each disc was cleaned with alcohol to remove the residual droplets of the cutting fluid. The CC measurements were then performed using a G-code part program that considers the sensor as a tool. 25 surface profiles were measured six times for further statistical analysis and for gathering the dataset to build a prediction model using ML algorithms.

After collecting the data using both sensors: the CC sensor (on-machine measurements), and the stylus Hommel (off-line measurements); post-processing of both data was done using MountainsMap software to extract the roughness parameters from surface profiles using the ISO4782 and cut-off λc=0.8 µm. The dataset for training the regression model was prepared in a table containing 125 surfaces with different cutting parameters and their corresponding surface roughness parameter (Ra), which represent the average of 6 measurements taken on each surface as depicted in Figure 33.

In order to compare the measurement capability of the three different CC sensors without the influence of the machine-tool, a set of measurements was done inside a metrology room using the STIL MICROMESURE 3D station, which is a system for 3D measurement that contains a high resolution motorized axes X, Y, and Z. It is designed with marble to reduce to effect of vibration on the measurements. Instead of comparing 2D profiles, this time the measurements were performed by scanning an area of the specimens in order to provide a 3D surface roughness texture.

Finally, a set of on-machine measurements was performed to evaluate the impact of the CC sensor's moving speed on the measurement of roughness parameters. For that, three CC sensors (CL1, 2 and 3) were tested using seven different scanning speeds: 60, 90, 120, 150, 200, 250, and 300 mm/min. Again, the roughness standards made of glass and nickel were measured, and the following roughness parameters were assessed: Ra, Rdq, Rsk, and Rku.

Data-driven prediction model

The model, which has been learned only from a given dataset, will help find an approximation to the theoretical physical law that correlates the output Ra to the cutting parameters and forces.

Each input variable (the cutting parameters and forces) participates with some weight for giving the output (Ra). The higher the weight, the higher the influence of the parameter on the output Ra.

Knowing that two profiles with the same Ra might not be symmetrical, having other surface roughness parameters will allow differentiating between profiles. Therefore, predicting only Ra would not be sufficient to know the real surface quality. For that, multiple-output prediction allows building a model that will relate the input variables (cutting parameters and forces) with the most significant roughness parameter outputs.

This chapter aims to predict the surface roughness knowing only the cutting parameters and the performed forces during milling. Based on this objective, building models for prediction has been done using the dataset collected from many experiments. These models are characterized by different architecture and performances, which will allow to initially study the power of each algorithm to give accurate predictions, and to decide which one of the investigated algorithms can be deployed at the end for real-time quality monitoring application.

In order to build the models. At first, the original data is split into three parts: the first one is The profile from the tactile profilometer is similar to the one measured on-machine with the CC sensor CL1. And according to Table 10, the CC sensors have different specifications. For example, the lateral resolution and the numerical aperture significantly impact the final measured profile. Among the 3 CC sensors, the CL1 is the one that exhibits the lowest lateral resolution, which means 1.1 µm of the distance between two surface points. In order to achieve such low lateral resolution, this sensor has to be closer to the surface when compared with the other sensors. In addition, the higher the numerical aperture, the higher is the maximal surface slope the sensor is capable of measuring. This is why the profiles from both CL2 and CL3 are less close to a perfect sinus when compared to CL1 and the tactile profilometer (in Figure 41).

The results of the glass roughness standard measurements are presented in Figure 42.

(3)

(4) (1) (3) (4)
(2) (1) F z The profile measured by the stylus profilometer and CL1 are significantly similar. Whereas CL3 and CL2 exhibit some additional peaks due to physical limitations of the CC sensors, which are related to the sensor's objective. For instance, the arrangement of lenses to control the effect called chromatic aberration is different, which eventually generates optical artifacts depending on the surface topography.

A statistical comparison was performed by extracting roughness parameters from each measured profile following the norm ISO4287, Figure 43. In general, a low percentage of errors was found. Based on roughness results from standard profiles measured inside the machine, the confidence in the CC sensors can be assured. and only a few disturbances can be seen in Figure 44 c), which can be considered as artifacts of measurement probably due to chromatic aberration of the sensor's set of lenses. However, the 3D topographies of the case ii) are not very clear, especially the measurements done with CL2 and CL3. This corroborates the results obtained from the on-machine measurements, and Gaussien Filter λc= 0.8 mm and λs=2.5 μm Gaussien Filter λc= 0.8 mm and λs=2.5 μm therefore one can consider that the influence of the machine-tool environment (vibration particularly) can be neglected in the scope of this proposed work.

Table 11 shows the results from three CC sensors used on-machine to measure two roughness standards. The green color on the table indicates that the measurements values are in an acceptable range +/-3% to the nominal values of the standards. The measurements of Ra and Rku from the nickel standard showed good results for all tested scanning speeds and CC sensors. And for both roughness standards, CL1 and CL2 showed better Ra results in at least four different scanning speeds up to 150 mm/min (included). In addition, for acquiring Rku and Rdq, the measuring speed of 60 mm/min showed the best results for CL1. Based on this analysis, the CL1 sensor was defined as the only one to be used to generate all roughness data that will be employed in this work for training/testing AI models. Figure 46 represents the correlations between each variable of the dataset. It is noticed that the feed rate is highly correlated with the Ra, which means that the feed is the cutting parameter that most influences Ra. Similarly, the active force Fa exhibits a 68% of correlation to Ra. Fz is slightly correlated with Ra with a negative correlation of 48%, though it shows a negative 62% of correlation to Fa. The correlation matrix also shows that the cutting depth ap is more correlated to the active force than to the passive force. Based on the correlation results, ap is proportionally correlated to Fa and inversely proportional to Fz.

Data variables extraction

Figure 46: Correlation matrix of the dataset variables

As shown in Figure 47, the same correlation has been found between Ra and the feed rate.

Moreover, x and y axes in the circle represent the PCA component that contains more information about the dataset samples. As Ra, feed, and Rmr are highly correlated (inversely and proportionally), they comprise the first component with 51% of information quantity.

Whereas in the y axis, the second component can be built using ap, vc, and Rdq. Based on the correlation circle, the following roughness parameters were selected as the most relevant ones for additional effect analysis and roughness prediction: Ra, Rdq, and Rsk. Based on this, it is clear that Ra increases linearly with the feed rate. This proportional correlation was already identified in the correlation matrix in Figure 46. When the cutting depth ap is greater than 1 mm, Ra increases even with low cutting speed values, starting from a 0.45 mm/rot of the feed rate. It can be explained by the changes in the chip formation mechanism, which happens when the chip cross-section area increases (significantly higher ap). From the analysis of the effect of the cutting parameters on Ra, it can be said that the feed rate in the milling process is the most informative factor on the surface quality. The colormaps for Fa and Fz showed an expected result: Fa increases with the feed rate, and Fz increases in magnitude with f. However, when these forces are divided by the MRR, the specific forces can be derived. For instance, there is a clear behavior of Fa' that repeats itself for all depth of cuts: Fa' decreases with increasing vc, and slightly decreases with increasing f.

Concerning Fz', there is also a repetition of its behavior over all ap's: mostly negative forces that increase in magnitude with f and vc. The negative forces are expected because the milling tool has a positive rake angle that makes the tool get pulled towards the part during the cut.

However, for ap values smaller than the tool tip radius (rε = 0.8 mm), Fz' exhibits rather positive values because only the region inside the tool tip radius is performing the cut. Thus, the geometry at that region does not make the tool get pulled against the workpiece surface as the chips are formed.

Based on the force analysis, it is clear that f is the most relevant variable to be considered.

Nonetheless, vc and ap will also contribute to the final surface quality since they have unneglectable influence on the cutting forces. Therefore, both cutting parameters and cutting forces will be used as inputs to build a roughness prediction model. It is also worth mentioning that other physical factors can influence the quality of the surface, although they are not included in the scope of this work.

Prediction of Ra

Figure 50 shows the prediction results from the NN and XGboost models applied on a fixed test data split (20% of the total dataset was taken as test data). Compared to the XGbosst results, the NN model exhibited a MAE equal to 0.094 that why some points are outside the trend line.

Whereas, the XGboost shows better results in which a few points were wrongly predicted with MAE equal to 0.033.

Figure 50: Predictions results from neural network (applied on original inputs) and XGBoost (applied on the extracted features)

As shown in Figure 51, the Adaboost and Random Forest predictions exhibit a pattern similar to the predictions of the XGboost model. On the other hand, AdaBoost did not perform well compared to the other boosting algorithms. Its MAE was about 0.065, whereas, for the others, the MAE was about 0.033, 0.042, and 0.047 for XGBoost, GB, and RF, respectively.

Nonetheless, these results were given to verify the ability of all models to give significant predictions of Ra. In the following results, it is shown that other methods must be performed in order to validate the capacity of each used model. in the algorithm. The final output from RF is the average of all the output predictions from all the trained trees.

The cross-validation score from Table 14 represents the average of the MAE computed using the 10 cross-validation technique. The second column of Table 14

Conclusions

Surface roughness parameter Ra is the most used index in the industry for the quality assessment of machined parts. Following metrology measurement standards, accurate values must be obtained using either a contact or non-contact method for surface roughness measurement. Onmachine roughness measurement has been done with a non-contact optical sensor. The most precise CC sensor was found to be the CL1 due to its small spot size, and its measured steeper slope compared to the other sensors: CL2 and CL3. The CL1 sensor also accurately measures other roughness parameters with scanning speeds higher than those ordinarily applied with CL2 and CL3.

The cutting parameters and the force components were chosen to be the inputs for the prediction model due to their physical relationship with Ra, which was validated using data analysis.

By comparing two methods of predicting Ra using NN and ensemble technique, it has been concluded that it is better to train the ensemble learning models from the original data splits without using the features extracted from the NN. The XGboost showed the lowest error in both cross-validation and test data. NN are known for their best performance when applied to a massive amount of data, which was not the case for this work's dataset. Moreover, the gradient boosting algorithms GB and XGboost showed good performance in predicting multiple outputs (Ra, Rsk, and Rdq) as well. Therefore, based on the collected data and the acquired results, the most recommended algorithm for predicting milled surface roughness is XGboost. By accurately predicting Ra with this algorithm, the adjustment of the process might be feasible in future work. The goal will be to build a proactive QC of milled parts with online metrology and a good deployed ML algorithm.

Chapter 4: Tool wear effect on roughness forecasting

Introduction and objectives

During the milling process, the tool experiences wear, which is an inevitable phenomenon caused by adhesion, abrasion, diffusion, thermal fatigue, and elastic or plastic deformation.

After a specific cutting time, the tool starts to wear out and lose its performance, which usually leads to unacceptable surface quality and eventually tool breakage, scrapped parts, or damage to the machine-tool [START_REF] Zhu | Tool wear characteristics in machining of nickel-based superalloys[END_REF]- [START_REF] Li | Tool wear state prediction based on feature-based transfer learning[END_REF]. In this sense, taking the tool wear into account is essential for developing a proactive QC system.

In industry, the tool wear is usually "controlled" by following a protection strategy in which tool replacements are done at early stages of wear and based on experience, which results in wasting the remaining tool life, and unnecessary tool change downtime [START_REF] An | A data-driven model for milling tool remaining useful life prediction with convolutional and stacked LSTM network[END_REF]. Therefore, estimating the wear progression in milling process is a relevant topic in machining. Several research works have proposed tool wear prediction AI models based on cutting parameters together with additional sensor-measured data such as: force (dynamometer) [START_REF] Li | Tool wear state prediction based on feature-based transfer learning[END_REF], [START_REF] Kong | Hidden semi-Markov model-based method for tool wear estimation in milling process[END_REF],

[124], acoustic emission [START_REF] Li Xiaoli | Tool wear monitoring with wavelet packet transform-fuzzy clustering method[END_REF], vibration [START_REF] An | A data-driven model for milling tool remaining useful life prediction with convolutional and stacked LSTM network[END_REF], spindle current [START_REF] Stavropoulos | Tool wear predictability estimation in milling based on multi-sensorial data[END_REF], and machine power signal [START_REF] Corne | Study of spindle power data with neural network for predicting real-time tool wear/breakage during inconel drilling[END_REF], [START_REF] Da Silva | A probabilistic neural network applied in monitoring tool wear in the end milling operation via acoustic emission and cutting power signals[END_REF]. For that, they performed feature extraction methods to determine the most relevant features for tool wear prediction based on different types of signals, such as time-domain signals, frequency-domain, and wavelet.

In order to study the influence of wear on surface quality, titanium has been selected as workpiece material for a set of cutting experiments to generate a dataset for building a datadriven model. The selection of titanium is based on its high strength at high temperatures and low thermal conductivity, which makes it a hard-to-machine material, and thus a good candidate for an experimental investigation on tool wear. In addition, titanium is considered an attractive engineering material that is widely used in aerospace and health industry due to its numerous advantages, such as weight savings, corrosion resistance, low young modulus, high-temperature capabilities, and excellent biocompatibility [129]- [START_REF] Turner | Titanium milling strategies[END_REF] There are several works referred in the review paper of Liang et al. [START_REF] Liang | State-of-the-art of surface integrity induced by tool wear effects in machining process of titanium and nickel alloys: A review[END_REF] that studied tool wear effect on the surface roughness of titanium. Some of them showed, for example, that the surface roughness firstly decreases and then increases with the progression of tool wear [START_REF] Ibrahim | The effect of dry machining on surface integrity of titanium alloy Ti-6A1-4V ELI[END_REF], [START_REF] Che-Haron | The effect of machining on surface integrity of titanium alloy Ti-6% Al-4% v[END_REF].

While others, like [START_REF] Liang | Experimental investigations on effects of tool flank wear on surface integrity during orthogonal dry cutting of Ti-6Al-4V[END_REF], [START_REF] Ginting | Surface integrity of dry machined titanium alloys[END_REF], stated the opposite: the surface roughness firstly increases and then decreases with the progression of tool wear. This chapter starts by presenting a brief theoretical background on tool wear and the model that is employed in this work for forecasting it. Then, the proposed experiments of surface milling are described, followed by an analysis of surface roughness progression over time, and the model to forecast it with the corresponding results and conclusion.

Tool wear

During a machining operation, the cutting tool degrades more or less rapidly depending on the material being machined, the tool material, the operating conditions (vc, vf, ae, ap) and the lubrication conditions. The tool wear will influence the cutting force, the chip fragmentation, but especially the geometrical dimensions and the surface integrity of the manufactured part (surface condition, residual stresses, etc.). In addition, the degradation of the tool can lead to a sudden breakage of the tool which must lead to an emergency stop of the machine and, generally, to the scrapping of the part. It is therefore necessary to understand these phenomena of degradation and wear to optimize productivity [START_REF] Ensam | Usinage des pièces mécaniques. Théorie et pratique -Manuel technique[END_REF].

Tool wear is rarely measured in production lines because it is time-consuming and also difficult to be done. Therefore, it is necessary to establish a wear law for a given combination of tool and material, so that one can estimate the tool wear based on the cutting parameters. The curve of the tool wear over the time is usually determined by wear experimental tests. Based on these, the progression of the tool wear over time (e.g. width of flank wear, Figure 55) is recorded [START_REF] Ensam | Usinage des pièces mécaniques. Théorie et pratique -Manuel technique[END_REF]. Then, the temporal progression of the measured wear patterns is plotted on a curve as it is also shown in Figure 55. ARIMA states that the future value of a variable is a linear combination of past values and past errors. Its process contains a combination of the autoregressive model and the moving average model [START_REF] George | TIME SERIES ANALYSIS Forecasting and Control[END_REF]. The process is defined by eq.34:

𝑦 𝑡 = ∅ 1 𝑦 𝑡-1 + ⋯ + ∅ 𝑝 𝑦 𝑡-𝑝 + 𝜀 𝑡 -𝜃 1 𝜀 𝑡-1 -⋯ -𝜃 𝑞 𝜀 𝑡-𝑞 ( 34
)
Where 𝒚 𝒕 is the actual value, 𝜺 𝒕 is the random error at t, ∅ 𝒊 and 𝜽 𝒊 are coefficients.

p and q are the parameters of the ARIMA model, in which p represents the order of autoregressive model, and q refers to the order of the moving average model. The autoregressive model is expressed in eq.35, which represents that the current value of a variable is linearly depending on its previous values.

𝑦 𝑡 = 𝜀 + ∅ 1 𝑦 𝑡-1 + ⋯ + ∅ 𝑝 𝑦 𝑡-𝑝 [START_REF] Kong | Bayesian linear regression for surface roughness prediction[END_REF] The moving average model states that the current value depends only on the weighted errors of the forecast values. It is expressed as follows:

𝑦 𝑡 = 𝜀 𝑡 -𝜃 1 𝜀 𝑡-1 -⋯ -𝜃 𝑞 𝜀 𝑡-𝑞 [START_REF] Ulas | Surface roughness prediction of machined aluminum alloy with wire electrical discharge machining by different machine learning algorithms[END_REF]

Experimental approach and method

In order to analyze the influence of the wear on the surface roughness, surface finishing milling operations were carried out using Titanium as workpiece material. Measurements of surface roughness, tool wear, and cutting forces were performed to collect a dataset for model building.

A series of surface-milling experiments were performed using nine different cutting conditions.

For each cutting condition, a new pair of carbide inserts was installed on the milling cutter, and the workpiece was cut until the tool flank wear reached a final value. During the milling experiments, for every predefined period of time, the cut was stopped, and the inserts were taken to be analyzed under the microscope OLYMPUS BX41M for tool wear measurement.

Depending on the cutting speed and feed rate, some experiments took much longer than others.

For instance, the effective time taken to reach 𝑉𝐵 = 1[𝑚𝑚] for 𝒗 𝒄 = 60 [𝑚/𝑚𝑖𝑛] and 𝒇 = 0.3 [𝑚𝑚/𝑟𝑜𝑡] was in the range of 5 min of cutting (without considering the time for measuring surface roughness, measuring tool wear, and machine setup). On the other hand, the effective time necessary to reach the same wear state, but employing 𝒗 𝒄 = 30 [𝑚/𝑚𝑖𝑛] and 𝒇 = 0.1 [𝑚𝑚/𝑟𝑜𝑡], was estimated to be around 20 hours. Due to this significant difference in the cutting time, the final flank wear VB reached for a given time for each cutting condition is different (see Figure 56-b)).

The surface-milling operations were performed on TiAl6V using a 20 mm diameter milling cutter R217.69-1020.RE-12-2AN with two inserts XOMX10T308TR-ME07 MS2500 from SECO, and a synthetic emulsion of water and Ecocool CS+ (~5%) cutting fluid. The experimental setup is presented in Figure 56-a). The milling operations were performed in a star-shaped path, starting from outside and moving to the center of the disc as depicted in Figure 33 (instead of 25 cuts, here 26 cuts per surface were performed). All cuts were performed in down milling mode. The forces were measured while doing the machining, and the acquisition interface from Labview was used to collect the data. Thereafter, the post processing was done using a MATLAB code in order to only consider the forces in the first 15 mm of cut, which corresponds to the same surface where the roughness will be measured from.

Every time a complete surface was surface-milled (26 lines cut), on-machine surface profile measurements were performed with a non-contact CC CL1MG240 sensor. The approach followed the same one presented in chapter 3: for each line cut, 6 surface profiles were measured over a 15 mm-long line (Figure 33). The acquired data from the sensor were post processed with MountainsMap software. The target was to calculate and to get the average of roughness parameters that compose a dataset with wear and cutting forces. Then, the final dataset was used to train a model for roughness predictions with multiple output regression, and to perform a time series forecasting.

For each single cutting condition, the wear of the tool was measured at regular time intervals.

The measurement was performed using an optical Microscope OLYMPUS BX41M. The principal cutting edge of the 2 inserts used in the cutting experiments were scanned as it is shown in Figure 57. Afterwards the measured flank wear width, also called VB, was calculated using the average of the two measurements. Since the number of measurements of surface roughness parameters over the cutting time was much higher compared to measurements of flank wear width, a linear interpolation was employed to estimate the flank wear between each In this sense, a dataset with cutting parameters (vc, f, ap), time, MRR, force components, roughness parameters given by MoutainsMap software, and the flank wear measurements was built. Then, a PCA analysis was performed to determine which input variables are most relevant and which roughness parameters can be used as outputs in the prediction model. Then, using python Numpy library, a correlation matrix is built to verify the correlation values between each preselected data variables. After this statistical verification, prediction models for multiple outputs are built without considering the cutting time. These models will help to validate again the performance of models that can be deployed for QC system. Afterwards, the progression of Ra and width of flank wear are analyzed over the cutting time. Finally, ARIMA forecasting model is built to investigate the capability of following and predicting the progression of the Ra over time.

Results and discussions

Based on the results given by PCA depicted in Figure 58, the bar plot shows the Eigen values percentages, which correspond to the information quantity given by each principal component.

As result, 65.2% of information is given by four principal components. The objective of applying this analysis is to identify the correlation between the variables and to define which roughness parameters should be used in the prediction model. Whereas, the second component will be given by a combination of Rmr and Fz. Since time (T) is in the negative part of the first component, it is inversely proportional to the variables that compose the first component.

In Figure 59 is presented the triangle correlation matrix. The most correlated variables are the forces, the wear and the MRR. In addition, when it comes to flank wear, the active force is the variable most correlated to the wear of the inserts. This means that, to build a proactive QC system for surface roughness the measurement, Fa is a very good candidate among the variables that should be measured during the cutting process, since VB is usually correlated to bad surface quality.

The summary of variables shown in Figure 59 The processed variables are formulated in the equations as follows:

The MRR [START_REF] López De Lacalle | Milling[END_REF] is expressed by eq.33, and L is the cutting length (L = 15 mm) The total cumulative machined Q is expressed by eq.34 as follows:

𝑄 = 𝐴 𝑐 * 𝑎 𝑝 ( 34
)
Where ap(mm) is the axial depth of cut. Table 17 shows the results of each regression model used for prediction of Ra, Rsk, and Rmr.

The values of MAE and RMSE were calculated by applying the prediction models on fixed test data. Then for each output, the difference between the predicted values and the true values was calculated using the above-mentioned metrics. The models perform well on predicting Ra outputs, with comparatively low error values given by the GB and XGboost. Whereas for Rsk and Rmr, the errors are not in the same range as the error of Ra. This is due to the differences in the scales of each output. Thus, the outputs should be normalized in order to evaluate them in inside the same error range. The goal of thesis was the build an overall understanding of the procedures that can be applied for developing proactive QC system. In addition, to determine which ML models can be used for each kind of surface QC applications. The ML models exhibited in fact some limitations that depend on the amount of learning data, and algorithms hyper parameters that need to be tuned in order to improve their performances. For machining the titanium workpieces, only nine cutting conditions were applied to cut during 5 to 8000 min depending on the cutting condition.

RMSE_

This way, the tool wear, the forces, and the surface roughness changed over the time. Therefore, it is reasonable to use time series forecasting models in order to predict future values of the surface quality while machining.

Figure 61 shows the evolution of Ra during the surface milling of titanium. The time of each measured Ra is equivalent to the time taken to cut one line (Figure 33). For all tested cutting speeds (30, 45 and 60 m/min), Ra fluctuates between 0.1 and 0.5 µm. In addition, at the beginning of the cutting experiments, Ra starts with rather high values, then it decreases until stabilizing. As the geometry of the tool cutting edge changes while getting worn, the chip formation can change, as well as the forces involved in the machining process change, which can lead to different process dynamics (vibration). However, the correlation that might be extracted via ARIMA model is the one between cutting forces and Ra, as it was shown by the correlation matrix in Figure 59.

Chapter 4: Tool wear effect on roughness forecasting Converting the curves to stationary-states by taking the first difference (the difference between a value at period t and its previous value) from the time series data, has given the results shown in Figure 64. It can be noticed that for most of the curves the forecasting follows only the average of the roughness curve, even after using the grid search integrated in the used AUTOARIMA module from sktime library. The grid search method is a tuning exhaustive technique that is applied in order to get the optimal model hyperparameters, which in case of ARIMA, are the order (p,d,q). Where, p refers to the order of auto regressive (AR) term (the regression model used to apply prediction of an output based on its previous values), d is the order of the difference needed to make the series stationary, and q is the order of the moving average (MA) term.

Conclusions

The study performed on titanium allowed to investigate the progression of tool wear while milling with fixed cutting conditions. Moreover, forces were measured during the cutting experiments, and surface profiles were measured on-machine. All these information were combined in one dataset that lead to analyze the correlation between the cutting parameters, forces, wear and surface roughness. It is concluded that the wear is highly correlated with the cutting force, feed speed, and MRR. Using the dataset, regression models were built. They performed well in predicting Ra, whereas, for Rsk and Rmr, they exhibited lower performance.

Having cutting time inside the dataset, time series forecasting models were built, and the forecasting of Ra was performed for each cutting condition. The limitation of the presented approach is that it must applied only on one fixed cutting condition. And since only one curve of tool wear per cutting condition was experimentally generated (wear experiments are very

General conclusions

Conclusions

This work proposed to build the baseline for a proactive surface QC. Such system will require integrated sensors that can give valuable information about the physical behavior behind the manufacturing process. By the application of a proactive QC, sanction metrology control can be avoided, as well as the so-called "zero-defect" manufacturing will start to become reality.

By the implementation of embedded data driven models capable of learning from historical data, decisions shall be taken autonomously by the system.

In this thesis, the quality control of manufactured surfaces has been divided in two main aspects:

the surface defect detection and the surface roughness. The study conducted in this thesis shows that defect classification can be done using a model given by transfer learning that has been trained on smart data composed of typical defects generated by a laser machining process. The defects were characterized using CCI system of STIL S.A. Company. The transfer learning model exhibited high accuracy and also rather low processing time, which is mandatory for future implementation into embedded systems with low processing capability.

The second study, which is about prediction of surface roughness based on cutting parameters and forces, shows that surface roughness measurement using non-contact CC sensors can be performed on-machine. The investigation done using roughness standards on-machine and exsitu provides information about the errors that are expected for each combination of sensor, scanning speed, and to-be-measured surface topography. Later on, to prove the concept of surface quality prediction using data-driven ML models with data measured by sensors inside a machine-tool, an analysis of the performances of regression algorithms has been conducted.

Two types of ML algorithms were compared: one based on NN, and ensemble methods. It is concluded that the algorithm based on Gradient Boosting performs better for prediction of one output and also for multiple outputs. In addition, low prediction errors MAE were found when predicting Ra. Whereas for the other roughness parameters, the errors are high when compared to Ra prediction errors; and this is due to the unbalanced range of values.

The third study analyzed the progress of surface roughness over the cutting time while considering the tool wear and the cutting forces. The analysis showed that the surface roughness of the machined surface changes with the cutting time and tool wear. The forecasting model for Ra did not exhibit accurate results, but it can however be used to forecast average values of Ra.

Introduction

The integration of data acquisition systems using computers with high processing performance has given industries the capability to perform computer vision inspection of products in real-time. These systems are embedded with advanced image-processing and pattern-recognition algorithms, which enable the execution of algorithm-based inspection similarly * Author to whom any correspondence should be addressed.

to human inspection. In a manufacturing line, the pattern recognition applications could be used for defect detection and classification, which would allow for example the detection of manufacturing problems and their correction before the product is finalized and needs to be fully rejected.

Despite the recent advances of data-processing and vision systems, there is a necessity of training artificial intelligence (AI) algorithms to combine them with the mentioned technologies, which is a complex task and requires several substeps to be accomplished. For instance, to train or employ a defect detection and classification method, images must be first preprocessed: filtering, segmentation, and thresholding of the raw data. Subsequently, there is a feature extraction phase, which can be done manually using for example edge detection algorithms to get the desired characteristics from the images; or it can be done automatically inside the layers of a neural network (NN) using deep learning (DL) algorithms. Once the feature extraction is done, the classification of the images can be executed so that the final decision concerning rejection or acceptance can be given by the system.

When it comes to object recognition, convolutional neural network (CNN) are the most used algorithms for applications based on images. Each layer in the network can individually execute a special function, and by doing so, features are extracted from the input image, providing the final model to learn the hidden patterns that characterize the targets wanted from the image. On the other hand, CNN algorithms usually require a higher amount of data; and for a binary classification such as defect-detection, the data must be balanced by having a number of images that represent the defect class nearly equal to the quantity of no-defect. To overcome that, some researchers apply data enhancement techniques like data augmentation (image rotation or noise addition) so the network can learn more features from data and return results with higher accuracy ( Although there are some works in the literature concerning the use of AI algorithms for defect-detection, their applicability on building an online QC system for real-case scenarios is easily blocked by different aspects that are present in production lines. For instance, performing detection of small-sized defects usually requires the use of high-resolution images that are not available in the shop floor. Besides, the post-processing of a massive high-quality image database can be time-consuming, and consequently, it would require more of data engineering solutions. The application of data enhancement techniques combined with smart data methodology is a practical solution for collecting just relevant data that ensures the rapid and automatic defect classification and is in the end an effective solution for the QC problem. In this sense, the present work aims to cover a topic that has not been found in the literature so far: the application of defectdetection machine learning (ML) algorithms on smart-data composed of high-resolution images taken using chromatic confocal imagery (CCI).

The general objective of this work is to investigate the applicability of combining AI algorithms with current metrology (CCI) by introducing a large degree of consistency in data-processing and characterization. This objective is part of the development of an online QC system for the detection of sub-millimeter defects generated by the laser-machining process that is employed on the surface of cooper rods coated with a polymer. The overall system for this online QC is depicted in figure 1, where the focus of the present work is highlighted.

To enable the development of an online QC system, this work proposes an investigation using different combinations of image segmentations and ML algorithms on high-resolution images taken using CCI on laser-machined parts from an industrial production line. The approach starts with the application of three different ML algorithms on features extracted from the Sobel filter, which is an algorithm for edge detection. The extracted features are taken from the selected pixels of the annotated regions on the training image. The experiment is performed using a DL algorithm, which grants to skip the manual feature extraction since it has already been executed inside the hidden layers by convolution operations. And finally, a transfer learning (TL) algorithm is performed with retraining the mobilenet-v1 model, which is a model that has been previously trained with a large variety of objects. By doing so, an increase in the accuracy of the defect classification model is expected.

The database used in this work for training (see section 3), validating, and testing the models was previously built by selecting the most representative images from a large database composed of multi-resolution images. Based on the accuracy results obtained with different ML and TL methods applied to this database, this work also aims to show the feasibility of having accurate ML classifiers trained on a small amount of data, in other words, smart data. For that, a TL method will be employed by using a model that was previously trained on a large number of images that are not related to this work. By doing so, the model can extract a significant variety of features that characterize different objects and can be fine-tuned by a rather small quantity of data for a new application.

AI background

The exponential growth of data acquisition in manufacturing has enabled the rise of a new paradigm named smart manufacturing [START_REF] Tao | Data-driven smart manufacturing[END_REF], Wang et al 2018). This collected data can be divided into structured data, such as machine cutting parameters, spindle current, temperature, etc; and unstructured data, such as videos, images, etc. The development of a datadriven system for online QC in manufacturing systems is challenging, especially because the data acquired from a manufacturing process environment, for instance, materials' properties and parameters of production, could be massive and would require a solid data structuring for efficient post-processing analysis [START_REF] Wang | Deep learning for smart manufacturing: methods and applications[END_REF]. However, for a specific application with dedicated sensors, smart data methodology might be a promising solution for an online QC (García-Gil et al 2019, Lareyre et al 2020).

Data preprocessing and augmentation

The data acquired from vision systems are usually presented in digital forms such as images and videos. These data might contain noises that are caused by the surrounding environment of the system or by its internal components. The data can also be exported in an extension that is not ready to be analyzed. Therefore, preprocessing the data is often necessary before using them inside an ML algorithm. Examples of data-preprocessing related to imagery are resizing and cropping of images [START_REF] Bacioiu | Automated defect classification of aluminium 5083 TIG welding using HDR camera and neural networks[END_REF].

According to [START_REF] Luengo | Big Data Preprocessing: Enabling Smart Data[END_REF], big data is an appealing topic that deals with the knowledge extraction process, in which vast amounts of data are analyzed, processed, interpreted, and cleaned in order to be accessed in a structured way. This transformation is the difference between 'big' and 'smart' data. Therefore, smart data (or intelligent data) is an approach to data processing, consisting in extracting from the gigantic mass of data provided by big data the most relevant information to conduct defect identification. Indeed, traditionally, data is first collected, converted, placed in a database, and processed in waves. However, with this approach, data is usually out of date when it is finally analyzed. Thanks to the smart data approach, also known as scarce data analysis, data is analyzed directly at the source to enable immediate decisions to be made. Processing time is reduced and the term 'smart' refers to the intelligence of this concept, but also to the fact that this approach is often linked to sensors with multiresolution. In addition, the notion of intelligence is based on the fact that less data is processed, because statistical models are responsible for determining which are the relevant variables, namely the most correlated. This is what saves time.

Depending on the application, the available data might be too small for a meaningful analysis; or it might be previously labeled or not. In both cases, by performing a rotation of the images or adding noise to them, it is possible to significantly increase the amount of data before using it to train an ML model [START_REF] Ferguson | Detection and segmentation of manufacturing defects with convolutional neural networks and transfer learning Smart Sustain[END_REF], Zhang et al 2019). This method is called data augmentation, and it must consider an eventual issue of overfitting the learning model. As it depends on the case base, such as for letters recognition, rotation of the images would change the meaning of the word in the image for example. Another alternative to the problem of not having labeled data is the application of unsupervised ML algorithms, which are another type of ML algorithm that represents an excellent solution to create models from unlabeled data.

Features extraction

Learning methods for pattern recognition aim to find meaningful information that can be hidden inside the data. Thus, to get significant knowledge from it, such as object localization and segmentation, letters or voice recognition; features that describe and characterize each element of the subject of interest must be extracted before the classification/clustering phase. This feature extraction and identification must be handcrafted by a domain expert before any training of ML models [START_REF] Wang | Deep learning for smart manufacturing: methods and applications[END_REF].

One way to avoid this phase is the employment of DL methods, which does not require pre-extraction of features because it performs a deep pattern recognition from a big amount of data using non-linear functions of the hidden layers. In case the amount of available data is not sufficient, data augmentation methods can be employed to increase the data for training NN algorithms.

ML algorithms 2.3.1. Decision trees (DTs).

DT (Quinlan 1993) is one of the ML algorithms classified as supervised learning since it is trained with a dataset that contains labeled observations. Its hierarchical structure, shown in figure 2, is described as follows:

• the first node (root node) represents the variable or the attribute that contains high-quantity information considering all samples of the data; • the branches describe the different possibilities or values for the attribute; • the leaves are their equivalent targets. The entropy measure helps to calculate the quantity of information of an attribute; and based on that, each branch node generates rules of a subset of the dataset. The entropy I is calculated by:

I (S) = - m ∑ i=1 p i log 2 p i (bits) ,
where p i represents the probability that a set S belongs to one of the class states.

If a hypothetical dataset D is partitioned into subsets D 1 , D 2 , D 3 … D n , depending on the cases that can be taken from an attribute, the expected information that can be given by the subset of the attribute X is given by:

I X (D) = n ∑ i=1 |D i | D I (D i ) .
Therefore, the equation of the gain criterion that measures the quantity of information given by the attribute X is:

gain (X) = I (D) -I X (D) .
Finding the maximum gain given by an attribute allows the construction of the first node and the other branches.

Random forest (RF)

. RF (Ho 1995, Breiman 2001) is one of the ensemble techniques that is based on the training of many DTs, where each tree is trained using a random subset of the original dataset, given by the bootstrap method (see figure 2). The best classifier is the tree that exhibits an error closest to the average value of errors of all trained trees.

Multi-layer perceptron (MLP). Proposed in 1958 by

Rosenblatt, the perceptron was the first model created that represents the human brain's cognitive functionality. Later, in 1969 [START_REF] Minsky | Perceptrons, Expanded Edition an Introduction to Computational Geometry[END_REF], found out that this model could learn only linearly separable data and could not resolve a nonlinear problem as shown for the case of XOR logical function. However, in 1985, (Rumelhart 1985) found that adding a layer to a simple perceptron permits resolving the nonlinear separation issue.

The MLP, also called NN, is considered as an approximation of a function, as it is stated in the universal approximation theorem (Cybenko 1989, Hornik et al 1989): any function can be approximated by a NN that maps inputs onto determined outputs with weights and by applying an activation function that yields a non-linear transformation. Its structure is schematically presented in figure 2.

CNN.

Models based on artificial NNs, named later as DL, have attracted attention not only from researchers in AI fields as well as from other scientific fields such as manufacturing, health, and economics. So far, DL algorithms have given good results in applications such as speech recognition, facial recognition, and object detection. Its name comes from the fact that the NN models may contain several layers, and each one can extract specific knowledge from the data. The results obtained from each layer are combined to form the output result [START_REF] Goodfellow | Adaptive Computation and Machine Learning[END_REF].

CNNs are DL algorithms that are used mostly for image recognition. Hidden layers of CNN can perform feature extraction on images (e.g. edges, corners, lines, and curves) using matrices called filters, which are applied to input matrices by convolution operator.

Experimental methodology

Copper rods used in electrical engines are coated with electrically insulating material. To weld them with other components, a region of the insolation layer must be removed by laser machining, which is a process based on the formation of grooves on the to-be-treated surface by vaporization owing to heating caused by a moving laser beam. By overlapping the grooves, it is possible to remove layers of coating material and thus to shape functional electrical rods for subsequent welding. However, the polarization-induced mechanism creates surface defects when selectively removing a groove. In addition, depending on the laser-machining conditions, the vaporization reaction becomes rapid enough for an appreciable removal of the coated material (i.e. unworn coated surface). Therefore, residual coating material eventually stays on the surface, which generates a performance defect of the component in terms of electrical conductivity. In this sense, a QC must be carried out to ensure that the surface is flawless, and thus to prevent any additional manufacturing costs and save production time.

The specimens investigated in this study have surfaces designated as non-defective or defective based on very fine discrimination from the production-line quality standard. A schematic depiction of the laser-machined section showing the effect of beam polarization on the groove shape is presented in figure 3. Each specimen has in total four surfaces that can be measured using different methods of image acquisition.

To better understand the generation of defects, a big data composed of images of such surfaces has been previously acquired from the manufacturing line to identify the critical features of unacceptable defects using optical, scanning electron microscopy (SEM), and CCI. From this pool of data, the four most representative laser-machined specimens are analyzed and presented in this work.

Measurements with optical microscope (OM), SEM and CCI

These four specimens are analyzed with three different technologies: OM, SEM, and CCI. The goal of the analysis is to define what is going to be considered a 'defective' and 'non-defective' surface in this study. In addition, it is also intended to evaluate the quality of the CCI measurement in terms of capability of showing surface details. In other words, if there are important surface details measurable by SEM and OM, but invisible for CCI. The investigation done with OM was carried out using an OLYMPUS BX41M, objective lens of 5× and exposure time of 60 µs. The region of interest (ROI) is illuminated by white light, and a CCD camera is used to acquire RGB images.

For the SEM analysis, two modes were employed: backscattered electrons (BSEs) and electron backscattered diffraction (EBSD). The measurements were carried out using a FEG JEOL JSM-7001F. First, the extremities of a specimen are painted with an electrically conductive material, then the specimen is placed inside the chamber, and vacuum is done inside it. The surface of the specimen is then subjected to electron beams with power up to 15 KV. Since the detected BSEs using the BSE mode depends on the atomic number of the element, light-colored areas in this analysis will correspond to copper (atomic number 29). On the other hand, dark-colored regions will correspond to the other elements with an atomic number lower than 29. An analysis of energy-dispersive x-ray using the EBSD mode was also carried out to characterize the chemical elements presented on the specimen's surface.

CCI

Chromatic confocal microscopy (CCM) is a well-known optical technique for non-contact measurement of surface topography (Quinsat and Tournier 2012, El-Hayek et al 2015, Niese and Quodbach 2018). Fundamentally, the output of a CCM sensor is the measurement of the distance between the surface and the sensor. By the combination of this measured distance and the corresponding position of the sensor along a preset line, the topography profile of the surface is obtained. The combination of many profiles measured in parallel lines allows a surface topography analysis.

To perform a CCM measurement, two different devices are mounted together: an optical probe and a vision system. The optical probe is a device that contains lenses with different refraction indexes to create the effect of chromatic aberration. By doing so, the diffraction of white light to monochromatic wavelengths is arranged linearly through an optical axis by their focal points. The spacing between the focal points represents the axial resolution of the sensor. The acquisition of surface profiles is performed by the extraction of the spectrum intensity of the wavelength scattered by the surface point. The centroid of the spectrum, which corresponds to the point of maximum intensity, and its equivalent pixel on the spectrometer graph are converted to a distance using a calibration table.

The MC2 ® vision system used in this work is a microscope under development that combines a chromatic confocal head with a 4K high-resolution camera. The head produces a white line spot on the inspected surface, which is coming from a linear illumination source. The white light coming from the source is scattered into monochromatic lights, and each of its wavelengths represents a specific distance. The nanometric axial resolution that is produced by the chromatic aberration of the objective lens represents the depth of field.

Industrial partner of the present work, the company STIL has developed three optical heads to be used with the MC2 ® vision system: DeepView ® (DV), MicroView ® (MV), and WireView ® (WV). The properties of each optical head are shown in table 1, with their main feature in bold.

As illustrated in table 1, the optical head DV is mostly used for applications where the sensor must be slightly away from the specimen, due to its larger working distance. The optical head WV is mainly used for inspection of surfaces that exhibit higher inclination (angle between surface normal vector and optical head longitudinal axis ⩽ 46 • ). And MV is mostly used for measuring preferably flat surfaces due to its shorter depth of field compared to the others.

To verify the capability of using CCI technology for defect detection, a large database of multi-resolution images was previously generated using different optical heads. In total, three different optical heads were investigated to determine if they are capable of capturing such sub-millimeter defects, and also to identify which one is more suitable for the ML algorithms in terms of higher accuracy, since each sensor exhibits a different resolution and contrast. Moreover, the sensors have different working distances, which let us investigate presumable distances that might be found in a production line. From this CCI database, the same four most representative specimens from the OM/SEM analysis were selected to form a small database. These four specimens were scanned with an exposure time of 60 µs, step resolutions of 1.23 µm, 1.00 µm, and 1.23 µm, using respectively DV, WV, and MV. Each measured area exhibits approximately the following dimensions: 14 mm × 2 mm. Data with '.SUR' extension were acquired and preprocessed with MountainsMap Software to subtract the signal that is reflected by the objective (called 'dark').

Implementation of AI

In figure 4 is summarized how the copper rod specimens were analyzed and data were acquired from the vision machine system. On the left is the MC2 ® machine connected to a computer equipped with a CameraLink acquisition card. After acquisition, images are preprocessed using MountainsMap commercial software to generate the dataset of gray-scale images. The dataset is then used in two different investigations: (a) 'direct defect classification with CNN and TL', which is about training/applying CNN algorithms and a TL method to analyze the resulting accuracy for defect classification; (b) 'segmentation with Weka plugin', which is about training/applying three different ML algorithms (DT, RF and MLP) to analyze their resulting accuracy and processing time. In both situations, the goal is to find the AI approaches that exhibit better performance and thus are most suitable to be integrated later on in a production line with AI-based QC system.

RF, MLP, and DT.

Three different ML algorithms have been tested for defect segmentation: RF, MLP, and DT. These algorithms are inside the public domain software ImageJ (Rueden et al 2017) as a plugin named Weka segmentation, which is an open software for ML and data mining developed by the University of Waikato in New Zealand. These algorithms have their hyperparameters that can be tuned depending on the requirement that must be satisfied, such as accuracy and processing time.

In the ImageJ plugin, the latest version of DT (C4.5) has been used. It is implemented in Weka as a classifier called J48. The hyperparameters that can be changed in this classifier are the confidence factor (by default 0.25), which is the confidence threshold for pruning. Lower values affect the processing time of the pruning and the minimum number of instances per leaf (by default 2).

In figure 5 is presented the procedure for training and testing each ML segmentation model. First, an image is acquired from a specimen with a clear defect and then used to train each proposed classifier (model). The training starts with labeling one defective (yellow-highlighted) and one nondefective (blue-highlighted) region of the image. Then, features are extracted from the training image using a filter for edge detection that is available on the Weka segmentation plugin: the Sobel filter. Among several extraction filters available inside the Weka plugin, the Sobel filter was selected, because during some preliminary tests the filter showed higher accuracy and lower processing time when compared to the other filters available inside the plugin. To illustrate the process, an example of matrix (cropped) of features resulting from the Sobel filter is shown in figure 5. The column '8: class' represents the manual labeling done by the operator before the feature extraction. The other columns represent the calculated approximations of the gradient of the image intensity at each pixel. After training, the generated classifier is ready to be applied to new images. Images taken from three specimens using three different CCI sensors are fed to the already trained classifier, which gives as result binary segmented images that exhibit in white color the defective regions of the analyzed surface. A classifier is then ran ten times for a single image dataset, so the average processing time can be measured. The application of three ML models on three image datasets captured with different CCI sensors results in nine combinations of tests. All test images are resized to 1586 × 1120 before being used in the models.

Defect classification using CNN and TL.

A simple CNN model was used to perform binary classification of 309 images, figure 6. This dataset is composed of images taken from 32 different surfaces (from eight laser-machined specimens) using DV and MV with different configuration parameters. The training images were separated into two classes: defect and non-defect. All images were resized to 224 × 224 pixels to decrease their dimension and also to compare later on the performances of this model with a TL method using Mobilenet model, which is a model limited to be trained with images' size up to 224 × 224 pixels. For validation with completely new data, 28 different images taken with WV and OM were tested by the CNN model.

In TL, the knowledge extracted from one or multiple models can be used for a new data learning. The learned model can be adjusted and retrained to improve its learning performance on the new target data even if this new data is not enough for a single training. Based on this, a TL model called mobilenet-v1 (Howard et al 2017) was employed in this work. The model is publicly available in the TensorFlow framework given by Google. Its architecture is based on CNN, and it is mostly used for object detection applications. Such applications do not require a significantly powerful calculation, and therefore can be embedded in mobiles or devices used for edge computing.

To apply the TL model, the data acquired from the CCI systems were separated into two classes: defect and no defect. The TL model was retrained on images acquired by two optical heads; it is designed to get an input image size of 224 × 224 pixels and to use 50% of the models' width. The model was retrained on a computer with CPU i7-6700HQ 2.6 GHz, graphical card GeForce GTX 960M, and 16 GB in RAM. For validation, the TL model was employed on the same database used to test the CNN model (composed of 28 images from OM and WV).

Results and discussion

Measurements with OM, SEM and CCI

In figure 7 are presented images of four different specimens, in which the major light-colored areas correspond to copper clean surface and the dark-colored ones (in (b)-(d) correspond to areas covered by residual isolation material. As observed in (a), copper is dominant while the black spots correspond to small holes on the surface. The pattern of some black spots and scratches are indicated in the measured pictures to evidence that the same region of the specimen is being analyzed by OM, SEM, and CCI. Despite the small black spots, specimen (a) will be classified in this work as non-defective, because the flaws to be identified/characterized are those related to residual isolation material, as exhibited in specimens (b)-(d). In addition, by comparing the CCI images to OM and SEM, it can be seen that although some small black spots are not present in the CCI images, the area considered as 'defect' (in red contour) is very clear in specimens (a)-(d). Therefore, on can attest the capability of using CCI for such sub-millimeter surface defect detection.

In figure 7 (SEM) are also presented images taken with BSE-SEM from the same specimens that were inspected using OM. The defects found in figure 7 (SEM (b)-(d)) are indicated with a red contour. To obtain more details, a ROI of the specimen (b) was further analyzed, and the results are presented in figure 8.

Based on figure 8, it can be seen that the elements that are mostly present on the analyzed surface are copper and carbon. The first one corresponds to the specimen material itself, and the latter corresponds to the residual isolating organic resin.

Measurements with CCI

Four specimens were scanned using DV, WV and MV, respectively. One image of each specimen inspected by the DV is presented in figure 9, together with the measurement settings.

In figure 10 are presented three different measurement results of the CCI at the location of the defect from specimen shown in figure 9(b). Despite the image (c) from figure 10 has shown better contrast compared to (a) and (b), the features and the geometrical textures of the defect region can still be detected by all the mentioned optical heads. The better contrast was achieved due to the highest axial resolution (i.e. low depth of field) of the MV optical head. Therefore, for online integration of the vision system in a manufacturing line, it is more important to consider the values of the working distance and depth of field of the optical heads.

Segmentation with ML

In figures 11-13 are shown the measurements of three different specimens done with the sensors DV, WV, and MV, respectively, together with the corresponding results achieved when applying the exported model from RF, MLP, and DT classifiers. The training image was the image from the specimen (c) in figure 9, measured using DV sensor.

When comparing the results from three different ML algorithms, RF and MLP (with two hidden layers) exhibited similar and rather poor segmentation performance, whereas DT algorithms exhibited the best segmentation of the residual carbon areas. For instance, among all results presented in figures 11-13, the edges of the defect are more visible in images (2) WV,DT and (2) DV,DT if compared to images (2) WV,RF and (2) WV,MLP ; (2) DV,RF and (2) DV,MLP , respectively. It is worth to mention that these results are based on the pixels labeled before in the training stage.

The processing time from each combination of classifier and image acquisition optical head is shown in table 2. Each classifier was applied ten times for both the training and test phase, so the average processing time could be calculated.

Defect classification with CNN

The resulting architecture of the CNN model is summarized in table 3. The CNN has in total 16 hidden layers. The training of the model was performed using two datasets: images acquired with DV sensor, and images taken with DV + MV. Four different parameters were used for each training dataset: batch sizes (BSs) of 10 and 2, and percentage of the validation data (VD) of 30% and 40%.

In figure 14 are presented the accuracy curves of the CNN model over 500 epochs. By comparing them, the model trained with DV images (figure 14) exhibited an accuracy of the VD i.e. close to the training accuracy. The best average accuracy is equal to 98.7% as shown in table 4. Therefore, the model is assumed to be overfitting on just this kind of dataset. Based on this assumption, the same model has been trained on images from DV + MV. The resulting accuracies of the VD related to the model trained with DV + MV dataset exhibited a decrease for all data settings (table 4) when compared to the resulting accuracies of the model trained with DV dataset. This can be explained by the fact that the quantity of MV images is not equal to the quantity of DV images. Nevertheless, the average accuracy achieved using 40% of VD over 500 epochs was 84.9%.

In table 5 are presented the results of defect-classification performed on completely new testing data that were taken using WV and OM. The highest accuracy achieved was 0.64, which corresponds to the model trained with DV, BS = 10, and VD = 40%. The highest-accuracy model found by the testing data agrees with the one obtained by the VD presented in table 4.

Based on the results presented in tables 4 and 5, the best model was the one trained on DV images using 40% of VD and with a BS equal to 10.

Defect classification using TL

The retraining using 500 epochs has taken approximately 4 min, and this is related to processing all images of the database. The average evaluation time of the model with ten trials applied on new test images, that are not included in the training database, was equal to 1.58 s. In figure 15 is presented the accuracy of the model trained with two types of image database: (a) images acquired with DV, and (b) images acquired with DV and MV optical heads. Although the training accuracy for (a) and (b) reached 100%, the most important accuracy result that should be concerned is the validation accuracy, which confirms that the model is not overfitting. The average validation accuracy over 500 epochs was 90.5% when using images from a single optical head (DV), and 89.2% when using images from MV and DV.

In table 6 is shown the confusion matrix of the TL model (trained on DV + MV) applied to a new database composed of WV and OM images.

Unlike the DV + MV CNN model that did not show good results when applied to the test data (table 5), the TL trained on DV + MV achieved an accuracy of 64.3%. This can be explained by the fact that the TL model was previously trained on a large database, which allowed it to learn different features by performing object detection and classification.

Conclusion

The purpose of this work was to investigate the accuracy and computing time when applying different combinations of image segmentations and ML algorithms on images taken using CCI. The important conclusions drawn from the present work are summarized as follows.

(a) From the comparative study between using SEM, OM and the CCI, the detection of residual parts of carbon on the copper surface could be successfully controlled by a computer vision system with the integration of ML algorithms in the CCI. (b) Segmentation of the collected images using the Weka plugin has given an investigation of three different ML algorithms. The DT algorithm proved to be more suitable for fast and accurate segmentation of defects exhibited by the images taken with STIL optical heads. (c) Classification of defects using CNN applied on images from CCI has given better accuracy results when compared to DT, RF, and MLP. (d) The classification using TL has shown better accuracy when compared to the simple CNN model especially in the database that contains images taken with two different optical heads. This can be explained by the fact that with the TL, the weights of the NN model are just tuned during the learning, whereas for the CNN model, the learning is done from scratch. The accuracy of the model depends on the quantity and variety of the VD, and on the architecture of the NN. (e) The use of a small amount of data rather than big data for training the AI algorithms successfully generated an accurate generalization for defect classification of surface images. Based on this result, the small database used in this work can be referred as smart data.

In future research, an online CCI-based QC control system will be implemented by the integration of the presented defectclassification models and a CCI sensor into a machine-tool. Later on, a new ML model will be designed in order to correlate the input machining parameters to the online-measured surface quality, so that an active feedback control to the manufacturing process can be performed based on the optimization of the machining parameters.

Data and code availability

The data generated and/or analyzed during the current study are not publicly available for legal/ethical reasons but are available from the corresponding author on reasonable request.

ÉCOLE DOCTORALE SCIENCES DES MÉTIERS DE L'INGÉNIEUR

Objectifs

Pour surmonter les problèmes mentionnés ci-dessus, cette thèse vise à construire le cadre d'un système de CQ qui, au lieu de détecter la non-conformité de la qualité de la surface pour la corriger plus tard, le système effectue un CQ proactif en prévoyant la non-conformité de la qualité de la surface et en changeant les paramètres liés à la machine afin que la surface de la pièce soit fabriquée avec une qualité acceptable. Pour développer un tel système complexe, ce travail propose les étapes suivantes : i) une recherche sur la méthode de détection et la génération d'une base de données suffisamment représentative en termes de paramètres de fabrication et de résultats de qualité de surface ; ii) une recherche sur la modélisation IA pour la prédiction de la qualité ; et iii) une recherche sur la modélisation IA capable de déterminer l'action de rétroaction pour la machine-outil afin d'éviter la fabrication de pièces de "mauvaise qualité". Seules les étapes i) et ii) font l'objet du présent travail. Et comme une approche de modélisation IA est très dépendante de la nature des données et du capteur, les étapes i) et ii) sont ici étudiées ensemble, mais divisées en deux approches différentes liées à la qualité : les défauts de surface et la topographie de surface. Pour l'approche de la topographie de surface, ce travail propose l'utilisation de capteurs ponctuels CC pour effectuer une mesure sans contact des profils de rugosité. Puisqu'un contrôle qualité proactif nécessiterait l'acquisition de la topographie de surface pendant le processus de fabrication, les capteurs ponctuels CC ont été installés à l'intérieur d'une machine-outil afin d'étudier l'applicabilité de cette technologie "dans la machine" en comparant les mesures effectuées à l'intérieur de la machine-outil avec les mesures effectuées "ex-situ" (à l'extérieur de la machine-outil, dans une salle de métrologie). En ce qui concerne la modélisation IA pour la topographie de surface, puisque l'objectif est d'avoir un modèle capable de prédire la qualité de la topographie, un ensemble de données expérimentales solides et multi-variables doit être généré. Pour cela, des centaines d'expériences de coupe ont été réalisées avec la mesure des forces d'usinage pendant les coupes, ainsi que la mesure postérieure sans contact et "sur machine" des profils de rugosité des surfaces usinées. Le matériau choisi pour les expériences de coupe était l'aluminium, en raison de sa bonne usinabilité qui permet de négliger l'usure de l'outil pour un temps de coupe raisonnablement court. Les paramètres du processus de coupe tels que la vitesse de coupe, la vitesse d'avance et la profondeur de coupe sont également inclus dans le jeu de données pour l'approche IA. L'objectif est de développer un modèle ML capable de prédire la rugosité de surface, et pouvant être appliqué ultérieurement dans une ligne de production. Afin d'acquérir un modèle avec une faible erreur de prédiction, certains algorithmes ML de régression sont étudiés en utilisant deux architectures différentes, puis une comparaison de leurs performances est effectuée. Afin d'étendre l'approche AI de prédiction de la rugosité pour prendre en compte la progression de l'usure de l'outil pendant le processus de coupe, un troisième ensemble de données expérimentales a été généré. Cette fois, le titane a été choisi comme matériau de la pièce à usiner, car il présente un taux d'usure significativement élevé sur un temps de coupe court. Dans cette approche finale, un algorithme de prévision de séries temporelles appelé Auto Regressive Integrated Moving Average (ARIMA) est étudié pour déterminer son applicabilité dans la prévision des valeurs futures de la rugosité de surface sur la base des valeurs précédentes, car elle change au fur et à mesure que l'usure de l'outil progresse pendant le temps de coupe.

Questions de recherche

Ce travail propose de répondre aux questions de recherche suivantes.

-Sur la base des bibliothèques d'IA les plus utilisées et en accès libre, quels algorithmes et méthodes d'IA sont les mieux adaptés à la détection des défauts de surface présents dans l'ensemble de données proposé ? -Lequel est le plus rapide et le plus précis et pourrait être mis en oeuvre à l'avenir dans un système à capacité de traitement limitée ? -Est-il possible d'obtenir une généralisation significative de la classification des défauts en utilisant uniquement des données intelligentes ? -Est-il possible d'effectuer des mesures de rugosité CC dans l'environnement difficile d'une machine-outil CNC pour obtenir ensuite un modèle ML capable de prédire la rugosité avec une erreur de validation inférieure ou proche de 10% ? -Les algorithmes ML peuvent-ils apprendre la corrélation vraisemblablement non linéaire entre les paramètres de coupe, les forces d'usinage et la rugosité de surface ? -En tenant compte de l'usure de l'outil et du temps de coupe, un modèle de prévision peut-il prédire et suivre l'évolution future de la rugosité de surface ?

Introduction

Ce chapitre est une synthèse bibliographique sur la métrologie sur machine et les différentes applications documentaires des méthodes de mesure. Il présente ensuite le paradigme de la fabrication intelligente et la nécessité de mettre en place un contrôle proactif de la surface des pièces usinées, soit en détectant les défauts, soit en prédisant la rugosité de surface. Enfin, le contexte théorique des modèles de décision basés sur les données, les bases des algorithmes d'apprentissage automatique et les méthodes utilisées dans cette thèse pour la classification des défauts et la prédiction de la rugosité sont résumés.

Métrologie de surface en ligne

Dans une ligne de production, différents types de mesures sont effectués tout au long de la fabrication d'une pièce. Chaque machine est disposée en fonction de la ligne mise en place dans l'usine comme le montre la Figure 2, où les différentes stations de mesure sont placées à différents endroits, et les conditions environnementales (température, vibration et humidité) présentent différents niveaux de contrôle. La métrologie traditionnelle, ici dénommée ex-situ¸ est généralement réalisée dans une chambre isolée où l'environnement est contrôlé. Lorsque la mesure est effectuée directement à l'atelier, ce type de métrologie est appelé in-situ. Cette dernière peut encore être divisée en trois catégories : in-line/on-line, lorsque la pièce est mesurée à l'intérieur de la ligne de fabrication ; off-line, lorsque la pièce est mesurée en dehors de la ligne de fabrication ; et on-machine, lorsque la métrologie est effectuée directement à l'intérieur de la machine de fabrication. En outre, la métrologie sur machine peut être divisée en trois catégories : in process (mesure en parallèle avec la fabrication de la pièce), pre-process (mesure avant l'exécution du processus), et post-process (la mesure est effectuée après le processus).

Prédiction de la rugosité de surface

La rugosité représente les irrégularités d'une surface qui résultent des conditions de coupe appliquées, des marques de frottement causées par l'usure de l'outil, des différents modes de formation des copeaux, de la géométrie de l'outil et du fluide de coupe, etc [START_REF] Klocke | Manufacturing processes 1[END_REF]- [START_REF] Petropoulos | Surface texture characterization and evaluation related to machining[END_REF]. Pour ces raisons, les valeurs des paramètres de rugosité de surface varient considérablement lors de l'usinage d'un même matériau avec différents procédés. A partir de n'importe quel processus d'usinage exécuté, la prédiction de la rugosité est possible en utilisant un modèle piloté par les données qui peut apprendre la corrélation entre les paramètres qui influencent directement la rugosité de surface [START_REF] Benardos | Predicting surface roughness in machining: A review[END_REF]. Cependant, il est fastidieux et coûteux (obtention des mesures physiques, collecte des données, post-traitement, etc.) de construire une base de données avec tous les facteurs qui influencent la rugosité de surface, comme le montre la Figure 3. (1) L'apprentissage supervisé qui concerne l'apprentissage à partir de données déjà étiquetées.

Cela signifie que la cible ou la sortie est déjà donnée à l'algorithme avec les entrées correspondantes.

( Néanmoins, la précision moyenne obtenue en utilisant 40% des données de validation sur 500 époques était de 84,9%.

Introduction

Sur la base de la revue de la littérature, aucune approche ML basée sur les données et utilisant la mesure de la rugosité de surface sans contact à l'intérieur d'une machine-outil n'a pu être Après avoir terminé 25 lignes de coupe (une surface complètevoir Figure 14), chaque région de cut # est mesurée six fois à l'aide d'un capteur CC installé dans le porte-outil. Comme les coupes ont été effectuées en suivant une trajectoire radiale avec un incrément de 360/25 = 14,4° en rotation, les coupes sont superposées. Pour éviter d'analyser une coupe de surface avec un mélange de différentes conditions de coupe, seule une partie de chaque région de coupe est analysée. Cette région présente une forme de "triangle". Figure 13, afin de mesurer les profils de deux étalons, et de collecter des données pour une analyse ultérieure. L'objectif est de vérifier et de choisir le capteur le plus précis et le plus adéquat pour la mesure in-situ et de créer un ensemble de données qui aidera à construire un modèle de prédiction de la rugosité de surface.

Mesure de la rugosité de surface

Pour valider la possibilité de mesurer la rugosité de surface sur la machine avec des capteurs CC, les profils de surface de deux étalons de rugosité différents ont été mesurés à l'intérieur de la machine-outil CNC : a) un étalon de rugosité en nickel avec un Ra nominal de 3,2 µm, et b) un étalon de rugosité en verre avec un Ra nominal de 0,94 µm (Figure 15). Six profils de surface de chaque standard de rugosité ont été mesurés. Les deux étalons ont été sélectionnés car ils présentent une topographie bien définie ainsi que des paramètres de rugosité connus. Sur cette base, une analyse comparative entre les mesures en machine effectuées à l'aide de trois capteurs CC différents et les mesures hors ligne avec un profilomètre tactile (Hommel Etamic W10) a été réalisée. Une analyse qualitative a été effectuée en ajustant les profils de rugosité mesurés ensemble pour visualiser les similitudes et les divergences des profils en termes de forme, de hauteur et de distance entre les pics du profil.

Concernant les pièces en aluminium usinées, après avoir effectué les opérations de fraisage, la surface de chaque disque a été nettoyée avec de l'alcool pour éliminer les gouttelettes résiduelles du fluide de coupe. Les mesures CC ont ensuite été effectuées à l'aide d'un programme pièce en code G qui considère le capteur comme un outil. 25 profils de surface ont été mesurés six fois pour une analyse statistique plus poussée et pour rassembler l'ensemble des données nécessaires à la construction d'un modèle de prédiction utilisant des algorithmes ML.

Après avoir collecté les données en utilisant les deux capteurs : le capteur CC (mesures sur la machine), et le stylet Hommel (mesures hors ligne) ; le post-traitement des deux données a été fait en utilisant le logiciel MountainsMap pour extraire les paramètres de rugosité des profils de surface en utilisant l'ISO4782 et la coupure λc=0.8 µm. Le jeu de données pour l'entraînement du modèle de régression a été préparé dans un tableau contenant 125 surfaces avec différents paramètres de coupe et leur paramètre de rugosité de surface correspondant (Ra), qui représentent la moyenne de 6 mesures sur chaque surface.

Modèle de prédiction basé sur les données

Le modèle, qui n'a été appris qu'à partir d'un ensemble de données donné, va permettre de trouver une approximation de la loi physique théorique qui corrèle la sortie Ra aux paramètres et aux forces de coupe. Chacun d'entre eux participe avec un certain poids. Plus le poids est élevé, plus l'influence du paramètre sur la sortie Ra est importante. Sachant que deux profils avec le même Ra peuvent ne pas être symétriques, avoir d'autres paramètres de rugosité de surface permettra de différencier les profils. Par conséquent, prédire uniquement Ra ne serait pas suffisant pour connaître la qualité réelle de la surface. Pour cela, la prédiction à sorties multiples permet de construire un modèle qui reliera les variables d'entrée (paramètres de coupe et forces) aux sorties les plus significatives des paramètres de rugosité.

Ce chapitre vise à prédire la rugosité de surface en connaissant uniquement les paramètres de coupe et les forces exercées pendant le fraisage. Sur la base de cet objectif, la construction de modèles de prédiction a été effectuée en utilisant l'ensemble des données collectées à partir de nombreuses expériences. Ces modèles sont caractérisés par une architecture et des performances différentes, ce qui permettra d'étudier initialement la capacité de chaque algorithme à fournir des prédictions précises, et de décider lequel des algorithmes étudiés peut être déployé à la fin pour une application de contrôle de qualité en temps réel. Adaboost n'a pas de paramètre max_depth, et le RF ne contient pas de taux d'apprentissage.

Mean Absolute error

Model

Introduction

Au cours du processus de fraisage, l'outil subit une usure, qui est un phénomène inévitable causé par l'adhésion, l'abrasion, la diffusion, la fatigue thermique et la déformation élastique ou plastique. Après un certain temps de coupe, l'outil commence à s'user et à perdre ses performances, ce qui conduit généralement à une qualité de surface inacceptable et finalement à la rupture de l'outil, à la mise au rebut des pièces ou à l'endommagement de la machine-outil.

Dans ce sens, la prise en compte de l'usure de l'outil est essentielle pour développer un système de contrôle qualité proactif.

Dans l'industrie, l'usure des outils est généralement "contrôlée" en suivant une stratégie de protection dans laquelle les remplacements d'outils sont effectués à des stades précoces d'usure et sur la base de l'expérience, ce qui entraîne un gaspillage de la durée de vie restante de l'outil et des temps d'arrêt inutiles pour le changer. Par conséquent, l'estimation de la progression de l'usure dans le processus de fraisage est un sujet pertinent dans l'usinage.

Afin d'étudier l'influence de l'usure sur la qualité de la surface, le titane a été choisi comme matériau de la pièce à usiner pour une série d'expériences de coupe afin de générer un ensemble de données pour construire un modèle piloté par les données. Le titane a été choisi en raison de sa grande résistance à haute température et de sa faible conductivité thermique, ce qui en fait un matériau difficile à usiner et donc un bon candidat pour une étude expérimentale de l'usure des outils. En outre, le titane est considéré comme un matériau d'ingénierie attrayant, largement utilisé dans l'industrie aérospatiale et de la santé en raison de ses nombreux avantages, tels que les économies de poids, la résistance à la corrosion, le faible module de Young, les capacités à haute température et l'excellente biocompatibilité.

Approche et méthode expérimentales

Afin d'analyser l'influence de l'usure sur la rugosité de surface, des opérations de fraisage de finition de surface ont été effectuées en utilisant le titane comme matériau de la pièce. Des mesures de la rugosité de surface, de l'usure de l'outil et des forces de coupe ont été effectuées afin de collecter un ensemble de données pour la construction du modèle. Chaque fois qu'une surface complète a été fraisée (26 lignes de coupe), des mesures de profil de surface ont été effectuées sur la machine avec un capteur sans contact CC CL1MG240.

L'approche a été la même que celle présentée au chapitre 3 : pour chaque ligne coupée, 6 profils de surface ont été mesurés sur une ligne de 15 mm de long (Figure 14). Les données acquises par le capteur ont été post-traitées avec le logiciel MountainsMap. L'objectif était de calculer et Le but de la thèse était de construire une compréhension globale des procédures qui peuvent être appliquées pour le développement d'un système CQ proactif. De plus, il s'agit de déterminer quels modèles ML peuvent être utilisés pour chaque type d'application de contrôle de surface.

Les modèles ML présentent en effet certaines limitations qui dépendent de la quantité de La troisième étude a analysé la progression de la rugosité de surface au cours du temps de coupe tout en considérant l'usure de l'outil et les forces de coupe. L'analyse a montré que la rugosité de la surface usinée change avec le temps de coupe et l'usure de l'outil. Le modèle de prévision

Figure 1 : 11 Figure 2 : 16 Figure 3 : 18 Figure 4 : 22 Figure 5 : 23 Figure 6 : 28 Figure 7 : 29 Figure 8 : 30 Figure 9 : 31 Figure 10 : 35 Figure 11 : 39 Figure 12 : 48 Figure 13 : 49 Figure 14 :

 111216318422523628729830931103511391248134914 Figure 1: Representation of surface quality aspects in a manufacturing process ................................................ 11 Figure 2: Different types of metrology in a manufacturing factory [5] .............................................................. 16 Figure 3: Integration on CC sensor inside machine and comparison of its measurements with the stylus measurements.(a) CC inside ultra-precision diamond turning [12], (b) measuring the wear on the surface of a twin disc [14]. ........................................................................................................................................................ 18 Figure 4: Structural deviations of a surface according to DIN 4287 [28] ........................................................... 22 Figure 5: The most parameters that influence the roughness [31] ..................................................................... 23 Figure 6: Example of the output given by feature extraction applied on an image [51]. ..................................... 28 Figure 7: Example of data visualization after 3D projection on 2D ................................................................... 29 Figure 8: The subfields of machine learning and their applications [58]............................................................ 30 Figure 9: Schematic structure of DT, RF, and MLP algorithms ........................................................................ 31 Figure 10: Schematic of steps that are executed by boosting classifier algorithm .............................................. 35 Figure 11: Architecture of the NN used for the prediction model using the cutting parameters and forces as inputs ....................................................................................................................................................................... 39 Figure 12: Architecture of QC system for smart manufacturing ........................................................................ 48 Figure 13: Coated rod specimens a) before, b) after manufacturing process ...................................................... 49 Figure 14: Flowchart of the experimental study using CCI and machine learning algorithms for defect detection ....................................................................................................................................................................... 52

Figure 15 : 54 Figure 16 : 55 Figure 17 : 56 Figure 18 : 57 Figure 19 :

 155416551756185719 Figure 15: Experimental procedure to train and test a single ML classifier ....................................................... 54 Figure 16: Architecture of the CNN model ...................................................................................................... 55 Figure 17: OM, SEM and CCI inspection of 4 surfaces, (a) surface without defect, and (b), (c), (d) surfaces with residual isolation material ............................................................................................................................... 56 Figure 18: Analysis of chemical composition presented in the region of interest ............................................... 57 Figure 19: Series of 4 images of laser-machined coated rods showing different types of groove sets. a) Surface considered non-defective. b, c, d) Defects highlighted by dashed circles .......................................................... 58

Figure 20 : 58 Figure 21 : 59 Figure 22 : 60 Figure 23 :Figure 24 : 63 Figure 25 : 65 Figure 26 : 67 Figure 27 : 68 Figure 28 : 68 Figure 29 : 69 Figure 30 : 73 Figure 31 : 75 Figure 32 : 76 Figure 33 : 77 Figure 34 : 78 Figure 35 : 80 Figure 36 : 81 Figure 37 : 81 Figure 38 : 82 Figure 39 : 82 Figure 40 : 85 Figure 41 : 85 Figure 42 : 86 Figure 43 : 86 Figure 44 : 88 Figure 45 : 89 Figure 46 : 91 Figure 47 : 92 Figure 48 :Figure 49 : 94 Figure 50 : 95 Figure 51 : 96 Figure 52 : 97 Figure 53 : 99 Figure 54 : 100 Figure 55 : 107 Figure 57 : 108 Figure 58 : 109 Figure 59 : 110 Figure 60 : 111 Figure 61 : 113 Figure 62 : 114 Figure 63 :Figure 64 :

 20582159226023246325652667276828682969307331753276337734783580368137813882398240854185428643864488458946914792484994509551965297539954100551075710858109591106011161113621146364 Figure 20: Same surface defect analyzed using three chromatic optical heads: a) DeepView®, b) WireView®, c) MicroView® .................................................................................................................................................. 58 Figure 21: Results of application of classifiers on images acquired by the optical head Deepview® (DV) ......... 59 Figure 22: Results of application of classifiers on images acquired by the optical head Wireview® .................. 60 Figure 23: Results of application of classifiers on images acquired by the optical head Microview® ................ 61

Table 1 :

 1 Summary of literature review on AI-based surface roughness prediction for milling ........................... Table 2: Confusion matrix for a binary classification problem with two targets ................................................ Table 3: Characteristics of the chromatic confocal optical heads ...................................................................... Table 4: Average processing time to train and test a ML classifier ................................................................... Table 5: Properties of the CNN model architecture .......................................................................................... Table 6: Accuracies of the validation data with different data settings .............................................................. Table 7: Confusion matrix of the classification models ran on two data sets ..................................................... Table 8: Confusion matrix of the TL model trained on DV+MV images .......................................................... Table 9: The machined Aluminum discs with the applied cutting parameters ................................................... Table 10: Characteristics of three different point sensors ................................................................................. Table 11: On-machine CC scanning speed comparison of different roughness parameters ................................ Table 12: Experimental results for surface milling of Aluminum workpiece ..................................................... Table 13: Mean absolute error of each version of the ML algorithms ............................................................... Table 14: Results of ensemble model applied on the original data .................................................................... Table 15: Results of the ensemble methods for multiple output prediction, using 10 K cross-validation ............

Figure 1 :

 1 Figure 1: Representation of surface quality aspects in a manufacturing process

Figure 2 :

 2 Figure 2: Different types of metrology in a manufacturing factory[5]

  Confocal microscope, interferometer, light scattering, etc; Scanning Electron Microscope; and Atomic Force Microscope. It is important to add that these instruments offer measurements on different scales.

Figure 3 :

 3 Figure 3: Integration on CC sensor inside machine and comparison of its measurements with the stylus measurements.(a) CCinside ultra-precision diamond turning[START_REF] Zou | Non-contact on-machine measurement using a chromatic confocal probe for an ultra-precision turning machine[END_REF], (b) measuring the wear on the surface of a twin disc[START_REF] Andersson | Determination of wear volumes by chromatic confocal measurements during twin-disc tests with cast iron and steel[END_REF].

Figure 4 :

 4 Figure4: Structural deviations of a surface according to DIN 4287[START_REF] Klocke | Manufacturing processes 1[END_REF]

Figure 6

 6 Figure 6 shows an example from computer vision applications of the result generated by a feature extraction algorithm. The final output are the features that characterize each significant parts from the original input image.

Figure 6 :

 6 Figure 6: Example of the output given by feature extraction applied on an image [51].

Figure 7 :

 7 Figure 7: Example of data visualization after 3D projection on 2D

Figure 9 :

 9 Figure 9: Schematic structure of DT, RF, and MLP algorithms

Figure 10 :

 10 Figure 10: Schematic of steps that are executed by boosting classifier algorithm

  𝑦 𝑡 -𝑦 𝑝𝑟𝑒𝑑 )𝑥 𝑖 = -𝛿𝑥 𝑖[START_REF] Mekid | Beyond intelligent manufacturing: A new generation of flexible intelligent NC machines[END_REF]

Figure 11 :

 11 Figure 11: Architecture of the NN used for the prediction model using the cutting parameters and forces as inputs

Figure 11 represents

 11 Figure 11 represents an example of the neural network architecture with one hidden layer using the input variables (The Xi are the input nodes it will be filled with values of each data observation), to predict the Ra. The hidden layer contains nodes with ℎ 𝑖 = 𝜑(∑ 𝑤𝑗 * 𝑋𝑗 5 𝑗=0

1. 7 . 3

 73 Defect detection based on learning models  Neural networks Algorithms based on neural networks for defect detection allow applying several steps of image processing in a single model: segmentation, feature extraction, and classification. These models are considered as a black box. The way that the NN gives the results is not perfectly known, and the only known variables are the input data (training) and the output results. Many research works that use methods based on deep learning algorithms to detect defect of metallic surfaces with images from vision systems have been published recently. Tao et al.[100], for example, presented a CNN architecture capable of performing both defect detection and classification for metallic surfaces. In their work, a cascading auto encoder is used for segmentation of defects on the images, and a CNN applies then classification on segmented regions of a defect. Similarly, Liu et al.[START_REF] Liu | Periodic surface defect detection in steel plates based on deep learning[END_REF] proposed a hybrid NN architecture with CNN + LSTM + attention algorithm to detect periodic surface defects of hot-rolled steel plates. Firstly, CNN is applied for feature extraction of defects, then the LSTM with attention mechanism recognizes defects from the extracted feature vectors. The attention mechanism is performed to focus only on the essential information and ignores the other non-useful information. Satorres Martínez et al.[START_REF] Satorres Martínez | Quality inspection of machined metal parts using an image fusion technique[END_REF] applied NN to classify defects of machined metal parts, using the features extracted from fused multiple images acquired under different lighting conditions. The CNN model was also used in the work of Zhang et al.[START_REF] Zhang | Weld image deep learning-based on-line defects detection using convolutional neural networks for Al alloy in robotic arc welding[END_REF], to realize an online welding defects detection for Al alloy.

  images by exploiting deep learning to develop a model based on CNN. Later on, transfer learning will be performed since it represents a better approach. It avoids training a DL model from scratch, thus reducing training time, and only tunes the model weights previously saved in the first training.

Figure 12 :

 12 Figure 12: Architecture of QC system for smart manufacturing

Figure 13 :

 13 Figure 13: Coated rod specimens a) before, b) after manufacturing process

Figure 14 :

 14 Figure 14: Flowchart of the experimental study using CCI and machine learning algorithms for defect detection

Figure 15 :Chapter 2 :

 152 Figure 15: Experimental procedure to train and test a single ML classifier 2.2.3.2 Defect classification using CNN and TL A simple CNN model was used to perform binary classification of 309 images, Figure 16. This dataset is composed of images taken from 32 different surfaces (from 8 laser-machined specimens) using DeepView ® and MicroView ® with different configuration parameters. The training images were separated into two classes: defect and non-defect. All images were resized to 224*224 pixels to decrease their dimension and also to compare later on the performances of this model with a TL method using Mobilenet-v1 model, which is a model limited to be trained with images' size up to 224*224 pixels. For validation with completely new data, 28 different images taken with WV and OM were tested by the CNN model.

Figure 16 :

 16 Figure 16: Architecture of the CNN modelIn TL, the knowledge extracted from one or multiple models can be used for a new data learning. The learned model can be adjusted and retrained to improve its learning performance on the new target data even if this new data is not enough for a single training. Based on this, a TL model called mobilenet-v1[START_REF] Howard | MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications[END_REF] was employed in this work. The model is publicly available in the TensorFlow framework given by Google. Its architecture is based on CNN, and it is mostly used for object detection applications. Such applications do not require a significantly powerful calculation, and therefore can be embedded in mobiles or devices used for edge computing.

2. 3 . 1

 31 Measurements with OM, SEM and CCIIn Figure17are presented images of four different specimens, in which the major light-colored areas correspond to copper clean surface and the dark-colored ones (in b, c, and d) correspond to areas covered by residual isolation material. As observed in (a), copper is dominant while the black spots correspond to small holes on the surface. The pattern of some black spots and scratches are indicated in the measured pictures to evidence that the same region of the specimen is being analyzed by OM, SEM, and CCI. Despite the small black spots, specimen (a) will be classified in this work as non-defective, because the flaws to be identified/characterized are those related to residual isolation material, as exhibited in specimens (b), (c), and (d). In addition, by comparing the CCI images to OM and SEM, it can be seen that although some small black spots are not present in the CCI images, the area considered as "defect" (in red contour) is very clear in specimens (b), (c), and (d). Therefore, on can attest the capability of using CCI for such sub-millimeter surface defect detection.

Figure 17 :

 17 Figure 17: OM, SEM and CCI (DV) inspection of 4 surfaces, (a) surface without defect, and (b), (c), (d) surfaces with residual isolation material In Figure 17 (SEM) are also presented images taken with BSE-SEM from the same specimens that were inspected using OM. The defects found in Figure 17 (SEM b-d) are indicated with a red contour. To obtain more details, a region of interest (ROI) of the specimen (b) was further analyzed, and the results are presented in Figure 18.

Figure 18 :

 18 Figure 18: Analysis of chemical composition presented in the region of interest

Figure 19 :

 19 Figure 19: Series of 4 images of laser-machined coated rods showing different types of groove sets. a) Surface considered non-defective. b, c, d) Defects highlighted by dashed circles In Figure 20 are presented three different measurement results of the CCI at the location of the defect from specimen shown in Figure 19-b). Despite the image "c" from Figure 20 has shown better contrast compared to "a" and "b, the features and the geometrical textures of the defect region can still be detected by all the mentioned optical heads. The better contrast was achieved due to the highest axial resolution (i.e., low depth of field) of the MicroView® optical head.

Figure 20 : 3

 203 Figure 20: Same surface defect analyzed using three chromatic optical heads: a) DeepView®, b) WireView®, c) MicroView®

Figure 21 :

 21 Figure 21: Results of application of classifiers on images acquired by the optical head Deepview® (DV)

Figure 22 :

 22 Figure 22: Results of application of classifiers on images acquired by the optical head Wireview®

Figure 23 :

 23 Figure 23: Results of application of classifiers on images acquired by the optical head Microview® When comparing the results from three different ML algorithms, RF and MLP (with only two hidden layers) exhibited similar and rather poor segmentation performance, whereas DT algorithms exhibited the best segmentation of the residual carbon areas. For instance, among all results presented in Figures. 21, 22, and 23, the edges of the defect are more visible in images (2)WV,DT and (2)DV,DT if compared to images (2)WV,RF and (2)WV,MLP; (2)DV,RF and (2)DV,MLP respectively. It is worth to mention that these results are based on the pixels labeled before in the training stage.

  RAW -Mi croVi ew® Cl a ssified by DT Cl a ssified by RF Cl a ssified by MLP (1) MV (1) MV,DT (1) MV,RF (1) MV,MLP (2) MV (2) MV,DT (2) MV,RF (2) MV,MLP (3) MV (3) MV,DT (3) MV,RF (3) MV,MLP

Figure 24 :

 24 Figure 24: Accuracy of the classification model using DV images. a) Accuracy of Batch Size (BS) 10 and 30% of Validation Data (VD). b) BS=2, VD=30%. c) BS=10, VD=40%. d) BS=2, VD=40%

  is presented the accuracy of the model trained with two types of image database: a) images acquired with DeepView ® , b) images acquired with DeepView ® and MicroView ® optical heads. Although the training accuracy for a) and b) reached 100%, the most importantaccuracy result that should be concerned is the validation accuracy, which confirms that the model is not overfitting. The average validation accuracy over 500 epochs was 90.5% when using images from a single optical head (DV), and 89.2% when using images from MV and DV.

Figure 25 :

 25 Figure 25: Accuracy of the model as a function of epochs: a) using only DV images, b) using MV+DV images In Table 8 is shown the confusion matrix of the TL model (trained on DV + MV) applied to a new database composed of WV and OM images.

  is shown an example of DV image annotated by rectangles. The coordinates of the rectangles represent the edges of the masks, which serve as a training database.

Figure 26 :

 26 Figure 26: Example of defect labeling with a rectangle An image resizing has been imperatively implemented, because of limited available computational-processing capacity. Thus, the algorithm is configured not to exceed a certain dimension of matrix (also Tensor). The image dimension chosen to train the Mask-RCNN is 2048*2048 pixels. After the image resizing, the annotations have been done, and they are saved on a JSON file, which will be included in the training database. The training of the Mask-RCNN was executed with the help of two GPUs (Quadro M4000) and with the use of the weight matrix of the model already trained on images of COCO dataset. Two ResNet [110] (Residual Network) backbones (ResNet50 and ResNet101) were used in order to compare their detection results, knowing that the architecture of the ResNet50 is smaller than the ResNet101.

Figure 27 :

 27 Figure 27: Result of detected defect with rectangle labelingWith the results received after the application of the model on test images, it was concluded that with annotation by rectangles, the detected masks do not have a precise segmentation of the edges of the defects. The same behavior was present in other images, when a defect is surrounded by several masks. In other words, the algorithm detects several defects with different characteristics when in reality there is only one defect.

Figure 28 :

 28 Figure 28: (a) Example of polygon labeling, (b) Result of MaskRCNN detection with polygon labeling

4 .

 4 The classification using TL has shown better accuracy when compared to the simple CNN model especially in the database that contains images taken with two different optical heads. This can be explained by the fact that with the TL, the weights of the NN model are just tuned during the learning, whereas for the CNN model, the learning is done from scratch. The accuracy of the model depends on the quantity and variety of the validation data, and on the architecture of the NN.

Figure 30 :

 30 Figure 30: Architecture of the proposed scope of the workFigure30shows the scope of this chapter which concerns the integration of a CC sensor with a force senor inside a machine-tool. The CC sensor performs on-machine measurement of machined aluminum surfaces. The collected raw profiles served to extract the roughness parameters after post-processing was done using Mountains Map software. The chapter aims to build a dataset and train ML models capable of extracting the effect of each cutting parameter on the surface quality by combining the Ra values with corresponding cutting parameters and

(

  roughness depth (peak to valley) along lm RA : Arithmetic roughness average

2017A using a 20

 20 mm diameter milling cutter R217.69-1020.RE-12-2AN with two carbide inserts XOEX120408FR-E06 H15 from SECO, and a synthetic emulsion of water and Ecocool CS+ (~5%) cutting fluid. The experimental setup is presented in Figure 32 (a). The milling operations were performed in a star-shaped path, starting from outside and moving to the center of the disc as depicted in Figure 32(b). All cuts were performed in down milling mode.

Figure 32 :

 32 Figure 32: (a) Experimental setup inside DMG Gildemeister CTX beta 1250 tc, (b) a view of the milling process on Aluminum surface In total, five discs were used in this study. Each disc contains 25 cuts, which gives at the end 125 different combinations of cutting parameters that were employed in the set of experiments Table 9. The following cutting parameters were analyzed: cutting speed, feed rate, and cutting depth. Each disc was cut using one fixed value of cutting depth, and then the 25 surfaces resulted from the combination of 5*5 sets of cutting speed and feed rate. The value of cutting speed is fixed at first, and then five cuts are performed using five different feed rates.

Figure 33 :

 33 Figure 33: Aluminum surface milled by 20mm diameter cutting tool (2 teeth)

Figure 34 :

 34 Figure 34: Design of the working principle of a chromatic confocal sensor The chromatic confocal sensor utilizes a white light LED to illuminate the test sample surface. The light travels through the fiber optic into the objective, then scattered into a chromatic

Figure 35 :

 35 Figure 35: Schematic of the force components in a milling process

Figure 36 :

 36 Figure 36: Schematic of the cut areas related to each cut on Aluminum workpieces

Figure 37 :3-axis dynamometer Aluminum workpiece 3 . 3 . 4

 37334 Figure 37: (a) Design of the force sensor setup with the end mill cutter, (b) Real installation of the Kistler force sensor inside CNC machine

Figure 38 :Figure 39 :

 3839 Figure 38: (a) Image of the nickel standard (high roughness), (b) Glass standard (low roughness)

Chapter 3 : Roughness prediction 85 Figure 40 :

 38540 Figure 40: Architecture of the algorithm to get the final prediction of Ra3.4 Results and discussions3.4.1 Analysis of on-machine CC measurementsIn Figure41is presented the measured profiles of the nickel roughness standard.

Figure 41 :

 41 Figure 41: Superimposed CC and stylus profiles measured from the nickel roughness standard (on-machine)

Figure 42 :

 42 Figure 42: Superimposed CC and stylus profiles measured from the glass roughness standard (on-machine)

Figure 43 :

 43 Figure 43: Statistical measures of roughness parameters for (a) nickel standard, (b) glass standard.

Figure 44 and

 44 Figure 44 and Figure 45 shows 3D surface roughness topography of two surfaces with different roughness, i) high and ii) low roughness respectively. It can be seen that the three CC sensors (CL1, 2 and 3) provided similar 3D topographies for case i). The peaks and valleys are visible,

Figure 44 :Figure 45 :

 4445 Figure 44: 3D views surfaces from one Aluminum surface with high roughness. a) Measurement with CL1 sensor, b) with CL2, c) with CL3

Figure 47 :

 47 Figure 47: Circle of correlation based on the results from PCA reduced matrix 3.4.3 Effect of cutting parameters on the Ra Figure 48 presents the results of Ra as a function of feed rate, cutting speed, and cutting depth.

Figure 48 :

 48 Figure 48: Results of Ra [µm] measured on-machine with CL1 for surface milled Aluminum workpieces 3.4.4 Force analysis In Figure 49 are plotted the results of cutting forces Fa, Fz, Fa' (Fap), and Fz' (Fzp) as function of feed rate f, cutting speed and cutting depth (ap).

Figure 52 :

 52 Figure 52: Comparison of the predicted outputs from XGboost with the real values of Ra using cutting speed and feed rate.Due to the stochastic nature of NN training, the result of retraining the same network architecture with the same data split is different. In other words, it produces some fluctuations in the evaluation of the test data. Whereas for the ensemble algorithms, the results stay fixed if the hyperparameters are unchanged. For this reason, many versions of NN retraining were performed in order to calculate an overall average of MAE. Moreover, following the architecture depicted in Figure40, the FeatureTrain and FeatureTest used as inputs for ensemble models, and they change depending on the results of NN prediction. The hyperparameters used in the ensemble algorithms are as follows: the learning rate was set to 0.01; the n_estimators (number of regression trees) is 1000; and max_depth = 4, which represents the depth of the tree (the number of levels of nodes in the tree, from the root node until the last leaf node). Adaboost does not have a max_depth parameter, and the RF does not contain a learning rate.

Figure 53 shows

 53 Figure53shows the prediction results of three outputs from the XGboost model. The predictions of Ra are almost linear, whereas, for Rsk, some significant errors of prediction can be noticed. For positive values of Rsk, they are mostly well-predicted. However, the model exhibits higher error for negative values of Rsk. Concerning Rdq, the predictions are uniformly close to the linear trend.

Figure 53 :

 53 Figure 53: Prediction results from the XGBoost multiple outputFigure54shows a 3D visualization of the prediction from XGboost applied on an extracted set from test data with ap=0.1mm. The bluish rectangles in the plots, they are always over two points to define a pair of real and predicted roughness parameter. The error percentages presented in the plot are related to the absolute difference between the actual and predicted value of the roughness parameters. From Figure54, it is noticed that the predicted Ra are well fitted with the actual values, whereas, for the other roughness parameters Rsk and Rdq, there is a difference between the predictions and the actual outputs. It is due to the lack of a strong correlation between them and the cutting parameters as it was shown in Figure46. Probably with an immense database, the regression model would find a better correlation. However, for

Figure 54 :(

 54 Figure 54: 3D visualization of the predicted values in comparison to real values from the extracted test set where ap=0.1mm

Chapter 4 :

 4 Tool wear effect on roughness forecasting[START_REF] Niese | Application of a chromatic confocal measurement system as new approach for in-line wet film thickness determination in continuous oral film manufacturing processes[END_REF]

Chapter 4 :

 4 Tool wear effect on roughness forecasting[START_REF] Rueden | ImageJ2: ImageJ for the next generation of scientific image data[END_REF]

Figure 55 :

 55 Figure 55: On Top-right: Typical curve of the flank wear as a function of cutting time [137]. I) rapid initial wear phase, II) steady state phase, III) accelerating phase. Below: the inspected flank wear of a milling tool.

Chapter 4 :

 4 Tool wear effect on roughness forecasting[START_REF] He | Mask R-CNN[END_REF]

Chapter 4 :

 4 Tool wear effect on roughness forecasting[START_REF] Ren | Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks[END_REF]

Figure 56 :

 56 Figure 56: a) The experiment setup with titanium disc, chromatic confocal and the force sensor. b) The nine cutting condition used to machine the titanium workpieces

Figure 57 :

 57 Figure 57: Example of the measured flank wear on two inserts used to cut one disc Once the cutting experiments and measurements were finished, data post-processing and analyses were performed following similarly what was done in chapter3 for aluminum, but with the addition of the forecasting time series data.

Chapter 4 : Tool wear effect on roughness forecasting 109 Figure 58 :

 410958 Figure 58: (Left) percentages of Eigen values given by the PCA analysis, (Right) circle of correlation based on principal components from PCA Based on the circle of correlation, the first component that contains the most information quantity (25%) is composed by feed rate (f), MRR, active force (Fa), and cutting speed (vc).

  are as follows: vc = cutting speed [m/min] f = feed rate [m/min] T = total cutting time [s] Q = total cumulative machined volume [mm 3 ] MRR = material removal rate [mm 3 /s] VB = width of flank wear [mm]

Figure 59 :Chapter 4 :

 594 Figure 59: Correlation matrix between the cutting conditions, the measured forces, the tool wear, and the roughness parameters Figure 60 shows the results of prediction done by XGboost for three roughness parameters outputs: Ra, Rsk, and Rmr. Among them, the predictions for Ra are the closest to the real values.Whereas for Rsk and Rmr, an offset of the linear fitting is found on the graphs. This behavior can be explained by the fact that the values in the testing data exhibit lower dispersion for Ra when compared to Rsk and Rmr.

Figure 60 :

 60 Figure 60: XGBoost multiple output prediction results

Chapter 4 :

 4 Tool wear effect on roughness forecasting 112

Figure 61 :

 61 Figure 61: Progression of Ra throughout time with fixed cutting speed vc and for each feed rate f Figure 62 shows the progression of Ra and flank wear as function of the cutting time. As it can be noticed, no obvious correlation between Ra and VB can be concluded from the graphs.

Figure 62 :Chapter 4 :Figure 63 :

 62463 Figure 62: Progression of Ra vs tool wear during machining time of each surface In Figure 63 are presented the results of forecasting done via ARIMA model. The blue line, measured Ra over the cutting time, was used as training data. The green line also represents measured Ra, and it was used as testing data. The red line is the forecasting of ARIMA model applied on test data. As it can be noticed, the forecasted values do not follow the same pattern of the test data. This can be due the fact that the curves are not stationary, they do not exhibit a steady state since they do not have constant statistical properties over time such as mean, variance, autocorrelation, etc.

Chapter 4 :

 4 Tool wear effect on roughness forecasting[START_REF] Jiang | Precision Surface measurement[END_REF]

Figure 64 :

 64 Figure 64: Forecasting of Ra after converting the time series data to stationary state

Chapter 4 :

 4 Tool wear effect on roughness forecasting 117 time-consuming), the amount of data to train the model might have been not sufficient to generate a sufficiently accurate model. Using the ARIMA model showed that the model was capable of forecasting only the average of Ra

Figure 1 .

 1 Figure 1. Architecture of QC system for smart manufacturing.

  Hanbay et al 2016, Ferguson et al 2018, Wen et al 2018, Zhang et al 2019). The use of DL and parallel computing (with graphics processing units (GPUs)) has given excellent results on segmentation and classification of defects of high-resolution images with a CNN architecture designed with two networks: one for the segmentation and the other one for classification (Tabernik et al 2020). CNN has also been successfully employed for the detection of welding defects (Bacioiu et al 2019), and for online quality control (QC) of robotic arc welding of aluminum alloy parts (Zhang et al 2019).

Figure 2 .

 2 Figure 2. Schematic structure of DT, RF, and MLP algorithms.

Figure 3 .

 3 Figure 3. Coated rod specimens (a) before and (b) after manufacturing process.

Figure 4 .

 4 Figure 4. Flowchart of the experimental study using CCI and ML algorithms for defect detection.

Figure 5 .

 5 Figure 5. Experimental procedure to train and test a single ML classifier.

Figure 6 .

 6 Figure 6. Architecture of the CNN model.

Figure 7 .

 7 Figure 7. OM, SEM and CCI inspection of four surfaces, (a) surface without defect, and (b)-(d) surfaces with residual isolation material.

Figure 8 .

 8 Figure 8. Analysis of chemical composition presented in the ROI.

Figure 9 .

 9 Figure 9. Series of four images of laser-machined coated rods showing different types of groove sets. (a) Surface considered non-defective. (b)-(d) Defects highlighted by dashed circles.

Figure 10 .

 10 Figure 10. Same surface defect analyzed using three chromatic optical heads: (a) DV, (b) WV, and (c) MV.

Figure 11 .

 11 Figure 11. Results of application of classifiers on images acquired by the optical head DV.

Figure 12 .

 12 Figure 12. Results of application of classifiers on images acquired by the optical head WV.

Figure 13 .

 13 Figure 13. Results of application of classifiers on images acquired by the optical head MV.

Figure 14 .

 14 Figure 14. Accuracy of the classification model using DV images. (a) Accuracy of BS 10 and 30% of VD. (b) BS = 2 and VD = 30%. (c) BS = 10 and VD = 40%. (d) BS = 2 and VD = 40%.

Figure 15 .

 15 Figure 15. Accuracy of the model as a function of epochs: (a) using only DV images and (b) using MV + DV images.

[

  Laboratoire de recherche MSMP -Campus de Aix En Provence] THÈSE présentée par : Hassan CHOUHAD soutenue le : 31 Mars 2022 pour obtenir le grade de : Docteur d'HESAM Université préparée à : École Nationale Supérieure d'Arts et Métiers Spécialité : Procédés de fabrication -Génie mécanique (AM) Introduction L'industrie manufacturière joue un rôle important dans l'économie mondiale, elle représente 20% du PIB et est considérée comme la base de la richesse, même dans une économie orientée vers les services. Elle couvre la fabrication de diverses pièces ou produits, allant de produits de faible qualité à des produits de haute précision. Quel que soit le type de pièce fabriquée, il existe toujours un risque de défauts et de non-conformité liés à la fabrication. Parmi les différents critères de qualité des pièces, la qualité des surfaces fabriquées représente un aspect très important à contrôler. Pour les procédés de fabrication basés sur l'enlèvement de matière, la surface générée contiendra la signature de l'opération de fabrication qui est représentée par sa topographie. En outre, la génération de défauts tels que des rayures, des piqûres, des saillies et des taches, peut également se produire au cours d'un processus de fabrication, Figure 1.

Figure 1 :

 1 Figure 1: Représentation des aspects de la qualité de surface dans un processus de fabricationCes deux aspects, la topographie de la surface et les défauts, sont décisifs pour déterminer la qualité d'une surface fabriquée. Pour éviter d'avoir des pièces fabriquées avec une qualité de surface inacceptable, les lignes de production disposent généralement de systèmes de contrôle de la qualité (CQ). Et malgré l'émergence de la numérisation globale de l'industrie et l'application d'algorithmes d'IA pour soutenir différents domaines de la technologie, les méthodes d'inspection manuelle des surfaces sont encore largement exécutées par les inspecteurs de la qualité sur les lignes de production. Même si cette métrologie dite "de sanction" présente des inconvénients tels que : une faible efficacité, une forte intensité de travail, une faible précision, une faible performance en temps réel, un risque non négligeable de pièces hors tolérance qui doivent être mises au rebut, et l'incapacité de satisfaire les normes de qualité en constante augmentation de l'industrie manufacturière.

  Pour l'approche des défauts, un système de vision par ordinateur basé sur une caméra confocale chromatique (CC) à haute résolution a été utilisé pour analyser les défauts sur la surface de barres de cuivre usinées au laser. Comme il est difficile dans l'industrie de disposer d'une base de données massive d'images à haute résolution de différents types de défauts pour une même pièce donnée, il est proposé dans ce travail d'entraîner les modèles d'IA en utilisant des données intelligentes plutôt que des données volumineuses. A la différence des big data, les smart data sont considérées ici comme un ensemble limité d'images qui contiennent les types de défauts les plus pertinents et permettent au modèle d'avoir une généralisation raisonnable. L'approche de l'IA consiste d'abord à effectuer une segmentation des défauts en extrayant les caractéristiques des images à l'aide d'un détecteur de bords, puis en appliquant la segmentation à l'aide de trois algorithmes différents d'apprentissage automatique (ML) : Arbres de décision (DT), Random Forest (RF), et Perceptron multicouche. Ensuite, pour la classification des défauts, un modèle de réseau neuronal convolutif (CNN) est testé, ainsi que l'apprentissage par transfert (TL) en réapprenant un modèle basé sur le CNN à l'aide d'un ensemble de données nettement plus petit. Enfin, le MaskRCNN est testé pour la localisation des défauts.

Figure 2 :

 2 Figure 2: Différents types de métrologie dans une usine de fabrication.

Figure 3 : 1 . 6 1 . 6 . 1 de décision 1 . 6 . 1 . 1

 3161611611 Figure 3: La plupart des paramètres qui influencent la rugositéLa prédiction de la rugosité de surface des pièces usinées se fait cependant en modélisant le comportement physique du processus de fabrication, ce qui permet d'établir la corrélation entre

  Les spécimens étudiés dans cette étude ont des surfaces désignées comme non défectueuses ou défectueuses sur la base d'une discrimination très fine de la norme de qualité de la ligne de production. Une représentation schématique de la section usinée au laser montrant l'effet de la polarisation du faisceau sur la forme de la rainure est présentée à la Figure5. Chaque spécimen a au total 4 surfaces qui peuvent être mesurées en utilisant différentes méthodes d'acquisition d'images.

Figure 5 : 2 . 3 . 1

 5231 Figure 5: Échantillons de tige revêtus a) avant, b) après le processus de fabrication.

Figure 6 :

 6 Figure 6: Organigramme de l'étude expérimentale utilisant l'ICC et les algorithmes d'apprentissage automatique pour la détection des défauts. 2.3.2 RF, MLP, and DT La Figure 7 présente la procédure d'apprentissage et de test de chaque modèle de segmentation par apprentissage automatique. Tout d'abord, une image est acquise à partir d'un spécimen présentant un défaut évident, puis utilisée pour entraîner chaque classificateur (modèle) proposé. L'entraînement commence par l'étiquetage d'une région défectueuse (surlignée en jaune) et d'une région non défectueuse (surlignée en bleu) de l'image. Ensuite, les caractéristiques sont extraites de l'image d'entraînement à l'aide d'un filtre de détection des bords disponible dans le plugin de segmentation de Weka : le filtre de Sobel. Parmi plusieurs filtres d'extraction disponibles dans le plugin Weka, le filtre de Sobel a été sélectionné, car au

Figure 7 :

 7 Figure 7: Procédure expérimentale pour former et tester un seul classificateur ML

Figure 8 :

 8 Figure 8: Temps de traitement moyen pour former et tester un classificateur ML Dans la Figure 10 sont présentées les courbes de précision du modèle CNN sur 500 époques. En les comparant, le modèle formé avec des images DV (Figure 10) a montré une précision des données de validation qui est proche de la précision d'entrainement. La meilleure précision moyenne est égale à 98,7% comme le montre le Tableau 1. Par conséquent, on suppose que le modèle est sur-ajusté sur ce type d'ensemble de données. Sur la base de cette hypothèse, le même modèle a été entraîné sur des images de DV+MV.

Computer Details: Xeon® CPU E5-1650 3 . 5

 35 GHz, 64 GB of RAM. GPU Quadro M4000 * Measurement uncertainty has a confidence interval of 95%. Les précisions résultantes des données de validation liées au modèle entraîné avec le jeu de données DV+MV ont montré une diminution pour tous les paramètres de données (Tableau 1) par rapport aux précisions résultantes du modèle entraîné avec le jeu de données DV. Cela peut s'expliquer par le fait que la quantité d'images MV n'est pas égale à la quantité d'images DV.

Figure 10 :

 10 Figure 10: Précision du modèle de classification utilisant des images DV. a) Précision de la taille de lot (BS) 10 et 30% des données de validation (VD). b) BS=2, VD=30%. c) BS=10, VD=40%. d) BS=2, VD=40%.

  trouvée. Pour combler cette lacune de la recherche, ce chapitre vise à construire la base d'un processus d'usinage intelligent capable de prédire la qualité de surface et, sur la base d'un algorithme d'IA robuste et précis, d'agir en conséquence pour corriger le processus d'usinage, évitant ainsi la mise au rebut de la pièce. Pour cela, ce travail utilise des mesures sur la machine à l'aide d'un capteur CC (au lieu d'un profilomètre à contact), puis combine les données mesurées par des capteurs embarqués, pour construire un modèle de prédiction efficace basé sur les données. L'objectif principal est de surveiller la qualité de surface des pièces usinées en utilisant des capteurs embarqués dans la machine-outil, combinés à la méthode d'apprentissage automatique adéquate avec de hautes performances.La Figure12montre la portée de ce chapitre qui concerne l'intégration d'un capteur CC avec un capteur de force dans une machine-outil. Le capteur CC effectue des mesures sur machine de surfaces en aluminium usinées. Les profils bruts collectés ont servi à extraire les paramètres de rugosité après un post-traitement effectué à l'aide du logiciel Mountains Map. Ce chapitre vise à construire un ensemble de données et à entraîner des modèles ML capables d'extraire l'effet de chaque paramètre de coupe sur la qualité de la surface en combinant les valeurs Ra avec les paramètres de coupe correspondants et les composantes de la force. Ensuite, le modèle déployé assurera la prédiction de Ra de la surface qui doit être fabriquée, en connaissant seulement les paramètres de coupe. Ce faisant, le réglage optimal de ces derniers permettra à la machine de fabriquer une pièce avec la qualité de surface souhaitée, telle que définie dans le cahier des charges.

Figure 12 : 3 . 3 et méthodes 3 . 3 . 1 Figure 13 :

 123333113 Figure 12: Architecture de la portée du travail proposé 3.3 Matériel et méthodes 3.3.1 Configuration expérimentale L'approche de ce travail de recherche est basée sur la validation du concept d'intégration d'un capteur sans contact dans une machine-outil CNC. La mesure de la topographie de la surface après l'usinage, puis l'utilisation des données générées pour étudier différentes méthodes de ML et pour comprendre la corrélation entre les variables liées au processus et les paramètres de rugosité obtenus. En ce qui concerne l'usinage, une série d'opérations de fraisage de surface a été réalisée sur l'aluminium 2017A à l'aide d'une fraise de 20 mm de diamètre R217.69-1020.RE-12-2AN avec deux plaquettes en carbure XOEX120408FR-E06 H15 de SECO, et une émulsion synthétique d'eau et de fluide de coupe Ecocool CS+ (~5%). Le montage expérimental est présenté à la Figure 13 (a). Les opérations de fraisage ont été effectuées selon une trajectoire en étoile, en commençant par l'extérieur et en se déplaçant vers le centre du disque, comme le montre la Figure 13 (b). Toutes les coupes ont été effectuées en mode de fraisage vers le bas.

Figure 14 :

 14 Figure 14: Surface d'aluminium fraisée par un outil de coupe de 20 mm de diamètre (2 dents) Trois capteurs confocaux chromatiques commerciaux (STIL, Marposs Group, France) ont été utilisés pour développer un système de mesure de la rugosité sur machine. Chacun de ces capteurs a été intégré à l'intérieur d'un centre d'usinage 5 axes DMG CTX gamma1250TC

Figure 15 :

 15 Figure 15: (a) Image de l'étalon en nickel (forte rugosité), (b) étalon en verre (faible rugosité).

  Afin de construire les modèles. Tout d'abord, les données originales sont divisées en trois parties : la première est utilisée pour l'entraînement, la seconde pour la validation et la dernière pour tester et évaluer les prédictions du modèle. L'algorithme ANN a d'abord été entraîné en utilisant les données d'entraînement et de validation. Ensuite, le modèle obtenu a été appliqué aux données d'entrainement et de test pour obtenir de nouvelles caractéristiques, respectivement : caractéristiques d'entrainement et caractéristiques de test. Ensuite, ces nouveaux vecteurs de données ont été utilisés pour former et tester les trois algorithmes de boosting afin d'obtenir la prédiction finale de Ra. Cette approche vise à obtenir des prédictions meilleures et rapides en combinant la sortie prédite de l'algorithme NN aux méthodes d'ensemble qui amélioreront à nouveau les prédictions en formant de nombreux modèles faibles. L'application d'une méthode d'ensemble présente l'avantage d'améliorer les performances du modèle de base en formant de nombreux modèles faibles et en obtenant le meilleur modèle avec l'erreur la plus faible. Trois algorithmes d'ensemble sont étudiés dans ce travail, et leurs résultats sont comparés à un réseau neuronal artificiel (ANN).

3. 4

 4 Résultats et discussions3.4.1 Analyse des mesures de CC sur la machineLa Figure16présente les profils mesurés de l'étalon de rugosité en nickel.

Figure 16 :

 16 Figure 16: Profils superposés du CC et du stylet mesurés à partir de l'étalon de rugosité en nickel (sur machine). Le profil du profilomètre tactile est similaire à celui mesuré sur la machine avec le capteur CC CL1. Et selon le tableau 10, les capteurs CC ont des spécifications différentes. Par exemple, la résolution latérale et l'ouverture numérique ont un impact significatif sur le profil final mesuré.Parmi les 3 capteurs CC, le CL1 est celui qui présente la plus faible résolution latérale, soit 1,1 µm de distance entre deux points de surface. Pour obtenir une résolution latérale aussi faible, ce capteur doit être plus proche de la surface que les autres capteurs. En outre, plus l'ouverture numérique est élevée, plus la pente maximale de la surface que le capteur est capable de mesurer est importante. C'est pourquoi les profils de CL2 et CL3 sont moins proches d'un sinus parfait que ceux de CL1 et du profilomètre tactile (Figure16). Les résultats des mesures de la norme de rugosité du verre sont présentés dans la Figure17.

Figure 17 :

 17 Figure 17: Profils superposés du CC et du stylet mesurés à partir de l'étalon de rugosité du verre (sur la machine). Le profil mesuré par le profilomètre à stylet et CL1 sont significativement similaires. Alors que CL3 et CL2 présentent quelques pics supplémentaires dus aux limitations physiques des capteurs CC, qui sont liées à l'objectif du capteur. Par exemple, la disposition des lentilles pour contrôler l'effet appelé aberration chromatique est différente, ce qui génère éventuellement des artefacts optiques selon la topographie de la surface.

Figure 19 :

 19 Figure 19: Résultats des prédictions du réseau neuronal (appliqué sur les entrées originales) et XGBoost (appliqué sur les caractéristiques extraites).En raison de la nature stochastique de l'apprentissage des réseaux neuronaux, le résultat du réentraînement de la même architecture de réseau avec la même répartition des données est différent. En d'autres termes, cela produit certaines fluctuations dans l'évaluation des données de test. Alors que pour les algorithmes d'ensemble, les résultats restent fixes si les hyperparamètres sont inchangés. Pour cette raison, de nombreuses versions de réentraînement de NN ont été effectuées afin de calculer une moyenne globale de MAE. Les prédictions données par NN sont utilisées comme entrées pour les modèles d'ensemble, et ils changent en fonction des résultats de la prédiction NN. Les hyperparamètres utilisés dans les algorithmes d'ensemble sont les suivants : le taux d'apprentissage a été fixé à 0,01 ; le n_estimateurs (nombre d'arbres de régression) est de 1000 ; et max_depth = 4, qui représente la profondeur de l'arbre (le nombre de niveaux de noeuds dans l'arbre, du noeud racine jusqu'au dernier noeud feuille).

  Une série d'expériences de fraisage de surface a été réalisée en utilisant neuf conditions de coupe différentes. Pour chaque condition de coupe, une nouvelle paire de plaquettes en carbure a été installée sur la fraise, et la pièce a été coupée jusqu'à ce que l'usure du flanc de l'outil atteigne une valeur finale. Pendant les expériences de fraisage, pour chaque période de temps prédéfinie, la coupe a été arrêtée, et les plaquettes ont été prises pour être analysées au microscope OLYMPUS BX41M pour mesurer l'usure de l'outil. En fonction de la vitesse de coupe et de l'avance, certaines expériences ont pris beaucoup plus de temps que d'autres. Par exemple, le temps effectif nécessaire pour atteindre VB=1[mm] pour vc=60[m/min] et f=0.3[mm/rot] était de l'ordre de 5 min de coupe (sans considérer le temps de mesure de la rugosité de surface, la mesure de l'usure de l'outil et le réglage de la machine). D'autre part, le temps effectif nécessaire pour atteindre le même état d'usure, mais en utilisant vc=30 [m/min] et f=0,1 [mm/rot], a été estimé à environ 20 heures. En raison de cette différence significative dans le temps de coupe, l'usure finale du flanc VB atteinte pour chaque condition de coupe est différente (voir Figure 20-b)). Les opérations de fraisage de surface ont été effectuées sur le TiAl6V en utilisant une fraise de 20 mm de diamètre R217.69-1020.RE-12-2AN avec deux plaquettes XOMX10T308TR-ME07 MS2500 de SECO, et une émulsion synthétique d'eau et de fluide de coupe Ecocool CS+ (~5%). Le montage expérimental est présenté à la Figure 20-a). Les opérations de fraisage ont été effectuées selon une trajectoire en étoile, en partant de l'extérieur et en se déplaçant vers le centre du disque, comme le montre la Figure 14 (au lieu de 25 coupes, 26 coupes ont été effectuées par surface). Toutes les coupes ont été effectuées en mode de fraisage vers le bas.

Figure 20 :

 20 Figure 20: a) Le montage expérimental avec le disque en titane, le confocal chromatique et le capteur de force. b) Les neuf conditions de coupe utilisées pour usiner les pièces en titane. Les forces ont été mesurées pendant l'usinage, et l'interface d'acquisition de Labview a été utilisée pour collecter les données. Par la suite, le post-traitement a été effectué à l'aide d'un code MATLAB afin de ne considérer que les forces dans les 15 premiers mm de coupe, ce qui correspond à la même surface sur laquelle la rugosité sera mesurée.

  la moyenne des paramètres de rugosité qui composent un ensemble de données avec l'usure et les forces de coupe. Ensuite, l'ensemble de données final a été utilisé pour former un modèle de prédiction de la rugosité avec une régression à sorties multiples, et pour effectuer une prévision de série temporelle.Pour la méthode suivie dans ce chapitre, nous appliquerons une méthode similaire à celle utilisée dans le chapitre 3 pour l'aluminium, en ajoutant les données de la série chronologique de prévision.Le jeu de données avec les paramètres de coupe (vc, f, ap), le temps, le MRR, les composantes de la force, les paramètres de rugosité donnés par le logiciel MoutainsMap, et la largeur d'usure des flancs a été organisé, pour les tâches suivantes :4.3 RésultatsLa Figure21montre les résultats de la prédiction effectuée par XGboost pour trois paramètres de rugosité : Ra, Rsk et Rmr. Parmi eux, les prédictions pour Ra sont les plus proches des valeurs réelles. Alors que pour Rsk et Rmr, un décalage de l'ajustement linéaire est trouvé sur les graphiques. Ce comportement peut être expliqué par le fait que les valeurs dans les données de test présentent une dispersion plus faible pour Ra par rapport à Rsk et Rmr.

Figure 21 :

 21 Figure 21: Résultats de la prédiction de sorties multiples XGBoost

  données d'apprentissage, et des hyper paramètres d'algorithmes qui doivent être ajustés afin d'améliorer leurs performances. Pour l'usinage des pièces en titane, seulement neuf conditions de coupe ont été appliquées pour couper pendant 5 à 8000 min selon la condition de coupe. De cette façon, l'usure de l'outil, les forces et la rugosité de surface ont changé au fil du temps. Par conséquent, il est raisonnable d'utiliser des modèles de prévision de séries temporelles afin de prédire les valeurs futures de la qualité de surface pendant l'usinage.La Figure22montre l'évolution de Ra pendant le fraisage de surface du titane. Le temps de chaque Ra mesuré est équivalent au temps pris pour couper une ligne (Figure14). Pour toutes les vitesses de coupe testées (30, 45 et 60 m/min), Ra fluctue entre 0,1 et 0,5 µm. En outre, au début des expériences de coupe, Ra commence avec des valeurs plutôt élevées, puis il diminue jusqu'à se stabiliser. Comme la géométrie de l'arête de coupe de l'outil change en s'usant, la formation de copeaux peut changer, ainsi que les forces impliquées dans le processus d'usinage, ce qui peut conduire à une dynamique de processus différente (vibration).

Figure 22 :

 22 Figure 22: Progression de Ra au cours du temps avec une vitesse de coupe fixe vc et pour chaque vitesse d'avance f. La Figure 23 montre la progression de Ra et de l'usure du flanc en fonction du temps de coupe. Comme on peut le remarquer, aucune corrélation évidente entre Ra et VB ne peut être conclue à partir des graphiques.

Figure 23 :

 23 Figure 23: Progression de Ra en fonction de l'usure de l'outil pendant le temps d'usinage de chaque surface. Dans la Figure 24-(a) sont présentés les résultats de la prévision faite via le modèle ARIMA. La ligne bleue, qui représente le Ra mesuré pendant le temps de coupe, a été utilisée comme donnée d'apprentissage. La ligne verte représente également le Ra mesuré, et elle a été utilisée comme donnée de test. La ligne rouge représente la prévision du modèle ARIMA appliquée aux données de test. Comme on peut le remarquer, les valeurs prévues ne suivent pas le même modèle que les données de test. Cela peut être dû au fait que les courbes ne sont pas stationnaires, elles ne présentent pas un état stable puisqu'elles n'ont pas de propriétés statistiques constantes dans le temps telles que la moyenne, la variance, l'autocorrélation, etc.

Figure 24 :

 24 Figure 24: Prévision de Ra à l'aide du modèle ARIMA classique, (a) sur les courbes brut, (b) après conversion en état stationnaire (a) (b)

4. 4

 4 ConclusionsL'étude réalisée sur le titane a permis d'étudier la progression de l'usure de l'outil lors du fraisage avec des conditions de coupe fixes. De plus, les forces ont été mesurées pendant les expériences de coupe, et les profils de surface ont été mesurés sur la machine. Toutes ces informations ont été combinées dans un ensemble de données qui a permis d'analyser la corrélation entre les paramètres de coupe, les forces, l'usure et la rugosité de surface. Il a été conclu que l'usure est fortement corrélée avec la force de coupe, la vitesse d'avance et le MRR. En utilisant l'ensemble de données, des modèles de régression ont été construits. Ils ont bien prédit Ra, alors que pour Rsk et Rmr, ils ont montré une performance plus faible. Avec le temps de coupe dans l'ensemble de données, des modèles de prévision de séries temporelles ont été construits, et la prévision de Ra a été effectuée pour chaque condition de coupe. La limite de l'approche présentée est qu'elle ne doit être appliquée qu'à une seule condition de coupe fixe. Et comme une seule courbe d'usure d'outil par condition de coupe a été générée expérimentalement (les expériences d'usure prennent beaucoup de temps), la quantité de données pour entraîner le modèle pourrait ne pas être suffisante pour générer un modèle suffisamment précis. L'utilisation du modèle ARIMA a montré que le modèle était capable de prévoir uniquement la moyenne de Ra.ConclusionsCe travail a proposé de construire la base d'un système proactif de contrôle de surface. Un tel système nécessitera des capteurs intégrés qui peuvent donner des informations précieuses sur le comportement physique derrière le processus de fabrication. Par l'application d'un CQ proactif, le contrôle métrologique de sanction peut être évité, ainsi que la fabrication dite "zéro défaut" commencera à devenir réalité. Par la mise en oeuvre de modèles embarqués pilotés par les données, capables d'apprendre à partir de données historiques, les décisions seront prises de manière autonome par le système.Dans cette thèse, le contrôle de la qualité des surfaces fabriquées a été divisé en deux aspects principaux : la détection des défauts de surface et la rugosité de surface. L'étude menée dans cette thèse montre que la classification des défauts peut être faite en utilisant un modèle donné par apprentissage de transfert qui a été entraîné sur des données intelligentes composées de défauts typiques générés par un processus d'usinage laser. Les défauts ont été caractérisés à l'aide du système CCI de la société STIL S.A. Le modèle d'apprentissage par transfert a montré une grande précision et un temps de traitement assez faible, ce qui est obligatoire pour une future mise en oeuvre dans des systèmes embarqués à faible capacité de traitement.La deuxième étude, qui concerne la prédiction de la rugosité de surface basée sur les paramètres et les forces de coupe, montre que la mesure de la rugosité de surface à l'aide de capteurs CC sans contact peut être effectuée sur la machine. L'étude réalisée à l'aide d'étalons de rugosité sur machine et ex-situ fournit des informations sur les erreurs attendues pour chaque combinaison de capteur, de vitesse de balayage et de topographie de surface à mesurer. Ensuite, pour prouver le concept de prédiction de la qualité de la surface en utilisant des modèles ML basés sur des données mesurées par des capteurs à l'intérieur d'une machine-outil, une analyse des performances des algorithmes de régression a été menée. Deux types d'algorithmes ML ont été comparés : un algorithme basé sur NN, et des méthodes d'ensemble. Il est conclu que l'algorithme basé sur le Gradient Boosting est plus performant pour la prédiction d'une sortie et également pour des sorties multiples. En outre, de faibles erreurs de prédiction MAE ont été trouvées lors de la prédiction de Ra. En revanche, pour les autres paramètres de rugosité, les erreurs sont élevées par rapport aux erreurs de prédiction de Ra, ce qui est dû à la gamme déséquilibrée de valeurs.

Table of contents ................................................................................................................... i iii

Table 16 :

 16 Results of the ensemble methods for multiple output prediction, applied on a fixed test data. ............

Table 17 :

 17 Evaluation using MAE and RMSE applied on testing data with unscaled three outputs ...................

Table 18 :

 18 Evaluation of MAE and RMSE on test data with normalized outputs ..............................................

	vii

Table 1 :

 1 Summary of literature review on AI-based surface roughness prediction for milling

		Input parameters	Output	Algorithms	device Measurement	Limitations
	[35]	V(r/min), f (mm/min), ae + features of PCA from vibration signals	Ra	Standard_SBLR VS ANN, PLS, SVR Using root mean squared error RMSE	Mitutoyo SJ-210 (contact-type profilometer)	Data with high dimension. Two stage model Hard to be deployed
						Usage of
		V(m/min),		LSSVM vs SVM and	MArsurf GD25	optimization
	[29]	f(mm/tooth), ap, ae,	Ra	RSM	(contact-type	algorithm to search
		VB		Using RMSE and R²	profilometer)	for the best hyper
						parameters
	[41]	Dynamic cutting forces (dimension reduced with PCA)	Ra	MLR, GRNN (generalized regression NN) Using MAPE	Mitutoyo SJ-410 (contact-type profilometer)	GRNN has a stochastic nature and it was just evaluated
	[42]	SS (rpm),f(mm/min),a, vapr	Ra (classification)	KBDBN, Accuracy	Measured off-line (contact-type profilometer)	Operator has to define the range of the Ra for a classification
	[34]	Speed(min-1), f (mm/min), ap (mm), vib(uV)	Ra	BP, RBF networks Using MSE	(contact-type profilometer)	RBF is limited to one hidden layer. BP network are
						stochastic not
						stable.
	[43]	S(rpm), f(mm/tooth),	Ra, Rz, MRR,	Kriging model vs	Mitutoyo SJ-301	The need to
		ap, nose radius,	SCE(N/mm²)	RSM	(contact-type profilometer)	determine the correlation factors

1.6.2 Decision algorithms 1.6.2.1 Machine Learning (ML)

1.6.2.2 Classification algorithms 1.6.2.2.1 Decision trees (DT)

					Fraud Detection	Image Classification
	Structure Discovery	Feature Extraction	Classification	Customer Retention
	Meaningfull				Supervised	Diagnostics
	Compression	Dimentionality	Learning	Forecastings
	Big data Visualisation Recommandation systems	UnSupervised Learning Reduction Clustering	Regression optimization Predictions Process
	Targetted
	Marketing			Real-Time Decisions
		Customer Segmentation	Reinforcement	Robot Navigation
					Learning	Skill Acquisition
					Game AI	Learning Tasks

1.6.2.2.2 Random Forest (RF)

  Table 2 using the eq.6:

			True Class
			Positive Negative
	Predicted	Positive	TP	FP
	Class	Negative	FN	TN

Table 2 :

 2 Confusion matrix for a binary classification problem with two targets

	𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦 =	𝑇𝑃 + 𝑇𝑁 𝐹𝑃 + 𝐹𝑁 + 𝑇𝑁 + 𝑇𝑃	(6)

1.6.2.3.2 Gradient Boosting

	root of the difference between real value and predicted value divided by two) with the updated
	weights. The algorithm starts by an initial guess 𝑭 𝟎 (𝒙)
		𝑵
	𝑭 𝟎 (𝒙) = 𝒂𝒓𝒈𝒎𝒊𝒏 𝝆 ∑ 𝑳(𝒚 𝒊 , 𝝆)	(12)
		𝒊=𝟏
	Original labeled data	Weak classifier 1	Increasing weight
			Increasing weight
	Weak classifier 2
	Weak classifier t
		Final classifier is the combination of all weak
		classifiers
	Gradient boosting [72] is an algorithm used for either classification or regression. The main
	goal of this algorithm is to minimize the gradient loss by correcting the errors made by the prior
	trained models. Then an additive model has to minimize the differentiable loss L (the square

1.6.2.3.3 Random Forest (RF)

1.6.2.3.4 Artificial Neural Network

	Artificial neural network (ANN) is an algorithm based on the biological design of a human
	brain, which consists of neurons and synapses. The algorithm can extract knowledge from data
	using the fully interconnected neurons that apply a mapping function. It has been used for
	various applications due to its high performance on resolving non-linear complex problems,
	such as in voice recognition, word embedding, and others. In supervised learning, where the
	target is already known, the goal of ANN is to predict the target values with a minimum error
	by finding a function 𝑓 * that can map the inputs to the target, equation (16). Therefore, the
	neural network learns the matrix of the weights w in 𝒚 = 𝒇(𝒙, 𝒘) that gives the best
	approximation function. The learning process is iteratively done with a trial and error
	procedure; in each iteration, the loss function (the difference between the real target values and
	the predicted values) is calculated. Adjustment of the weights that minimizes this loss function
	is done by calculating the gradient, which is performed by an optimization using the gradient
	descent.
	𝑦 𝑗 = 𝑓 * (𝑥) = ∑ 𝑤 𝑖𝑗 . 𝑥 𝑖 + 𝑏𝑖𝑎𝑠 𝑖

1.6.2.4 Deep learning (DL)

	Hidden Layer networks, named later as DL, have attracted attention not only from researchers in AI fields but
	h1 also from other scientific areas such as manufacturing, health, and economics. Its name comes Input Layer
	from the fact that the NN models may contain several layers, and each one can extract specific Feed X1 Rate knowledge from the data. The results obtained from each layer are combined to form the output
	h2 result [75]. So far, DL algorithms have given good results in speech recognition, facial
	X2 recognition, and object detection application. Cutting Speed
	h3 NN can be used to avoid the traditional feature extraction done by additional algorithms. The Output Layer
	X3 hidden layers work as a feature extractor with one deep neural network architecture. Thus, it Cutting Depth Ra h4 can learn the hidden patterns directly from the raw data. Deep belief networks and autoencoders
	are some examples of architectures for feature extraction.
	F z	X4
		h5
	F a	X5
		h6
	DL is a subfield of ML, based exclusively on the neural network algorithm. The term "deep"
	signifies that the learning is applied using many stages of hidden layers. Whereas, in a simple
	neural network, learning is done using only one hidden layer. Models based on artificial neural

1.

6.2.4.1 Convolutional neural networks (CNN

	When it comes to object recognition, CNNs are the most used algorithms for applications based
	on images. Each layer in the network can individually execute a particular function. By doing
	so, features are extracted from the input image (e.g., edges, corners, lines, and curves),

1.6.2.4.3 Recurrent neural network (RNN):

Table 3 :

 3 Characteristics of the chromatic confocal optical heads

  . Each classifier was applied 10 times for both the training and test phase, so the average processing time could be calculated.

		Training [ms] *		Test [ms] *
	RF	10080 ± 50	DV	1665 ± 50
			WV	1700 ± 50
			MV	1742 ± 50
	MLP	1855 ± 50	DV	485 ± 50
			WV	479 ± 50
			MV	479 ± 50
	DT	250 ± 50	DV	268 ± 50
			WV	265 ± 50
			MV	258 ± 50

Table 4 :

 4

	Layer (type)	Output Shape	Parameters
	conv2d (Conv2D)	(None, 222, 222, 32)	320
	activation (Activation)	(None, 222, 222, 32)
	max_pooling2d(MaxPooling2D)	(None, 111, 111, 32)
	conv2d_1 (Conv2D)	(None, 109, 109, 64)	18496
	activation_1 (Activation)	(None, 109, 109, 64)
	max_pooling2d_1(MaxPooling2)	(None, 54, 54, 64)
	conv2d_2 (Conv2D)	(None, 52, 52, 128)	73856
	activation_2 (Activation)	(None, 52, 52, 128)
	max_pooling2d_2(MaxPooling2)	(None, 26, 26, 128)
	dropout (Dropout)	(None, 26, 26, 128)
	flatten (Flatten)	(None, 86528)
	dense (Dense)	(None, 128)	11075712
	activation_3 (Activation)	(None, 128)
	dropout_1 (Dropout)	(None, 128)
	dense_1 (Dense)	(None, 2)	258
	activation_4 (Activation)	(None, 2)

Average processing time to train and test a ML classifier

2.3.4 Defect classification with CNN

The resulting architecture of the CNN model is summarized in Table

5

. The CNN has in total 16 hidden layers. The training of the model was performed using two datasets: images acquired with DeepView ® sensor, and images taken with DV+MicroView ® . Four different parameters were used for each training dataset: batch sizes of 10 and 2, and percentage of the validation data of 30% and 40%. Computer Details: Xeon® CPU E5-1650 3.5 GHz, 64 GB of RAM. GPU Quadro M4000 * Measurement uncertainty has a confidence interval of 95%.

Table 5 :

 5 Properties of the CNN model architecture

Table 7 :

 7 Confusion matrix of the classification models ran on two data sets

		Model accuracy with DV dataset	Model accuracy with DV+MV dataset
	Validation data	Batch 10	Batch 2	Batch 10	Batch 2
	30%	95,9%	94,3%	82,4%	74,7%
	40%	98,7%	97,1%	84,9%	73,2%

Based on the results presented in Table

6 and Table 7

, the best model was the one trained on DV images using 40% of validation data and with a batch size equal to 10.

Table 6 :

 6 Accuracies of the validation data with different data settings

	TP: True Positive (defect)	PP: Predicted positive	Average accuracy: accuracy of 5 test runs

TN:

True Negative (no-defect) PN: Predicted Negative

Table 8 :

 8 Confusion matrix of the TL model trained on DV+MV images

Table 9 :

 9 The machined Aluminum discs with the applied cutting parameters

	Alu disc # Cutting speed [m/min]	Feed rate per tooth [mm/rot]	Cutting depth [mm]
	1	250, 350, 400, 600, 800	0.15; 0.25; 0.45; 0.65; 0.85	0.1
	2	100, 300, 500, 700, 900	0.1; 0.2; 0.4; 0.6; 0.8	0.5
	3	250, 350, 400, 600, 800	0.15; 0.25; 0.45; 0.65; 0.85	1
	4	250, 350, 400, 600, 800	0.15; 0.25; 0.45; 0.65; 0.85	2
	5	250, 350, 400, 600, 800	0.15; 0.25; 0.45; 0.65; 0.85	3

Table 10 :

 10 Characteristics of three different point sensors

Ra Error % (ref: nominal)

						Low roughness standard
	Nominal CL3	CL2	CL1	Stylus	Nominal	CL3	CL2	CL1	Stylus
	Ra [			Ra [µm]	0.866	0.8967	0.9314 0.9222 0.9365
				Rz [µm]	2.064	2.78	2.933	2.31	2.108
				RSm [µm]	79.978	76.13	80.24	79.74	78.46
				λs [µm] λc [mm]	-0.8	2.5 0.8	2.5 0.8	2.5 0.8	2.5 0.8
				Evaluation length [mm]	6	5	4.8	5	4.8
						3.54%	7.55%	6.48% 8.14%

µm] 3.22 3.247 3.186 3.231 3.21 Rz [µm] 10

.22 9.948 10.37 10.41 10.27 RSm [µm] 100 100.2 99.97 99.97 99.

71 λs [µm]

			2.5	2.5	2.5	2.5
	λc [mm]	0.8	0.8	0.8	0.8	0.8
	Evaluation length [mm] 4.8	5	5	5	4.8

Ra Error % (ref: nominal) 0

.84% -1.06% 0.34% -0.31% High roughness standard

Table 11 :

 11 On-machine CC scanning speed comparison of different roughness parameters

Table 12

 12

			Glass standard Ra0.94um			Nickel standard Ra3.2um
		Ra	Rdq	Rsk	Rku	Ra	Rdq	Rsk	Rku
	CL1		--------+ + + + + + +	+ + + + +			+ + + + + + +
	CL2		--+ + + ---+ + + + + + + + + + + + + +		+ + + + + + + + + + + + + +
	CL3 -------+ + + ----+ + + + + + + + + + + + +		+ + + + + + + + + + + + + +
	Measuring
	speed =	60 90 120 150 200 250 300 mm/min

presents the results of all surface milling experiments done with Aluminum. The table consists of cutting parameters, force components, and roughness parameters obtained after processing the raw scanned profiles from 125 surfaces of Aluminum. This dataset was used for training a prediction model.

Table 12 :

 12 Experimental results for surface milling of Aluminum workpiece

Chapter 3: Roughness prediction 91

Mean Absolute error Model Version1 Version2 Version3 Version4 Version5 Version6 Version7 Version8 Average

	XGBoost	0.087	0.104	0.082	0.079	0.056	0.106	0.092	0.160	0.096
	NN	0.080	0.085	0.114	0.076	0.091	0.096	0.098	0.109	0.094
	Adaboost	0.093	0.093	0.082	0.095	0.065	0.091	0.090	0.112	0.090
	RF	0.083	0.095	0.087	0.091	0.062	0.089	0.090	0.101	0.087
	GBoost	0.061	0.091	0.073	0.089	0.085	0.112	0.110	0.129	0.094

Table 13 :

 13 Mean absolute error of each version of the ML algorithms

Table 13

 13

shows the values of the MAE of each algorithm after applying the fitted ensemble models on the feature test except the NN, which is applied on the test data. The lowest average of 8.7% was found to be given by the RF algorithm. It is due to the averaging method performed

Extracted table from test data for fixed ap=1mm Vc (m/min) F (mm/(rpm*tooth))

								Fa	Fz	Ra_test	Xgb_pred	Error
								(N)	(N)	(µm)	(µm)	%
						250	0.65	117.25	-4.23	0.82	0.78	-4.87
		(0.45;600)	(0.65;800)	(0.85;800)	800 400	0.65 0.25	85.93 50.3	-7.75 -0.56	0.75 0.2	0.77 0.15	2.67 -25
	(0.45;400) (0.45;350)	(0.65;600)		800	0.85	104.96	-10.38	0.76	0.87	14.47
	(0.25;400)	(0.65;250)	(0.85;400)		400 250	0.45 0.15	85.05 33.16	-2.94 0.22	0.68 0.11	0.7 0.12	2.94 9.09
						350	0.45	77.46	-3.2	0.68	0.68	0
	(0.15;250)					400	0.85	145.37	-7.44	0.81	0.81	0
						600	0.45	69.17	-3.51	0.68	0.72	5.88
						600	0.65	95.33	-6.33	0.79	0.77	-2.53

Error = 100* (Xgb_pred-Ra_test) / Ra_test *(f [mm/rot]; vc [m/min])

Table 14 :

 14 is the MAE values after applying the ensemble models on the fixed test data from the original dataset. XGboost and GBoost performed well on the training with 5% of error, whereas on the test data, XGboost exhibited the lowest error. Moreover, NN shows a 9.4% error on the test data. Results of ensemble model applied on the original data

	Model	Cross validation score	MAE (test data)
	XGBoost	0.055		0.058
	RF	0.066		0.061
	Adaboost	0.073		0.077
	GBoost	0.055		0.068
	Model	MAE	RMSE	Time
	GBoost	0.120	0.043	1.84
	RF	0.121	0.041	7.05
	Adaboost	0.125	0.04	7.02
	XGBoost	0.118	0.04	2.34

3.4.6 Multiple output prediction: Ra, Rdq and Rsk

From the results shown in Table

15

, of MAE and the RMSE, the K cross-validation method applied to all proposed ensemble techniques gives approximatively identical error results around respectively 12% and 3.9%. The major difference between the results is the processing time: GB and XGboost take approximately 2 seconds for processing, whereas RF and Adaboost take around 7 seconds.

Table 15 :

 15 Results

of the ensemble methods for multiple output prediction, using 10 K cross-validation

Table 16

 16 shows the predictions of the ensemble algorithms applied on the fixed test set which have given a relatively small difference in terms of errors as compared to the K cross-validation results. Xgboost resulted the lowest error metrics with 11% MAE and 4% in RMSE, and the algorithms based on gradient boosting gave the fastest results.

	Model	MAE	RMSE	Time
	GBoost	0.121	0.04	0.09
	RF	0.132	0.035	0.35
	Adaboost	0.144	0.04	0.36
	XGBoost	0.110	0.032	0.12

Table 16 :

 16

Results of the ensemble methods for multiple output prediction, applied on a fixed test data.

3-axis Dynamometer Force sensor Tool with 2 inserts Chromatic confocal sensor Titanium Workpiece Cutting speed [m/min] Feed rate per rotation [mm/rot] Cutting depth [mm]

	measurement.			Final flank wear
				width
				[mm]
	30	0.1	0.5	0.08
	30	0.2	0.5	0.43
	30	0.3	0.5	0.15
	45	0.1	0.5	0.16
	45	0.2	0.5	0.52
	45	0.3	0.5	0.74
	60	0.1	0.5	0.16
	60	0.2	0.5	1.08
	60	0.3	0.5	1.25

Total 65,2% Chapter 4: Tool wear effect on roughness forecasting

	𝑀𝑅𝑅 =	𝐴 𝑐 𝐿	• 𝑎 𝑝 •	𝑣 𝑓 60	[ 𝑚𝑚 3 𝑠	] (33)
						110

Ra MAE _Ra RMSE_ Rsk MAE _Rsk RMSE_ Rmr

							MAE_
							Rmr
	GBoost	0.037	0.026	0.19	0.142	13.37	10.32
	Random_Forest	0.048	0.035	0.24	0.174	14.14	11.38
	AdaBoost	0.052	0.044	0.25	0.191	15.01	12.38
	XGBoost	0.037	0.026	0.19	0.14	13.15	10.06
	Neural Network	0.062	0.047	0.35	0.24	16.76	12.93

Table 17 :

 17 Evaluation using MAE and RMSE applied on testing data with unscaled three outputs

Table 18

 18 presents the results after normalizing the outputs with a standard scaler (each output value is subtracted by the mean and divided by the standard deviation). Same as above, GB and XGboost exhibited the lowest MAE and RMSE when compared to the other ensemble models and NN.

		RMSE_	MAE	RMSE_	MAE	RMSE_	MAE_
		Ra	_Ra	Rsk	_Rsk	Rmr	Rmr
	GBoost	0.44	0.28	0.57	0.42	0.73	0.56
	Random_Forest	0.60	0.45	0.70	0.50	0.76	0.60
	AdaBoost	0.68	0.56	0.78	0.60	0.82	0.68
	XGBoost	0.44	0.30	0.56	0.40	0.71	0.56
	Neural Network	0.61	0.41	0.61	0.46	0.94	0.74

Table 18 :

 18 Evaluation of MAE and RMSE on test data with normalized outputs

Table 1 .

 1 Characteristics of the chromatic confocal optical heads.

		DeepView ®	WireView ®	MicroView ®
		4K	4K	4K
	Line length (mm)	4.05	1.51	1.79
	Depth of field (µm) 2600	900	500
	Working distance	47.8	7.8	10.1
	(mm)
	Max inclination	20	46	30
	angle of sample ( • )
	Pixel size on the	1.23	0.45	0.54
	sample (µm)

Table 2 .

 2 Average processing time to train and test a ML classifier. Measurement uncertainty has a confidence interval of 95%.

		Training (ms)	*	Test (ms)	*
			DV	1665 ± 50
	RF	10 080 ± 50	WV	1700 ± 50
			MV	1742 ± 50
			DV	485 ± 50
	MLP	1855 ± 50	WV	479 ± 50
			MV	479 ± 50
			DV	268 ± 50
	DT	250 ± 50	WV	265 ± 50
			MV	258 ± 50
	Computer Details: Xeon ® CPU E5-1650 3.5 GHz, 64 GB of RAM. GPU
	Quadro M4000.

*

Table 3 .

 3 Properties of the CNN model architecture.

	Layer (type)	Output shape	Parameters
	Conv2d (Conv2D)	(None, 222, 222, 32)	320
	Activation (Activation)	(None, 222, 222, 32)	0
	Max_pooling2d (Max-	(None, 111, 111,
	Pooling2D)

Table 4 .

 4 Accuracies of the VD with different data settings.

		Model accuracy with DV dataset	Model accuracy with DV + MV dataset
	VD	Batch 10	Batch 2	Batch 10	Batch 2
	30%	95.9%	94.3%	82.4%	74.7%
	40%	98.7%	97.1%	84.9%	73.2%

Table 5 .

 5 Confusion matrix of the classification models ran on two data sets.

					DV model							DV + MV model
		BS = 10,		BS = 2,	BS = 10,		BS = 2,	BS = 2,	BS = 10,	BS = 10,	BS = 2,
		VD = 40%	VD = 40%	VD = 30%	VD = 30%	VD = 30%	VD = 30%	VD = 40%	VD = 40%
		PP	PN PP	PN	PP	PN PP	PN	PP	PN PP	PN	PP	PN PP PN
	TP	6	6	8	4	8	4	6	6	6	6	4	8	4	8	8	4
	TN	1	15	10	6	7	9	10	6	9	7	11	5	8	8	7	9
	Average accuracy		0.64		0.47		0.57		0.49		0.42		0.36	0.35		0.48

TP: true positive (defect), PP: predicted positive. Average accuracy: accuracy of five test runs.TN: true negative (no-defect), PN: predicted negative.

Table 6 .

 6 Confusion matrix of the TL model trained on DV + MV images.

		PP	PN
	TP	10	2
	TN	8	8
	Accuracy	0.643

3 Métrologie de topographie de surface avec et sans contact

  En ce qui concerne la métrologie sur machine, cette technique peut être réalisée en utilisant la méthode de type contact ou de type sans contact, lorsque le capteur est généralement éloigné de l'objet mesuré. Différentes technologies de métrologie en ligne sont utilisées dans l'industrie : les instruments optiques, tels que le microscope confocal chromatique, l'interféromètre, la diffusion de la lumière, etc., le microscope électronique à balayage et le microscope à force atomique. Il est important d'ajouter que ces instruments offrent des mesures à différentes échelles.L'un des types de métrologie sur machine les plus intéressants en termes de qualité de surface des pièces usinées est réalisé à l'aide de capteurs optiques, car ils permettent de superviser la qualité de surface des pièces usinées en temps réel avec une grande efficacité. La nature sans contact des capteurs optiques est particulièrement avantageuse car elle permet d'éviter les défauts inhérents qui pourraient être causés par la métrologie de type contact, comme les rayures causées par la sonde d'un profilomètre à contact. En outre, elle permet de réduire le temps nécessaire pour amener les pièces fabriquées dans une salle de métrologie, puis de décider soit de poursuivre l'usinage, soit de modifier les paramètres. Un autre avantage est d'éviter la détérioration des pièces pendant leur transport vers les stations de mesure. En conservant l'état d'origine de la surface, s'il y a des motifs indésirables sur la surface tels que des défauts ou une mauvaise rugosité, d'autres actions de correction peuvent être appliquées directement sans perdre la position exacte de la pièce.L'usinage intelligent désigne un procédé d'usinage capable d'ajuster de manière autonome ses paramètres pendant le processus d'usinage pour atteindre un objectif prédéterminé. Cette nouvelle approche vise à surmonter les erreurs qui peuvent être présentes lors des processus d'usinage conventionnels, comme le broutage, les erreurs géométriques, la déformation élastique et thermique, etc. L'usinage intelligent peut être développé par l'interaction de différents systèmes. Par exemple : machines-outils, réseaux de capteurs et de contrôleurs, conceptions basées sur la simulation, big data et systèmes basés sur le cloud, ainsi que des algorithmes de contrôle intelligents. En mettant en oeuvre le concept d'usinage intelligent, on peut optimiser automatiquement les paramètres du processus en temps réel pour obtenir des performances de traitement et une qualité de produit optimales. De nombreux facteurs affectent la qualité du produit final pendant les opérations d'usinage, tels que les propriétés de la pièce, les caractéristiques de la machine-outil, l'outil de coupe et les conditions de coupe.

	1.5
	Puisque dans le présent travail, les mesures de la topographie de la surface sont effectuées avec
	des dispositifs sans contact, le prochain sous-chapitre se concentrera particulièrement sur cette
	méthode de mesure.
	1.Les instruments de mesure par contact se caractérisent par leur capacité à donner des mesures
	à l'échelle du microscopique au nanométrique. Les limites de ces instruments sont : un temps
	de mesure significativement long, la génération d'effets négatifs sur la surface d'échantillons
	particulièrement lisses, et la fragilité de la tête de la sonde. En revanche, avec les méthodes
	optiques de mesure de la topographie de surface, les mesures peuvent être effectuées en un
	temps très court et sans aucune influence sur la surface de l'objet à mesurer.
	1.4 Usinage intelligent

Contrôle de la qualité de l'intégrité de la surface

  Traditionnellement, le contrôle de l'intégrité de la surface se fait en dehors de la ligne de fabrication, dans une station de métrologie dédiée. En suivant des normes de qualité spécifiques, un métrologue ou un opérateur CQ donne un rapport final sur la conformité d'un produit.Comme le résultat est donné par un humain, son jugement est une source d'erreur. En outre, la méthode traditionnelle de contrôle de la qualité prend beaucoup de temps et n'offre généralement pas la possibilité d'améliorer la qualité de surface de la pièce dans une ligne de production réelle. Compte tenu de ces inconvénients du CQ traditionnel, les idées de surveillance de l'intégrité de la surface sur la machine sont actuellement très prometteuses. La proposition d'un CQ proactif vise à garantir un retour d'information en temps réel à la machineoutil pour produire la surface désirée plus proche des spécifications prédéfinies.

1.5.1 Détection des défauts Les

  pièces mécaniques usinées peuvent présenter des défauts dus à un dysfonctionnement de la machine-outil, à des comportements externes inattendus ou au matériau de la pièce. Les défauts de surface empêchent la pièce mécanique de remplir la fonctionnalité qu'elle est censée garantir.La détection automatique de défauts dans des images à haute résolution exige une performance de calcul considérablement élevée. Par exemple, les images doivent d'abord être prétraitées, puis le filtrage, la segmentation et le seuillage sont effectués. Plusieurs algorithmes de base de traitement d'image peuvent être utilisés dans chaque partie de ce prétraitement. Une autre

	solution consiste à exploiter la capacité des algorithmes de réseaux neuronaux à extraire de
	nombreuses caractéristiques d'un grand nombre d'images. Dans ce cas, les fonctions de
	prétraitement seront imbriquées dans les couches cachées des réseaux neuronaux artificiels
	(ANN). Le système d'acquisition d'images peut également être équipé d'une source d'éclairage
	de haute qualité, par exemple pour éviter certaines étapes de prétraitement des images telles
	que la réduction du bruit ou l'amélioration du contraste.
	Par conséquent, un contrôle de la qualité doit être effectué avant la livraison de tout produit
	final afin de s'assurer qu'il est conforme aux normes et d'éviter tout problème au niveau du client
	et des processus de production ultérieurs. Les défauts de surface peuvent être détectés à l'aide
	d'algorithmes avancés comme l'apprentissage profond embarqué sur des systèmes de vision
	artificielle avec traitement d'images. La détection et la localisation des défauts à l'aide d'une
	approche d'apprentissage basée sur les données permet d'améliorer et de corriger le processus
	de fabrication en renvoyant les résultats des algorithmes pour modifier les paramètres d'usinage
	afin d'obtenir une meilleure qualité de surface.

  DL est un sous-domaine de ML, basé exclusivement sur l'algorithme de réseau neuronal. Le terme "profond" signifie que l'apprentissage est appliqué en utilisant de nombreux étages de couches cachées. Alors que, dans un réseau neuronal simple, l'apprentissage se fait à l'aide d'une seule couche cachée. Les modèles basés sur les réseaux de neurones artificiels, appelés par la suite DL, ont attiré l'attention non seulement des chercheurs en IA, mais aussi d'autres domaines scientifiques tels que la fabrication, la santé et l'économie. Son nom vient du fait que les modèles de réseaux neuronaux peuvent contenir plusieurs couches, et que chacune d'entre elles peut extraire des connaissances spécifiques des données. Les résultats obtenus à partir de chaque couche sont combinés pour former le résultat de sortie. Jusqu'à présent, les algorithmes DL ont donné de bons résultats dans les applications de reconnaissance vocale, de reconnaissance faciale et de détection d'objets. pour la classification. Le CNN a également été utilisé avec succès pour détecter les défauts de soudage et pour le contrôle en ligne du soudage à l'arc robotisé de pièces en alliage d'aluminium. Pourtant, ils présentent des performances remarquables, que ce soit en termes de temps de traitement ou de précision du modèle. De plus, elles donnent un modèle stable et général qui peut être déployé dans un système prêt à l'emploi. Par conséquent, les méthodes d'ensemble ont été employées et comparées avec le NN pour prédire la rugosité de surface dans le processus de fraisage.Dans ce chapitre, une étude de la faisabilité de l'intégration d'un système de vision industrielle sur la ligne de fabrication afin de détecter les défauts. Un système de vision combinant une caméra 4K et une technologie confocale chromatique a été utilisé pour analyser les surfaces de pièces en cuivre après le processus d'usinage au laser. Par l'application de trois algorithmes d'apprentissage automatique (arbres de décision, forêt aléatoire et perceptron multicouche) sur les caractéristiques extraites du détecteur de bords de Sobel, la segmentation des défauts a été réalisée à l'aide du plugin de segmentation Weka. Un simple réseau neuronal convolutif (CNN) a également été appliqué pour la classification des défauts. Par la suite, en utilisant des données intelligentes plutôt que des données volumineuses, l'apprentissage par transfert a été réalisé avec succès en recyclant le modèle mobilenet-v1, qui est basé sur le CNN. Ce processus d'apprentissage allégé peut être mis en oeuvre dans des dispositifs qui sont limités par leurs ressources de calcul. Enfin, la localisation des défauts a été effectuée en adaptant le cadre de segmentation d'instance, MaskRCCN, aux images de défauts annotées. un système de CQ en ligne pour la détection de défauts sub-millimétriques générés par le processus d'usinage au laser utilisé sur la surface de barres de cuivre revêtues d'un polymère.Les tiges de cuivre utilisées dans les moteurs électriques sont recouvertes d'un matériau électriquement isolant. Pour les souder avec d'autres composants, une région de la couche d'isolation doit être enlevée par usinage au laser, qui est un procédé basé sur la formation de rainures sur la surface à traiter par vaporisation due à l'échauffement provoqué par un faisceau laser en mouvement. En faisant se chevaucher les rainures, il est possible d'enlever les couches de matériau de revêtement et donc de former des tiges électriques fonctionnelles pour un soudage ultérieur. Cependant, le mécanisme induit par la polarisation crée des défauts de surface lors de l'élimination sélective d'une rainure. En outre, selon les conditions d'usinage au laser, la réaction de vaporisation devient suffisamment rapide pour permettre un enlèvement appréciable du matériau de revêtement (c'est-à-dire de la surface revêtue non usée). Par

	1.6.2 Apprentissage profond (DL) 2.1 Résumé
	1.7 Conclusions 2.3 Méthodologie expérimentale
	La littérature a montré de nombreuses idées pour étudier la topographie de surface des pièces
	fabriquées. Certaines d'entre elles consistent à utiliser des capteurs optiques pour mesurer la
	rugosité de surface dans une station de métrologie, et d'autres à développer un système de vision
	pour détecter les défauts de surface.
	Diverses approches sont proposées en termes de prétraitement des données après leur collecte
	auprès des capteurs, afin d'extraire une quantité significative d'informations qui garantirait une
	L'application de techniques d'amélioration des données combinées à une méthodologie de
	données intelligentes est une solution pratique pour collecter des données pertinentes qui
	côté, les algorithmes CNN nécessitent généralement une plus grande quantité de données. Pour assurent une classification rapide et automatique des défauts et, en fin de compte, une solution
	une classification binaire telle que la détection des défauts, les données doivent être équilibrées efficace pour le problème du contrôle qualité. Dans ce sens, le présent travail vise à couvrir un ) L'apprentissage non supervisé est défini comme l'obtention de connaissances à partir de en ayant un nombre d'images représentant la classe des défauts presque égal à la quantité sujet qui n'a pas été trouvé dans la littérature jusqu'à présent : l'application d'algorithmes données non étiquetées en trouvant des modèles cachés dans les données d'entrée. L'application d'images sans défaut. Pour surmonter ce problème, certains chercheurs appliquent des d'apprentissage automatique (ML) de détection de défauts sur des données intelligentes la plus connue de ce type d'apprentissage est le regroupement d'observations ou d'échantillons de données dans des groupes qui présentent des similitudes plus étroites et les mêmes caractéristiques. techniques d'amélioration des données telles que l'augmentation des données (rotation de composées d'images à haute résolution prises en utilisant l'imagerie confocale chromatique Le chapitre suivant porte sur la détection des défauts basée sur l'IA à l'aide d'images haute l'image ou ajout de bruit), afin que le réseau puisse apprendre plus de caractéristiques à partir des données et renvoyer des résultats plus précis. résolution prises par un système de vision par ordinateur. L'objectif est de proposer une (CCI).
	approche de détection des défauts en ligne et de déterminer quelle méthode est la plus rapide et
	(3) L'apprentissage semi-supervisé est la combinaison des deux types d'apprentissage la plus précise.
	mentionnés ci-dessus. Les données pour l'apprentissage ont une partie où les entrées et la sortie
	sont connues, l'autre partie sont des données sans sortie.

Le NN peut être utilisé pour éviter l'extraction traditionnelle de caractéristiques effectuée par des algorithmes supplémentaires. Les couches cachées fonctionnent comme un extracteur de caractéristiques avec une architecture de réseau neuronal profond. Ainsi, il peut apprendre les modèles cachés directement à partir des données brutes. Les réseaux de croyance profonds et les autoencodeurs sont quelques exemples d'architectures pour l'extraction de caractéristiques.

1.6.2.1 Réseaux neuronaux convolutifs (CNN)

En

matière de reconnaissance d'objets, les CNN sont les algorithmes les plus utilisés pour les applications basées sur les images. Chaque couche du réseau peut exécuter individuellement une fonction particulière. Ce faisant, les caractéristiques sont extraites de l'image d'entrée (par exemple, les bords, les coins, les lignes et les courbes), fournissant le modèle final pour apprendre les modèles cachés qui caractérisent les cibles recherchées dans l'image. D'un autre L'utilisation de DL et du calcul parallèle (avec des unités de traitement graphique GPU) a donné d'excellents résultats sur la segmentation et la classification de défauts d'images à haute résolution avec une architecture CNN conçue avec deux réseaux : un pour la segmentation et l'autre meilleure performance du modèle de décision entraîné. En fonction de l'application étudiée et de la quantité de données, un choix raisonnable d'algorithmes doit être justifié. L'utilisation de données intelligentes qui fournissent des informations pertinentes réduira de manière significative le temps de traitement pour l'entrainement, et évitera la redondance des informations, réduisant ainsi la probabilité d'un sur-ajustement. Sur la base de la revue de littérature, cette thèse traitera initialement de la détection de défauts à partir d'images en exploitant l'apprentissage profond pour développer un modèle basé sur CNN. Plus tard, l'apprentissage par transfert sera effectué car il représente une meilleure approche. Il évite d'entraîner un modèle DL à partir de zéro, ce qui réduit le temps d'entraînement, et n'accorde que les poids du modèle préalablement enregistrés lors du premier entraînement.

Pour la prédiction de la rugosité, il a été remarqué que peu de travaux de recherche ont utilisé la méthode d'ensemble.

2.2 Introduction

Bien qu'il existe quelques travaux dans la littérature concernant l'utilisation d'algorithmes d'IA pour la détection des défauts, leur applicabilité à la construction d'un système de CQ en ligne pour des scénarios de cas réels est facilement bloquée par différents aspects qui sont présents dans les lignes de production. Par exemple, la détection de défauts de petite taille nécessite généralement l'utilisation d'images à haute résolution qui ne sont pas disponibles dans l'atelier.

En outre, le post-traitement d'une base de données massive d'images de haute qualité peut prendre beaucoup de temps, ce qui nécessite davantage de solutions d'ingénierie des données. L'objectif général de ce travail est d'étudier l'applicabilité de la combinaison des algorithmes d'IA avec la métrologie courante (CCI) en introduisant un grand degré de cohérence dans le traitement des données et la caractérisation. Cet objectif s'inscrit dans le cadre du développement d'conséquent, le matériau de revêtement résiduel reste finalement sur la surface, ce qui génère un défaut de performance du composant en termes de conductivité électrique. En ce sens, un CQ doit être effectué pour s'assurer que la surface est sans défaut, et ainsi éviter tout coût de fabrication supplémentaire et gagner du temps de production.

  En comparant les résultats de trois algorithmes ML différents, RF et MLP (avec deux couches cachées) ont présenté des performances de segmentation similaires et plutôt médiocres, tandis que les algorithmes DT ont présenté la meilleure segmentation des zones de carbone résiduel.Le temps de traitement de chaque combinaison de classificateur et de tête optique d'acquisition d'images est présenté dans Figure13. Chaque classificateur a été appliqué 10 fois pour la phase de l'entrainement et de test, de sorte que le temps de traitement moyen a pu être calculé.

	Chapitre2 : détection et classification des défauts
	2.4 Résultats
	Par exemple, parmi tous les résultats présentés dans la Figure 9, les bords du défaut sont plus
	visibles dans les images (2)WV,DT et (2)DV,DT par rapport aux images (2)WV,RF et
	(2)WV,MLP ; (2)DV,RF et (2)DV,MLP respectivement. Il est utile de mentionner que ces
	résultats sont basés sur les pixels étiquetés avant dans l'étape d'entrainement.
		Training of a classifier
	Training image
	No. 1: original	…	7: Sobel_filter_16.0	8: class
	1	121.4305	…	3.7952	Class 1
	2	132.1565	….	1.5049	Class 1
	…	…	…	…	…
	Cropped images
	Images measured
	with a CCI sensor
			Ran 10 times to
			calculate average
			processing time
	Laser-machined
	copper rods	Average processing times

Model accuracy with DV dataset Model accuracy with DV+MV dataset

  Dans le Tableau 2 sont présentés les résultats de la classification des défauts effectuée sur des données de test complètement nouvelles qui ont été prises en utilisant WV et OM. La plus haute précision obtenue était de 0,64, ce qui correspond au modèle entraîné avec DV, BS=10, et VD=40%. Le modèle de plus haute précision trouvé par les données de test est en accord avec celui obtenu par les données de validation présentées dans le Tableau 1.Contrairement au modèle CNN DV+MV qui n'a pas montré de bons résultats lorsqu'il a été appliqué aux données de test (Tableau 2), le modèle TL entraîné sur DV+MV a atteint une précision de 64,3%. Cela peut s'expliquer par le fait que le modèle TL a été préalablement entraîné sur une grande base de données, ce qui lui a permis d'apprendre différentes caractéristiques en effectuant la détection et la classification des objets.Dans ce chapitre, une étude de la faisabilité de la mesure de la rugosité sur la machine à l'aide d'un capteur sans contact a été réalisée sur des surfaces d'aluminium fraisées. Ensuite, un ensemble de données comprenant les paramètres de coupe, les forces et Ra a été utilisé pour analyser d'abord l'effet de chaque paramètre de coupe sur Ra, puis leur effet sur les forces d'usinage. En outre, le même ensemble de données a été utilisé pour former des modèles d'apprentissage automatique pour effectuer la prédiction de Ra, tels que le réseau neuronal NN, XGboost, Gradient Boosting (GB), AdaBoost, et Random Forest (RF). En raison de la nature stochastique du NN, différents résultats ont été trouvés pour le même modèle appliqué sur des données de test fixes. En revanche, les méthodes d'ensemble ont montré des résultats stables et significatifs lorsque leurs modèles finaux ont été appliqués aux données de test. Le XGBoost a présenté l'erreur la plus faible lorsqu'il a été appliqué à des données de test réelles, avec 5,8 %

	3.1 Résumé
			PP	PN
		TP	10	2
		TN	8	8
		Accuracy	0.643
		Tableau 3: Matrice de confusion du modèle TL entraîné sur des images DV+MV
	2.5 Conclusion
	2.	La segmentation des images collectées à l'aide du plugin Weka a permis d'étudier trois
	Validation data algorithmes d'apprentissage automatique différents. L'algorithme de l'arbre de décision s'est Batch 10 Batch 2 Batch 10 Batch 2
	30% avéré plus approprié pour une segmentation rapide et précise des défauts présentés par les 95,9% 94,3% 82,4% 74,7%
	40% images prises avec les têtes optiques STIL. 98,7% 97,1%		84,9%	73,2%
		Tableau 1: Précision des données de validation avec différents paramètres de données
	3.	La classification des défauts à l'aide de CNN appliquée aux images de CCI a donné de
	meilleurs résultats de précision par rapport à DT, RF et MLP.
	4.	La classification utilisant TL a montré une meilleure précision par rapport au modèle
	CNN simple, en particulier dans la base de données qui contient des images prises avec deux
	têtes optiques différentes. Cela peut être expliqué par le fait qu'avec la TL, les poids du modèle
	NN sont simplement ajustés pendant l'apprentissage, alors que pour le modèle CNN,

Sur la base des résultats présentés dans le Tableau 1 et le Tableau 2, le meilleur modèle était celui formé sur des images DV en utilisant 40% des données de validation et avec une taille de lot égale à 10. Le but de ce travail était d'étudier la précision et le temps de calcul lors de l'application de différentes combinaisons de segmentations d'images et d'algorithmes ML sur des images prises à l'aide de l'CCI système. Les conclusions importantes tirées de ce travail sont résumées comme suit : 1. D'après l'étude comparative entre l'utilisation du MEB, de la MO et de l'CCI, la détection des parties résiduelles de carbone sur la surface du cuivre peut être contrôlée avec succès par un système de vision par ordinateur avec l'intégration d'algorithmes d'apprentissage automatique dans l'CCI. l'apprentissage est fait à partir de zéro. La précision du modèle dépend de la quantité et de la variété des données de validation, ainsi que de l'architecture du NN. d'erreur.

Alu disc # Cutting speed [m/min] Feed rate per tooth [mm/rot] Cutting depth [mm]

	1	250, 350, 400, 600, 800	0.15; 0.25; 0.45; 0.65; 0.85	0.1
	2	100, 300, 500, 700, 900	0.1; 0.2; 0.4; 0.6; 0.8	0.5
	3	250, 350, 400, 600, 800	0.15; 0.25; 0.45; 0.65; 0.85	1
	4	250, 350, 400, 600, 800	0.15; 0.25; 0.45; 0.65; 0.85	2
	5	250, 350, 400, 600, 800	0.15; 0.25; 0.45; 0.65; 0.85	3

Tableau 4: Les disques d'aluminium usinés avec les paramètres de coupe appliqués.

  Erreur absolue moyenne de chaque version des algorithmes MLLe Tableau 5 montre les valeurs de l'erreur absolue moyenne de chaque algorithme après l'application des modèles d'ensemble ajustés sur le test des caractéristiques, à l'exception du NN, qui est appliqué sur les données de test. La moyenne la plus basse de 8,7% a été trouvée

		Version1 Version2 Version3 Version4 Version5 Version6 Version7 Version8 Average
	XGBoost	0.087	0.104	0.082	0.079	0.056	0.106	0.092	0.160	0.096
	NN	0.080	0.085	0.114	0.076	0.091	0.096	0.098	0.109	0.094
	Adaboost	0.093	0.093	0.082	0.095	0.065	0.091	0.090	0.112	0.090
	RF	0.083	0.095	0.087	0.091	0.062	0.089	0.090	0.101	0.087
	GBoost	0.061	0.091	0.073	0.089	0.085	0.112	0.110	0.129	0.094
			Tableau 5:

  Le Tableau 9 présente les résultats après normalisation des sorties avec un « standard scaler » (chaque valeur de sortie est soustraite de la moyenne et divisée par l'écart type). Comme cidessus, GB et XGboost ont présenté les MAE et RMSE les plus faibles par rapport aux autres modèles d'ensemble et au NN. Tableau 9: Évaluation de MAE et RMSE sur les données de test avec des sorties normalisées.

		RMSE	MAE	RMSE	MAE	RMSE	MAE
		Ra	Ra	Rsk	Rsk	Rmr	Rmr
	GBoost	0.44	0.28	0.57	0.42	0.73	0.56
	Random_Forest	0.60	0.45	0.70	0.50	0.76	0.60
	AdaBoost	0.68	0.56	0.78	0.60	0.82	0.68
	XGBoost	0.44	0.30	0.56	0.40	0.71	0.56
	Neural Network	0.61	0.41	0.61	0.46	0.94	0.74

Figure 49: Colormaps of the forces with respect to the effect of feed rate (x_axis) and cutting speed (y_axis)

ACKNOWLEDGMENTS

Acknowledgment

The authors would like to express their gratitute to Stil Marposs Company for funding this work and also the framework of the PHD project of Hassan Chouhad directed by prof. El Mansori.

Abstract

In this chapter, an investigation of the feasibility of integrating a machine vision system on manufacturing line in order to detect defects. A vision system that combines a 4K camera and chromatic confocal technology was employed to analyze surfaces of copper parts after the laser machining process. By the application of three machine-learning algorithms (Decision Trees, Random Forest and Multi-Layer Perceptron) on features extracted from the Sobel edge detector, segmentation of defects has been performed using the Weka segmentation plugin. A simple Convolutional Neural Network (CNN) was also applied for the classification of defects. Later on, using smart data rather than big data, transfer learning has been successfully performed with retraining the mobilenet-v1 model, which is based on CNN. This lean learning process can be implemented in devices that are limited by their computation resources. Finally, defect localization has been performed by adapting the instance segmentation framework, MaskRCCN, to the annotated defect images.

Introduction

The use of machine vision systems for Quality Control (QC) of reflective metal surfaces has increased over the years with new systems that combine higher resolution cameras and better illumination of inspected objects. With the advances in Artificial Intelligence (AI) pattern recognition of images, the integration of a machine vision systems in a manufacturing line for accurate automatic classification of defects would work towards the application of a smart manufacturing concept.

The integration of data acquisition systems using computers with high processing performance has given industries the capability to perform computer vision inspection of products in realtime. These systems are embedded with advanced image-processing and pattern-recognition algorithms, which enable the execution of algorithm-based inspection similarly to human inspection. In a manufacturing line, the pattern recognition applications could be used for defect detection and classification, which would allow for example the detection of manufacturing problems and their correction before the product is finalized and needs to be fully rejected. In Figure 52 is presented the 3D scatter plot of the predicted output from the XGboost model versus the real measured Ra. The table inside Figure 52 shows a subset of the test data obtained by fixing the value of the cutting depth ap = 1mm. From the table, one can notice that most predicted Ra are well fitted to the actual measured Ra with a total error of 9% shown in Table 13.

Perspectives

The studies performed in this thesis showed the possibility of predicting surface roughness parameters based on only three cutting parameters. Nonetheless, other parameters might influence the surface roughness as referred in the literature. To propose feedback actions for a machine-tool, another model for dynamic control should be developed, which takes results from the prediction model as inputs and then finds the optimal of a set of variables.

As suggestion for future works, the developed defect detection model can be implemented inside the CCI system, and its accuracy can be improved by getting more defect images for its training database. The integration of this system for classification of defect will allow companies to only classify the inspected parts. In order to perform.

Concerning surface roughness considering tool wear, other experiments and approaches are suggested for building a proactive QC system:

 Forecasting of surface roughness using LSTM and multivariate forecasting models;

 Increasing database with experiment replicas and more cutting conditions;

 Extraction of features from forces data and analysis if we can predict roughness by only forces data;  Development of wear prediction model based on force data and cutting parameters;  Forecasting remaining useful life of the tool using LSTM and multivariate forecasting models;

 Setup of a system capable of getting data in streaming, in order to predict and readjust in real-time the surface quality.

Bibliography Appendix

Conflicts of interest

The authors declare that they have no conflict of interest.

ORCID iD

Ricardo Knoblauch  https://orcid.org/0000-0002-2158-(4) L'apprentissage par renforcement est un apprentissage dynamique qui utilise un agent qui essaie d'apprendre à résoudre un défi provenant d'un environnement. En fonction de son action, l'agent reçoit des récompenses positives ou négatives selon l'objectif final à atteindre. Par conséquent, lorsque l'agent essaie à nouveau de recommencer depuis le début pour résoudre le problème, il doit le faire parfaitement sans recevoir de récompenses négatives. Les types de problèmes qui peuvent être résolus par les algorithmes ML sont représentés sur la

Effet des paramètres de coupe sur le Ra

La Figure 18 présente les résultats de Ra en fonction de l'avance, de la vitesse de coupe et de la

Prédiction de Ra

La Figure 19

Conclusions

Le paramètre de rugosité de surface Ra est l'indice le plus utilisé dans l'industrie pour l'évaluation de la qualité des pièces usinées. de Ra n'a pas donné de résultats précis, mais il peut cependant être utilisé pour prévoir les valeurs moyennes de Ra.

Perspectives

Les études réalisées dans cette thèse ont montré la possibilité de prédire les paramètres de rugosité de surface à partir de seulement trois paramètres de coupe. Néanmoins, d'autres paramètres peuvent influencer la rugosité de surface comme mentionné dans la littérature. Pour proposer des actions de rétroaction pour une machine-outil, un autre modèle de contrôle dynamique devrait être développé, qui prend les résultats du modèle de prédiction comme entrées et trouve ensuite l'optimum d'un ensemble de variables.

Comme suggestion pour les travaux futurs, le modèle de détection des défauts développé peut être mis en oeuvre dans le système CCI, et sa précision peut être améliorée en obtenant plus d'images de défauts pour sa base de données d'entraînement. L'intégration de ce système pour la classification des défauts permettra aux entreprises de classer uniquement les pièces inspectées. La localisation des défauts nécessite différents types de défauts qui peuvent résulter d'un processus donné.

En ce qui concerne la rugosité de surface et l'usure des outils, d'autres expériences et approches sont suggérées pour construire un système de contrôle qualité proactif :

 La prévision de la rugosité de surface en utilisant des modèles de prévision LSTM et multivariés ;  Augmentation de la base de données avec des répliques d'expériences et plus de conditions de coupe ;  Extraction de caractéristiques à partir des données de forces et analyse si nous pouvons prédire la rugosité en utilisant uniquement les données de forces ;  Développement d'un modèle de prévision de l'usure basé sur les données de force et les paramètres de coupe ;  Prévision de la durée de vie utile restante de l'outil à l'aide de modèles de prévision LSTM et multivariés ;  Mise en place d'un système capable de recevoir des données en continu, afin de prédire et de réajuster en temps réel la qualité de la surface.



Hassan CHOUHAD

Vers la métrologie en ligne pour un contrôle qualité proactif dans la fabrication intelligente

Résumé Dans l'industrie de fabrication traditionnelle, la métrologie est un élément essentiel de sanction de la qualité en bout de la chaîne de production. L'innovant dans le concept de la fabrication intelligente conduit à un repositionnement de la métrologie qui devient proactive au coeur même de la production pour fabriquer dès le départ une première pièce conforme. L'objet de cette thèse est donc de proposer une approche méthodologique pour le développement d'un système proactif, augmenté par des modèles d'intelligence artificielle IA, de contrôle en usinage de la conformité d'un produit à un cahier des charges et de caractériser ses défauts. Pour cela, une première étude sur l'aspect de surface a été réalisée en recueillant des images à haute résolution de fils de cuivre revêtus et découpés pouvant présenter des défauts. Les images, prises par un système de vision par ordinateur basé sur l'imagerie confocale chromatique, ont été utilisées pour générer différents modèles d'intelligence artificielle. Ce traitement consiste à faire de la segmentation et de la classification des défauts observés. En comparant la précision et le temps de traitement des modèles d'IA, l'apprentissage par transfert utilisant le modèle de mobile-net a montré de meilleures performances. Afin d'élargir l'étude de l'évaluation de la qualité de surface, des mesures de profil de surface sur machine-outil ont été effectuées à l'aide de capteurs confocaux chromatiques sans contact. Deux approches ont été réalisées : i) le fraisage de l'aluminium sans signature d'usure d'outil de coupe et ii) le fraisage du titane en tenant compte de la signature de l'usure de l'outil de coupe. Dans les deux configurations de coupe, les paramètres d'usinage, les profils de rugosité de surface et les efforts d'enlèvement de matière ont été enregistrés pour construire une base de données pour l'entraînement des modèles de prédiction par apprentissage automatique. Les résultats ont montré que le modèle XGboost a présenté la meilleure performance de prédiction et ce pour les deux scénarios. En considérant le temps de coupe dans le fraisage du titane, le modèle de prévision de séries temporelles ARIMA a été appliqué pour suivre l'évolution de la rugosité en fonction de l'usure de l'outil. L'analyse moyenne mobile autorégressive intégrée a permis de suivre l'évolution de la rugosité en fonction de la signature d'usure.

Mots clés : usinage intelligent, contrôle qualité proactif, intelligence artificielle, confocal chromatique, métrologie sur machine.

Towards online metrology for proactive quality control in smart manufacturing

Abstract

In the traditional manufacturing industry, metrology is an essential element in sanctioning quality at the end of the production line. The innovation brought by concept of smart manufacturing leads to a repositioning of metrology to be proactive at the heart of production by performing the so-called first-time-right manufacturing of parts. The goal of this thesis is therefore to propose a methodological approach for the development of a proactive system, enhanced by AI models, to control the conformity of a product to a specification during machining and to characterize its defects. For this purpose, a first study on the surface aspect was carried out by collecting high-resolution images of coated and cut copper wires that may present defects. The images, taken by a computer vision system based on chromatic confocal imaging, were used to generate different artificial intelligence models. These models can perform segmentation and classification of observed defects. When comparing the accuracy and processing time of the AI models, transfer learning using the mobile-net model showed better performance. To extend the study of surface quality assessment, surface profile measurements on machine tools were performed using non-contact chromatic confocal sensors. Two approaches were performed: i) milling aluminum without tool wear signature, and ii) milling titanium with tool wear signature. In both cutting configurations, machining parameters, surface roughness profiles, and cutting forces were measured to build a dataset for training the prediction models by machine learning.

The results showed that the XGboost model presented the best prediction performance and for both scenarios i) and ii). By considering the cutting time in titanium milling, the autoregressive integrated moving average time series prediction model was applied to track the evolution of roughness with tool wear.