Next Article in Journal
DFFNet: A Dual-Domain Feature Fusion Network for Single Remote Sensing Image Dehazing
Previous Article in Journal
REEV SENSE IMUs for Gait Analysis in Stroke: A Clinical Study on Lower Limb Kinematics
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Weld Defect Detection in Laser Beam Welding Using Multispectral Emission Sensor Features and Machine Learning

Virtual Manufacturing Processes, School of Engineering Sciences, University of Skövde, Kaplansgatan 11, SE-541 34 Skövde, Sweden
*
Author to whom correspondence should be addressed.
Sensors 2025, 25(16), 5120; https://doi.org/10.3390/s25165120
Submission received: 19 June 2025 / Revised: 14 August 2025 / Accepted: 15 August 2025 / Published: 18 August 2025
(This article belongs to the Special Issue Applications of Laser Sensors for Precision Measurements)

Abstract

Highlights

  • Developed a data-driven framework integrating supervised and unsupervised machine learning techniques for interpreting multispectral emission sensor data in laser welding.
  • Enhanced the LSTM network with an attention mechanism to identify features related to one defect (pore—supervised learning).
  • Anomaly detection in sensor signals based on features using the Isolation Forest algorithm (unsupervised learning)
  • Demonstrated correlations between spectral emissions and weld defects.
What are the main findings?
  • Data-driven framework enabling quantitative monitoring using the multispectral emission.
  • Machine learning to find the correlation between spectral emissions and weld defects.
What is the implication of the main finding?
  • Improve the in situ monitoring in weld applications.
  • Explain the multispectral emission data, which make it easier to use in a decision-making system.

Abstract

Laser beam welding (LBW) involves complex and rapid interactions between the laser and material, often resulting in defects such as pore formation. Emissions collected during the process offer valuable insight but are difficult to interpret directly for defect detection. In this study, we propose a data-driven framework to interpret electromagnetic emissions in LBW using both supervised and unsupervised learning. Our framework is implemented in the post-process monitoring stage and can be used as a real-time framework. The supervised approach uses labeled data corresponding to predefined defects (in this work, pore formation is an example of a defined defect). Meanwhile, the unsupervised method is used to identify anomalies without using predefined labels. Supervised and unsupervised learning aims to find reference values in the emissions data to determine the values of signals that lead to defects in welding (enabling quantitative monitoring). A total of 81 welding experiments were conducted, recording real-time emission data across 42 spectral channels. From these signals, statistical, temporal, and shape-based features were extracted, and dimensionality was reduced using Principal Component Analysis (PCA). The LSTM model achieved an average mean squared error (MSE) of 0.0029 and mean absolute error (MAE) of 0.0288 on the testing set across five folds. The Isolation Forest achieved 80% accuracy and 85.7% precision in detecting anomalous welds on a subset with validated defect labels. The proposed framework enhances the interpretability of 4D photonic data and enables both post-process analysis and potential real-time monitoring. It provides a scalable, data-driven approach to weld quality assessment for industrial applications.

1. Introduction

LBW is an efficient and non-contact method of joining materials used in manufacturing. In LBW, the laser beam sends a focused energy to the material in the workpiece (the specimen). Part of this energy is absorbed, and the rest of it is reflected. The absorbed energy quickly heats the material, which increases its temperature. Ultimately, the material reaches the melting point, which leads to vaporization. This vaporization generates recoil pressure, leading to a keyhole formation. A keyhole is an open hole with a cave-like shape in the molten pool, and it increases energy absorption because of the multiple reflections of the laser beam on the keyhole walls. Thus, LBW is a complex process because it is affected by various physical interactions, such as plasma and plume formation, and forces such as Marangoni flow, buoyancy, and gravity. These forces and interactions contribute to the complexity of material behavior during the welding process [1].
Due to the high complexity and stochastic behavior in the molting pool, these interactions and forces cannot be controlled; consequently, monitoring the welding process is needed to ensure weld quality. Recently, data-driven systems have been used to monitor the welding process. Researchers using these data-driven systems rely on two main approaches: vision-based monitoring [2,3,4], sensor-based monitoring, or a combination of both [5,6]. Vision-based monitoring uses images to observe the welding surface [7]. Two-dimensional images of the weld surface can help identify the locations of the laser and their correlation to the defects. Additionally, two-dimensional images are sensitive to environmental factors, such as plasma and light, which introduce noise into the image data. Furthermore, analyzing two-dimensional images has a computational cost [8].
Consequently, researchers have turned to sensor-based monitoring, such as photodiodes, as a potential solution. A photodiode collects electromagnetic feedback from the weld zone across various wavelengths. In the literature [9,10], the photodiode used divides the emission radiation into three wavelength ranges, each corresponding to one of the following: reflected laser light, thermal radiation from the weld zone, and plasma radiation, which is the temperature radiation from the plasma above the weld surface. Two studies employ a photodiode that divides the wavelength range into multiple sub-bands instead of just three [11,12]. In [11], Brüggenjürgen utilized 4D photodiodes that segment the emission radiation into 42 channels, the same sensor we used in our study. Similarly, [12] utilized a wavelength range sensor with 25 sub-bands that records wavelengths from 186 nm to 1100 nm. Although these sensors provide rich data, interpreting the high-dimensional photodiode signals remains a major challenge, as highlighted in the literature.
This study addresses that challenge by investigating whether features extracted from 4D photodiode signals can be meaningfully linked to weld quality. Our framework introduces a two-path approach: a supervised learning path, used when defect labels are available, to determine which features are most revealing of specific defects; an unsupervised learning path, used when labels are unavailable, to detect anomalous behavior by learning features of normal signals.
The novelty of this work lies in introducing a framework that uses features extracted from high-resolution 4D photodiode signals to detect weld quality issues without relying only on predefined defect labels by showing that it is possible to define threshold values that separate normal and abnormal signal data for specific weld applications. In this work, we explore whether it is possible to define signal boundaries that distinguish normal welding behavior from abnormal behavior, specifically for a given welding setup. The analysis was based on post-process sensor data, from which we identified typical signal patterns linked to known defects. These threshold values are not general-purpose; they depend on the specific process and conditions. That means, for each application, the boundaries must be defined individually. Once this is accomplished, the same values can assist during production to spot abnormal signals as they happen. This idea opens up the possibility of using photodiode sensors not only for offline analysis but also for real-time monitoring and possibly for triggering alerts during welding when a signal goes out of the expected range.
To test this framework, we conducted welding experiments on 81 samples and collected 4D photodiode data. The 4D photonics sensor spans the wavelength range from 317 nm to 1934 nm, divided into 42 channels corresponding to VIS, NIR, and laser back-reflection. We extracted statistical, temporal, and shape-based features from the raw signals to characterize welding dynamics. To analyze the relationship between the extracted features and welding parameters, we applied PCA.
This paper is structured as follows: Section 2 describes the experimental setup, including the welding system, specimen geometry, and sensor configuration. Section 3 presents the methodology. It starts with the feature extraction process and dimensionality reduction using PCA. It then describes the supervised learning model—an LSTM with attention—to identify critical time steps and feature importance associated with pore formation. Lastly, it introduces the unsupervised anomaly detection using the Isolation Forest algorithm. Section 4 provides the results of both supervised and unsupervised analyses, including insights into the spectral channels associated with weld defects and validation using longitudinal weld cuts. Section 5 concludes with key findings and highlights the potential of using 4D photonic data and machine learning for in-line monitoring of LBW. It also outlines directions for future research.

2. Experimental Setup

