Lightweight bearing surface defect detection method and system based on improved YOLOv10n

By introducing the FCF full-scale connection module and MOBFFN forward network architecture into the YOLOv10 network, the problem of imbalance in accuracy and efficiency in bearing surface defect detection is solved, and efficient and robust defect detection is achieved.

CN119624897AActive Publication Date: 2025-03-14YANCHENG INST OF TECH +1

Patent Information

Application Number
CN202411682346.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-14
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

The prior art is difficult to achieve a balance between accuracy and efficiency in the detection of bearing surface defects, especially in terms of robustness and inference speed in complex scenarios.

Method used

By constructing the FCF full-scale connection module and MOBFFN forward network architecture in the YOLOv10 network structure, the multi-scale feature extraction capability and model expression efficiency are improved, the robustness of the model is enhanced and the inference speed is improved.

Benefits of technology

It has achieved a significant increase inference speed while maintaining high accuracy, enhanced the robustness of the model in complex scenarios, and achieved a good balance between accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119624897A_ABST
    Figure CN119624897A_ABST
Patent Text Reader

Abstract

The invention discloses a lightweight bearing surface defect detection method and system based on improved YOLOv10n. The method comprises the following steps: acquiring a bearing surface defect sample data set; the method comprises the following steps: improving a YOLOv10 network structure to obtain an FM-NET algorithm model; training an FM-NET algorithm model based on the bearing surface defect sample data set to obtain a target FM-NET algorithm model; and performing defect detection on a to-be-detected bearing image according to the target FM-NET algorithm model, and determining a defect position and a corresponding defect category in the bearing image. According to the method, the multi-scale feature extraction capability and the model expression efficiency are remarkably improved, the robustness of the model in a complex scene is enhanced, the reasoning speed is remarkably improved on the premise of keeping high precision, and therefore good balance between the precision and the efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of bearing surface defect detection, and in particular to a lightweight bearing surface defect detection method and system based on improved YOLOv10n. Background Art

[0002] Bearings are one of the most important components in mechanical equipment and are widely used in many industries such as automobiles, aerospace, energy, and machinery manufacturing. According to market statistics, the global bearing market size has exceeded US$12 billion in 2022, and is expected to grow at an annual compound growth rate of more than 6% in the next few years. The main function of bearings is to reduce friction and wear generated during movement, thereby improving the operating efficiency and service life of equipment. It can be seen that the quality of bearings plays a decisive role in the stability and reliability of mechanical systems.

[0003] During the manufacturing and use of bearings, surface defects (such as abrasions, pits, scratches, etc.) are common. These defects may be caused by material problems, improper manufacturing processes, wear or corrosion. Even tiny surface defects may cause bearing performance degradation, increase friction, shorten service life, and even cause equipment failure. Industrial data shows that about 15% of mechanical failures are caused by bearing failures, further highlighting the importance of bearing quality. Therefore, accurately detecting and identifying bearing surface defects is of great significance to ensure bearing quality and stable equipment operation.

[0004] In recent years, with the rapid development of deep learning technology, target detection technology based on convolutional neural network (CNN) has performed well in image recognition and object detection tasks. As an efficient real-time target detection model, YOLO (You Only Look Once) can quickly and accurately identify multiple targets in a single prediction. Compared with other target detection algorithms, YOLO has significant advantages in detection speed and accuracy. At present, the basic network framework for bearing surface defect detection uses the YOLOv10 network in the single-stage detection network category, but the multi-scale feature extraction capability and model expression efficiency are low, the model has low robustness in complex scenarios, and the inference speed is not high in high-precision detection scenarios, which makes it impossible for the model to achieve a balance between accuracy and efficiency when detecting bearing surface defects. Summary of the invention

[0005] The present invention aims to solve at least one of the technical problems in the above-mentioned technology to a certain extent. To this end, the first purpose of the present invention is to propose a lightweight bearing surface defect detection method based on improved YOLOv10n, which achieves a significant improvement in multi-scale feature extraction capability and model expression efficiency, not only enhancing the robustness of the model in complex scenarios, but also significantly improving the inference speed while maintaining high accuracy, thereby achieving a good balance between accuracy and efficiency.

[0006] The second object of the present invention is to propose a lightweight bearing surface defect detection system based on improved YOLOv10n.

[0007] To achieve the above object, the first embodiment of the present invention proposes a lightweight bearing surface defect detection method based on improved YOLOv10n, comprising:

[0008] Obtain a sample data set of bearing surface defects;

[0009] Improve the YOLOv10 network structure and obtain the FM-NET algorithm model;

[0010] The FM-NET algorithm model is trained based on the bearing surface defect sample data set to obtain the target FM-NET algorithm model;

[0011] According to the target FM-NET algorithm model, defect detection is performed on the bearing image to be inspected, and the defect position in the bearing image and its corresponding defect category are determined.

[0012] According to some embodiments of the present invention, obtaining a bearing surface defect sample data set includes:

[0013] Obtaining a bearing image dataset containing surface defects;

[0014] The bearing image data set is amplified based on data enhancement technology to obtain a bearing surface defect sample data set; the data enhancement technology includes at least one of introducing noise, Mixup, CutMix and Mosaic.

[0015] According to some embodiments of the present invention, the YOLOv10 network structure is improved to obtain the FM-NET algorithm model, including:

[0016] Construct FCF full-scale connection module;

[0017] Build the MOBFFN forward network architecture;

[0018] The first improvement result is obtained by replacing the Concat module in the neck network of the YOLOv10 network structure with the FCF full-scale connection module;

[0019] The second improvement result is obtained by replacing the C2f module in the backbone network of the YOLOv10 network structure based on the MOBFFN forward network architecture;

[0020] According to the first improvement result and the second improvement result, the FM-NET algorithm model is obtained.

[0021] According to some embodiments of the present invention, the FCF full-scale connection module includes:

[0022] The interpolation upsampling module is used to receive feature maps from different scales. Assume that the input feature maps are: Among them, C 1 ,C 2 ,...,C n Indicates the number of channels of different feature maps, H n and W n Respectively represent the nth feature map x n The height and width of

[0023] All feature maps are normalized to obtain a uniform size for fusion; the process is expressed as:

[0024] x i ˊ=Interpolate(x i ,size=(H T ,W T )),i=1,2,...,n

[0025] Among them, x i ˊ is the result of interpolation of the ith feature map; Interpolate means using the Nearest interpolation algorithm for interpolation; x i is the i-th feature map of the input; i = 1, 2, ..., n, n is the number of feature maps of the input; size = (H T ,W T ) means adjusting all feature maps to a uniform size: the height is represented by H T , width is represented by W T ;

[0026] The channel splicing module is used to splice these feature maps in the channel dimension after all feature maps are adjusted to the same spatial size through interpolation;

[0027] The concatenation operation is expressed as:

[0028]

[0029] Among them, Concat represents the interpolated feature map x 1ˊ ,x 2 ˊ ,...,x n ˊ Perform the splicing operation of the channel dimension; the spliced ​​feature map is represented as x concat , the number of channels is C total =C 1 +C 2 +...+C n , the spatial resolution remains at H T ×W T ;

[0030] The feature enhancement module is used to enhance the features of the concatenated feature map through the attention mechanism. The channel attention mechanism and the spatial attention mechanism assign adaptive weights to each channel and spatial position of the feature map.

[0031] The convolution processing module is used to adjust the number of channels of the output feature map and compress the channels using 1×1 convolution. Assuming that the number of target output channels is C out , then the convolution operation is expressed as:

[0032]

[0033] Among them, Conv 1×1 (x spatial ) represents the feature map x spatial Apply a 1×1 convolution operation; Represents the dimension of the output feature map, where C out is the number of output channels, and H T and W T is the height and width of the space.

[0034] According to some embodiments of the present invention, the feature enhancement module includes:

[0035] Channel attention mechanism module, used for:

[0036] For the concatenated feature map x concat Apply global average pooling to generate a global description of each channel;

[0037]

[0038] Among them, z c represents the average result of channel c; H T and W T Represents the height and width of the target feature map, that is, the spatial dimension for averaging; C total Represents x concat The total number of channels in, c from 1 to C total ;

[0039] Generate channel attention weight a through convolution c , and use the activation function to compress the weights into the range [0,1], expressed as:

[0040] a c =Sigmoid(Conv1D(z c ))

[0041] Among them, Conv1D means using one-dimensional convolution on z c Perform convolution operation; Sigmoid means using Sigmoid activation function to compress weights;

