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.