The specimen used in the experiments consisted of two overlapping AA1050 aluminum sheets arranged in a lap joint configuration. The upper sheet measured 100 mm × 25 mm with a thickness of 0.8 mm, while the lower sheet measured 100 mm × 25 mm and had a thickness of 4 mm. This geometry was selected to simulate real-world conditions for laser welding in applications involving thin-to-thick aluminum joint geometries, such as tab-to-busbar connections in battery packs [13]. All sheets were cleaned with 2-propanol before laser exposure to eliminate surface contamination.
Experiments were conducted using a Laser machine (TruLaser Cell 3000, Trumpf SE & Co. KG, Ditzingen, Germany), a versatile 5-axis laser system equipped with a solid-state disk laser (TruDisk 6001, Trumpf SE & Co. KG, Ditzingen, Germany). The system included a programmable focusing optics (PFO 33-2, Trumpf SE & Co. KG, Ditzingen, Germany) laser head with a focal length of 255 mm and a collimation length of 150 mm. Figure 1 illustrates the experimental setup and provides an example of the specimen containing five weld lines. The laser emitted radiation at a wavelength of 1030 nm, delivered through a 2-in-1 fiber of a core fiber (100 µm diameter) surrounded by a ring fiber (400 µm diameter). This optical configuration resulted in an aspect ratio of approximately 1:1.7 between the fiber diameter and the focal spot size. Additionally, beam-shaping capabilities were improved by employing Trumpf’s BrightLine Weld (BLW) technology throughout the experiments.
A Box–Behnken strategy is used for the design of experiments (DoE) with four welding parameters at three different levels: laser power (3000 W, 3500 W, and 4000 W), feed rate (150 mm/s, 200 mm/s, and 250 mm/s), focus depth (−0.2 mm, 0 mm, and 0.2 mm), and inclination angle (2.74°, 4.92°, and 7.09°). The inclination angles were achieved by translating the PFO head along the Y-axis through translation distances of 25 mm, 45 mm, and 65 mm. Angles are calculated from Equation (1), as follows:
ϕ = tan−1 [(0.50 × ΔY)/292.5] × 180/π,
Every combination of parameters was tested three times for 81 weld lines across 27 different experimental conditions. The literature suggested the weld parameters and correlation with pore formation and penetration defects [14,15]. Additionally, as part of a collaborative effort, a recent study by Meena demonstrated the influence of the laser beam’s angle of occurrence on pore formation. Therefore, the effect of this angle was also considered in this work [16].

Multispectral Data Acquisition

A 4D.TWO multispectral sensor from 4D Photonics GmbH was used to capture emission data. The sensor records the spectrum in NIR and VIS ranges. It includes 16 designated channels in the VIS range and 16 in the NIR range, along with 0th-order channels for VIS, NIR, and laser back-reflection. The system supports high-precision synchronized data acquisition via a precision time protocol (PTP), resulting in a high resolution of 10 μs. The spectral wavelength ranges for the channels are categorized according to their wavelength ranges.
VIS channels: [317 + 38n] nm, where n = 0, 1, …, 15 (16 channels).
NIR channels: [1017 + 57/58n] nm, where n = 0, 1, …, 15 (16 channels).
Back-reflection laser channels: [900–1100] nm.
The wavelength is 1030 nm, which is recorded in the laser back channels and the lower ranges of the NIR spectrum. Two distinct datasets were collected with varying sampling frequencies. Dataset 0 was recorded at a sampling frequency of 5 kHz, with an integration time of 200 μs, applied to the 32 channels for both VIS and NIR wavelengths. Dataset 1 was recorded at a sampling frequency of 100 kHz, with an integration time of 10 μs, for the laser back-reflection channels and the zeroth-order channels for VIS and NIR. To capture visual features such as spatter and plume formation during the welding process, a FASTCAM NOVA S9 high-speed camera was employed. This camera recorded video at a frame rate of 6000 frames per second, with a resolution of 1024 × 1024 pixels. The high-speed imagery was utilized to verify weld defects related to spatter and visible surface anomalies on the weld.
Table 1 shows the experimental parameter values. The focus depth [mm] is the vertical distance between the laser focus and the workpiece surface. The PFO translation Y [mm] is the movement of the programmable focusing optics (PFO) along the Y-axis, which results in an angle for the laser welding. So, 4D photonics data were collected from the 81 weld lines. To analyze the recorded data, this study applied a feature extraction technique to allow us to identify the (statistical, temporal, and shape-based) patterns in the welding process.

3. Methodology

In this paper, we developed a data-driven approach to better understand the multispectral emission during laser beam LBW. Our goal was twofold: First, to explore how the spectral signals relate to weld defects; we chose one defect in this paper, porosity. Second, to detect unexpected anomalies from the signals. To achieve this, we combined both supervised and unsupervised machine learning methods. The supervised part is to identify specific patterns in the sensor data linked to known defects. For this, we used an LSTM model with an attention mechanism to investigate which features (from the signals) and time steps most affected pore formation. In contrast, the unsupervised part is to detect unusual behavior in the data without using labeled defects. Here, we applied the Isolation Forest algorithm. The overall framework is illustrated in Figure 2.

3.1. Data Processing

3.1.1. Feature Extraction

Working with sensor data is vital in laser welding because the process occurs on a temporal millisecond scale, and light reflection intensities fluctuate within that same timeframe. Consequently, processing raw signal data directly and mapping electromagnetic feedback data to weld defects is challenging [10]. Researchers have verified the advantages of using extracted features from sensor data instead of raw signals [17]. They extracted both statistical and temporal features from photodiode sensor data and applied PCA to reduce the dimensionality of these features. Their study classified weld quality into one of four categories using a Support Vector Machine (SVM) classifier. This approach demonstrated that feature extraction combined with machine learning techniques can enhance weld quality.
Will et al. (2022) [17] analyzed the correlation between spatter occurrences and the extracted features to validate the integration of feature extraction into machine learning models. In their study, the FRESH library from Python was used for feature extraction. Similarly, ref. [18] used photodiode sensor data to train a Convolutional Neural Network (CNN) for classifying weld penetration levels. Their model performed real-time classification every 50 milliseconds and achieved an accuracy of 90%. More recently, ref. [19] extracted statistical and temporal features from photodiode sensor data across three channels (plasma signal, temperature signal, and back-reflection). Then, supervised learning methods (SVM and Random Forest) and unsupervised learning using an autoencoder were applied for anomaly detection. The autoencoder identified anomalies by comparing the reconstructed signals with the original ones. Furthermore, ref. [19] correlated the sensor signals with two welding defects, over-penetration and lack of connection, using feature-based analysis in defect detection.
We extracted statistical and temporal features from each sensor channel based on these findings. These extracted features include statistical measures such as mean, variance, skewness, and frequency–domain characteristics derived from the Fast Fourier Transform (FFT), as well as shape-related metrics like crest factor and entropy. Below, we provide mathematical definitions of these key features. Based on their integration times, the data acquired from the 4D photonics system across 81-line welds were grouped into two datasets, Set0 and Set1. Each dataset comprises multiple sensor channels, which were further segmented into equal-length time windows. The defined statistical and temporal features were then calculated individually for each time window within each channel. Figure 3 illustrates the workflow of the feature extraction.
For Set0, Set1 = {S1, S2, …, SN}, where Si represents a sample in the dataset, and N = 81. In Set0, the signals have 200 μs as an integration time, while in Set1, the data have an integration time of 10 μs. Each sample Si contains multiple channels: Si = {C1, C2, …, Cj}, with each Cj representing a channel within the sample. The number of channels per sample varies, with 1 ≤ j ≤ 42.
Each channel Cj contains multiple windows: Cj = {W1, W2, …, Wk}, where Wk represents different windows within the channel and k = number of windows. D(Wi) represents the signal data for window number i, where i = 0, 1, …, k.
The features were selected based on findings in the literature, where they have demonstrated strong correlations with signal fluctuations. Below, we provide mathematical definitions of these features with Equations (2)–(25).
F 1 W i = m i n ( D ( W i ) )
F 2 W i = m a x D W i
F 3 W i = m e a n ( D ( W i ) )
F 4 W i = R M S = 1 k i = j 1 j k D ( W i ) 2
F 5 W i = v a r   ( D ( W i ) )
F 6 W i = s t d   ( D ( W i ) )
F 7 W i = p o w e r = m e a n   ( D ( W i ) 2 )
F 8 W i = p e a k = m a x   ( | D ( W i ) | )
F 9 W i = p e a k   t o   p e a k = P T P ( D ( W i ) )
F 10 W i = c r e s t   f a c t o r = p e a k / R M S   ( D W i )
Crest factor: The crest factor indicates the ratio of a waveform’s highest peak and average intensity levels.
F 11 W i = f o r m f a c t o r   = R M S / m e a n   ( D W i )
The form factor defines a periodic waveform’s shape, structure, and quality or unimodal continuous distributions.
F 12 W i = p u l s e I n d i c a t o r = p e a k / m e a n   ( D W i )
F 13 W i = s k e w n e s s = K D W i D ( W i ) ¯ 3 ( k 1 ) ( k 2 ) σ 3
A skewness value greater than zero indicates that the distribution has a longer tail on the right side (positive skew), while a value less than zero suggests a longer tail on the left (negative skew).
F 14 W i = k u r t o s i s = 1 k   ( D w i D w i ¯ σ ) 4
Kurtosis measures the distribution’s tailedness or peakedness. A higher kurtosis indicates more data in the tails and a sharper peak, while a lower kurtosis suggests a flatter distribution.
The second set of features consists of those extracted after applying the FFT. First, we compute the FFT of the signal and its power spectrum to obtain frequency–domain features; FFT (D(Wi)) represents the Fourier Transform applied at the window level.
F 15 W i = s u m _ f   ( P ( D ( W i ) ) )
F 16 W i = m a x _ f ( P ( D ( W i ) ) )
F 17 W i = m e a n _ f ( P ( D ( W i ) ) )
F 18 W i = v a r _ f ( P ( D ( W i ) ) )
F 19 W i = p e a k _ f ( P ( D ( W i ) ) )
F 20 W i = s k e w n e s s _ f   ( P ( D ( W i ) ) )
F 21 W i = k u r t o s i s _ f   ( P ( D ( W i ) ) )
F 22 W i = f u n d a m e n t a l   f r e q u e n c y = f i r s t   p e a k   i n   f f t = P e a k _ f ( P ( D ( W i ) ) )
Equations (24) and (25) are applied directly to the signal data.
F 23 W i = l a g 1 a u t o c o r r e l a t i o n   c o e f f i c i e n t = t = 1 T 1 x t x ¯ x t + 1   x ¯   t = 1 T 1 x t x ¯ 2 t = 1 T 1 ( x t + 1 x   ¯ ) 2
In Equation (24), T is the total time in the channel and t is the time step in the channel data. So, the autocorrelation calculates the coefficient between the time series and a one-time step-shifted series to calculate how much each time step depends on the previous one.
F 24 W i = e n t r o p y   ( D W i )
Shannon [20] introduced entropy to measure the randomness within a probability distribution, which summarizes the likelihood for each point. All features are computed using Equations (2)–(25). Consequently, we obtain a collection of statistical, temporal, and shape-related features for each channel across the two datasets, Set0 and Set1.