[0042] Using channel attention weight a c The feature map of each channel is weighted, and the process is expressed as:

[0043] x channel (i,j,c)=x concat (i,j,c)·a c

[0044] Among them, x channel (i, j, c) represents the value of the weighted feature map at position (i, j) and channel c; x concat (i,j,c) represents the original concatenated tensor x concat The value of channel c at position (i, j); a c is a weighting coefficient for each channel c, which controls the importance of each channel in the feature map;

[0045] Spatial attention mechanism module, used to:

[0046] After the channel attention mechanism module is processed, the spatial attention mechanism is used to further enhance the important spatial positions;

[0047] First, calculate the average feature and maximum feature of each position, respectively:

[0048]

[0049] Among them, x avg (i,j) is the average feature of position (i,j); C total is the total number of channels, is a normalization factor that calculates the channel average at each spatial position;

[0050] x max (i,j)=max(x channel (i,j,c)),c∈{1,2,…,C total}

[0051] Among them, x max (i,j) represents the sum of all channels in the set c∈{1,2,…,C total}, the maximum eigenvalue at position (i, j); x channel (i,j,c) is the eigenvalue of the cth channel at position (i,j);

[0052] The average feature and the maximum feature of each position are concatenated, and the spatial attention weight is generated through 2D convolution:

[0053] a s (i,j)=Sigmoid(Conv2D([avg(i,j),max(i,j)]))

[0054] The input in the formula is the average pooling value avg(i,j) and the maximum pooling value max(i,j) at the position (i,j), that is, the average and maximum features of all channels are first obtained at each spatial position; Conv2D([avg(i,j),max(i,j)]) represents a two-dimensional convolution operation on the concatenated average pooling value and the maximum pooling value; after the convolution output passes through the Sigmoid activation function, the attention coefficient a is obtained. s (i,j);

[0055] Use spatial attention weights to perform spatial weighting on the feature map, expressed as:

[0056] x spatial (i,j,c)=x channel (i,j,c)·a s (i,j)

[0057] Among them, x spatial (i, j, c) represents the value of the feature map at position (i, j) and channel c after spatial attention weighting; x channel (i, j, c) is the feature map obtained by channel weighting, that is, the feature value after the weighting coefficient is applied to each channel; a s (i,j) is the spatial attention coefficient at position (i,j), which is a weight between 0 and 1, indicating the importance of that position.

[0058] According to some embodiments of the present invention, a MOBFFN forward network architecture is constructed, including:

[0059] For the input feature x∈R C×H×W Perform 1×1 convolution to double the number of channels to 2C;

[0060] xˊ=Conv 1×1 (x),xˊ∈R2C×H×W

[0061] Among them, Conv 1×1 (x): indicates that a 1×1 convolution operation is applied to the input feature map x; xˊ∈R 2C×H×W Represents the dimension of the output feature map; here 2C means that the number of output channels is twice the number of input channels, while the spatial resolution H and W are consistent with the input feature map; xˊ represents the feature map after convolution;

[0062] Split the doubled xˊ into two parts x along the channel dimension 1 and x 2 , the number of channels in each part is C;

[0063] x 1 ,x 2 =xˊ·chunk(2,dim=1),x 1 ,x 2 ∈R C×H×W

[0064] Among them, xˊ·chunk(2,dim=1) means dividing the feature map x′ into two parts along the channel dimension, where the channel dimension is the first dimension; x 1 ,x 2 ∈R C×H×W The two feature maps x after partitioning 1 and x 2 The number of channels is C, and the spatial dimensions H and W remain unchanged;

[0065] x 2 Input MOB module for multi-branch convolution processing to get the output x MOB , x 1 and x MOB Perform element-wise multiplication to enhance feature interactions;

[0066] x fused =x 1 ·x MOB ,x fused ∈R C×H×W

[0067] Among them, x fused =x 1 ·x MOB Indicates x 1 and x MOB Multiply corresponding elements at the same position; x fused ∈R C×H×W Represents the fused feature map x fused It has C channels, and the spatial resolutions H and W remain unchanged;

[0068] Through 1×1 convolution, the backend feature map x is fused. fused Processing is performed to compress the number of channels, expressed as:

[0069] x out =Conv 1×1 (x fused ),x out ∈R C×H×W

[0070] Among them, Conv 1×1 (x fused ) represents the feature map x fused Apply a 1×1 convolution operation; x out ∈R C×H×W Represents the dimension of the final output feature map; the number of channels C remains the same as the input, and the spatial resolutions H and W also remain unchanged;

[0071] Combine the original input feature x with the output x out Add together to form a residual connection;

[0072] y=x out +x

[0073] Among them, y represents the residual connection.

[0074] According to some embodiments of the present invention, the MOB module is the core part of the MOBFFN module, which performs multi-path processing on input features through multiple parallel convolution branches and simplifies these branches into a single convolution by reparameterization during the inference phase;

[0075] The mathematical representation of the MOB module is:

[0076] Training phase: Feature enhancement of multi-branch structure;

[0077] During the training phase, the MOB module enhances features through a multi-branch structure; each branch includes a skip connection, a convolution branch, and a scale scaling branch. All branches are batch normalized and processed by an activation function after fusion.

[0078] Skip connection: Skip connection processes the input feature x through batch normalization;

[0079] x skip =BN(x)

[0080] Among them, BN(x) means applying batch normalization operation to input feature x;

[0081] Convolution branch: Use n convolution kernels of size k i ×k i The convolution branches of, the output of each branch;

[0082]

[0083] in, Indicates that the convolution kernel size is k i ×k i The convolution kernel performs a convolution operation on the feature x; BN means applying a batch normalization operation; To use a convolution kernel size of k i ×k i The result of the convolution operation of the convolution kernel on the feature x;

[0084] Scale scaling branch: Use 1×1 convolution and Batch Normalization for scale scaling;

[0085] x scale =BN(Conv 1×1 (x))

[0086] Among them, Conv 1×1 (x) indicates that a convolution operation is performed on feature x using a convolution kernel with a convolution kernel size of 1×1; BN indicates the application of batch normalization operation;

[0087] Feature fusion and activation: The results of the skip connection, scale scaling branch, and convolution branch are added and processed by the activation function σ, expressed as:

[0088]

[0089] Among them, x skip is the feature map in the skip connection or residual path; x scale It is a scaled feature map used to adjust the scale of the overall feature; Represents multiple convolutional feature maps The sum of n convolution results is superimposed; σ(.) means applying the SiLU activation function to the summed result;

[0090] Inference stage: reparameterized convolution simplification;

[0091] In the inference phase, the multi-branch structure of the MOB module is simplified into a single convolution operation. Through the reparameterization technique, the convolution kernels and biases of multiple convolution branches in the training phase are fused.

[0092] Fusion skip connection: The batch normalization operation of the skip connection can be converted into an equivalent convolution kernel K skip and bias b skip ;

[0093]

[0094] Among them, γ skipand β skip is the parameter of BatchNorm, μ skip and σ skip are the mean and variance;

[0095] Fusion convolution branch: For each convolution branch, assume that the convolution kernel is Bias is The convolution kernels and biases of all convolution branches are accumulated. In this way, multiple convolution operations are combined into a single convolution operation, expressed as:

[0096]

[0097] Among them, K skip is the convolution kernel in the skip connection path; represents the sum of n convolution kernels, that is, the weights of multiple groups of convolution kernels are superimposed together; the final K fused It is the fusion result of these convolution kernels, which contains the information of skip connection and multi-layer convolution; b skip is the bias term in the skip connection path; represents the sum of the biases of n convolutional layers, and the final b fused is the fusion result of these bias terms;

[0098] Simplified convolution operation in the inference phase: In the inference phase, all convolution branches and skip connections are equivalent to a single convolution operation, through the convolution kernel K fused and bias b fused Perform convolution calculation, expressed as:

[0099] x out =σ(BN(Conv(x,K fused ,b fused )))

[0100] Among them, Conv(x,K fused ,b fused ) means applying a convolution operation to the input feature map x, and the convolution kernel is the fused K fused , the bias term is the fused b fused ; BN(·): batch normalization operation; σ(·): application of activation function SiLU to the result after batch normalization.

[0101] According to some embodiments of the present invention, the FM-NET algorithm model is trained based on a bearing surface defect sample data set to obtain a target FM-NET algorithm model, including:

[0102] S41. Randomly divide the bearing surface defect sample data set into a training set, a test set, and a validation set in a ratio of 6:2:2; initialize the network weight, learning rate, batch size, and number of iterations of the FM-NET algorithm model;

