Welding defect identification method based on welding bead 3D point cloud image
Through the welding defect identification method learned by adaptive graph convolution network and category feature comparison learning, the problems of high error detection rate and insufficient feature extraction in the prior art are solved, and high-precision welding defect identification is achieved.
Patent Information
- Application Number
- CN202510508609.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-08-05
AI Technical Summary
The existing welding defect detection methods have high error detection rate, high detection cost, and complex operation. The 3D point cloud welding defect detection methods face the problems of high point cloud data, point cloud distribution inhomogeneity and insufficient defect feature extraction capabilities.
Adaptive graph convolution network is used to extract multi-scale features of welding bead 3D point cloud data, and welding defect characteristics are enhanced through multi-scale feature fusion, combined with category feature comparison learning and self-attention mechanism to improve classification accuracy.
It improves the classification accuracy and robustness of welding defect identification, reduces the confusion of defect characteristics of the same category, enhances the classification distinction, and automatically focuses on key defect areas.
Smart Images

Figure CN120431374A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image recognition, and in particular relates to a welding defect recognition method based on weld bead 3D point cloud images. Background Art
[0002] In modern manufacturing, welding quality inspection is a key link in ensuring product reliability and safety. Traditional welding defect detection methods mainly include manual visual inspection, ultrasonic testing, X-ray testing, etc. Although these methods can identify welding defects to a certain extent, they often have problems such as high false detection rate, high detection cost, and complex operation. Since weld defects usually have complex three-dimensional structures, relying solely on 2D images cannot fully capture the spatial geometric information of welding defects. They are easily interfered with by environmental factors such as light and reflection, affecting detection accuracy.
[0003] With the development of 3D sensing technology, 3D point cloud welding defect detection methods can provide precise geometric information of the weld surface compared to 2D image methods, enabling more accurate identification of welding defects. However, current 3D point cloud welding defect detection methods still face many challenges, such as high noise in point cloud data, non-uniform point cloud distribution, and insufficient defect feature extraction capabilities.
[0004] To address the above problems, a welding defect recognition method based on 3D point cloud images of weld beads was proposed. Point cloud features were extracted through an adaptive graph convolutional network, and multi-scale feature fusion was combined to enhance welding defect information at different scales. Category feature contrast learning was used to constrain features of the same category to be more closely aggregated. At the same time, the self-attention mechanism was used to focus on key defect areas to improve classification accuracy. Summary of the Invention
[0005] The present invention provides a welding defect recognition method based on weld bead 3D point cloud images, aiming to propose a welding defect recognition model, wherein the defect feature extraction module extracts multi-scale features of weld bead 3D point cloud data through an adaptive graph convolutional network, and enhances the characteristics of welding defects by fusing multi-scale weld bead 3D point cloud features; wherein the welding defect classification module uses category feature comparative learning to constrain welding defect features of the same category, so that defect features of the same category are more closely aggregated in the feature space and away from other categories, thereby improving category differentiation; at the same time, the self-attention mechanism is used to focus on key welding defect areas to improve classification accuracy.
[0006] The present invention aims to propose a welding defect recognition model and provide a welding defect recognition method based on a 3D point cloud image of a weld bead, which includes the following steps.
[0007] S1. Obtain a 3D point cloud dataset of the weld bead. Use 3D laser scanning to obtain point cloud data of the weld bead surface. Perform filtering and denoising, point cloud alignment, downsampling, and normalization preprocessing on the collected point cloud data. Perform defect annotation on the preprocessed weld bead 3D point cloud dataset to obtain the weld bead 3D point cloud dataset.
[0008] S2. Construct a defect feature extraction module and design an adaptive graph convolution feature extraction method. Combined with the adaptive adjacency matrix and multi-scale feature fusion, the features of the weld 3D point cloud data are extracted.
[0009] S3. Build a welding defect classification module, combining the self-attention mechanism, multi-layer perceptron and category feature comparative learning to identify different types of welding defects.
[0010] S4. Construct a welding defect recognition model, which consists of an output, a defect feature extraction module, a welding defect classification module and an output. Design a joint loss function to enhance the separability between welding defect category features so that the model can correctly classify different categories of welding defects.
[0011] Preferably, in step S1, a weld bead 3D point cloud dataset is obtained, and point cloud data of the weld bead surface is obtained using 3D laser scanning. The welding defects of the obtained weld bead 3D point cloud dataset include cracks, pores, lack of fusion, undercuts and weld beads. Defects are annotated for each weld bead 3D point cloud data obtained, including defect type and location. The annotated weld bead 3D point cloud data and annotation information are sorted to obtain a weld bead 3D point cloud dataset.
[0012] Preferably, in step S2, the defect feature extraction module is constructed as follows:
[0013] S21, input the pre-processed weld 3D point cloud data X to the defect feature extraction module, the weld 3D point cloud data is composed of N 3D coordinate points, X = {p1, p2, ..., p N}, each point p i is a three-dimensional coordinate point, p i ={x i ,y i , z i}, calculate each pair of points p i and p j The Euclidean distance between them is calculated as follows:
[0014]
[0015] For each pair of points p, the inverse of the Euclidean distance is calculated i and p j The similarity between them is calculated as follows:
[0016]
[0017] For each pair of points p in the point cloud i and p j Calculate the similarity and fill it into the adjacency matrix A until the complete N×N adjacency matrix A is constructed;
[0018] S22. Use the adaptive graph convolution mechanism to dynamically adjust the adjacency matrix A and generate a new adjacency matrix A. adapt , the matrix can be optimized during the training process, and the formula for generating the adaptive adjacency matrix is:
[0019] A adapt =Sigmoid(W1X+b1);
[0020] Where W1 is the weight matrix and b1 is the bias term;
[0021] Through the graph convolution operation, X is propagated from one point to its neighboring points, thereby capturing the local spatial relationship of the data in the point cloud. The formula of the graph convolution operation is:
[0022] H l+1 =ReLU(A adapt H l W l );
[0023] Where W2 is the weight matrix of graph convolution, H l It is the characteristic matrix of the lth layer, initially H0=X;
[0024] Use L layers of graph convolution for feature extraction, and the output of each layer is used as the input of the next layer to obtain the final output feature H final , H final =H L ;
[0025] S23. Graph convolutions at different layers extract 3D point cloud features of welds at different scales, and fuse features of different scales using an adaptive weighting method. The formula for the adaptive weighting is:
[0026]
[0027] Where K is the scale, α l,k is the weight of the k-th scale in the l-th layer, H l,k is the output feature of layer l and scale k;
[0028] Ensure that the sum of the weights of all scales is 1, α l,k The mathematical model is:
[0029]
[0030] Where MLP is a multi-layer perceptron;
[0031] The feature H of each layer l Further sum to get the final fused feature H MSF ,
[0032] Preferably, in step S2, for the defect feature extraction module, an adaptive graph convolution mechanism, multi-scale feature fusion and an adaptive weighting strategy are adopted to extract the defect features of the weld 3D point cloud, wherein the improvement of the adaptive adjacency matrix can dynamically adjust the topological structure of the point cloud data to adapt to the morphological changes of different welding defects, wherein the improvement of the multi-scale feature fusion can simultaneously extract welding defect information of different scales and enhance the detection capability, and improve the accuracy and robustness of the model by adaptively weighting and fusing features of different scales, wherein the adaptive adjacency matrix and the learnable weight mechanism reduce the need for manually setting hyperparameters and improve the automatic learning ability of the model, which is suitable for industrial intelligent detection.
[0033] Preferably, in step S3, the construction method of the welding defect classification module is:
[0034] S31, input the output feature H of the defect feature extraction module MSF In the welding defect classification module, a multi-layer perceptron is used to map the features H MSF , and get the transformed feature Z′, the calculation formula is:
[0035] Z=ReLU(W3H MSF +b3);
[0036] Z′=W4Z+b4;
[0037] Where W3 and W4 are weight matrices, b3 and b4 are bias terms;
[0038] S32. Construct a category feature center matrix C and calculate a feature center vector C for each category c. c , the formula is:
[0039]
[0040] Where S C is the set of all samples in category c, z i is the feature of the sample of category c, from feature H MSF ;
[0041] For each sample z i , calculate z i and its category center Cti The similarity is calculated as follows:
[0042]
[0043] Where z i ·C c is used to measure similarity, ||z i ||·||C c || Make the similarity value between [-1, 1];
[0044] Category feature contrast learning uses contrast loss to make samples of the same category move closer to the center and features of different categories move away. The formula for contrast loss is:
[0045]
[0046] Where τ is the temperature parameter, which controls the smoothness of the distribution;
[0047] S33. Use the self-attention mechanism to adaptively adjust the weights of different areas of the point cloud data to enhance the features of key defect areas. The attention weight calculation formula for each point is:
[0048]
[0049] Where W a is the attention weight matrix;
[0050] Calculate the global feature H att ,
[0051] S34, the classification layer uses the Softmax layer for final classification, and the mathematical model of the classification is:
[0052]
[0053] Where, is the final category probability distribution, W cls is the weight of the classification layer, b cls is the bias term.
[0054] Preferably, in step S3, for the welding defect classification module, the MLP performs feature transformation, reduces feature dimensions, reduces computational complexity, and improves classification efficiency, wherein category feature contrast learning allows feature vectors of similar defect samples to be more tightly aggregated, reduces feature differences within categories, and allows feature vectors of different categories to be far away from each other, thereby enhancing the model's ability to distinguish similar defects, wherein the self-attention mechanism suppresses the interference of irrelevant point cloud areas on classification, allowing the model to automatically focus on the welding defect area, thereby improving classification accuracy.
[0055] Preferably, in step S4, the method for constructing the joint loss function of the welding defect recognition model is:
[0056] The joint loss function L is composed of the category contrast loss function L CACL And the cross entropy loss function L CE Composition, where the cross entropy loss function is L CE , the mathematical model of the cross entropy loss function is:
[0057] Where y i One-hot form of the actual welding defect category, y′ i is the class probability predicted by the model;
[0058] The mathematical model of the joint loss function is:
[0059] L=λ1L CE +λ2L CACL ;
[0060] Where λ1 and λ2 are two hyperparameters used to control the weights of the two losses.
[0061] Preferably, in step S4, the joint loss function of the welding defect recognition model is composed of category contrast loss and cross entropy loss, wherein the cross entropy loss guides the model to gradually learn defect features of different categories during the training process to improve the classification accuracy, wherein the category contrast loss enhances the aggregation of samples of the same category, making the welding defect features of the same category more concentrated, stretching the feature distribution of different categories, reducing confusion between similar defect categories, and improving classification accuracy.
[0062] Compared with the prior art, the present invention has the following technical effects:
[0063] The technical solution provided by the present invention proposes a welding defect recognition model, in which the defect feature extraction module extracts multi-scale features of weld 3D point cloud data through an adaptive graph convolutional network, and enhances the characteristics of welding defects by fusing multi-scale weld 3D point cloud features; the welding defect classification module uses category feature comparison learning to constrain welding defect features of the same category, so that defect features of the same category are more closely aggregated in the feature space, and at the same time stay away from other categories, thereby improving category differentiation, and at the same time using the self-attention mechanism to focus on key welding defect areas to improve classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 This is a flow chart for welding defect recognition based on a 3D point cloud image of a weld provided by the present invention.
[0065] Figure 2 This is a structural diagram of the welding defect recognition model provided by the present invention. DETAILED DESCRIPTION
[0066] The present invention aims to propose a welding defect recognition method based on weld bead 3D point cloud images, and aims to propose a welding defect recognition model, wherein the defect feature extraction module extracts multi-scale features of weld bead 3D point cloud data through an adaptive graph convolutional network, and enhances the characteristics of welding defects by fusing multi-scale weld bead 3D point cloud features; wherein the welding defect classification module uses category feature comparative learning to constrain welding defect features of the same category, so that defect features of the same category are more closely aggregated in the feature space, and at the same time stay away from other categories, thereby improving category discrimination, and at the same time using the self-attention mechanism to focus on key welding defect areas to improve classification accuracy.
[0067] See Figure 1 As shown, a welding defect recognition method based on a 3D point cloud image of a weld in an embodiment of the present application has the following specific steps.
[0068] S1. Obtain a 3D point cloud dataset of the weld bead. Use 3D laser scanning to obtain point cloud data of the weld bead surface. Perform filtering and denoising, point cloud alignment, downsampling, and normalization preprocessing on the collected point cloud data. Perform defect annotation on the preprocessed weld bead 3D point cloud dataset to obtain the weld bead 3D point cloud dataset.
[0069] Furthermore, in step S1, a weld 3D point cloud dataset is obtained, and point cloud data of the weld surface is obtained using 3D laser scanning. The welding defects in the obtained weld 3D point cloud dataset include cracks, pores, lack of fusion, undercuts, and weld bumps. Defects are annotated for each weld 3D point cloud data obtained, including defect type and location. The annotated weld 3D point cloud data and annotation information are sorted to obtain a weld 3D point cloud dataset.
[0070] Furthermore, the weld 3D point cloud dataset is preprocessed. For filtering and denoising, the radius filtering method is adopted, and a radius threshold is set. If the number of neighbors of a point is less than the threshold, it is judged as an outlier and deleted; for point cloud alignment, the global registration method is adopted; for downsampling, the voxel grid downsampling method is adopted, and a voxel size is set to divide the point cloud into grids, and each grid retains a representative point; for normalization, the minimum-maximum normalization method is adopted to convert the weld 3D point cloud data into a standardized [0,1] range.
[0071] S2. Construct a defect feature extraction module and design an adaptive graph convolution feature extraction method. Combined with the adaptive adjacency matrix and multi-scale feature fusion, the features of the weld 3D point cloud data are extracted.
[0072] Furthermore, in step S2, the defect feature extraction module is constructed as follows:
[0073] S21, input the pre-processed weld 3D point cloud data X to the defect feature extraction module, the weld 3D point cloud data is composed of N 3D coordinate points, X = {p1, p2, ..., p N}, each point p i is a three-dimensional coordinate point, p i ={x i ,y i , z i}, calculate each pair of points p i and p j The Euclidean distance between them is calculated as follows:
[0074]
[0075] For each pair of points p, the inverse of the Euclidean distance is calculated i and p j The similarity between them is calculated as follows:
[0076]
[0077] For each pair of points p in the point cloud i and p j Calculate the similarity and fill it into the adjacency matrix A until the complete N×N adjacency matrix A is constructed;
[0078] S22. Use the adaptive graph convolution mechanism to dynamically adjust the adjacency matrix A and generate a new adjacency matrix A. adapt , the matrix can be optimized during the training process, and the formula for generating the adaptive adjacency matrix is:
[0079] A adapt =Sigmoid(W1X+b1);
[0080] Where W1 is the weight matrix and b1 is the bias term;
[0081] Through the graph convolution operation, X is propagated from one point to its neighboring points, thereby capturing the local spatial relationship of the data in the point cloud. The formula of the graph convolution operation is:
[0082] H l+1 =ReLU(A adapt H l W l );
[0083] Where W2 is the weight matrix of graph convolution, H l It is the characteristic matrix of the lth layer, initially H0=X;
[0084] Use L layers of graph convolution for feature extraction, and the output of each layer is used as the input of the next layer to obtain the final output feature H final , H final =H L ;
[0085] S23. Graph convolutions at different layers extract 3D point cloud features of welds at different scales, and fuse features of different scales using an adaptive weighting method. The formula for the adaptive weighting is:
[0086]
[0087] Where K is the scale, α l,k is the weight of the k-th scale in the l-th layer, H l,k is the output feature of layer l and scale k;
[0088] Ensure that the sum of the weights of all scales is 1, α l,k The mathematical model is:
[0089]
[0090] Where MLP is a multi-layer perceptron;
[0091] The feature H of each layer l Further sum to get the final fused feature H MSF ,
[0092] S3. Build a welding defect classification module, combining the self-attention mechanism, multi-layer perceptron and category feature comparative learning to identify different types of welding defects.
[0093] Furthermore, in step S3, the construction method of the welding defect classification module is as follows:
[0094] S31, input the output feature H of the defect feature extraction module MSF In the welding defect classification module, a multi-layer perceptron is used to map the features H MSF , and get the transformed feature Z′, the calculation formula is:
[0095] Z=ReLU(W3H MSF +b3);
[0096] Z′=W4Z+b4;
[0097] Where W3 and W4 are weight matrices, b3 and b4 are bias terms;
[0098] S32. Construct a category feature center matrix C and calculate a feature center vector C for each category c. c , the formula is:
[0099]
[0100] Where S C is the set of all samples in category c, z i is the feature of the sample of category c, from feature H MSF ;
[0101] For each sample z i , calculate z i and its category center C yi The similarity is calculated as follows:
[0102]
[0103] Where z i ·C c is used to measure similarity, ||z i ||·||C c || Make the similarity value between [-1, 1];
[0104] Category feature contrast learning uses contrast loss to make samples of the same category move closer to the center and features of different categories move away. The formula for contrast loss is:
[0105]
[0106] Where τ is the temperature parameter, which controls the smoothness of the distribution;
[0107] S33. Use the self-attention mechanism to adaptively adjust the weights of different areas of the point cloud data to enhance the features of key defect areas. The attention weight calculation formula for each point is:
[0108]
[0109] Where W a is the attention weight matrix;
[0110] Calculate the global feature H att ,
[0111] S34, the classification layer uses the Softmax layer for final classification, and the mathematical model of the classification is:
[0112]
[0113] Where, is the final category probability distribution, W cls is the weight of the classification layer, b cls is the bias term.
[0114] S4. Construct a welding defect recognition model, which consists of an output, a defect feature extraction module, a welding defect classification module and an output. Design a joint loss function to enhance the separability between welding defect category features so that the model can correctly classify different categories of welding defects.
[0115] Furthermore, in step S4, the joint loss function of the welding defect recognition model is constructed as follows:
[0116] The joint loss function L is composed of the category contrast loss function L CACL And the cross entropy loss function L CE Composition, where the cross entropy loss function is L CE , the mathematical model of the cross entropy loss function is:
[0117] Where y i One-hot form of the actual welding defect category, y′ i is the class probability predicted by the model;
[0118] The mathematical model of the joint loss function is:
[0119] L=λ1L CE +λ2L CACL ;
[0120] Where λ1 and λ2 are two hyperparameters used to control the weights of the two losses.
[0121] Furthermore, in step S4, for the welding defect recognition model, its structure is as follows Figure 2 As shown in the figure, during the training process, the model adopts a dynamic learning rate adjustment strategy, the initial learning rate is set to 0.001, and an adaptive learning rate decay method is used to gradually decay the learning rate with the increase of training rounds; after the model training is completed, it is evaluated on the weld 3D point cloud data test set, using precision, recall and F1-score as the main evaluation indicators to measure the classification performance of the model in different categories.
[0122] Furthermore, in step S4, for the welding defect recognition model, it is written based on the Pytorch framework, and the optimizer adopts AdamW, combined with the adaptive learning rate to improve the model convergence speed. The learning rate in the AdamW optimizer is set to 0.001, the first-order momentum estimation coefficient is set to 0.9, the second-order momentum estimation coefficient is set to 0.999, the weight decay coefficient is set to 0.01, the batch size is set to 32, and the number of training rounds is set to 150.
[0123] The above are only preferred embodiments of the present invention. It should be pointed out that those skilled in the art can make several modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the scope of protection of the present invention.
Claims
1. A welding defect recognition method based on 3D point cloud image of weld bead, characterized in that: The specific steps include: S1. Obtain a 3D point cloud dataset of the weld bead. Use 3D laser scanning to obtain point cloud data of the weld bead surface. Perform filtering and denoising, point cloud alignment, downsampling, and normalization preprocessing on the collected point cloud data. Perform defect annotation on the preprocessed weld bead 3D point cloud dataset to obtain a weld bead 3D point cloud dataset. S2. Construct a defect feature extraction module and design an adaptive graph convolution feature extraction method, combining adaptive adjacency matrix and multi-scale feature fusion to extract the features of weld 3D point cloud data; S3. Build a welding defect classification module that combines self-attention mechanism, multi-layer perceptron, and category feature comparative learning to identify different types of welding defects. S4. Construct a welding defect recognition model, which consists of an output, a defect feature extraction module, a welding defect classification module and an output. Design a joint loss function to enhance the separability between welding defect category features so that the model can correctly classify different categories of welding defects.
2. The welding defect recognition method based on weld bead 3D point cloud image according to claim 1, characterized in that: In step S1, a weld bead 3D point cloud dataset is obtained, and point cloud data of the weld bead surface is obtained using 3D laser scanning. The welding defects in the obtained weld bead 3D point cloud dataset include cracks, pores, lack of fusion, undercuts, and weld bumps. Defects are annotated for each weld bead 3D point cloud data obtained, including defect type and location. The annotated weld bead 3D point cloud data and the annotation information are sorted to obtain the weld bead 3D point cloud dataset.
3. The welding defect recognition method based on weld bead 3D point cloud image according to claim 2, characterized in that: In step S2, the defect feature extraction module is constructed as follows: S21, input the pre-processed weld 3D point cloud data X to the defect feature extraction module, the weld 3D point cloud data is composed of N 3D coordinate points, X = {p1, p2, ..., p N }, each point p i is a three-dimensional coordinate point, p i ={x i ,y i , z i }, calculate each pair of points p i and p j The Euclidean distance between them is calculated as follows: For each pair of points p, the inverse of the Euclidean distance is calculated i and p j The similarity between them is calculated as follows: For each pair of points p in the point cloud i and p j Calculate the similarity and fill it into the adjacency matrix A until the complete N×N adjacency matrix A is constructed; S22. Use the adaptive graph convolution mechanism to dynamically adjust the adjacency matrix A and generate a new adjacency matrix A. adapt , the matrix can be optimized during the training process, and the formula for generating the adaptive adjacency matrix is: A adapt =Sigmoid(W1X+b1); Where W1 is the weight matrix and b1 is the bias term; Through the graph convolution operation, X is propagated from one point to its neighboring points, thereby capturing the local spatial relationship of the data in the point cloud. The formula of the graph convolution operation is: A l+1 =ReLU(A adapt A l W l ); Where W2 is the weight matrix of graph convolution, H l It is the characteristic matrix of the lth layer, initially H0=X; Use L layers of graph convolution for feature extraction, and the output of each layer is used as the input of the next layer to obtain the final output feature H final , H final =H L ; S23. Graph convolutions at different layers extract 3D point cloud features of welds at different scales, and fuse features of different scales using an adaptive weighting method. The formula for the adaptive weighting is: Where K is the scale, α l,k is the weight of the k-th scale in the l-th layer, H l,k is the output feature of layer l and scale k; Ensure that the sum of the weights of all scales is 1, α l,k The mathematical model is: Where MLP is a multi-layer perceptron; The feature H of each layer l Further sum to get the final fused feature H MSF , 4. The welding defect recognition method based on weld bead 3D point cloud image according to claim 3, characterized in that: In step S3, the construction method of the welding defect classification module is: S31, input the output feature H of the defect feature extraction module MSF In the welding defect classification module, a multi-layer perceptron is used to map the features H MSF , and get the transformed feature Z′, the calculation formula is: <h2 style=";text-align:left;direction:ltr">Z = ReLU(W3H<h2 style=";text-align:left;direction:ltr"> MSF <h2 style=";text-align:left;direction:ltr"> +b3); Z′=W4Z+b4; Where W3 and W4 are weight matrices, b3 and b4 are bias terms; S32. Construct a category feature center matrix C and calculate a feature center vector C for each category c. c , the formula is: Where S C is the set of all samples in category c, z i is the feature of the sample of category c, from feature H MSF ; For each sample z i , calculate z i and its category center C yi The similarity is calculated as follows: Where z i ·C c is used to measure similarity, ||z i ||·||C c || Make the similarity value between [-1, 1]; Category feature contrast learning uses contrast loss to make samples of the same category move closer to the center and features of different categories move away. The formula for contrast loss is: Where τ is the temperature parameter, which controls the smoothness of the distribution; S33. Use the self-attention mechanism to adaptively adjust the weights of different areas of the point cloud data to enhance the features of key defect areas. The attention weight calculation formula for each point is: Where W a is the attention weight matrix; Calculate the global feature H att , S34, the classification layer uses the Softmax layer for final classification, and the mathematical model of the classification is: Where, is the final category probability distribution, W cls is the weight of the classification layer, b cls is the bias term.
5. The welding defect recognition method based on weld bead 3D point cloud image according to claim 4, characterized in that: In step S4, the method for constructing the joint loss function of the welding defect recognition model is: The joint loss function L is composed of the category contrast loss function L CACL and the cross entropy loss function L CE Composition, where the cross entropy loss function is L CE , the mathematical model of the cross entropy loss function is: Where y i One-hot form of the actual welding defect category, y′ i is the class probability predicted by the model; The mathematical model of the joint loss function is: L=λ1L CE +λ2L CACL ; Where λ1 and λ2 are two hyperparameters used to control the weights of the two losses.
Citation Information
Cited By
Flexible display module surface defect image recognition method
CN120912621A