3.1.2. PCA for Dimensionality Reduction and Feature Analysis

Highly correlated and high-dimensional datasets were obtained from the previous section. Researchers in the literature, especially those who used the same sensor [11] or a very similar one [12], reduce the dimensions and deal with uncorrelated data. Similar to [17,21,22], PCA transforms the high-dimensional and correlated dataset into a new coordinate system, where the new axes, the principal components (PCs), are uncorrelated and ordered by the amount of variance they capture.
Mathematically, the PCA is represented as PCA = F.W, where F is the features and W is the loaded matrix with eigenvectors that define the directions of maximum variance. The PCA loadings matrix W is calculated by solving the eigenvalue problem for the covariance matrix.
Sum∑1/(n − 1) × FT F     and          ∑W = WΛ,
where W represents the eigenvectors, which represent the directions of maximum variance; Λ represents the eigenvalues, which indicate the variance explained by each PC. Each PC is a linear combination of the original features, defined by the eigenvectors in W. The weights related to Equation (27) are described in Table 2.
PCAi = wi1 F1 + wi2 F2 + … + win Fn,
PCA was applied to project the high-dimensional features dataset extracted into a lower-dimensional dataset while keeping the most significant variance. We selected four principal components (PCA1–PCA4), each capturing a subset of the total variance.
Table 2 shows the PCA loading matrix. From Table 2, we can notice that PCA1 captures the statistical characteristics of the channels, including mean, variance, RMS, power, and peak values. These features describe the overall distribution of the channel over time. Also from Table 2, PCA2 is associated with the shape and distribution of the channel rather than its statistical weights. It has a high skewness, kurtosis, and entropy load, which measure irregularity, peak distribution, and randomness. PCA3 and PCA4 capture additional variations with lower weights.
After extracting the features, we have a dataset with high dimensions. Therefore, we employ PCA to reduce the number of dimensions. Now, we have the extracted features, collected from different experiments with varying welding parameters, as input. This raises several questions: Do the welding parameters influence the channel signals and affect the extracted features? Is the defect we aim to analyze measurable through sensor signals? Does the chosen weld defect vary across different welding parameters? For example, cracks (as a weld defect) occur at the final stage of solidification [23], at which point emission feedback has already been collected. This highlights the importance of analyzing the correlation between welding inputs/outputs and the extracted features.

3.1.3. Analyzing the Influence of Weld Parameters on Sensor Data

In this study, weld parameters are the input, while weld quality represents the output of the welding process. To monitor weld quality, we aim to establish a connection between the input and output by analyzing features extracted from 4D photonics data. Consequently, verifying whether the chosen weld parameters and defects correlate with these extracted features is essential. Establishing this connection through the extracted features would not be feasible without correlation.
To better understand the relationship between weld parameters and extracted features, we analyze the variation in PCAs under different welding parameters. This approach identifies key parameters influencing the welding process, their role in pore formation, and the features extracted from the sensor data.
In this analysis, the max pore volume was measured using CT scan data, and the max pore volume for all samples was clustered into three groups: large, medium, and small. Confidence ellipsoids were computed using the following equation for the covariance matrix to visualize the distribution of each group in the PCA space:
( ) =     1 n 1 i = 1 n x i x ¯ x i x ¯   T
where xi represents a data point (pore volume value) in the PCA space and x ¯ is the mean value for xi for all n samples in the group. This matrix’s eigenvalues and eigenvectors define the ellipsoids’ shape and orientation. A 95% confidence ellipse was drawn. The ellipsoids represent regions where data points (pore volume) are likely to be found. A clear visualization of the distribution of different clusters (large, medium, and small pore volumes) in the PCA space is shown from one side. On the other hand, the arrows in the center of the PCA space show the correlation with the weld parameters. Longer arrows indicate a more significant contribution to the PCA’s variance, and welding parameters strongly correlate with this specific PCA component (axis) (see Figure 4).
The red ellipsoid is centered and spread equally along all axes, and we can interpret that the small pores are not affected by the process parameters. Small pores will always be present regardless of the parameters. The discussion of the pores follows in Section 3.2.1. The green ellipsoid is shifted in the PFO Y translation direction, which means that increasing the angle will accordingly increase the number of pores with a medium-sized volume (between 0.2 and 0.4). The large-pore-volume group is shifted to the bottom of the figure, so it is correlated with lower values in the defocused parameter and also lower values in the feed rate. As a result, increasing the feed rate will increase the number of pores with a large volume.

3.2. Modeling

3.2.1. Supervised Learning