[0103] S42, inputting the samples in the training set into the FM-NET algorithm model for pre-training;

[0104] S43, using the CIOU loss function, calculate the loss value between the predicted box and the target GT box of the sample in the training set, and back-propagate the loss value to optimize and update the network weights of the FM-NET algorithm model;

[0105] S44, repeating steps S42 and S43 until the samples in the training set are exhausted, and obtaining a pre-trained improved FM-NET algorithm model;

[0106] S45, input the samples in the verification set into the pre-trained FM-NET algorithm model for verification;

[0107] S46, calculating the precision value AP of the surface defect category of the samples in the validation set, and calculating the average precision value mAP of all precision values ​​AP;

[0108] S47, repeat S44-S46 until the average precision value mAP obtained multiple times is equal to or close to a fixed value, and the trained FM-NET algorithm model is obtained;

[0109] S48. Use the test set to test the trained FM-NET algorithm model to evaluate the performance of the model.

[0110] According to some embodiments of the present invention, defect detection is performed on a bearing image to be detected according to a target FM-NET algorithm model, and a defect position in the bearing image and a corresponding defect category thereof are determined, including:

[0111] The FM-NET algorithm model is pruned using model pruning technology, the performance of the pruned model is evaluated, and the target FM-NET algorithm model after LAMP pruning is obtained;

[0112] The target FM-NET algorithm model after LAMP pruning is deployed to embedded devices to obtain bearing surface defect detection equipment;

[0113] The bearing image to be inspected is input into the bearing surface defect detection device, and the defect position in the bearing image and its corresponding defect category are output.

[0114] To achieve the above object, the second embodiment of the present invention proposes a lightweight bearing surface defect detection system based on improved YOLOv10n, comprising:

[0115] An acquisition module, used to acquire a bearing surface defect sample data set;

[0116] Improvement module, used to improve the YOLOv10 network structure and obtain the FM-NET algorithm model;

[0117] A training module is used to train the FM-NET algorithm model based on a bearing surface defect sample data set to obtain a target FM-NET algorithm model;

[0118] The detection module is used to perform defect detection on the bearing image to be detected according to the target FM-NET algorithm model, and determine the defect position in the bearing image and its corresponding defect category.

[0119] This paper proposes a lightweight bearing surface defect detection method and system based on improved YOLOv10n. By building the FCF full-scale connection module and MOBFFN forward network architecture on the basis of the original YOLOv10 algorithm, the multi-scale feature extraction capability and model expression efficiency are significantly improved. These two key improvements not only enhance the robustness of the model in complex scenarios, but also significantly improve the inference speed while maintaining high accuracy, thus achieving a good balance between accuracy and efficiency.

[0120] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.

[0121] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0122] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0123] Figure 1 is a flow chart of a lightweight bearing surface defect detection method based on improved YOLOv10n according to an embodiment of the present invention;

[0124] Figure 2 is a schematic diagram of a network architecture of a FM-NET algorithm model according to an embodiment of the present invention;

[0125] Figure 3 is a structural diagram of an FCF full-scale connection module according to an embodiment of the present invention;

[0126] Figure 4 is a schematic diagram of a MOBFFN forward network architecture according to an embodiment of the present invention;

[0127] Figure 5 is a schematic diagram of a bearing surface defect sample data set according to an embodiment of the present invention;

[0128] Figure 6 is a category example diagram of a bearing surface defect sample data set according to an embodiment of the present invention, which includes: defect type and sample quantity, label box visualization, label box distribution center point (x, y) and label size distribution;

[0129] Figure 7 is a comparison diagram of mAP during training in an ablation experiment according to an embodiment of the present invention;

[0130] Figure 8 is a comparison diagram of detection results according to an embodiment of the present invention;

[0131] Fig. 9 is a diagram showing embedded deployment results according to an embodiment of the present invention;

[0132] Fig.10 is a comparison chart of experimental results of applying the FM-NET algorithm model according to an embodiment of the present invention to NEU-DET;

[0133] Fig.11 is a comparison chart of experimental results of applying the FM-NET algorithm model according to an embodiment of the present invention to a Peking University printed circuit board defect data set;

[0134] Fig.12 This is a comparison chart of experimental results of applying the FM-NET algorithm model according to an embodiment of the present invention to the Tianchi aluminum defect dataset. DETAILED DESCRIPTION

[0135] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0136] According to the attached Figure 1-Figure 12 A lightweight bearing surface defect detection method and system based on improved YOLOv10n are described.

[0137] like Figure 1 As shown, the first embodiment of the present invention proposes a lightweight bearing surface defect detection method based on improved YOLOv10n, including steps S1-S4:

[0138] S1. Obtain a sample data set of bearing surface defects;

[0139] S2. Improve the YOLOv10 network structure to obtain the FM-NET algorithm model;

[0140] S3, training the FM-NET algorithm model based on the bearing surface defect sample data set to obtain the target FM-NET algorithm model;

[0141] S4. Perform defect detection on the bearing image to be inspected according to the target FM-NET algorithm model, and determine the defect position in the bearing image and its corresponding defect category.

[0142] The working principle of the above technical solution: The YOLOv10 network structure is a conventional network structure in the prior art and will not be described here.

[0143] The FM-NET algorithm model is an algorithm model obtained by constructing the FCF full-scale connection module and the MOBFFN forward network architecture and improving the YOLOv10n network structure.

[0144] The target FM-NET algorithm model is the trained FM-NET algorithm model.

[0145] The beneficial effects of the above technical solution are: by building the FCF full-scale connection module and MOBFFN forward network architecture on the basis of the original YOLOv10 algorithm, the multi-scale feature extraction capability and model expression efficiency are significantly improved. These two key improvements not only enhance the robustness of the model in complex scenarios, but also significantly improve the inference speed while maintaining high accuracy, thus achieving a good balance between accuracy and efficiency.

[0146] According to some embodiments of the present invention, obtaining a bearing surface defect sample data set includes:

[0147] Obtaining a bearing image dataset containing surface defects;

[0148] The bearing image data set is amplified based on data enhancement technology to obtain a bearing surface defect sample data set; the data enhancement technology includes at least one of introducing noise, Mixup, CutMix and Mosaic.

[0149] Working principle and beneficial effects of the above technical solution: The original bearing image dataset containing surface defects has three types of defects, namely grooves, abrasions, and scratches, and each image contains 3 to 5 defects. After expansion, it becomes 4,500. Introducing noise: Noise enhancement increases the diversity of data by adding random noise to the image. For bearing images, Gaussian noise, salt and pepper noise, etc. can be added to simulate the noise interference that may be encountered during actual shooting. This enhancement method helps the model learn the ability to accurately identify defects in a noisy environment. Mixup is a data enhancement technology that generates new training samples by randomly mixing two or more samples and their labels. For bearing images, Mixup can mix two images with different defects in a certain proportion and mix their labels at the same time. This method helps the model learn the correlation and difference between different defects and improve the generalization ability of the model. CutMix is ​​an improved version of Mixup, which cuts out a part of an image and fills it into the corresponding area of ​​another image, while adjusting the label to reflect this combination. For bearing images, CutMix can simulate the performance of defects in different backgrounds and help the model learn more complex feature combinations and background changes. Mosaic data augmentation technology combines multiple images and stitches them together to form a new image. This method is particularly effective in target detection tasks because it can simulate situations where multiple targets appear in the same scene at the same time. For bearing images, Mosaic can enhance the model's ability to recognize the simultaneous presence of multiple defects and improve the model's performance in complex scenarios. By performing a series of transformations on the original dataset, more diverse samples can be generated, helping the model learn more robust features. Amplifying the bearing image dataset based on data augmentation technology is an effective strategy that can significantly improve the performance of the model in bearing surface defect detection tasks. The original image data is enhanced using random data augmentation methods to improve the network's detection effect on small targets. Part of the expanded bearing surface defect sample dataset is shown below. Figure 5-6 shown.

[0150] like Figure 2 As shown, according to some embodiments of the present invention, the YOLOv10 network structure is improved to obtain the FM-NET algorithm model, including:

[0151] Construct FCF full-scale connection module;

[0152] Build the MOBFFN forward network architecture;

[0153] The first improvement result is obtained by replacing the Concat module in the neck network of the YOLOv10 network structure with the FCF full-scale connection module;

[0154] The second improvement result is obtained by replacing the C2f module in the backbone network of the YOLOv10 network structure based on the MOBFFN forward network architecture;

[0155] According to the first improvement result and the second improvement result, the FM-NET algorithm model is obtained.

