1. Introduction
Data-driven process monitoring is becoming increasingly popular in the additive manufacturing process because it enables real-time verification of component quality. Qualifying additively manufactured parts in real time offers a considerable advantage by reducing the costs associated with traditional post-production inspection methods [
1,
2].
A great deal of research has been conducted into in situ quality monitoring. Broadly speaking, the main monitoring methods fall into three categories: surface and internal defect control methods, thermal analysis and melt pool and heat-affected zone parameter methods, and 3D surface micro-relief parameter methods. Detailed information on sensors and research methods can be found in reviews [
3,
4,
5].
In this study, the main focus with regard to laser direct energy deposition (DED) technology is on optical measurement methods, since a built-in optical camera is used to take fragmentary images of the molten pool. The following technologies and sensors are used in optical systems:
- (a)
Visual Imaging with Optical digital camera/Photodiode for melt pool analysis [
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16], data collection for machine learning and defect detection [
17,
18,
19,
20], melt pool analysis and defect detection [
21,
22,
23,
24].
- (b)
Visual Imaging/High-fidelity Video with High frame-rate optical camera for melt pool analysis, powder consolidation [
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35].
- (c)
- (d)
Combine technologies Visual Imaging plus Thermography with Optical cameras and Pyrometer for Defect Detection [
30,
31,
32,
33], Visual Imaging plus Acoustic Emissions with Optical cameras and Acoustic sensors for part quality and defect detection [
43,
44].
Various process measuring devices, such as digital cameras [
5,
6,
7], high-speed cameras [
8,
9,
10], infrared cameras [
11,
12,
13], acoustic sensors [
14,
15,
16,
17] and photodiodes [
18,
19,
20,
21] are usually the first to be implemented around the process zone in order to collect process signatures.
While incorporating suitable optics with IR and high-speed imaging techniques enables the retrieval of high-resolution spatial information from the melt pool surface, issues arise with emissivity calibration [
36,
37,
38,
39]. Additionally, it should be emphasised that this approach is not cost-effective in terms of hardware management, data management and treatment. Furthermore, the optics must be mounted co-axially with the laser head to improve visualization of the melt pool, requiring alterations to existing industrial machines.
Experiments focusing on powder flow measurements and the mechanisms of powder delivery in Directed Energy Deposition (DED) processes have been instrumental in optimising powder flow rates and spatial powder distribution distances [
40,
41]. A range of microstructural changes can occur within the melt pool, including the melting and vaporisation of powders and the substrate, powder movement and ejection, spattering, the solidification of molten materials and powders, and alterations to the vapour depression zone. All of these changes can contribute to defect formation [
28,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45].
The main objects of monitoring are structural defects, which in turn depend on processing parameters (factors).
Elevated temperatures, rapid thermal cycling and significant temperature gradients can affect the energy density of the process, potentially causing defects in the manufactured parts [
46,
47]. Consequently, defect formation is strongly linked to the temperature gradients present during processing. This is supported by extensive research into laser welding and laser cladding, which share similarities with LPBF in theory and methodology [
48,
49,
50].
LPBF parameters, such as laser power, powder composition, scanning speed, layer thickness, scanning strategy, chamber environment and particle size, directly affect part quality [
51,
52]. Sub-optimal laser settings can result in defects such as balling, cracking, delamination, lack of fusion (LoF) and keyhole porosity, which reduce density and weaken mechanical properties. High scanning speeds increase melt pool instability, causing spheroidisation (balling) to minimise free energy [
53,
54], while insufficient laser power reduces thermal energy, impairing wettability and fluidity and also leading to balling [
55,
56].
Balling increases surface roughness and pore formation. LoF defects result from inadequate energy, which causes incomplete laser track overlaps and traps unmelted powder, creating permanent pores [
57,
58]. In contrast to balling and LoF, keyhole porosity occurs when high thermal energy density creates deeper melt pools and vapour channels [
59]. The collapsing vapour cavity traps metal vapour and shielding gases, forming spherical pores [
29]. Keyhole pore formation under different laser scanning speeds demonstrates that keyhole pores are sensitive to manufacturing parameters [
60].
Figure 1 illustrates the influence of processing parameters on porosity: keyhole porosity appears in the high-power/low-velocity regime, whereas lack-of-fusion porosity appears in the low-power/high-velocity regions of the processing parameter space [
61].
Advancements in sensor technology, coupled with the ability to extract valuable information from sensor signatures during manufacturing using machine learning (ML) algorithms, have become crucial for developing effective, data-driven monitoring systems. Conventional ML techniques, such as K-Nearest Neighbour (KNN) and Decision Trees, have been used with optical and thermal sensor data to evaluate part quality [
62]. Khanzadeh et al. [
63] applied multilinear principal component analysis (MPCA) to thermal maps for process monitoring. Gobert et al. [
64] trained a linear support vector machine (SVM) on visual features derived from images of the build layer, while features obtained via singular value decomposition (SVD) from photodiode sensors were used within a Gaussian mixture model (GMM) to evaluate quality [
65]. Acoustic signals analysed using SVM, Random Forest (RF) and logistic regression classifiers have also proven effective in identifying processing regimes [
66,
67]. However, these approaches rely on manual feature extraction, necessitating human expertise. In contrast, deep learning techniques can process raw sensor data directly with minimal preprocessing, presenting a promising alternative for monitoring LPBF processes [
68,
69].
Machine learning (ML), particularly deep learning (DL), is widely used to analyse in situ sensing data in manufacturing, correlating signals to quality-related features such as melt flow [
50,
70], melt pool [
71,
72], and porosity defects [
73,
74], among others [
68,
75,
76]. ML techniques can effectively uncover hidden knowledge and complex relationships within digital manufacturing systems, learning from reliable training datasets to make decisions without the need for explicit programming [
77]. However, balanced datasets are essential for optimal model performance, which can be challenging in real-world applications due to data imbalance, where one class (the majority) exceeds the others (the minority). As demonstrated by Scime et al. [
78], the classification accuracy of minority classes is notably lower, and anomaly samples are often misclassified as normal. This imbalance hinders the model’s ability to detect defects, since acceptable conditions are more prevalent than defective ones in practice, resulting in datasets that are biased towards normal conditions. For this reason, Li et al. propose an imbalanced data generation and fusion approach for in situ quality monitoring in LPBF [
79]. They capture layer-wise images, acoustic signals and photodiode signals with a multi-sensor system and then create three intentionally imbalanced datasets. A generative adversarial network-based data generation model (GAN-based model) generates minority class samples, and a deep learning (DL)-based fusion method combines the augmented datasets. The results demonstrate that high-quality generated samples substantially enhance model performance.
Machine learning algorithms can address many challenges in process monitoring by enabling the quick extraction and analysis of features, which is suitable for real-time LPBF applications. However, most current methods rely on passive supervised learning, which is time-consuming and costly in terms of training and testing. Exploring unsupervised and reinforcement learning approaches could greatly improve the quality control of real-time LPBF processes [
79].
This study proposes a new approach to creating a dataset for monitoring L-DED processes, based on the fact that defects are formed when fusion process parameters shift into a dangerous range due to external disturbances (
Figure 1).
Let us illustrate this with the example of a change in focal length. Defocusing can occur due to the accumulation of layer-by-layer errors as a result of powder consumption not matching the theoretical increase in deposited volume.
The actual profile of the deposited weld bead differs from the theoretical profile, which is based on the volume of powder supplied to the melt pool. This discrepancy (see
Figure 2) increases with each subsequent layer as the total deposition height grows. Consequently, defocusing occurs, and the actual radius of the laser beam differs from the theoretical radius. This deviation can occur in either direction, making the radius larger or smaller. Consequently, the temperature field in the melt pool and the temperature of the keyhole surface are affected.
By using the 2D moving heat source model [
29], the keyhole surface temperature is approximated by the melt pool peak temperature,
where
I is the laser intensity (approximated as
),
is the liquidus thermal conductivity,
is the laser beam radius. β is the laser absorptivity,
is the liquid thermal diffusivity, and
is laser power. Keyhole porosity depends on several factors, including the peak temperature of the melt pool. According to Equation (1), this temperature is a function of the actual laser beam radius
, and the velocity of the liquid in the melt pool is
. The latter is conventionally equated to the scanning speed and is proportional to the laser power [
80]. Therefore, controlling the focal length enables one of the factors influencing defect formation to be controlled. The same applies to other technological parameters, primarily radiation power and scan speed. Key factors influencing the occurrence of defects include the temperature field in the melt bath and HAZ, local temperature fluctuations, and temperature changes over time.
During metal deposition, it should be noted that the heat balance conditions for each layer change as the total deposition height increases due to the accumulation of thermal energy in the total deposited volume. This results in a gradual shift in the boundaries of the defect regions within the technological parameter coordinates (see
Figure 1). Consequently, the regions of optimal parameter 1 and acceptable parameter 2 (
Figure 1) will also shift from layer to layer. Controlling the technological parameters (radiation power, scanning speed and the technological pause necessary to equalise the heat balance in each layer) ensures that these values do not exceed the permissible range 2 (
Figure 1).
The experimental objective was to predict process parameters such as welding speed, effective focusing distance, internal powder flow rate, and the number of the deposited layers. Since each of these parameters takes on a limited set of values, the prediction task was transformed into a classification problem, where each unique value of the target parameter corresponds to a specific class. For each target parameter, a separate classifier was trained.
2. Materials and Methods
Let us formulate the control problem as follows: The target state of the DED system is an absence of defects. This state is determined by a vector of target parameters for laser power, scanning speed and focus distance, provided that the technological parameters affecting the melt pool and crystallisation process remain unchanged.
Let’s assume that it is possible to create a mapping between the technological parameters by preprocessing the images of the melt pool obtained from the sensor and transforming them into a certain set of k = 1…K features , which identify these images.
Target state
corresponds to a vector of features, such that the following dependencies are satisfied:
where
some fuzzy matching functions are defined on a set of permissible parameters
For example, the set of parameters
corresponds to area 1, and the set of parameters
corresponds to area 2 (
Figure 1). In this case, it is necessary to solve the following control problem:
i.e., by influencing the technological parameters
, ensure that condition (3) is met.
In our case, such a sensor is the optical camera of the DED device.
The permissible range of parameter R is selected in such a way that the shift in this region for any i-th layer does not cause the appearance of defects.
This problem can be solved by robust design of experiments based on Taguchi methods [
81,
82] when varying factors
within specified limits
.
As a result, instead of the need to generate a DataSet for implementing control algorithms based on ML with samples containing defect signatures—which, as previously mentioned, is labor-intensive and material-specific—it becomes possible to perform in situ monitoring of the DED process. This is achieved by collecting data from sensors and transforming it into signature parameters, thereby ensuring the control law (3).
Summarizing and moving towards the main goal of this paper—namely, in situ monitoring of the DED process using the optical camera—the following problems should be solved:
- (a)
Identification of a sufficient set of signature parameters , obtained from the camera mounted coaxially with the laser head, is necessary for the identification of the melt pool state.
- (b)
Solution of a classification problem, using ML mechanisms to develop dependencies (3) for variables P and v with an acceptable accuracy of no less than 95%, aimed at process regulation.
A separately defined task involves deriving regression equations that relate the laser beam spot radius r to the signature parameters , .
The overall research logic is presented in
Figure 3.
Thus, the main goal is to determine whether it is possible to predict the welding mode parameters based on features obtained from the formed segmentation masks. This will allow assessing the effectiveness of the technology for contactless real-time monitoring of DED.
All experiments were conducted using ILIST (ILIST, Saint Petersburg, Russia; Nd:YAG, 2000 W, continuous-wave laser) with a laser beam movement system, powder feeding system, coaxial nozzle based on the Fanuc 6-axis robot, and a 2-axis rotary platform. Melt pool imaging was performed with the built-in P30-007443-HD Camera (True 720p HD output @ 60 fps), which was supplied together with the IPG D30 welding head (
Figure 4).
The process parameters for deposition of specimens in the form of rectangular parallelepipeds with dimensions (L × W × H) of 50 × 10 × 10 mm made from high-temperature corrosion-resistant alloy Cr32Ni50W4.5Mo2.5TiAl powder (
Table 1) for the orthogonal L9:4 Taguchi experimental plan for 3 factors are presented in
Table 2 and
Table 3. The diagram of image registration of the melt pool for creating the DataSet for training and validation of the monitoring system is shown in
Table 4.
For the experiments, the built-in system recorded video recordings of the metal deposition processes under various process modes. The video files were saved in the format “X Y Z.mp4”, where
- -
X—the number of the process mode (from 1 to 9);
- -
Y—the layer number by height of the specimen {2, 4, 5, 7, 12};
- -
Z—the sequential number of the track within the layer (from 1 to 5).
For each video, segmentation masks were generated to highlight important regions: the exposure area (background inside the powder feed nozzle), the laser spot, sparking region around the laser spot, the high-temperature region, and other areas. Based on these masks, new parameters (features) were calculated and recorded in CSV files with the same names as the video recordings. A description of these new parameters is provided below in
Table 5.
The features are grouped in triplets: the area of the region of interest and its center coordinates (X and Y). The calculation of these parameters was performed based on segmented images using contour analysis methods from the OpenCV library (
https://opencv.org (accessed on 26 November 2025). This dataset serves as the basis for analyzing and predicting the process state (addressing classification and regression tasks) based on the extracted features.
Across all experiments, the dataset was divided into training and testing subsets in an 80% to 20% ratio. The split was stratified to preserve the class proportions.
For building classifiers, models from the scikit-learn library were used. To evaluate the quality of each model, the following metrics were calculated:
Accuracy is the proportion of correct predictions.
where
TP is the number of true positives;
TN is the number of true negatives;
FP is the number of false positives;
FN is the number of false negatives.
Precision is the proportion of correct predictions of a given class among all predictions of this class.
Recall is the proportion of correct predictions of this class among all actual observations of this class.
F1-score is a harmonic mean of precision and recall.
For each model, the averages of these metrics and their standard deviations were calculated. The main metric for comparison is the F1 measure, which reflects the balance between precision and recall.
The following characteristics were used to assess the quality of the regression models:
where
is actual value,
is predicted value
, and
is the total number of values.
The following material was used to clarify the analysis tools in the form of graphs: Confusion matrices, along with bar graphs, were employed to visually represent classification performance. A confusion matrix evaluates a classification model by comparing its predicted outcomes to the observed outcomes in the dataset. It displays the number of correct predictions (true positives and true negatives)—located on the main diagonal from the top-left to the bottom-right—and incorrect predictions (false positives and false negatives)—found in the off-diagonal elements. 1D and 2D bar graphs were utilized to illustrate the values of various quality metrics. The 2D bar graphs were constructed as arrays of colored rectangular cells, where the color intensity of each cell reflects the value of the quality metric at the corresponding coordinate (X, Y). To assess regression performance, 2D plots of classification quality metrics and scatter plots were employed.
4. Discussion
The analysis of the research results led to the following conclusions:
The application of robust experimental design and orthogonal Taguchi plans for image segmentation of the region of interest (monitoring the melt pool via built-in camera of the L-DED system) enabled the following tasks:
- a
Efficiently creating a dataset with video specimens featuring controlled variability of the melting process parameters.
- b
Improving the segmentation accuracy of images of the melt pool region of interest captured by the DED system’s camera, reducing the influence of factors causing image variations.
Controlled variability, based on experimental planning methods, allows variation in process parameters (powder feed rate, laser power, scanning speed) within specified levels that reflect possible real-world variations. The most significant variations influencing the results are related to practical deviations, primarily:
- -
Discrepancies between the calculated and actual powder feed rate, affecting focus distance and scanning speed.
- -
Variation in scanning speed, linked to the dynamics of DED-system acceleration and deceleration during changes in deposition direction.
Laser power is correlated with scanning speed via the linear energy density (P/V), which is necessary for stable DED operation (see
Figure 1). Since the variations in power within the study were within manufacturer-recommended values, these were not explicitly varied.
It’s important to note that segmentation with neural networks is sensitive to shooting conditions. Adapting the segmentation algorithm to different camera settings, as well as ensuring reliable performance across different materials, is challenging. Therefore, for practical implementation, it is necessary to develop an algorithm to stably extract regions of interest based on image brightness in segmented images of the melt pool. The planned implementation will utilize standard computer vision tools from the OpenCV library (
https://opencv.org/ (accessed on 26 November 2025). Considering the observation conditions, combining thresholding analysis and brightness normalization should enable consistent segmentation of features such as:
- -
The laser spot (determined as the brightest region),
- -
Surrounding sparking regions,
- -
High-temperature zones,
- -
Laser traces,
- -
The entire exposure area.
Additional bright segments adjacent to the laser spot can be identified as separate regions.
A set of identifying features of the regions of interest in the recorded images of the melt pool was defined, optimized by importance and quantity to ensure sufficiency for monitoring tasks. The feature set includes the collection of triplets {(Si, Xi, Yi)i} normalized relative to the entire region of interest (ROI), where Si is the contour area of the i-th ROI, and Xi, Yi are the coordinates of its center of gravity. Moment characteristics of the contours were additionally analyzed. Importance was determined during classification and regression tasks, including predicting the focal length using random forest-based algorithms. In model training, the out-of-bag error was calculated for each feature element’s subset (out-of-bag error) and averaged across the entire random forest [
85]. It was established that a set of 9 features, corresponding to the top three brightness-ranked regions (laser spot, sparking region around the laser spot, high-temperature area), meets the information importance criterion (maximum MSE on out-of-bag feature samples). Additional dimensionality reduction using UMAP to 8 features and 3 synthetic features revealed a significant decrease.
An adaptive noise-robustness algorithm was proposed: using a moving average with an optimal window size of 20–25 frames for feature calculation. Additionally, outlier filtering based on deviations exceeding 2 standard deviations from the moving average of the brightness of the region of interest is possible.
Based on the study results, it can be concluded that the laser spot area detected by the camera (the brightest cluster in the segmented image) exhibits good correlation with both the focus distance and the powder feed rate in the DED process. This fact is confirmed by the data presented in
Figure 16. When the powder feed rate and focus distance are reduced by 20% relative to their nominal values, and the height of the built-up specimen increases (i.e., the layer number increases), the laser spot size decreases (
Figure 16a). Conversely, when these parameters are increased by 20% (
Figure 16b), the laser spot size also increases. This suggests that, since the layer number being deposited can be determined with sufficient accuracy (the average accuracy for the entire dataset is 0.973), deviations of the focus distance from its nominal value—caused by accumulated errors due to external deposition conditions and discrepancies between the theoretical calculated powder consumption and the actual required amount—can be compensated by adjusting the powder feed rate.
Notably, cross-validation revealed the most process-sensitive external factor, which is especially important under complex visual effects inherent in DED. This factor was identified as the layer number being deposited.
It should also be noted that proper focusing, in conjunction with other process parameters maintained at optimal levels, is a necessary condition for forming the desired thermal field within the melt pool to ensure the quality of the DED process. Larger deviations from the nominal parameters tend to destabilize the process—this is reflected in increased prediction errors. This is clearly illustrated by the data in
Figure 8 and
Figure 9, which show the dependence of
MAE on the specific melting process parameters (specimen numbers). The ninth process mode exhibits the greatest deviations from the nominal parameters and, correspondingly, the highest
MAE values.
The curves of predicted and observed focus distance shown in
Figure 17 display some outliers in the prediction curves, but a general trend of agreement between these curves is observed. Individual outliers and deviations can be easily corrected in in situ monitoring systems using PID regulators and threshold filters based on deviations.
The main task of the closed-loop system is to monitor and ensure the conditions for Directed Energy Deposition (DED) within the “stability window” (
Figure 1). It is assumed that prior testing has been conducted, and the process parameters suitable for this region have been identified. Research shows that, by layers 5–7, the DED process and the molten pool parameters stabilize. At this point, deviations from the optimal build-up conditions are typically not observed. Consequently, the recorded parameters for the melt pool state (
Table 7) can be treated as target values, and control can be actively maintained by adjusting the scanning speed and powder feed rate, as well as fine-tuning the focal distance. The proposed method does not require instantaneous reactions; instead, it diagnoses deviations from nominal melting conditions before defects appear. These deviations occur gradually due to changes in the thermal regime during layer-by-layer build-up. Previous studies indicate that the interlayer wait time should be at least 40 s. Otherwise, defects may form in the material due to accumulated thermal energy. Therefore, a system response time of approximately 40 s is sufficient for corrective actions. Image acquisition and a 23-frame moving average consume minimal time: at each moment, one frame is analyzed, and features are averaged with the 22 previously processed frames. This ensures that computational time is significantly less than the 40 s required for process stabilization. Delays only occur during the initial frames processing; afterward, the main task is to process one frame at a time, given that regression and classification operations are computationally lightweight.
The accuracy and sensitivity of the method were evaluated during the fusion of layers 4 and 5 across all specimens, where the focal distance was varied linearly within a range of delta = 2–4 mm (
Table 4). The regression model was trained to determine the current focal distance. The achieved training accuracy with the optimal set of identifying features (
Table 3) yielded a
MAE of 0.16488 mm. With a minimal data acquisition frequency of f = 0.5 Hz, the conditional error in the calculated focal distance for each 1 mm increase in the height of the workpiece will be inversely proportional to the number of measurements, which can be expressed as:
This accuracy is acceptable for adjusting the focal distance, for example, after every 10 layers.