Data Labeling–Defect Definition (Pore Segmentation)
To guide our defect analysis, we referred to the international standards EN ISO 13913-2 and EN ISO 13919-2, which describe common weld defects in laser beam welding [24]. In this study, we focused specifically on defects related to pore formation and penetration. These standards offer useful reference examples for weld imperfections. Based on this, our goal was to examine whether the anomalies detected in the sensor data correspond to actual weld defects observed in the samples.
To build the labeled dataset (pore volume) over time, high-resolution volumetric data were obtained by scanning the specimens using CT. Then, the images were processed with VGStudioMax (2024.3) to extract detailed pore information, as shown in Figure 5. For porosity analysis, the identified pores were manually labeled and then segmented into 30 segments along the Y-axis for each specimen. This segmentation was conducted to be aligned with the 30 windows used in the feature extraction phase to ensure that each time segment meets one window in the feature dataset. As explained in Section 3.1.1, features were extracted from each window. After labeling, we had two datasets: one containing the extracted features for each channel across the 30 windows and another containing the segmented pore data for each specimen over the 30 time segments. The data within each segment were then aggregated to define the maximum pore volume per segment.
This segmentation aims to create a labeled dataset for one defect (pore volume). Therefore, it is important to identify which extracted features influence the selected defect and determine its critical time step.
Deep Learning (LSTM with Attention Mechanism) to Analyze Feature Time Step Importance in Predicting Pore Volume
LSTM networks have broad applications in general time series prediction and welding applications [25,26] because they can learn both short- and long-term dependencies in sequence data. LSTMs capture critical information in long sequences and, at the same time, avoid the gradient problem. They achieve this by using a structure in each LSTM cell, which contains three gates controlling the flow of information: the forget gate, the input gate, and the output gate. The three gates control what information should be kept or dropped as new information passes through the cell. Figure 6b shows the architecture of the LSTM cell and the three gates.
The forget gate removes unnecessary information from the last time step. It uses the current time step input and the previous time step output. The forget gate activation function (sigmoid σ) returns zero if information of the previous time step is not needed for the current time step; otherwise, it returns one (Equation (29)). The input gate determines what part of the new information in the current time step should be kept by using the sigmoid activation function. Subsequently, the cell state is made using the tanh activation function, which gives a value in the range [−1, 1] (Equations (30)–(32)). The output gate determines which part of the cell state must be passed as output to the next time step, using a σ function once more. The cell state is updated with the tanh activation function, and the final production is calculated from (Equation (33)).
f t = σ ( w f · h t 1 ,   x t + b f )
i t = σ ( w i · h t 1 ,   x t + b i )
C ^ t = t a n h ( w c · h t 1 ,   x t + b c )
C t = f t     C t 1   + i t       C ^ t
o t = σ ( w o · h t 1 ,   x t + b o )
where w represents the weights in the gate, b is the bias in the gate, ht−1 is the output from the previous time step, and xt is the information for the current time step; Ct is the cell state, and ⊙ means element-wise matrix multiplication; σ represents the sigmoid activation function.
Combined LSTMs with attention mechanisms have become increasingly popular in recent research, showing promising results in time series analysis, particularly in laser welding [27,28,29,30]. The self-attention mechanism, shown in Figure 6a, works as follows: multiply the LSTM output by itself; then, a SoftMax function is applied to correct the weights that are assigned to each time step to ensure they are not all equal. This process helps the model focus more on the most relevant time steps by giving them higher weights. Finally, the attention layer produces a square matrix, where its width and height match the number of time steps.
The output of the LSTM layer is then passed to an attention layer [27,28,29,31]. The attention layer computes alignment scores between the LSTM outputs to identify which time steps contain the most essential information related to the target output (max volume pore per segment). LSTM learns the dependencies for time steps and features to predict the pore volume per segment. By applying SoftMax (in the attention layer) to the output from the LSTM, the attention mechanism analyzes the correlation for each time step and feature to the predicted output.
The deep learning model investigates the importance of features extracted from 4D sensor signals regarding pore volume formation. The model’s prediction, generated by LSTM layers combined with an attention mechanism, is used to evaluate the model’s accuracy and validate the alignment of features with pore formation.
The dataset comprises 930 features collected over 30 windows for each of the 81 weld lines. To ensure the model’s generalizability, the dataset is divided into training and validation sets, and then K-fold cross-validation is used. Our model first includes an LSTM layer with 256 neurons to capture temporal dependencies, followed by batch normalization and dropout to prevent overfitting. The data then pass through a second LSTM layer containing 128 neurons. After the second LSTM layer, a self-attention layer with 64 neurons is added to help the model concentrate on the most important time-dependent information. As shown in Figure 6, the self-attention mechanism operates by computing alignment scores through matrix multiplication with the LSTM output. These scores are then processed through a SoftMax function, which assigns different weights to each time step, giving more importance to the most significant one, as shown in Figure 6c.
The output of the attention layer is added to the output of the LSTM layer. This integration enhances gradient flow during training and contributes to overall performance, as time steps are not treated equally after the attention is applied (more critical ones will have higher weights). Following this, a batch normalization layer standardizes the combined output. The data then flows through two fully connected dense layers, with 256 and 128 neurons, respectively, preparing it for the final prediction stage.
Finally, a dense output layer with a single neuron and a linear activation function generates the prediction (the pore volume per segment; as we mentioned, the prediction is used for evaluating the model and measuring feature and time importance). The model optimization employs the Adam optimizer, with Mean Squared Error (MSE) as the loss function. After training, the model’s predictive performance is validated using a test dataset.

3.2.2. Unsupervised Learning

Since labeling welding defects is time-consuming and impractical for real-time monitoring, we employ unsupervised anomaly detection methods to identify deviations from normal welding behavior. Conducting experiments on hundreds of defective and hundreds of normal samples is critical to training a deep learning model. Therefore, an unsupervised learning method is needed to detect weld defects based on the sensor data.
The detection of anomalies mainly depends on deviations from the normal data, starting from the extracted features, assuming that most data are considered normal. Each feature from every channel and each window is regarded as a point in the data. An anomaly point is a single data point that stands out from other points. Since our data consist of these feature points and are high-dimensional, we avoid methods with high computational costs, such as those that measure the distance or density between data points.
Therefore, this study uses a partitioning-based isolation method, motivated by how the technique works. We do not need to provide the process with any prior knowledge about what constitutes an anomaly specification. The literature also supports the use of Isolation Forests for their advantages [32,33,34,35].
The Isolation Forest algorithm starts by randomly selecting a point from the data (a point in our data is a feature in a window in a channel for a one-line weld). Then, the algorithm calculates the minimum and maximum values for this point in the sub-data that the point belongs to (we can call it the point range). After that, the algorithm chooses a random split value from the point range. Then, the data are divided into two portions. This algorithm is repeated for each point until it reaches a leaf with one point or the tree reaches its maximum depth (which is a parameter we can set prior).
In the Isolation Forest, anomalies are efficiently isolated from the dataset, requiring fewer splits. The number of splits needed to isolate a feature is the anomaly score. The Isolation Forest algorithm defines a threshold representing the dataset’s percentage of anomalies, ensuring a thorough anomaly detection process. Figure 7 provides a clear illustration of the concept of the Isolation Forest.
This paper utilizes the Isolation Forest from the sklearn.ensemble to implement the partitioning-based isolation library in Python. After detecting anomalies, PCA is applied to reduce dimensionality and visualize high-dimensional features in a 2D plot. The segments in the tree represent decision boundaries created by the partitioning process. The Isolation Forest tree does not measure the distance between points, so the proximity of two points does not influence the anomaly results but rather their variation from the data.

4. Results