[0156] The working principle and beneficial effects of the above technical solution: The FCF full-scale connection module comprehensively processes multi-level and multi-scale information by fusing feature maps from different sources of the backbone part, retaining the feature information of each level and multi-scale to the greatest extent, which is used to improve the model's ability to detect targets of different scales and reduce the problems of information loss and insufficient feature expression. At the same time, through interpolation and the introduction of channel attention mechanism and spatial attention mechanism in sequence, the FCF full-scale connection module can improve the ability and accuracy of feature expression. Not only that, it also significantly enhances the distinguishability of features, making the model more robust when dealing with complex scenes.

[0157] The MOBFFN forward network architecture combines the advantages of reparameterization technology and element multiplication strategy to further integrate the fused features, so that the forward network architecture can efficiently learn complex features in the training phase, while achieving a perfect balance between speed and accuracy in the inference phase, and introducing residual connections to ensure the stability of gradient propagation, enhance the training robustness of the model, and avoid problems such as gradient disappearance.

[0158] According to the first improvement result and the second improvement result, the FM-NET algorithm model is obtained.

[0159] like Figure 3 As shown, according to some embodiments of the present invention, the FCF full-scale connection module includes:

[0160] The interpolation upsampling module is used to receive feature maps from different scales. Assume that the input feature maps are: 1 ∈R C1×H1×W1 ,x 2 ∈R C2×H2×W2 ,...,x n ∈R Cn×Hn×Wn Among them, C 1 ,C 2 ,...,C n Indicates the number of channels of different feature maps, H n and W n Respectively represent the nth feature map x n The height and width of

[0161] All feature maps are normalized to obtain a uniform size for fusion; the process is expressed as:

[0162] ˊ

[0163] x i =Interpolate(x i ,size=(H T ,W T )),i=1,2,...,n

[0164] Among them, x i ˊ is the result of interpolation of the ith feature map; Interpolate means using the Nearest interpolation algorithm for interpolation; x i is the i-th feature map of the input; i = 1, 2, ..., n, n is the number of feature maps of the input; size = (H T ,W T ) means adjusting all feature maps to a uniform size: the height is represented by H T , width is represented by W T ;

[0165] The channel splicing module is used to splice these feature maps in the channel dimension after all feature maps are adjusted to the same spatial size through interpolation;

[0166] The concatenation operation is expressed as:

[0167]

[0168] Among them, Concat represents the interpolated feature map x 1 ˊ ,x 2 ˊ ,...,x n ˊ Perform the splicing operation of the channel dimension; the spliced ​​feature map is represented as x concat , the number of channels is C total =C 1 +C 2 +...+C n , the spatial resolution remains at H T ×W T ;

[0169] The feature enhancement module is used to enhance the features of the concatenated feature map through the attention mechanism. The channel attention mechanism and the spatial attention mechanism assign adaptive weights to each channel and spatial position of the feature map.

[0170] The convolution processing module is used to adjust the number of channels of the output feature map and compress the channels using 1×1 convolution. Assuming that the number of target output channels is C out , then the convolution operation is expressed as:

[0171]

[0172] Among them, Conv 1×1 (x spatial ) represents the feature map x spatial Apply a 1×1 convolution operation; Represents the dimension of the output feature map, where C out is the number of output channels, and H T and W T is the height and width of the space.

[0173] Working principle and beneficial effects of the above technical solution: The core function of the FullConnectFusion (FCF) module is to fuse feature maps from different scales, combining high-level semantic information with low-level detail information, thereby improving the ability of multi-scale object detection. The module implements these fusions and enhancements through multiple core steps, including interpolation upsampling of feature maps, channel splicing, feature enhancement, and convolution processing. During the interpolation upsampling process, since the spatial sizes of feature maps may be different, all feature maps need to be adjusted to a uniform size first. The purpose of the splicing operation performed by the channel splicing module is to fuse feature information from different scales together to comprehensively utilize their details and semantic information. In the feature enhancement module, the spliced ​​feature map is enhanced by the attention mechanism. The channel attention and spatial attention mechanisms assign adaptive weights to each channel and spatial position of the feature map, thereby enhancing the expression of important features. In the convolution processing module, after the feature enhancement processing, the feature map already contains rich information from different scales. In order to adjust the number of channels of the output feature map, the FCF module uses 1×1 convolution to compress the channels. Represents the shape of a three-dimensional tensor, C i Indicates the number of channels of the tensor corresponding to the feature map; H i Indicates the height of the tensor corresponding to the feature map; W i Indicates the width of the tensor corresponding to the feature map.

[0174] According to some embodiments of the present invention, the feature enhancement module includes:

[0175] Channel attention mechanism module, used for:

[0176] For the concatenated feature map x concat Apply global average pooling to generate a global description of each channel;

[0177]

[0178] Among them, z c represents the average result of channel c; H T and WT Represents the height and width of the target feature map, that is, the spatial dimension for averaging; C total Represents x concat The total number of channels in, c from 1 to C total ;

[0179] Generate channel attention weight a through convolution c , and use the activation function to compress the weights into the range [0,1], expressed as:

[0180] a c =Sigmoid(Conv1D(z c ))

[0181] Among them, Conv1D means using one-dimensional convolution on z c Perform convolution operation; Sigmoid means using Sigmoid activation function to compress weights;

[0182] Using channel attention weight a c The feature map of each channel is weighted, and the process is expressed as:

[0183] x channel (i,j,c)=x concat (i,j,c)·a c

[0184] Among them, x channel (i, j, c) represents the value of the weighted feature map at position (i, j) and channel c; x concat (i,j,c) represents the original concatenated tensor x concat The value of channel c at position (i, j); a c is a weighting coefficient for each channel c, which controls the importance of each channel in the feature map;

[0185] Spatial attention mechanism module, used to:

[0186] After the channel attention mechanism module is processed, the spatial attention mechanism is used to further enhance the important spatial positions;

[0187] First, calculate the average feature and maximum feature of each position, respectively:

[0188]

[0189] Among them, x avg (i,j) is the average feature of position (i,j); C total is the total number of channels, is a normalization factor that calculates the channel average at each spatial position;

[0190] x max (i,j)=max(x channel (i,j,c)),c∈{1,2,…,C total}

[0191] Among them, x max (i,j) represents the sum of all channels in the set c∈{1,2,…,C total}, the maximum eigenvalue at position (i, j); x channel (i,j,c) is the eigenvalue of the cth channel at position (i,j);

[0192] The average feature and the maximum feature of each position are concatenated, and the spatial attention weight is generated through 2D convolution:

[0193] a s (i,j)=Sigmoid(Conv2D([avg(i,j),max(i,j)]))

[0194] The input in the formula is the average pooling value avg(i,j) and the maximum pooling value max(i,j) at the position (i,j), that is, the average and maximum features of all channels are first obtained at each spatial position; Conv2D([avg(i,j),max(i,j)]) represents a two-dimensional convolution operation on the concatenated average pooling value and the maximum pooling value; after the convolution output passes through the Sigmoid activation function, the attention coefficient a is obtained. s (i,j);

[0195] Use spatial attention weights to perform spatial weighting on the feature map, expressed as:

[0196] x spatial (i,j,c)=x channel (i,j,c)·a s (i,j)

[0197] Among them, x spatial (i, j, c) represents the value of the feature map at position (i, j) and channel c after spatial attention weighting; x channel (i, j, c) is the feature map obtained by channel weighting, that is, the feature value after the weighting coefficient is applied to each channel; a s (i,j) is the spatial attention coefficient at position (i,j), which is a weight between 0 and 1, indicating the importance of that position.

[0198] like Figure 4 As shown, according to some embodiments of the present invention, a MOBFFN forward network architecture is constructed, including:

[0199] For the input feature x∈R C×H×W Perform 1×1 convolution to double the number of channels to 2C;

[0200] xˊ=Conv 1×1 (x),xˊ∈R 2C×H×W

[0201] Among them, Conv 1×1 (x): indicates the use of a 1×1 convolution operation on the input feature map x; xˊ∈R 2C×H×W Represents the dimension of the output feature map; here 2C means that the number of output channels is twice the number of input channels, while the spatial resolution H and W are consistent with the input feature map; xˊ represents the feature map after convolution;

[0202] Split the doubled xˊ into two parts x along the channel dimension 1 and x 2 , the number of channels in each part is C;

[0203] x 1 ,x 2 =xˊ·chunk(2,dim=1),x 1 ,x 2 ∈R C×H×W

[0204] Among them, xˊ·chunk(2,dim=1) means dividing the feature map x′ into two parts along the channel dimension, where the channel dimension is the first dimension; x 1 ,x 2 ∈R C×H×W The two feature maps x after partitioning 1 and x 2 The number of channels is C, and the spatial dimensions H and W remain unchanged;

[0205] x 2 Input MOB module for multi-branch convolution processing to get the output x MOB , x 1 and x MOB Perform element-wise multiplication to enhance feature interactions;

[0206] x fused =x 1 ·x MOB ,x fused ∈R C×H×W

[0207] Among them, x fused =x 1 ·x MOB Indicates x 1 and x MOB Multiply corresponding elements at the same position; xfused ∈R C×H×W Represents the fused feature map x fused It has C channels, and the spatial resolutions H and W remain unchanged;

[0208] Through 1×1 convolution, the backend feature map x is fused. fused Processing is performed to compress the number of channels, expressed as:

[0209] x out =Conv 1×1 (x fused ),x out ∈R C×H×W

[0210] Among them, Conv 1×1 (x fused ) represents the feature map x fused Apply a 1×1 convolution operation; x out ∈R C×H×W Represents the dimension of the final output feature map; the number of channels C remains the same as the input, and the spatial resolutions H and W also remain unchanged;

[0211] Combine the original input feature x with the output x out Add together to form a residual connection;

[0212] y=x out +x

[0213] Among them, y represents the residual connection.

[0214] Working principle and beneficial effects of the above technical solution: The main goal of the MOBFFN forward network architecture is to learn features through a multi-branch structure and optimize the performance of the inference stage by using reparameterization technology. The MOBFFN forward network architecture effectively improves the performance of the model in the training and inference stages by combining reparameterization technology and element multiplication strategy. In the training stage, MOBFFN enhances the accuracy of feature extraction and ensures the stability of gradient propagation through a multi-branch convolution structure. In particular, the element multiplication strategy strengthens the interaction between different feature channels, effectively preventing the occurrence of problems such as gradient disappearance, thereby improving the learning ability of the model. In the inference stage, MOBFFN simplifies the multi-branch structure into a single convolution operation, greatly reducing the computational complexity and resource consumption, and improving the inference speed. This design enables the model to run efficiently while maintaining high detection accuracy, demonstrating excellent computational efficiency.

[0215] According to some embodiments of the present invention, the MOB module is the core part of the MOBFFN module, which performs multi-path processing on input features through multiple parallel convolution branches and simplifies these branches into a single convolution by reparameterization during the inference phase;

[0216] The mathematical representation of the MOB module is:

[0217] Training phase: Feature enhancement of multi-branch structure;

[0218] During the training phase, the MOB module enhances features through a multi-branch structure; each branch includes a skip connection, a convolution branch, and a scale scaling branch. All branches are batch normalized and processed by an activation function after fusion.

[0219] Skip connection: Skip connection processes the input feature x through batch normalization;

[0220] x skip =BN(x)

[0221] Among them, BN(x) means applying batch normalization operation to input feature x;

[0222] Convolution branch: Use n convolution kernels of size k i ×k i The convolution branches of, the output of each branch;

[0223]

[0224] in, Indicates that the convolution kernel size is k i ×k i The convolution kernel performs a convolution operation on the feature x; BN means applying a batch normalization operation; To use a convolution kernel size of k i ×k i The result of the convolution operation of the convolution kernel on the feature x;

[0225] Scale scaling branch: Use 1×1 convolution and Batch Normalization for scale scaling;

[0226] x scale =BN(Conv 1×1 (x))

[0227] Among them, Conv 1×1 (x) indicates that a convolution operation is performed on feature x using a convolution kernel with a convolution kernel size of 1×1; BN indicates the application of batch normalization operation;

[0228] Feature fusion and activation: The results of the skip connection, scale scaling branch, and convolution branch are added and processed by the activation function σ, expressed as:

[0229]

[0230] Among them, xskip is the feature map in the skip connection or residual path; x scale It is a scaled feature map used to adjust the scale of the overall feature; Represents multiple convolutional feature maps The sum of n convolution results is superimposed; σ(.) means applying the SiLU activation function to the summed result;

[0231] Inference stage: reparameterized convolution simplification;

[0232] In the inference phase, the multi-branch structure of the MOB module is simplified into a single convolution operation. Through the reparameterization technique, the convolution kernels and biases of multiple convolution branches in the training phase are fused.

[0233] Fusion skip connection: The batch normalization operation of the skip connection can be converted into an equivalent convolution kernel K skip and bias b skip ;

[0234]

[0235] Among them, γ skip and β skip is the parameter of BatchNorm, μ skip and σ skip are the mean and variance;

[0236] Fusion convolution branch: For each convolution branch, assume that the convolution kernel is Bias is The convolution kernels and biases of all convolution branches are accumulated. In this way, multiple convolution operations are combined into a single convolution operation, expressed as:

[0237]

[0238] Among them, K skip is the convolution kernel in the skip connection path; represents the sum of n convolution kernels, that is, the weights of multiple groups of convolution kernels are superimposed together; the final K fused It is the fusion result of these convolution kernels, which contains the information of skip connection and multi-layer convolution; b skip is the bias term in the skip connection path; represents the sum of the biases of n convolutional layers, and the final b fused is the fusion result of these bias terms;

[0239] Simplified convolution operation in the inference phase: In the inference phase, all convolution branches and skip connections are equivalent to a single convolution operation, through the convolution kernel K fused and bias b fusedPerform convolution calculation, expressed as:

[0240] x out =σ(BN(Conv(x,K fused ,b fused )))

[0241] Among them, Conv(x,K fused ,b fused ) means applying a convolution operation to the input feature map x, and the convolution kernel is the fused K fused , the bias term is the fused b fused ; BN(·): batch normalization operation; σ(·): application of activation function SiLU to the result after batch normalization.

[0242] According to some embodiments of the present invention, the FM-NET algorithm model is trained based on a bearing surface defect sample data set to obtain a target FM-NET algorithm model, including:

[0243] S41. Randomly divide the bearing surface defect sample data set into a training set, a test set, and a validation set in a ratio of 6:2:2; initialize the network weight, learning rate, batch size, and number of iterations of the FM-NET algorithm model;

[0244] S42, inputting the samples in the training set into the FM-NET algorithm model for pre-training;

[0245] S43, using the CIOU loss function, calculate the loss value between the predicted box and the target GT box of the sample in the training set, and back-propagate the loss value to optimize and update the network weights of the FM-NET algorithm model;

[0246] S44, repeating steps S42 and S43 until the samples in the training set are exhausted, and obtaining a pre-trained improved FM-NET algorithm model;

[0247] S45, input the samples in the verification set into the pre-trained FM-NET algorithm model for verification;

[0248] S46, calculating the precision value AP of the surface defect category of the samples in the validation set, and calculating the average precision value mAP of all precision values ​​AP;

[0249] S47, repeat S44-S46 until the average precision value mAP obtained multiple times is equal to or close to a fixed value, and the trained FM-NET algorithm model is obtained;

[0250] S48. Use the test set to test the trained FM-NET algorithm model to evaluate the performance of the model.

[0251] The working principle and beneficial effects of the above technical solution are as follows: The bearing surface defect sample data set is randomly divided into a training set, a test set, and a validation set in a ratio of 6:2:2; the network weights, learning rate, batch size, and number of iterations of the FM-NET algorithm model are initialized; specifically, the network weights of the original YOLOv10 algorithm downloaded from the Internet can be selected as the initial network weights of the FM-NET algorithm, the initial learning rate and the cosine annealing learning rate are set to 0.01, and the learning rate lr0=0.02 is selected when training the final model to accelerate the convergence process and improve the model performance to a certain extent. The learning rate momentum is 0.937, the weight decay coefficient is 0.0005, the optimizer is stochastic gradient descent (SGD), the random seed (seed) is 8, the number of data loading threads (workers) is 8, and the Batch Size is 16.

[0252] In step S46, in order to verify the detection performance of the model, a variety of evaluation indicators are introduced, including multi-class average accuracy (mAP@50 and mAP@50-95), parameter amount (Parameters), computation amount (GFLOPs) and frame rate (FPS). These indicators are used to comprehensively evaluate the performance of the model. The specific expressions of precision (Precision, P) and recall (Recall, R) are:

[0253]

[0254]

[0255] Among them, TP represents true positive, FP represents false positive, TN represents true negative, and FN represents false negative. The average precision (AP) is obtained by integrating the precision-recall (PR) curve, and its expression is:

[0256]

[0257] mAP (Mean Average Precision) is the average of the accuracy of various types of target detection, where mAP@50 represents the average accuracy calculated for all images when the intersection over union (IoU) threshold is 0.5. The specific calculation formula for mAP is:

[0258]

[0259] Where mAP is the mean average precision. n represents the total number of categories. (i)Represents the average precision of the i-th category.

[0260] In addition, the frame rate (FPS, Frames Per Second) is used to measure the number of frames processed per second by the model during inference. The calculation formula is:

[0261]

[0262] Among them, N represents the number of frames or pictures processed, and T represents the total time spent processing these frames. FPS is an important indicator to measure the real-time performance of the model. A high frame rate usually means faster processing speed and better real-time performance.

[0263] In order to prove the reliability of the improved model of the present invention in detecting bearing surface defects, the embodiment is compared with other advanced bearing surface defect detection networks, namely YOLOv5, YOLOv8, YOLOv9, SSD, Faster R-CNN, RT-DETR-1 and the latest YOLOv11. The overall results of the experiment are shown in Table 1:

[0264] Table 1 Detection comparison results of this embodiment and various comparison methods on the data set

[0265]

[0266] According to the results in Table 1, the following conclusions can be drawn: The FM-NET model performs well in multiple key performance indicators, especially in the two important indicators of mAP50 (0.883) and mAP50-95 (0.558), showing excellent target detection capabilities. In terms of precision (P), the precision of the FM-NET model also reached 0.881, still maintaining a high level of target detection accuracy. In terms of recall rate (R), the FM-NET model performed extremely well, reaching 0.831, far ahead of other models, indicating that it has a strong ability to detect more targets. In terms of computational complexity and parameter quantity, the parameter quantity of the model in this paper is only 1.411M, which is the smallest among all models, and its GFLOPS is only 6.5, which is similar to the latest lightweight model YOLOv11n. This means that while ensuring high detection performance, the computational cost of the model proposed in this invention is extremely low, showing good practical deployment potential. In terms of frame rate (FPS), the frame rate of the FM-NET model is 135.5FPS, which is not as good as the YOLOv series, but can still meet the needs of most real-time applications.

[0267] like Figure 7 As shown, in order to verify the superiority of the proposed improved model over YOLOv10n, the present invention adopts the control variable method to perform ablation experiments. The experimental results are shown in Table 2:

[0268] Model A: The FCF full-scale connection module is used to replace the original Concat at the neck of YOLOv10n to improve the fusion capability of multi-scale features.

[0269] Model B: Add the MOBFFN forward network to the backbone, as follows Figure 2 As shown in the main part, reparameterization and element multiplication strategies are used to optimize feature fusion and model performance.

[0270] AB model: superimpose model A and model B to verify the advantages of the combined model.

[0271] Table 2 Ablation experiment

[0272]

[0273] Experimental results show that the AB model achieves significant detection performance improvement by combining the FCF full-scale connection module and the MOBFFN forward network, surpassing other models in key indicators such as Map50, Map50-95, and recall. Although its inference speed has decreased, its comprehensive advantages in precision and recall make it the model with the most comprehensive performance, especially suitable for tasks that require high-precision detection in complex scenes. In the accuracy evaluation of object detection, Map50 and Map50-95 are core indicators. YOLOv10n, as a baseline model, achieved results of 0.855 and 0.511 respectively. By introducing the A model with the FCF full-scale connection module and the B model with the MOBFFN forward network, both indicators have been improved. However, the AB model performs best in these two indicators, reaching 0.875 and 0.54 respectively, indicating that it has the strongest comprehensive detection ability in different scales and complex scenes. In terms of precision (P value) and recall (R value), YOLOv10n has a P value of 0.87 and an R value of 0.789, showing a good balance. Model A and Model B slightly improved the R and P indicators through different module improvements. The recall rate of the AB model has improved, with a P value of 0.885 and an R value of 0.81, demonstrating its excellent ability in recall rate. It also shows the effectiveness of fusion. As the model introduces more feature fusion and optimization modules, the number of parameters and computational complexity increase slightly. The number of parameters of YOLOv10n is 2.265M and the GFLOPS is 6.5. The number of parameters of the AB model is 2.874M and the GFLOPS is 9.8. Although this increases the computational complexity of the model, this price is exchanged for a significant improvement in detection performance. For task scenarios that require higher detection accuracy, this increase in complexity of the AB model is worthwhile.

[0274] Contribution of the FCF full-scale connection module: The FCF full-scale connection module significantly improves the model's ability to detect multi-scale targets by effectively fusing feature information at multiple scales. Unlike traditional methods that only combine two feature layers for fusion, the FCF full-scale connection module adopts a full-scale feature fusion strategy to retain feature information at all levels and multiple scales to the greatest extent. At the same time, through interpolation and attention mechanisms, the expressive power of features is further enhanced, making the model more robust and more accurate in detecting complex scenes. Therefore, the FCF full-scale connection module overcomes the limitations of information loss in traditional multi-scale detection and shows significant advantages in complex target detection tasks.

[0275] Contribution of the MOBFFN forward network architecture: The MOBFFN forward network architecture effectively improves the performance of the model in the training and reasoning stages by combining reparameterization technology and element multiplication strategy. In the training stage, MOBFFN enhances the accuracy of feature extraction and ensures the stability of gradient propagation through a multi-branch convolution structure. In particular, the element multiplication strategy strengthens the interaction between different feature channels, effectively preventing the occurrence of problems such as gradient disappearance, thereby improving the learning ability of the model. In the reasoning stage, MOBFFN simplifies the multi-branch structure into a single convolution operation, greatly reducing the computational complexity and resource consumption, and improving the reasoning speed. This design enables the model to run efficiently while maintaining high detection accuracy, demonstrating excellent computational efficiency.

[0276] like Figure 8-9 As shown, according to some embodiments of the present invention, defect detection is performed on the bearing image to be detected according to the target FM-NET algorithm model, and the defect position in the bearing image and its corresponding defect category are determined, including:

[0277] The FM-NET algorithm model is pruned using model pruning technology, the performance of the pruned model is evaluated, and the target FM-NET algorithm model after LAMP pruning is obtained;

[0278] The target FM-NET algorithm model after LAMP pruning is deployed to embedded devices to obtain bearing surface defect detection equipment;

[0279] The bearing image to be inspected is input into the bearing surface defect detection device, and the defect position in the bearing image and its corresponding defect category are output.

[0280] Working principle and beneficial effects of the above technical solution: Taking the improved model (AB model) as the benchmark, experiments with different pruning rates were conducted, using three pruning methods: L1, group_norm and LAMP, and setting the pruning rate to 1.5 to achieve lightweight model and improve computational efficiency. Among them, EXP1, EXP2 and EXP3 all use the LAMP pruning method, and the pruning rates are set to 2.5, 2 and 1.3 respectively. The experimental results are summarized in Table 3.

[0281] Table 3 Pruning experiment

[0282]

[0283] In the pruning experiment, three pruning methods, L1, group_norm and LAMP, were compared in detail. The experimental results show that the LAMP method has the best comprehensive performance in terms of accuracy (mAP50 is 0.883, mAP50-95 is 0.558), model complexity (parameters are 1.411M, GFLOPs are 6.5) and real-time performance (FPS is 133.8). Compared with L1 and group_norm, LAMP can not only significantly reduce the number of parameters and computational costs of the model while maintaining high accuracy, but also maintain high real-time detection performance. Although the L1 method performs the fastest in FPS, its detection accuracy is not as good as LAMP; while group_norm, although its accuracy is almost consistent with the basic model, does not reach the performance of LAMP in terms of complexity and real-time performance. Therefore, among the three pruning methods, LAMP achieves the best balance and becomes the optimal solution for model pruning.

[0284] In addition, the LAMP pruning method was further verified at different pruning rates (i.e., EXP1, EXP2, and EXP3) to explore its performance under different configurations. The results show that although the accuracy and real-time performance under some configurations (such as EXP3) have reached a similar level as the original LAMP, they are slightly higher than the original LAMP in terms of parameter volume and computational complexity (1.411M parameters and 6.5GFLOPs). Considering the optimization requirements for resource utilization in practical applications, the original LAMP scheme achieves a more ideal balance between accuracy, complexity, and real-time performance. Therefore, it was finally decided to select LAMP as the optimal pruning scheme to ensure the best comprehensive performance of the model between lightweight, accuracy, and efficiency.