Results from the supervised method show the importance of the feature for the chosen defect (pore volume). As illustrated in Figure 8, the features most strongly correlated with pore volume come from Channel 18, like peak-to-peak values and standard deviation. This indicates that the distance between peaks in Channel 18 impacts the volume of pore formation.
However, we cannot conclude that each peak in the channel data corresponds directly to a large pore, as the feature importance shows a moderate correlation (around 5 on a scale from 1 to 10).
Also, we should consider that the channel data are in 2D, whereas the pore formation could occur in any position in the weld in 3D space. Due to this dimensional difference, precise alignment between detected peaks in the channel data and actual pore locations is challenging. Rather than identifying exact pore positions, peaks in channel data may better indicate regions with a higher likelihood of large pores forming.
Table 3 summarizes the model’s performance, reporting both MSE and Mean Absolute Error (MAE) for the training and validation sets across all folds. The final reported values represent the average MSE and MAE over the K-folds.
The unsupervised model (Figure 9) labeled features across all channels as either normal or anomalous. To interpret the results at the channel level, we counted how many times each channel was flagged as anomalous across all samples. This analysis revealed two distinct types of channels: those showing high variation across samples and channels that remained stable with minimal fluctuations (Table A1 in Appendix A).
Channels with frequent fluctuations may reflect noise or general variability in the welding process. In contrast, stable channels with minimal changes are more likely to capture critical information about process defects.
Among the stable channels, Channel 18 shows a slight fluctuation under normal conditions. However, when changes did occur, they appeared as distinct peaks. Figure 10 shows the behavior of Channel 18 across four weld lines (Samples 33, 51, 67, and 79). Two of these samples correspond to anomaly peaks, while the other two are normal. These same samples are also listed in Table 4 and Table 5.
To determine whether these peaks reflect weld defects, a longitudinal cut was made along each weld to examine the weld depth and internal structure. This step was critical, as some samples were damaged or not cut exactly at the weld center, reducing the number of usable cases for verification.
By aligning the longitudinal cut images with the behavior of Channel 18, we can compare its variations to those of other channels that show anomalies using the anomaly detection method. Table 4 reveals that these two samples (79 and 67) have higher peaks in Channel 18, while normal samples have a maximum amplitude of about 100,000. Samples 79 and 67 display amplitudes of approximately 800,000 and 350,000 for their highest peaks, respectively. Upon reviewing the longitudinal cut images, we noted an unexpected lack of penetration that corresponds with these high peaks.
Channel 18 (394–430 nm) is associated with known aluminum and aluminum oxide emission lines. Neutral aluminum (Al I) releases at 394.4 nm and 396.2 nm, while ionized aluminum (Al II) has transitions at 407 nm and 430 nm. These wavelengths for Al I and Al II are associated with plasma formation and oxidation effects in laser welding. The occurrence of peaks in Channel 18 during lack of penetration, a common welding defect, suggests a possible link between plasma intensity, oxidation, and a lack of energy absorption, which can affect the quality of the weld.
Similarly, Channels 22 and 23 show high variations in their anomaly scores, indicating that they belong to a different category of channels characterized by significant fluctuations in the data. It is also notable that the channels in general are highly correlated, which means their extracted features are similarly correlated. This relationship is reflected in the PCA analysis shown in Table 1, where all features contribute meaningfully to the first four PCAs.
To evaluate Isolation Forest model, anomalies were aggregated at the sample level by counting how many channels were flagged as anomalous for each weld sample. Ground truth validation was conducted through visual inspection of cross-sectional images, including both longitudinal and normal cuts. However, only a limited number of samples had such images available, which restricted the extent of quantitative validation. For the samples with cross-sections, weld quality was assessed visually to determine the presence of defects. This evaluation was qualitative, as the types of defects observed varied and were not consistently labeled. Based on the subset of samples with ground truth labels, the model achieved an accuracy of 0.80 and a precision of 0.857. The ground truth annotations used in this comparison are provided in Table A2 of Appendix A.
As an unsupervised learning method, the Isolation Forest has shown promising results. Since it does not require labeled data, it can detect unexpected behavior in the weld, process instability, or significant deviations from normal data. This makes it effective for identifying material defects or unexpected environmental conditions. To maximize the benefits of this method for in situ monitoring, a set of normal weld samples can be collected to establish threshold sensor values. Once these thresholds are assigned, the system can be automated to trigger an alert and stop welding if the sensor signals exceed the threshold values.
The primary goal of using 4D sensor data is to investigate the correlation between the 42 channels, the welding process, the weld parameters, and different weld defects. Ultimately, the aim is to move toward a quantitative assessment of weld defects rather than relying on qualitative classifications that merely distinguish between acceptable (OK) and non-conforming (NOR) welds. As we seek to enable a more quantitative assessment of weld quality, by linking specific signal patterns and amplitude behaviors across selected channels to visual inspection results, we aim to better understand how defects such as pores, lack of fusion, or over-penetration manifest in the spectral data. The following tables are examples that summarize these findings so to see how certain signal behaviors correlate with observed weld conditions.

5. Conclusions

In this study, we developed a data-driven approach to analyze multispectral emission data captured during laser beam welding using a 4D photonic sensor. By extracting statistical and temporal features from 42 sensor channels, we explored their relationship with weld quality. Through a supervised learning model (LSTM with attention), we found moderate to strong correlations between pore volume and features extracted from Channels 18, 23, and 24. These findings suggest that certain signal patterns may indicate conditions that lead to defect formation. However, it may not be a single feature from a specific channel that plays the key role. Rather, a combination of features across multiple channels could be more indicative of pore formation. As shown in Figure 8, many features from different channels contribute similarly to pore prediction according to the LSTM with attention, pointing toward a collective signature rather than an isolated signal.
Moreover, the features most strongly correlated with pore formation tend to describe overall signal characteristics, such as standard deviation and variance, rather than signal peaks or individual values. This further highlights the challenge of linking a specific feature in a specific channel directly to pore formation. It suggests that porosity may arise from complex, distributed signal behavior rather than localized anomalies. In contrast, it is possible that other types of weld defects may show clearer relationships with specific features or channels, “a hypothesis we plan to explore in future work”.
Additionally, this study highlights the role of data-driven models, shifting the focus from experience-based knowledge to models built directly from data without prior assumptions. Instead of relying on predefined expectations, the data drives the direction of model design, leading to more adaptive and efficient anomaly detection.
Future work will explore 4D sensor data and its connection to various weld defects, including spatter and width variations. Furthermore, high-speed imaging will be incorporated to examine spatter formation and changes in weld width. This ongoing research will aid in the development of in-line monitoring systems.

Author Contributions

Conceptualization, A.D. and K.S.; methodology, A.D.; software, A.D.; validation, A.D., S.E., and M.P.; formal analysis, A.D.; investigation, A.D. and M.P.; resources, M.P.; data curation, A.D.; writing—original draft preparation, A.D.; writing—review and editing, A.D., K.S., and S.E.; visualization, A.D.; supervision, K.S. and S.E.; project administration, R.G. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Vinnova through the Production 2030 program for the QWELD project (grant number 2021-03693); the European M-ERA.NET 3 call (project 9468 LaserBATMAN); the Swedish Governmental Agency for Innovation Systems (Vinnova, grant number 2022-01257); and Innovation Fund Denmark (grant number 1139-00001). The APC was funded by the same sources.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Acknowledgments

The authors also wish to sincerely thank the talented team whose work ethic and perseverance significantly helped in conducting the first experiments that established the direction of this research. Andreas Andersson Lassila and Dan Lönn are particularly thanked for their unwavering dedication and expertise in conducting the experiments. Their constructive criticism and diligence were of great help to the success of this research. Special appreciation goes to Wei Wang for his significant role in the selection of sensors and purchasing them. His determination and perseverance showed that we had the right equipment in hand when we needed it, allowing the timely completion of the experimental work.

Conflicts of Interest

The authors state that they have no personal or financial conflicts of interest known to them that could have affected the research reported in this article.

Abbreviations

The following abbreviations are used in this manuscript:
LBWLaser Beam Welding
VISVisible Spectrum (approx. 317–900 nm)
NIRNear-Infrared Spectrum (approx. 900–1934 nm)
CTComputed Tomography, used for pore volume analysis
PFOProgrammable Focusing Optics
ϕInclination Angles
ΔYPFO Y Translation
DoEDesign of Experiments
FFTFast Fourier Transform
PCAPrincipal Component Analysis
LSTMLong Short-Term Memory, a type of RNN used for time-series data
MSEMean Squared Error
Set0Dataset collected at 5000 Hz with 200 μs integration time (VIS and NIR channels)
Set1Dataset collected at 100,000 Hz with 10 μs integration time (back-reflection channels)
WkWindow number k in a channel
D(Wi)Signal data in window Wi
σSigmoid activation function
Element-wise multiplication
PSDPower Spectral Density (from FFT)
FRESHFeature Extraction based on Scalable Hypothesis tests (Python package)
CNNConvolutional Neural Network
SVMSupport Vector Machine
RMSRoot Mean Square
TiTime step index
Eigenvector (w)Direction of maximum variance
Eigenvalue (Λ)Variance explained by a principal component (in PCA)

Appendix A

Table A1. Shows the results of anomaly detection using the extracted features. The results are aggregated by channel name, and the number of anomalies detected in each channel is summed.
Table A1. Shows the results of anomaly detection using the extracted features. The results are aggregated by channel name, and the number of anomalies detected in each channel is summed.
ChannelAnomaly Count in (Set0)Anomaly Count in (Set1)
chan11-136
chan12-129
chan13-59
chan14-58
chan15-59
chan182-
chan1914-
chan20128-
chan21211-
chan2265-
chan232-
chan264-
chan2725-
chan2824-
chan2912-
chan306-
chan312-
chan46-13
chan6-4
chan8-47
Table A2. Presents the results of anomaly detection based on the extracted features. The anomalies are aggregated by sample number, with the total number of detected anomalies reported for each sample.
Table A2. Presents the results of anomaly detection based on the extracted features. The anomalies are aggregated by sample number, with the total number of detected anomalies reported for each sample.
Sample No.Anomaly Count Ground Truth Model Prediction *
(Set0)(Set1)Cross-Section or Longitude CutDefect ObservedDefect?Weld Parameters
23243Sensors 25 05120 i021The cross-section shows excessive penetration with a keyhole shape extending below the joint Keyhole length = 1571.6 μmYesPower: 4000
Feed Rate: 200
Defocus: 0
PFO Y: 25
TP
67242Sensors 25 05120 i022The penetration depth varies along the weld line, with areas of insufficient fusion between the weld metal and the base materialYesPower: 4000
Feed Rate: 200
Defocus: 0.2
PFO Y: 45
TP
712211Sensors 25 05120 i023The penetration depth varies along the weld line, with areas of insufficient fusion between the weld metal and the base materialYesPower: 3500
Feed Rate: 200
Defocus: −0.2
PFO Y: 25
TP
802210Sensors 25 05120 i024Small pores, but accepted weldNoPower: 3500
Feed Rate: 150
Defocus: −0.2
PFO Y: 45
FP
152012Sensors 25 05120 i025Undercut and lack of penetrationYesPower: 4000
Feed Rate: 200
Defocus: −0.2
PFO Y: 45
TP
122010Sensors 25 05120 i026PoresYesPower: 3500
Feed Rate: 150
Defocus: −0.2
PFO Y: 45
TP
791810Sensors 25 05120 i027Lack of penetrationYesPower: 3500
Feed Rate: 150
Defocus: −0.2
PFO Y: 45
TP
1018Sensors 25 05120 i028Accepted weldNoPower: 4000
Feed Rate: 200
Defocus: 0
PFO Y: 65
TN
5013Sensors 25 05120 i029Accepted weldNoPower: 3000
Feed Rate: 200
Defocus: 0.2
PFO Y: 45
TN
1803Sensors 25 05120 i030Accepted weldNoPower: 3000
Feed Rate: 200
Defocus: 0
PFO Y: 65
TN
2803Sensors 25 05120 i031The penetration depth varies along the weld line, with areas of insufficient fusion between the weld metal and the base materialYesPower: 3500
Feed Rate: 150
Defocus: 0
PFO Y: 65
FN
2903Sensors 25 05120 i032Accepted weldNoPower: 3500
Feed Rate: 200
Defocus: −0.2
PFO Y: 65
TN
3073Sensors 25 05120 i033Accepted weldNoPower: 4000
Feed Rate: 150
Defocus: 0
PFO Y: 45
TN
3552Sensors 25 05120 i034The penetration depth varies along the weld line, with areas of insufficient fusion between the weld metal and the base materialYesPower: 3500
Feed Rate: 150
Defocus: 0.2
PFO Y: 45
FN
3613Sensors 25 05120 i035Accepted weldNoPower: 3500
Feed Rate: 200
Defocus: 0.2
PFO Y: 65
TN
4504Sensors 25 05120 i036Accepted weldNoPower: 3500
Feed Rate: 250
Defocus: 0
PFO Y: 25
TN
73511Sensors 25 05120 i037Accepted weldNoPower: 3500
Feed Rate: 250
Defocus: 0
PFO Y: 25
TN
81011Sensors 25 05120 i038Accepted weldNoPower: 3500
Feed Rate: 200
Defocus: 0
PFO Y: 45
TN
5702Sensors 25 05120 i039Lack of penetrationYesPower: 3500
Feed Rate: 200
Defocus: 0.2
PFO Y: 65
FN
2564Sensors 25 05120 i040Accepted weldNoPower: 4000
Feed Rate: 200
Defocus: 0.2
PFO Y: 45
TN
* TP: true positive. TN: true negative. FN: false negative. FP: false positive.