[0285] The target FM-NET algorithm model after LAMP pruning is deployed to the embedded device to obtain the bearing surface defect detection device; Embedded device configuration: The Jetson Orin Nano CLB development kit (4GB) is selected as the edge computing platform. The device integrates a 512-core graphics processing unit (GPU) based on the NVIDIA Ampere architecture and a six-core Arm Cortex-A78AE v8.2 64-bit central processing unit (CPU), and its computing performance can reach up to 20TOPS (INT8). The device is pre-installed with Ubuntu 18.04 as the operating system, and uses Anaconda to manage the Python development environment.

[0286] To achieve the above object, the second embodiment of the present invention proposes a lightweight bearing surface defect detection system based on improved YOLOv10n, comprising:

[0287] An acquisition module, used to acquire a bearing surface defect sample data set;

[0288] Improvement module, used to improve the YOLOv10 network structure and obtain the FM-NET algorithm model;

[0289] A training module is used to train the FM-NET algorithm model based on a bearing surface defect sample data set to obtain a target FM-NET algorithm model;

[0290] The detection module is used to perform defect detection on the bearing image to be detected according to the target FM-NET algorithm model, and determine the defect position in the bearing image and its corresponding defect category.

[0291] By building the FCF full-scale connection module and the MOBFFN forward network architecture on the basis of the original YOLOv10 algorithm, a significant improvement in the multi-scale feature extraction capability and model expression efficiency is achieved. These two key improvements not only enhance the robustness of the model in complex scenarios, but also significantly improve the inference speed while maintaining high precision, thereby achieving a good balance between precision and efficiency. Secondly, through model pruning and embedded device deployment, a new solution is brought to the task of bearing defect target detection in practical applications. The improved algorithm achieved an accuracy rate of 87.5%, a precision of 88.5, a recall rate of 81%, and a detection speed of 135.5. It can be seen that the detection method and system of the present invention not only have high detection accuracy in detecting bearing surface defects, but also have good performance in detection speed.

[0292] The detection method of the present invention can also be used in other industrial application scenarios, especially in the field of target detection with small targets and complex backgrounds. The FM-NET network architecture of the present invention is applied to NEU-DET, Peking University printed circuit board defect dataset and Tianchi aluminum defect dataset for generalization experiments. The results show that the network architecture of the present invention has very superior performance, such as Figure 10-12 shown.

[0293] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A lightweight bearing surface defect detection method based on improved YOLOv10n, characterized in that: include: Obtain a sample data set of bearing surface defects; Improve the YOLOv10 network structure and obtain the FM-NET algorithm model; The FM-NET algorithm model is trained based on the bearing surface defect sample data set to obtain the target FM-NET algorithm model; According to the target FM-NET algorithm model, defect detection is performed on the bearing image to be inspected, and the defect position in the bearing image and its corresponding defect category are determined.

2. The lightweight bearing surface defect detection method based on improved YOLOv10n as claimed in claim 1 is characterized in that: Obtain a sample data set of bearing surface defects, including: Obtaining a bearing image dataset containing surface defects; The bearing image data set is amplified based on data enhancement technology to obtain a bearing surface defect sample data set; the data enhancement technology includes at least one of introducing noise, Mixup, CutMix and Mosaic.

3. The lightweight bearing surface defect detection method based on improved YOLOv10n as claimed in claim 1 is characterized in that: The YOLOv10 network structure is improved to obtain the FM-NET algorithm model, including: Construct FCF full-scale connection module; Build the MOBFFN forward network architecture; The first improvement result is obtained by replacing the Concat module in the neck network of the YOLOv10 network structure with the FCF full-scale connection module; The second improvement result is obtained by replacing the C2f module in the backbone network of the YOLOv10 network structure based on the MOBFFN forward network architecture; According to the first improvement result and the second improvement result, the FM-NET algorithm model is obtained.

4. The lightweight bearing surface defect detection method based on improved YOLOv10n as claimed in claim 3 is characterized in that: The FCF full-scale connection module includes: The interpolation upsampling module is used to receive feature maps from different scales. Assume that the input feature maps are: Among them, C1, C2, ..., C n Indicates the number of channels of different feature maps, H n and W n Respectively represent the nth feature map x n The height and width of All feature maps are normalized to obtain a uniform size for fusion; the process is expressed as: ˊ x i =Interpolate(x i ,size=(H T ,W T )),i=1,2,...,n Among them, x i ˊ is the result of interpolation of the i-th feature map; Interpolate means using the Nearest interpolation algorithm for interpolation; x i is the i-th feature map of the input; i = 1, 2, ..., n, n is the number of feature maps of the input; size = (H T ,W T ) means adjusting all feature maps to a uniform size: the height is represented by H T , width is represented by W T ; The channel splicing module is used to splice these feature maps in the channel dimension after all feature maps are adjusted to the same spatial size through interpolation; The concatenation operation is expressed as: Among them, Concat represents the interpolated feature map x1 ˊ ,x2 ˊ ,...,x n ˊ Perform the splicing operation of the channel dimension; the spliced ​​feature map is represented as x concat , the number of channels is C total =C1+C2+...+C n , the spatial resolution remains at H T ×W T ; The feature enhancement module is used to enhance the features of the concatenated feature map through the attention mechanism. The channel attention mechanism and the spatial attention mechanism assign adaptive weights to each channel and spatial position of the feature map. The convolution processing module is used to adjust the number of channels of the output feature map and compress the channels using 1×1 convolution. Assuming that the number of target output channels is C out , then the convolution operation is expressed as: Among them, Conv 1×1 (x spatial ) represents the feature map x spatial Apply a 1×1 convolution operation; Represents the dimension of the output feature map, where C out is the number of output channels, and H T and W T is the height and width of the space.

5. The lightweight bearing surface defect detection method based on improved YOLOv10n as claimed in claim 4 is characterized in that: The feature enhancement module comprises: Channel attention mechanism module, used for: For the concatenated feature map x concat Apply global average pooling to generate a global description of each channel; Among them, z c represents the average result of channel c; H T and W T Represents the height and width of the target feature map, that is, the spatial dimension for averaging; C total Represents x concat The total number of channels in, c from 1 to C total ; Generate channel attention weight a through convolution c , and use the activation function to compress the weights into the range [0,1], expressed as: a c =Sigmoid(Conv1D(z c )) Among them, Conv1D means using one-dimensional convolution on z c Perform convolution operation; Sigmoid means using Sigmoid activation function to compress weights; Using channel attention weight a c The feature map of each channel is weighted, and the process is expressed as: x channel (i,j,c)=x concat (i,j,c)·a c Among them, x channel (i, j, c) represents the value of the weighted feature map at position (i, j) and channel c; x concat (i,j,c) represents the original concatenated tensor x concat The value of channel c at position (i, j); a c is a weighting coefficient for each channel c, which controls the importance of each channel in the feature map; Spatial attention mechanism module, used to: After the channel attention mechanism module is processed, the spatial attention mechanism is used to further enhance the important spatial positions; First, calculate the average feature and maximum feature of each position, respectively: Among them, x avg (i,j) is the average feature of position (i,j); C total is the total number of channels, is a normalization factor that calculates the channel average at each spatial position; x max (i,j)=max(x channel (i,j,c)),c∈{1,2,…,C total } Among them, x max (i,j) represents the sum of all channels in the set c∈{1,2,…,C total }, the maximum eigenvalue at position (i, j); x channel (i,j,c) is the eigenvalue of the cth channel at position (i,j); The average feature and the maximum feature of each position are concatenated, and the spatial attention weight is generated through 2D convolution: a s (i,j)=Sigmoid(Conv2D([avg(i,j),max(i,j)])) The input in the formula is the average pooling value avg(i,j) and the maximum pooling value max(i,j) at the position (i,j), that is, the average and maximum features of all channels are first obtained at each spatial position; Conv2D([avg(i,j),max(i,j)]) represents a two-dimensional convolution operation on the concatenated average pooling value and the maximum pooling value; after the convolution output passes through the Sigmoid activation function, the attention coefficient a is obtained. s (i,j); Use spatial attention weights to perform spatial weighting on the feature map, expressed as: x spatial (i,j,c)=x channel (i,j,c)·a s (i,j) Among them, x spatial (i, j, c) represents the value of the feature map at position (i, j) and channel c after spatial attention weighting; x channel (i, j, c) is the feature map obtained by channel weighting, that is, the feature value after the weighting coefficient is applied to each channel; a s (i,j) is the spatial attention coefficient at position (i,j), which is a weight between 0 and 1, indicating the importance of that position.

6. The lightweight bearing surface defect detection method based on improved YOLOv10n as claimed in claim 3 is characterized in that: Build the MOBFFN forward network architecture, including: For the input feature x∈R C×H×W Perform 1×1 convolution to double the number of channels to 2C; xˊ=Conv 1×1 (x),xˊ∈R 2C×H×W Among them, Conv 1×1 (x): indicates that a 1×1 convolution operation is applied to the input feature map x; xˊ∈R 2C×H×W Represents the dimension of the output feature map; here 2C means that the number of output channels is twice the number of input channels, while the spatial resolution H and W are consistent with the input feature map; xˊ represents the feature map after convolution; Split the doubled xˊ into two parts x1 and x2 along the channel dimension, and the number of channels in each part is C; x1,x2=xˊ·chunk(2,dim=1),x1,x2∈R C×H×W Among them, xˊ·chunk(2,dim=1) means dividing the feature map x′ into two parts along the channel dimension, where the channel dimension is the first dimension; x1,x2∈R C×H×W The number of channels of the two feature maps x1 and x2 after block division is C, and the spatial dimensions H and W remain unchanged; Input x2 into the MOB module for multi-branch convolution processing to obtain the output x MOB , x1 and x MOB Perform element-wise multiplication to enhance feature interactions; x fused =x1 x MOB ,x fused ∈R C×H×W Among them, x fused =x1·x MOB Represents x1 and x MOB Multiply corresponding elements at the same position; x fused ∈R C×H×W Represents the fused feature map x fused It has C channels, and the spatial resolutions H and W remain unchanged; Through 1×1 convolution, the backend feature map x is fused. fused Processing is performed to compress the number of channels, expressed as: x out =Conv 1×1 (x fused ),x out ∈R C×H×W Among them, Conv 1×1 (x fused ) represents the feature map x fused Apply a 1×1 convolution operation; x out ∈R C×H×W Represents the dimension of the final output feature map; the number of channels C remains the same as the input, and the spatial resolutions H and W also remain unchanged; Combine the original input feature x with the output x out Add together to form a residual connection; y=x out +x Among them, y represents the residual connection.

7. The lightweight bearing surface defect detection method based on improved YOLOv10n as claimed in claim 6 is characterized in that: The MOB module is the core part of the MOBFFN module. It processes the input features in multiple paths through multiple parallel convolution branches and simplifies these branches into a single convolution by reparameterization during the inference phase. The mathematical representation of the MOB module is: Training phase: Feature enhancement of multi-branch structure; During the training phase, the MOB module enhances features through a multi-branch structure; each branch includes a skip connection, a convolution branch, and a scale scaling branch. All branches undergo batch normalization and are processed by an activation function after fusion. Skip connection: Skip connection processes the input feature x through batch normalization; x skip =BN(x) Among them, BN(x) means applying batch normalization operation to input feature x; Convolution branch: Use n convolution kernels of size k i ×k i The convolution branches of, the output of each branch; in, Indicates that the convolution kernel size is k i ×k i The convolution kernel performs a convolution operation on the feature x; BN means applying a batch normalization operation; To use a convolution kernel size of k i ×k i The result of the convolution operation of the convolution kernel on the feature x; Scale scaling branch: Use 1×1 convolution and Batch Normalization for scale scaling; x scale =BN(Conv 1×1 (x)) Among them, Conv 1×1 (x) indicates that a convolution operation is performed on feature x using a convolution kernel with a convolution kernel size of 1×1; BN indicates the application of batch normalization operation; Feature fusion and activation: The results of the skip connection, scale scaling branch, and convolution branch are added and processed by the activation function σ, expressed as: Among them, x skip is the feature map in the skip connection or residual path; x scale It is a scaled feature map used to adjust the scale of the overall feature; Represents multiple convolutional feature maps The sum of n convolution results is superimposed; σ(.) means applying the SiLU activation function to the summed result; Inference stage: reparameterized convolution simplification; In the inference phase, the multi-branch structure of the MOB module is simplified into a single convolution operation. Through the reparameterization technique, the convolution kernels and biases of multiple convolution branches in the training phase are fused. Fusion skip connection: The batch normalization operation of the skip connection can be converted into an equivalent convolution kernel K skip and bias b skip ; Among them, γ skip and β skip is the parameter of BatchNorm, μ skip and σ skip are the mean and variance; Fusion convolution branch: For each convolution branch, assume that the convolution kernel is Bias is The convolution kernels and biases of all convolution branches are accumulated. In this way, multiple convolution operations are combined into a single convolution operation, expressed as: Among them, K skip is the convolution kernel in the skip connection path; represents the sum of n convolution kernels, that is, the weights of multiple groups of convolution kernels are superimposed together; the final K fused It is the fusion result of these convolution kernels, which contains the information of skip connection and multi-layer convolution; b skip is the bias term in the skip connection path; represents the sum of the biases of n convolutional layers, and the final b fused is the fusion result of these bias terms; Simplified convolution operation in the inference phase: In the inference phase, all convolution branches and skip connections are equivalent to a single convolution operation, through the convolution kernel K fused and bias b fused Perform convolution calculation, expressed as: x out =σ(BN(Conv(x,K fused ,b fused ))) Among them, Conv(x,K fused ,b fused ) means applying a convolution operation to the input feature map x, and the convolution kernel is the fused K fused , the bias term is the fused b fused ; BN(·): batch normalization operation; σ(·): application of activation function SiLU to the result after batch normalization.

8. The lightweight bearing surface defect detection method based on improved YOLOv10n according to claim 1, characterized in that: The FM-NET algorithm model is trained based on the bearing surface defect sample data set to obtain the target FM-NET algorithm model, including: S41. Randomly divide the bearing surface defect sample data set into a training set, a test set, and a validation set in a ratio of 6:2:2; initialize the network weight, learning rate, batch size, and number of iterations of the FM-NET algorithm model; S42, inputting the samples in the training set into the FM-NET algorithm model for pre-training; S43, using the CIOU loss function, calculate the loss value between the predicted box and the target GT box of the sample in the training set, and back-propagate the loss value to optimize and update the network weights of the FM-NET algorithm model; S44, repeating steps S42 and S43 until the samples in the training set are exhausted, and obtaining a pre-trained improved FM-NET algorithm model; S45, input the samples in the verification set into the pre-trained FM-NET algorithm model for verification; S46, calculating the precision value AP of the surface defect category of the samples in the validation set, and calculating the average precision value mAP of all precision values ​​AP; S47, repeat S44-S46 until the average precision value mAP obtained multiple times is equal to or close to a fixed value, and the trained FM-NET algorithm model is obtained; S48. Use the test set to test the trained FM-NET algorithm model to evaluate the performance of the model.

9. The lightweight bearing surface defect detection method based on improved YOLOv10n according to claim 1, characterized in that: According to the target FM-NET algorithm model, the defect detection is performed on the bearing image to be inspected, and the defect location in the bearing image and its corresponding defect category are determined, including: The FM-NET algorithm model is pruned using model pruning technology, the performance of the pruned model is evaluated, and the target FM-NET algorithm model after LAMP pruning is obtained; The target FM-NET algorithm model after LAMP pruning is deployed to embedded devices to obtain bearing surface defect detection equipment; The bearing image to be inspected is input into the bearing surface defect detection device, and the defect position in the bearing image and its corresponding defect category are output.

10. A lightweight bearing surface defect detection system based on improved YOLOv10n, characterized in that: include: An acquisition module, used to acquire a bearing surface defect sample data set; Improvement module, used to improve the YOLOv10 network structure and obtain the FM-NET algorithm model; A training module is used to train the FM-NET algorithm model based on a bearing surface defect sample data set to obtain a target FM-NET algorithm model; The detection module is used to perform defect detection on the bearing image to be detected according to the target FM-NET algorithm model, and determine the defect position in the bearing image and its corresponding defect category.

Citation Information

Patent Citations

  • Attention mechanism CNN-based 5-day and 9-day incubated egg embryo image classification method

    CN110309880A

  • PCB surface defect detection method based on improved YOLOv5

    CN115719338A

  • Improved YOLO-v8-based pipe surface defect detection method

    CN118485648A

  • Bearing surface defect detection method and system based on improved YOLOv10

    CN118711000A

  • Eel fry detecting and counting method

    CN118898859A

Cited By

  • Urban emergency shelter environment assessment method based on image enhancement

    CN119888240A

  • Texture multi-scale feature fusion detection method based on light convolution and deformation attention

    CN120198763A

  • Steel surface defect detection method based on deep learning

    CN121707957A