References

  1. SaediArdahaei, S.; Pham, X.-T. Toward Stabilizing the Keyhole in Laser Spot Welding of Aluminum: Numerical Analysis. Materials 2024, 17, 4741. [Google Scholar] [CrossRef]
  2. Ma, D.; Wang, Y.; Zhang, J.; Li, X. DBN-based online identification of porosity regions during laser welding of aluminum alloys using coherent optical diagnosis. Opt. Laser Technol. 2023, 165, 109597. [Google Scholar] [CrossRef]
  3. Cai, W.; Jiang, P.; Shu, L.; Geng, S.; Zhou, Q. Real-time monitoring of laser keyhole welding penetration state based on deep belief network. J. Manuf. Process. 2021, 72, 203–214. [Google Scholar] [CrossRef]
  4. Cao, L.; Li, J.; Zhang, L.; Luo, S.; Li, M.; Huang, X. Cross-attention-based multi-sensing signals fusion for penetration state monitoring during laser welding of aluminum alloy. Knowl.-Based Syst. 2023, 261, 110212. [Google Scholar] [CrossRef]
  5. Dong, H.; Li, W.; Mu, W.; Cai, Y. Instability monitoring of molten pool in pure copper laser welding based on a multi-scale cascade model and spatial optical signals. J. Mater. Process. Technol. 2024, 118581. [Google Scholar] [CrossRef]
  6. She, K.; Li, D.; Yang, K.; Li, M.; Wu, B.; Yang, L.; Huang, Y. Online Detection of Laser Welding Penetration Depth Based on Multi-Sensor Features. Materials 2024, 17, 1580. [Google Scholar] [CrossRef]
  7. Liu, T.; Zheng, P.; Bao, J. Deep learning-based welding image recognition: A comprehensive review. J. Manuf. Syst. 2023, 68, 601–625. [Google Scholar] [CrossRef]
  8. Lee, J.; Choi, H.; Kim, J. Welding Bead Inspection Using Image and Multi-Sensor Fusion. Appl. Sci. 2023, 13, 11497. [Google Scholar] [CrossRef]
  9. Eriksson, I.; Powell, J.; Kaplan, A.F.H. Signal overlap in the monitoring of laser welding. Meas. Sci. Technol. 2010, 21, 105705. [Google Scholar] [CrossRef]
  10. Olsson, R.; Eriksson, I.; Powell, J.; Langtry, A.V.; Kaplan, A.F. Challenges to the interpretation of the electromagnetic feedback from laser welding. Opt. Lasers Eng. 2011, 49, 188–194. [Google Scholar] [CrossRef]
  11. Brüggenjürgen, J.; Spurk, C.; Hummel, M.; Franz, C.; Häusler, A.; Olowinsky, A.; Moosmann, J. Analyzing multispectral emission and synchrotron data to evaluate the quality of laser welds on copper. J. Laser Appl. 2024, 36, 032032. [Google Scholar] [CrossRef]
  12. Zhang, Y.; You, D.; Gao, X.; Zhang, N.; Gao, P.P. Welding defects detection based on deep learning with multiple optical sensors during disk laser welding of thick plates. J. Manuf. Syst. 2019, 51, 87–94. [Google Scholar] [CrossRef]
  13. Harati, E.; Kah, P. Laser welding of aluminum battery tab to variable Al/Cu busbars in Li-ion battery joint. AIMS Mater. Sci. 2022, 9, 884–918. [Google Scholar] [CrossRef]
  14. Pastor, M.; Zhao, H.; Debroy, T. Pore formation during continuous wave Nd:YAG laser welding of aluminium for automotive applications. Weld. Int. 2001, 15, 275–281. [Google Scholar] [CrossRef]
  15. Seto, N.; Katayama, S.; Matsunawa, A. Porosity formation mechanism and suppression procedure in laser welding of aluminium alloys. Weld. Int. 2001, 15, 191–202. [Google Scholar] [CrossRef]
  16. Meena, A.; Lassila, A.A.; Lonn, D.; Salomonsson, K.; Wang, W.; Nielsen, C.V.; Bayat, M. The effect of laser off-axis angle on the formation of porosities, fluid flow and keyhole formation of an aluminum alloy (AA1050) in the laser welding process. Opt. Laser Technol. 2025, 184, 112534. [Google Scholar] [CrossRef]
  17. Will, T.; Schwarzkopf, K.; Hölbling, C.; Müller, L.; Schmidt, M. Feature extraction based on scalable hypothesis tests from photodiode data in laser welding processes. Procedia CIRP 2022, 111, 527–531. [Google Scholar] [CrossRef]
  18. Lee, K.; Kang, S.; Kang, M.; Yi, S.; Kim, C. Estimation of Al/Cu laser weld penetration in photodiode signals using deep neural network classification. J. Laser Appl. 2021, 33, 032032. [Google Scholar] [CrossRef]
  19. Ozkat, E.C. Photodiode Signal Patterns: Unsupervised Learning for Laser Weld Defect Analysis. Processes 2025, 13, 121. [Google Scholar] [CrossRef]
  20. Shannon, C.E. A mathematical theory of communication. Bell Syst. Tech. J. 1948, 27, 379–423. [Google Scholar] [CrossRef]
  21. Lei, T.; Gu, S.; Yu, H. Keyhole morphology monitoring of laser welding based on image processing and principal component analysis. Appl. Opt. 2022, 61, 1492–1499. [Google Scholar] [CrossRef]
  22. You, D.; Gao, X.; Katayama, S. WPD-PCA-based laser welding process monitoring and defects diagnosis by using FNN and SVM. IEEE Trans. Ind. Electron. 2015, 62, 628–636. [Google Scholar] [CrossRef]
  23. Shin, J.; Kang, S.; Kim, C.; Hong, S.; Kang, M. Identification of solidification cracking using multiple sensors and deep learning in laser overlap welded Al 6000 alloy. J. Laser Appl. 2023, 35, 042019. [Google Scholar] [CrossRef]
  24. ISO 13919-2; Welding—Electron and Laser-Beam Welded Joints—Guidance on Quality Levels for Imperfections—Part 2: Aluminium and Its Weldable Alloys. International Organization for Standardization: Geneva, Switzerland, 2011. Available online: https://www.iso.org/standard/75515.html (accessed on 10 August 2025).
  25. Yan, S.; Chen, B.; Tan, C.; Song, X.; Wang, G. A data-driven time-sequence feature-based composite network of time-distributed CNN-LSTM for detecting pore defects in laser penetration welding. J. Intell. Manuf. 2025, 36, 3509–3526. [Google Scholar] [CrossRef]
  26. Peng, P.; Fan, K.; Fan, X.; Zhou, H.; Guo, Z. Real-time defect detection scheme based on deep learning for laser welding systems. IEEE Sens. J. 2023, 23, 17301–17309. [Google Scholar] [CrossRef]
  27. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Polosukhin, I. Attention is all you need. In Proceedings of the 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA, 4–9 December 2017; Volume 30, pp. 6000–6010. [Google Scholar]
  28. Wen, X.; Li, W. Time series prediction based on the LSTM-Attention-LSTM model. IEEE Access 2023, 11, 48322–48331. [Google Scholar] [CrossRef]
  29. Zhang, X.; Liang, X.; Zhiyuli, A.; Zhang, S.; Xu, R.; Wu, B. AT-LSTM: An attention-based LSTM model for financial time series prediction. IOP Conf. Ser. Mater. Sci. Eng. 2019, 569, 052037. [Google Scholar] [CrossRef]
  30. Lu, Y.; Huang, Q. DRST-Net: A Dual-Branch Feature Fusion Network Combining ResNet50 and Swin Transformer for Welding Light Strip Recognition. Appl. Sci. 2025, 15, 2016. [Google Scholar] [CrossRef]
  31. Xu, J.; Liu, Q.; Xu, Y.; Xiao, R.; Hou, Z.; Chen, S. Review on the Application of the Attention Mechanism in Sensing Information Processing for Dynamic Welding Processes. J. Manuf. Mater. Process. 2024, 8, 22. [Google Scholar] [CrossRef]
  32. Cao, Y.; Xiang, H.; Zhang, H.; Zhu, Y.; Ting, K.M. Anomaly Detection Based on Isolation Mechanisms: A Survey. arXiv 2024, arXiv:2403.10802. [Google Scholar] [CrossRef]
  33. Al Farizi, W.S.; Hidayah, I.; Rizal, M.N. Isolation forest based anomaly detection: A systematic literature review. In Proceedings of the 2021 8th International Conference on Information Technology, Computer and Electrical Engineering (ICITACEE), Semarang, Indonesia, 23–24 September 2021; pp. 118–122. [Google Scholar] [CrossRef]
  34. Liu, F.T.; Ting, K.M.; Zhou, Z.H. Isolation forest. In Proceedings of the 2008 Eighth IEEE International Conference on Data Mining, Pisa, Italy, 15–19 December 2008; pp. 413–422. [Google Scholar] [CrossRef]
  35. Liu, F.T.; Ting, K.M.; Zhou, Z.H. Isolation-based anomaly detection. ACM Trans. Knowl. Discov. Data (TKDD) 2012, 6, 1–39. [Google Scholar] [CrossRef]
Figure 1. Experimental setup and an example of the specimens.
Figure 1. Experimental setup and an example of the specimens.
Sensors 25 05120 g001
Figure 2. Schematic of the proposed framework for LBW monitoring and defect detection using 4D photonics data.
Figure 2. Schematic of the proposed framework for LBW monitoring and defect detection using 4D photonics data.
Sensors 25 05120 g002
Figure 3. Feature extraction workflow from SQLite databases.
Figure 3. Feature extraction workflow from SQLite databases.
Sensors 25 05120 g003
Figure 4. A 3D PCA biplot with confidence ellipsoids grouped by maximum pore volume. Power [W] loads on PC4 with zero loading on PC1–PC3. Therefore, its vector does not appear in the PC1–PC3 biplot. The red ellipsoid represents the small pore distribution, the green ellipsoid represents the medium pore distribution, and the blue ellipsoid represents the large pore distribution.
Figure 4. A 3D PCA biplot with confidence ellipsoids grouped by maximum pore volume. Power [W] loads on PC4 with zero loading on PC1–PC3. Therefore, its vector does not appear in the PC1–PC3 biplot. The red ellipsoid represents the small pore distribution, the green ellipsoid represents the medium pore distribution, and the blue ellipsoid represents the large pore distribution.
Sensors 25 05120 g004
Figure 5. Porosity analysis: Starting with CT scans of the specimens, porosities were then analyzed using VGStudioMax. Afterwards, the data were manually labeled, projected into 2D space, and segmented into 30 time steps.
Figure 5. Porosity analysis: Starting with CT scans of the specimens, porosities were then analyzed using VGStudioMax. Afterwards, the data were manually labeled, projected into 2D space, and segmented into 30 time steps.
Sensors 25 05120 g005
Figure 6. (a) The architecture for LSTMs and self-attention mechanism; (b) the architecture for a single LSTM cell with the three gates; (c) the deep learning architecture for the LSTM incorporating a self-attention mechanism.
Figure 6. (a) The architecture for LSTMs and self-attention mechanism; (b) the architecture for a single LSTM cell with the three gates; (c) the deep learning architecture for the LSTM incorporating a self-attention mechanism.
Sensors 25 05120 g006
Figure 7. An illustrative example of the Isolation Forest algorithm: red points indicate outliers, blue points indicate normal data.
Figure 7. An illustrative example of the Isolation Forest algorithm: red points indicate outliers, blue points indicate normal data.
Sensors 25 05120 g007
Figure 8. Time importance for detecting the maximum pore volume in the time segment and feature importance for detecting the maximum pore volume in the time segment.
Figure 8. Time importance for detecting the maximum pore volume in the time segment and feature importance for detecting the maximum pore volume in the time segment.
Sensors 25 05120 g008
Figure 9. Anomaly detection using the Isolation Forest: (a) the anomalies in Set0; (b) the anomalies in Set1.
Figure 9. Anomaly detection using the Isolation Forest: (a) the anomalies in Set0; (b) the anomalies in Set1.
Sensors 25 05120 g009
Figure 10. Example of Channel 18 data for four weld lines. Channel 18 is one of the VIS channels with a wavelength range of 393–431 nm.
Figure 10. Example of Channel 18 data for four weld lines. Channel 18 is one of the VIS channels with a wavelength range of 393–431 nm.
Sensors 25 05120 g010
Table 1. Welding parameters for the welding experiments.
Table 1. Welding parameters for the welding experiments.
Parameter
Power [W][3000, 3500, 4000]
Feed Rate [mm/s][150, 200, 250]
Focus Depth [mm][−0.2, 0, 0.2]
PFO Translation Y [mm][25, 45, 65]
Inclination Angle [deg][2.74, 4.92, 7.09]
Table 2. PCA loadings (feature contributions to each PC) according to Equation (27). This table represents the data from Set0.
Table 2. PCA loadings (feature contributions to each PC) according to Equation (27). This table represents the data from Set0.
FeatureEquationPCA1PCA2PCA3PCA4
RMS50.2630.0790.035−0.068
max30.2610.0200.043−0.122
peak90.2610.0200.043−0.122
std70.2610.013−0.076−0.058
p2p100.2590.000−0.002−0.112
mean40.2570.1030.069−0.068
sum_f160.2500.143−0.0820.119
mean_f180.2500.143−0.0820.119
power80.2500.143−0.0820.119
max_f170.2440.162−0.0490.126
peak_f200.2440.162−0.0490.126
var60.2330.057−0.1860.078
min20.1980.1110.251−0.139
var_f190.1920.173−0.1500.306
crestfactor110.176−0.2720.169−0.150
pulseindicator130.152−0.3340.009−0.049
autocorr240.144−0.1410.330−0.048
entropy25−0.1330.3450.2280.034
formfactor120.132−0.352−0.1910.007
skew140.106−0.2080.4300.123
skew_f21−0.0850.3610.282−0.019
kurtosis_f22−0.0850.3590.285−0.007
kurtosis150.037−0.1670.4160.415
fundamental_f230.013−0.1890.1100.620
Table 3. Per-fold metrics (MSE and MAE) for the LSTM model.
Table 3. Per-fold metrics (MSE and MAE) for the LSTM model.
FoldMSEMAE
TrainingTestingTrainingTesting
10.00240.00450.02260.0375
20.00140.00830.02260.0461
30.00340.00030.02680.0151
40.00330.00050.02950.0178
50.00320.00100.02990.0273
Average0.00280.00290.02630.0288
Table 4. Example of anomalous samples and their channels that appear as anomalies in the feature data.
Table 4. Example of anomalous samples and their channels that appear as anomalies in the feature data.
Sample No.: 79Sample No.: 67
Longitudinal cut, Sample No. 79Longitudinal cut, Sample No. 67
Power: 3500; Feed Rate: 150; Defocus: −0.2; PFO Y: 45Power: 4000; Feed Rate: 200; Defocus: 0.2; PFO Y: 45
Sensors 25 05120 i001Sensors 25 05120 i002
Chan18
VIS channel
393–410 nm
Sensors 25 05120 i003Sensors 25 05120 i004
Chan23Sensors 25 05120 i005Sensors 25 05120 i006
Chan24Sensors 25 05120 i007Sensors 25 05120 i008
Chan63Sensors 25 05120 i009Sensors 25 05120 i010
Samples 79 and 67 show unstable signals. For example, in Sample 67, Channel 24 displays sharp high-energy peaks at segment 40, with an amplitude that exceeds the values for the same channel in the normal signals. This correlates with the visible defect in the cross-section showing lack of fusion and inconsistent penetration depth. Similarly, Sample 79 shows multiple high-amplitude peaks in Channel 24, indicating instability and sudden changes in emission intensity, which aligns with the observed keyhole-shaped excessive penetration in the weld cut.
Table 5. Examples of accepted weld and their channels for compression purposes.
Table 5. Examples of accepted weld and their channels for compression purposes.
Sample No.: 33Sample No.: 51
Longitudinal cut, Sample No. 33
Power: 3000; Feed Rate: 200; Defocus: −0.2; PFO Y: 45
Longitudinal cut, Sample No. 51
Power: 4000; Feed Rate: 200; Defocus: 0.2; PFO Y: 45
Sensors 25 05120 i011Sensors 25 05120 i012
Chan18Sensors 25 05120 i013Sensors 25 05120 i014
Chan23Sensors 25 05120 i015Sensors 25 05120 i016
Chan24Sensors 25 05120 i017Sensors 25 05120 i018
Chan63Sensors 25 05120 i019Sensors 25 05120 i020
In contrast, Samples 33 and 51 demonstrate stable and smoother signal patterns, with no extreme spikes across the same channels. For example, Channel 24 in Sample 51 maintains a low-amplitude profile throughout the sequence. This consistent behavior aligns with the clean, well-formed weld cross-sections, supporting the interpretation that stable signal patterns are indicative of good welding quality. A similar observation applies to Channel 63, which shows stable signals with only minor fluctuations in these samples—especially when compared to Channel 63 in the defective samples listed in Table 4. As previously discussed, it is not only about individual spikes but about the overall behavior of the signal, which is why the extracted features are essential—they provide deeper insights into signal distribution and variability over time.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Darwish, A.; Persson, M.; Ericson, S.; Ghasemi, R.; Salomonsson, K. Weld Defect Detection in Laser Beam Welding Using Multispectral Emission Sensor Features and Machine Learning. Sensors 2025, 25, 5120. https://doi.org/10.3390/s25165120

AMA Style

Darwish A, Persson M, Ericson S, Ghasemi R, Salomonsson K. Weld Defect Detection in Laser Beam Welding Using Multispectral Emission Sensor Features and Machine Learning. Sensors. 2025; 25(16):5120. https://doi.org/10.3390/s25165120

Chicago/Turabian Style

Darwish, Amena, Manfred Persson, Stefan Ericson, Rohollah Ghasemi, and Kent Salomonsson. 2025. "Weld Defect Detection in Laser Beam Welding Using Multispectral Emission Sensor Features and Machine Learning" Sensors 25, no. 16: 5120. https://doi.org/10.3390/s25165120

APA Style

Darwish, A., Persson, M., Ericson, S., Ghasemi, R., & Salomonsson, K. (2025). Weld Defect Detection in Laser Beam Welding Using Multispectral Emission Sensor Features and Machine Learning. Sensors, 25(16), 5120. https://doi.org/10.3390/s25165120

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop