Bearing surface defect detection method and system based on improved YOLOv10
By introducing EMAttention attention module, SPPELAN module and FasterNeT backbone network in the YOLOv10 model, the problems of insufficient detection accuracy and low training efficiency in bearing defect detection are solved, and efficient and accurate bearing defect detection is achieved to meet real-time detection of industrial environments. need.
Patent Information
- Application Number
- CN202411203703.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing bearing defect detection technology has insufficient detection accuracy under complex backgrounds, low training efficiency, limited ability to identify complex defects, low positioning accuracy, and high calculation complexity, making it difficult to meet the real-time and high precision requirements of the industrial environment.
The EMAttention attention module and the SPPELAN module of YOLOv9 were introduced, and the Backbone of YOLOv10 was replaced as FasterNeT, and the loss function and feature fusion module were optimized to improve detection accuracy and training efficiency, and reduce calculation complexity.
It significantly improves the accuracy and efficiency of bearing surface defect detection, enhances the ability to identify complex, overlapping or occlusion defects, meets the real-time inspection needs of the industrial environment, reduces maintenance costs, and improves production efficiency.
Smart Images

Figure CN118711000B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of bearing information detection, and in particular to a bearing surface defect detection method and system based on improved YOLOv10. Background Art
[0002] Existing bearing defect detection methods are prone to missed detection or false detection in complex backgrounds, especially for subtle defects, and the detection accuracy of traditional models is difficult to meet high requirements. In addition, the training process of deep learning models is usually very time-consuming and requires a lot of computing resources, especially when processing large-scale industrial data sets. The limited efficiency of existing optimizers leads to a slow training process.
[0003] In addition, existing models are not effective in identifying complex, overlapping or occluded defects, making it difficult to accurately detect these problems in practical applications. Traditional bounding box regression methods have positioning bias when dealing with complex-shaped defects, making it difficult to accurately locate the defect location. In order to improve detection accuracy, many models have become increasingly complex, resulting in a significant increase in computational costs, which is not conducive to deployment and application in resource-limited environments.
[0004] In industrial manufacturing, bearings are critical mechanical components that directly affect the stability and safety of equipment. Undetected wear or cracks can lead to serious operational and financial losses, so accurate identification of bearing defects is critical to maintaining production safety and equipment reliability. Traditional defect detection methods, such as visual inspection and simple sensor-based methods, can detect problems to a certain extent, but they are inefficient and difficult to meet the needs of high-precision and real-time monitoring. Advances in computer vision and artificial intelligence technologies have provided new solutions for bearing defect detection. These modern detection methods are highly intelligent, precise, and efficient, bringing breakthroughs in the field of defect detection.
[0005] At present, two-stage target detection algorithms (such as R-CNN, Fast R-CNN and Faster R-CNN) and single-stage target detection algorithms (such as the YOLO series) have been widely used in the field of bearing defect detection. The two-stage algorithm first generates candidate regions, and then classifies and regresses these regions. Although it has high accuracy, it is slow and difficult to meet the needs of real-time detection. In contrast, the single-stage algorithm (such as YOLOv10) directly predicts the category and location of the target from the image, eliminating the step of generating candidate regions. Therefore, it can achieve faster detection speed while ensuring high accuracy, and is more suitable for real-time monitoring applications.
[0006] As an advanced single-stage object detection algorithm, YOLOv10 can effectively identify various defects in bearings, including subtle defects in complex backgrounds, through its unique network architecture and optimization technology. Although YOLOv10 performs well in detection accuracy and speed, it still has some limitations in identifying the complexity and subtle features of bearing defects.
[0007] Existing deep learning and target detection technologies have achieved certain results in the field of bearing defect detection, but there are still some major shortcomings. Among them, insufficient detection accuracy is a significant problem. The traditional YOLOv10 model is prone to missed detection or false detection when detecting subtle bearing defects in complex backgrounds, and it is difficult to meet the needs of high-precision detection. At the same time, training efficiency is also a challenge. The training process of deep learning models is usually time-consuming and requires a lot of computing resources, especially when processing large-scale industrial data sets. The efficiency of existing optimizers is limited.
[0008] In addition, existing models have limited ability to identify complex defects, and are not effective in identifying complex, overlapping, or occluded defects, making it difficult to accurately detect these problems in practical applications. Positioning accuracy is also a problem, and traditional bounding box regression methods have positioning biases when dealing with defects with complex shapes. Finally, computational complexity also increases with model complexity, which leads to increased computational costs and is not conducive to deployment and application in resource-limited environments.
[0009] Through the above analysis, the problems and defects of the existing technology are: the existing technology has insufficient bearing defect detection accuracy, low training efficiency, limited complex defect recognition ability, low positioning accuracy and high computational complexity. Summary of the invention
[0010] In order to overcome the problems existing in the related art, the disclosed embodiments of the present invention provide a bearing surface defect detection method and system based on improved YOLOv10. The model significantly improves the detection efficiency and accuracy by introducing EMAttention (EMA) attention, the SPPELAN module of YOLOv9, and FasterNeT to replace Backbone.
[0011] The technical solution is as follows: a bearing surface defect detection method based on improved YOLOv10, comprising:
[0012] S1, collecting bearing defect images, which include bearing groove images, bearing wear images and bearing scratch images;
[0013] S2, data enhancement and preprocessing of the collected bearing defect images;
[0014] S3, constructs a complete dataset of bearing defect images after data enhancement and preprocessing;
[0015] S4, based on the YOLOv10 model, the EMAttention attention module and the SPPELAN module of YOLOv9 are introduced, and FasterNeT is used to replace Backbone to build an improved bearing defect detection model, where the improved bearing defect detection model is an improved YOLOv10 model;
[0016] S5, input the constructed bearing defect dataset into the improved YOLOv10 model for training, and optimize the detection accuracy and generalization ability of the improved YOLOv10 model by optimizing the loss function, adding the attention mechanism and feature fusion module;
[0017] S6, on the test set, the trained YOLOv10 model and the improved YOLOv10 model were tested and the experimental results were compared to verify the accuracy and efficiency of the two in detecting bearing defects, including defect location, defect category and confidence;
[0018] S7, compares the improved YOLOv10 model with mainstream algorithms, and comprehensively evaluates the detection performance, computational efficiency, and number of parameters of different models.
[0019] In step S2, data enhancement and preprocessing are performed on the collected bearing defect images, including:
[0020] Gamma transform technology is used to adjust the brightness and contrast of the image, reduce the background noise in the defective image, and enhance the robustness of the model. The conversion formula is:
[0021]
[0022] In the formula, is the pixel value after gamma transformation, is a constant used to scale the transformed pixel values to the possible range, is the pixel value in the original image, is the gamma value used for brightness and contrast adjustment;
[0023] In step S3, a complete data set is constructed, including:
[0024] (3.1) Defect classification: The bearing surface defect image data after sample amplification and data enhancement are classified into three categories: grooves, abrasions and scratches according to their types;
[0025] (3.2) Dataset division: The sample-augmented and data-enhanced bearing surface defect image data are divided into a training set, a test set, and a validation set in a ratio of 8:1:1;
[0026] (3.3) Image annotation: Use the labelimg image annotation tool to perform multi-point annotation on the image, and use multi-point annotation to segment the actual defect area on the contour of the defect area;
[0027] (3.4) Data reading: Use the torch.utils.data function of the PyTorch library in Python software to read the dataset.
[0028] In step S4, an improved bearing defect detection model is constructed, including:
[0029] (4.1) Configure the environment: Use Anaconda to create a virtual environment for the source code of the YOLOv10 model;
[0030] (4.2) Data input: Input the constructed bearing surface defect dataset into the YOLOv10 network structure model, including obtaining bearing surface defect images, bearing surface defect image labels, YOLOv10 network structure model pre-trained weights, and YOLOv10 network structure model configuration file;
[0031] (4.3) Configure hyperparameters: set the optimal hyperparameter combination of learning rate, batch size, number of iterations, number of image channels, image cropping size, and learning rate momentum;
[0032] (4.4) The original model used is YOLOv10, and the YOLOv10 network structure model is improved.
[0033] In step (4.4), the YOLOv10 network structure model is improved, including:
[0034] (4.4.1) Introduce the attention module EMA;
[0035] (4.4.2) Use the SPPELAN module of YOLOv9;
[0036] (4.4.3) Replace Backbone with FasterNeT.
[0037] In step (4.4.1), the attention module EMA is introduced, including:
[0038] (4.4.1.1) Module design: The attention module EMA divides the input feature map into multiple subgroups along the channel direction; each subgroup is processed in a parallel subnetwork, including a 1×1 convolution branch and a 3×3 convolution branch;
[0039] (4.4.1.2) Run a 1×1 convolution branch and a 3×3 convolution branch, including:
[0040] (i) Parallel subnetwork: The 1×1 convolution branch is responsible for processing global information to recalibrate the channel weights in each parallel branch; the specific implementation steps are as follows:
[0041] (i.1) 1×1 convolution operation, expressed as:
[0042]
[0043] In the formula, is the extracted global feature map, is a 1×1 convolution operation, is the input feature map;
[0044] (i.2) Global average pooling, expressed as:
[0045]
[0046] In the formula, It is the feature after global average pooling, which represents the global feature of each channel;
[0047] (i.3) Fully connected generation weight, the expression is:
[0048]
[0049] In the formula, The weight for each channel is generated through a fully connected layer;
[0050] (i.4) Channel weighted calibration, the expression is:
[0051]
[0052] In the formula, For the recalibrated feature map, calibration is achieved by multiplying the channel weights with the input feature map; The weight for each channel is generated through a fully connected layer;
[0053] (ii) The 3×3 convolution branch further aggregates the output features of the two parallel branches through cross-dimensional interaction to capture the pairwise relationship at the pixel level. The specific implementation steps are as follows:
[0054] (ii.1) 3×3 convolution operation, expressed as:
[0055]
[0056] In the formula, is the feature map after 3×3 convolution, It is a 3×3 convolution operation;
[0057] (ii.2) Cross-dimensional interaction and feature aggregation, expressed as:
[0058]
[0059] In the formula, is the feature map after aggregation, It is the feature map after convolution;
[0060] (ii.3) Capturing the pairwise relationship at the pixel level, the expression is:
[0061]
[0062] In the formula, is the attention weight, which is generated by performing element-wise dot product operation on the aggregated feature map; is the activation function, is the index; (ii.4) applying the weight, the expression is:
[0063]
[0064] In the formula, For the final feature map, the pixel-level pairwise relationship is enhanced by applying attention weights to the aggregated feature map;
[0065] (4.4.1.3) Cross-space learning: By fusing the output feature maps of two parallel sub-networks together, the matrix dot product operation is used to capture the pairwise relationship at the pixel level. The 1×1 convolution branch is responsible for processing global information and recalibrating the channel weights in each parallel branch, while the 3×3 convolution branch further aggregates the output features of the two parallel branches through cross-dimensional interaction. Feature map fusion is achieved by element-by-element addition or concatenation. The correlation matrix is generated by the matrix dot product operation to capture the pairwise relationship at the pixel level, and the attention weight is generated by the activation function and applied to the feature map to enhance the pixel pairs with strong correlation and suppress the pixel pairs with weak correlation.
[0066] In step (4.4.2), use the SPPELAN module of YOLOv9, including:
[0067] a. Module design: The SPPELAN module uses an initial convolutional layer cv1 to reduce the number of channels of the input data;
[0068] b. Multi-scale maximum pooling: The output is applied to three parallel maximum pooling layers cv2, cv3, and cv4. Each maximum pooling layer has a different spatial receptive field. The outputs of the pooling layers are then connected to form a feature map containing multi-scale information to achieve multi-scale maximum pooling. The specific process is as follows:
[0069] b.1. Input feature map processing: Process through an initial convolution layer cv1 to reduce the number of channels and extract preliminary features;
[0070] b.2. Multi-scale max pooling: The preliminarily processed feature map is simultaneously applied to three parallel max pooling layers cv2, cv3, and cv4; each max pooling layer has a different spatial receptive field, which is achieved by setting different padding and step sizes;
[0071] b.3. Feature map connection: The output feature maps of the three parallel maximum pooling layers are connected to form a feature map containing multi-scale information;
[0072] c. Feature fusion: The concatenated feature map is converted into the required number of output channels through a convolutional layer cv5. The specific process is as follows:
[0073] c.1. Input feature map;
[0074] c.2. Design of convolutional layer cv5, including convolution kernel size and number of convolution kernels;
[0075] c.3. Convolution operations, including:
[0076] c.3.1. Input feature map: Input feature map The dimensions are: ,in, is the height, is the width, is the number of channels;
[0077] c.3.2, Convolution kernel: 1×1 convolution kernel The dimensions are: ,in, is the number of channels of the output feature map; for the input feature map Each position in , output feature map The value of the corresponding position in is calculated by the following formula:
[0078]
[0079] In the formula, The output feature map is at position and Channel The value of For the input feature map at position and Channel The value of For 1×1 convolution in channel and Channel The weight of
[0080] d. Channel number conversion, including:
[0081] d.1. Capture different spatial context information of input data;
[0082] d.2. Fusion to generate rich feature representations, including: multi-scale feature map concatenation, concatenating the output feature maps of each pooling layer in the channel dimension to form a feature map containing multi-scale information, expressed as:
[0083]
[0084] In the formula, is the concatenated multi-scale feature map, For splicing operation, They are the output feature maps of the pooling layers with different receptive fields;
[0085] Convolutional layer conversion, through a convolutional layer cv5, converts the spliced multi-scale feature map into the required number of output channels, the expression is:
[0086]
[0087] In the formula, is the final output feature map, It is a 1×1 convolution operation.
[0088] In step (4.4.3), replace Backbone with FasterNeT, including:
[0089] (A) PConv design: By introducing a novel local convolution PConv operation, the computational complexity is reduced and the training process is accelerated;
[0090] (B) FasterNeT module structure: It contains a local convolution PConv layer and two point convolution PWConv or 1×1Conv layers; the local convolution PConv layer is used to extract the local spatial features of the input feature map;
[0091] Point convolution PWConv or 1×1Conv layer is used for channel fusion and feature conversion;
[0092] (C) Feature transfer: The PConv layer extracts spatial features from the input feature map, and the PWConv layer transfers the extracted features to subsequent processing.
[0093] In step S5, the constructed bearing defect dataset is input into the improved YOLOv10 model for training, including:
[0094] (5.1) Input the constructed bearing defect dataset into the improved YOLO model with set hyperparameters for training;
[0095] (5.2) Model training: The training set of the constructed bearing surface defect dataset is input into the improved YOLOv10 model for training, including:
[0096] (5.2.1) Use the advanced classifier XGBoost to classify the bounding boxes and obtain the defect type probabilistic classification method corresponding to each bounding box, including:
[0097] (I) Advanced Classifier XGBoost: Use the XGBoost classifier to classify each bounding box;
[0098] (II) Feature extraction: Extract the features of each bounding box from the convolutional feature map and use these features as input to XGBoost;
[0099] (III) Classification process: XGBoost classifies each bounding box and outputs the probability of the defect type corresponding to each bounding box. The classification result is the defect category and its probability distribution of each bounding box;
[0100] (IV) The classification probability of each bounding box is sorted by the soft non-maximum suppression method Soft-NMS to obtain the bounding box prediction value with the highest confidence. Soft-NMS does not directly delete bounding boxes with high overlap, but attenuates the confidence according to the overlap. The expression is:
[0101]
[0102] In the formula, is the initial confidence of the boundary, is the overlap between the current bounding box and other boxes, is the attenuation coefficient; the confidence threshold is set to 0.5, The threshold is set to 0.3;
[0103] (V) The loss value between the predicted value and the true value is calculated through the optimized loss function Shape-IoU. Shape-IoU introduces the concept of shape similarity based on the traditional IoU, and the expression is:
[0104]
[0105] In the formula, is a loss function, which is used to calculate the loss value between the predicted value and the true value. The smaller the loss value, the higher the match between the predicted box and the true box. To measure the similarity between the predicted box and the true box, To adjust the parameters, To measure the difference in aspect ratio between the predicted box and the real box;
[0106] (VI) Back-propagation is performed based on the loss value of the optimized loss function Shape-IoU;
[0107] (5.2.2) During the model training process, iterative training is performed, the model is validated on the validation set, and the accuracy and recall of the model are evaluated;
[0108] Then adjust the learning rate and dynamically adjust the learning rate according to the verification results;
[0109] The training process continues until the preset number of iterations is reached or the performance of the validation set no longer improves, and the network model training is completed.
[0110] In step S6, the trained YOLOv10 model and the improved YOLOv10 model are tested, including: loading the weight file generated after the model training is completed into the test file for model testing, obtaining the test results of the improved bearing defect detection model on the test set, including defect location, defect category and confidence, and comparing with the YOLOv10 model;
[0111] In step S7, the detection performance, computational efficiency and number of parameters of different models are comprehensively evaluated, including: mAP@0.5%, mAP@0.5-0.95%, FLOPs and number of parameters Params are selected as evaluation indicators.
[0112] Another object of the present invention is to provide a bearing surface defect detection system based on improved YOLOv10, which is implemented by the bearing surface defect detection method based on improved YOLOv10, and the system includes:
[0113] A defect image acquisition module is used to collect bearing defect images, which include bearing groove images, bearing wear images and bearing scratch images;
[0114] A data enhancement and preprocessing module, used for performing data enhancement and preprocessing on the collected bearing defect images;
[0115] A complete dataset building module, which is used to build a complete dataset from bearing defect images that have undergone data enhancement and preprocessing;
[0116] A YOLOv10 model improvement module is used to introduce the EMAttention attention module and the SPPELAN module of YOLOv9, and use FasterNeT to replace Backbone to build an improved bearing defect detection model, where the improved bearing defect detection model is an improved YOLOv10 model;
[0117] The model training module is used to input the constructed bearing defect dataset into the improved YOLOv10 model for training. By optimizing the loss function, adding the attention mechanism and feature fusion module, the detection accuracy and generalization ability of the improved YOLOv10 model are optimized.
[0118] The comparison module is used to test the trained YOLOv10 model and the improved YOLOv10 model on the test set, compare the experimental results, and verify the accuracy and efficiency of the two in detecting bearing defects; compare the improved YOLOv10 model with the mainstream algorithm, and comprehensively evaluate the detection performance, computational efficiency, and number of parameters of different models.
[0119] Combining all the above technical solutions, the beneficial effects of the present invention are as follows: the present invention aims to improve the model's feature extraction capability, detection accuracy and training efficiency by introducing the EMAttention (EMA) attention module, using the SPPELAN module of YOLOv9 and replacing Backbone with FasterNeT technology, while reducing computational complexity and enhancing the practical applicability of the model. These improvements enable the model to detect defects on the bearing surface more efficiently and accurately, meeting the needs of industrial environments for real-time, high-precision defect detection. Through these innovations, the present invention provides more reliable technical support for the maintenance of industrial equipment, reduces maintenance costs and improves production efficiency.
[0120] The present invention solves the problems of poor detection accuracy, training efficiency and complex defect recognition ability of bearing defect detection algorithms under complex backgrounds, meets the requirements of industrial environments for fast and real-time defect detection, and lays a technical foundation for the ultimate establishment of an efficient and reliable bearing defect detection system. The present invention integrates artificial intelligence technology and defect detection technology to achieve end-to-end bearing defect detection.
[0121] The present invention significantly improves the accuracy and efficiency of the target detection algorithm by introducing the attention module EMA into YOLOv10, using the SPPELAN module of YOLOv9, and replacing Backbone with FasterNeT.
[0122] The existing YOLO algorithm often shows the problem of insufficient detection accuracy when dealing with complex backgrounds and noise interference. The present invention introduces the EMA attention module and the SPPELAN module and uses FasterNeT as the backbone, which not only improves the detection accuracy but also enhances the robustness of the model in complex scenes.
[0123] The field of target detection has always been faced with the problem of how to maintain high detection accuracy and high efficiency in complex backgrounds. The present invention successfully solves this problem by integrating multiple advanced technologies. In particular, by introducing the attention mechanism, the model's ability to focus on target features is enhanced; the SPPELAN module optimizes the feature extraction process and improves the detection speed; and the FasterNeTBackbone further improves the overall performance of the network. These innovative improvements enable the present invention to maintain excellent detection results in highly complex and dynamic environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0124] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure;
[0125] Figure 1 It is a flow chart of a bearing surface defect detection method based on improved YOLOv10 provided in an embodiment of the present invention;
[0126] Figure 2 This is a diagram showing the effect of data enhancement provided by an embodiment of the present invention;
[0127] Figure 3 Schematic diagram of the YOLOv10 model used in the present invention provided by an embodiment of the present invention;
[0128] Figure 4 Schematic diagram of the improved YOLOv10 model provided by an embodiment of the present invention;
[0129] Figure 5 It is a schematic diagram of the SPPELAN module of YOLOv9 introduced in the present invention provided by an embodiment of the present invention;
[0130] Figure 6 This is a test result diagram of scratches and groove defects by the YOLOv10 model in the comparison of experimental effects between the improved model of the present invention and the original model provided in the embodiment of the present invention;
[0131] Figure 7 This is a test result diagram of the YOLOv10 model for groove and scratch defects in the experimental effect comparison between the improved model of the present invention and the original model provided in the embodiment of the present invention;
[0132] Figure 8 It is a test result diagram of scratch and groove defects of the improved model in the comparison of experimental effects between the improved model of the present invention and the original model provided in the embodiment of the present invention;
[0133] Fig. 9 This is a test result diagram of groove and scratch defects of the improved YOLOv10 model in the comparison of experimental effects between the improved model of the present invention and the original model provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0134] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific implementation disclosed below.
[0135] The present invention improves the detection accuracy and efficiency by introducing the EMA attention module, using the SPPELAN module of YOLOv9 and replacing Backbone with FasterNeT, effectively solving the problem of insufficient detection accuracy under complex backgrounds.
[0136] The key point of the present invention is to improve the existing YOLOv10 model in many aspects to solve practical problems in bearing defect detection, including the introduction of EMAttention (EMA) attention module, SPPELAN module of YOLOv9 and the use of FasterNeT to replace Backbone. EMAttention (EMA) attention module improves feature extraction and representation capabilities by retaining the information of each channel and reducing computational overhead, while avoiding the use of pooling operations or dimensionality reduction techniques to maintain the spatial resolution of feature maps. SPPELAN module of YOLOv9 adopts parallel multi-scale maximum pooling operations to capture different spatial context information of input data, and generates richer feature representations by fusing multi-scale information, thereby enhancing the recognition ability of complex defects. FasterNeT, as a new backbone network, reduces computational complexity and accelerates the training process by introducing local convolution (PConv) operations, simplifies the network structure and reduces memory access, improves the efficiency of the model when processing large-scale data sets, and maintains high-precision detection capabilities. These improvements significantly improve detection accuracy, training efficiency and complex defect recognition capabilities, while reducing computational complexity and enhancing the practical applicability of the model.
[0137] The innovative points of the present invention include the design and implementation of the EMAttention (EMA) attention module, its specific feature grouping, parallel sub-network structure and cross-space learning method, the structure of the SPPELAN module of YOLOv9, including the combination of the initial convolution layer, the parallel maximum pooling layer and the final convolution layer and its application in multi-scale information fusion, the application of the FasterNeT backbone network, including the specific design of the PConv layer and the PWConv layer and its application in feature extraction, and the method of improving the training and reasoning speed by simplifying the network structure and reducing memory access. Through these key points and points to be protected, the present invention has achieved many aspects of innovation and optimization in technology, and provided an efficient, accurate and real-time monitoring bearing defect detection solution in practical applications, which significantly improves the reliability and production efficiency of industrial equipment.
[0138] Compared with the prior art, the present invention has significant advantages in many aspects. First, by introducing the EMAttention (EMA) attention module, the present invention reduces the computational overhead while retaining the information of each channel, significantly improving the feature extraction and representation capabilities. This enables the model to more accurately identify subtle bearing defects in complex backgrounds, effectively reducing missed detections and false detections. Secondly, FasterNeT is used as the backbone network, and its efficient local convolution (PConv) operation reduces the computational complexity and accelerates the training process. FasterNeT simplifies the network structure and reduces memory access, improves the efficiency of the model when processing large-scale industrial data sets, and makes the training process faster and the reasoning speed higher. Thirdly, combined with the SPPELAN module of YOLOv9, the different spatial context information of the input data is captured through parallel multi-scale maximum pooling operations, and this information is fused to produce a richer feature representation. This design enhances the model's ability to recognize complex, overlapping or occluded defects, so that these problems can be detected more accurately in practical applications. Finally, while improving detection accuracy, training efficiency and complex defect recognition capabilities, the present invention maintains a low computational complexity, ensuring the deployability and practicality of the model in resource-constrained environments. These advantages together improve the overall performance of the present invention in bearing defect detection and provide strong guarantees for the reliability, production efficiency and safety of industrial equipment.
[0139] Embodiment 1, as Figure 1 As shown, the bearing surface defect detection method based on improved YOLOv10 provided in an embodiment of the present invention includes:
[0140] S1, collecting bearing defect images, which include bearing groove images, bearing wear images and bearing scratch images;
[0141] S2, data enhancement and preprocessing of the collected bearing defect images;
[0142] Data enhancement and preprocessing are performed on the collected bearing defect images. Random scaling, image flipping, and Mosaic data enhancement techniques are applied to expand the original dataset and increase its diversity. In addition, data enhancement is performed by combining traditional sample amplification and generative adversarial networks to generate high-quality and diverse bearing defect image samples;
[0143] S3, constructs a complete dataset of bearing defect images after data enhancement and preprocessing;
[0144] The bearing defect images that have undergone data enhancement and preprocessing are constructed into a complete dataset to provide data support for training and testing models;
[0145] S4, based on the YOLOv10 model, the EMAttention attention module and the SPPELAN module of YOLOv9 are introduced, and FasterNeT is used to replace Backbone to build an improved bearing defect detection model, where the improved bearing defect detection model is an improved YOLOv10 model;
[0146] S5, input the constructed bearing defect dataset into the improved YOLOv10 model for training, and optimize the detection accuracy and generalization ability of the improved YOLOv10 model by optimizing the loss function, adding the attention mechanism and feature fusion module;
[0147] S6, on the test set, the trained YOLOv10 model and the improved YOLOv10 model were tested and the experimental results were compared to verify the accuracy and efficiency of the two in detecting bearing defects, including defect location, defect category and confidence;
[0148] The comparison results include the detection performance of YOLOv10 and improved YOLOv10 models on the test set. The detailed results are as follows: Figure 5 As shown;
[0149] S7, compares the improved YOLOv10 model with mainstream algorithms, and comprehensively evaluates the detection performance, computational efficiency, and number of parameters of different models;
[0150] Comprehensive comparison of multiple models: In addition to the YOLOv10 model and its improved version, the improved YOLOv10 model is also compared with several other mainstream algorithms, including four indicators: mAP@0.5%, mAP@0.5-0.95%, FLOPs, and the number of parameters (Params). By comprehensively evaluating the detection performance, computational efficiency, and number of parameters of different models, the specific results are as follows: Figure 6 and Figure 7 shown.
[0151] like Figure 3 and Figure 4 The present invention introduces the EMAttention (EMA) attention module, the SPPELAN module of YOLOv9 and FasterNeT to replace the Backbone on the basis of YOLOv10 to solve the deficiencies in the prior art. The specific purposes are as follows: By introducing the EMAttention (EMA) module, the present invention retains the information of each channel and reduces the computational overhead, thereby enhancing the feature extraction and representation capabilities of the model without dimensionality reduction, which helps the model to more accurately identify subtle bearing defects in complex backgrounds and reduce missed detections and false detections. FasterNeT is used as a new backbone network, and its efficient local convolution (PConv) operation is used to reduce computational complexity and accelerate the training process. FasterNeT improves the speed of training and reasoning by simplifying the network structure and reducing memory access, so that it can converge faster when processing large-scale industrial data sets and improve the overall training efficiency. Combined with the SPPELAN module of YOLOv9, the different spatial context information of the input data is captured through parallel multi-scale maximum pooling operations, and this information is fused to produce a richer feature representation. This design enhances the model's performance in identifying complex, overlapping or occluded defects, allowing these problems to be detected more accurately in practical applications. The Shape-IoU loss function is introduced to optimize the bounding box regression method and improve the positioning accuracy of the model when dealing with complex-shaped defects. By considering boundary shape and scale factors, the Shape-IoU loss function can more accurately evaluate the model's positioning ability, thereby reducing positioning deviations. Despite the addition of new modules and optimization strategies, the design of the present invention still focuses on maintaining a relatively low computational complexity. The efficient design of FasterNeT and the optimization strategy of the EMA module jointly reduce the computational cost of the model, ensuring its deployability and practicality in resource-constrained environments. Through these improvements, the present invention aims to provide an efficient, accurate and real-time bearing defect detection solution to improve the reliability of industrial equipment, reduce maintenance costs, and prevent potential equipment failures, thereby improving the production efficiency and safety of chemical companies.
[0152] This paper introduces the EMAttention (EMA) attention module, which enhances the feature extraction and representation capabilities by retaining the information of each channel and reducing the computational overhead, and improves the detection accuracy of the model under complex backgrounds. Secondly, FasterNeT is used as the backbone network, and its efficient local convolution (PConv) operation is used to reduce the computational complexity and accelerate the training process, simplify the network structure and reduce memory access, thereby improving the efficiency of the model when processing large-scale industrial data sets. Finally, as Figure 5As shown in the figure, combined with the SPPELAN module of YOLOv9, the different spatial context information of the input data is captured through parallel multi-scale maximum pooling operations, and this information is fused to produce a richer feature representation, thereby enhancing the model's ability to recognize complex, overlapping or occluded defects.
[0153] It can be seen from the above embodiments that the experimental data used to train the network model in the present invention comes from a bearing defect dataset, which contains various common bearing defects such as grooves, wear and scratches. In order to enhance the generalization ability and robustness of the model, random scaling, image flipping and Mosaic data enhancement techniques are applied to expand the original dataset and increase its diversity. Data enhancement technology can not only effectively prevent overfitting and improve the generalization ability and stability of the model, but also help the model better understand the performance of bearing defects in different scenarios, thereby promoting better identification and detection of these defects and improving industrial production efficiency and quality.
[0154] The YOLOv10 model is improved for bearing defect detection, including the introduction of the EMAttention (EMA) attention module, the SPPELAN module of YOLOv9, and the replacement of Backbone with FasterNeT. The improved YOLOv10 model is obtained after fusion, which optimizes the problems of poor effect in feature extraction and complex defect detection, improves the detection accuracy of the model, and increases the generalization ability and robustness of the model.
[0155] Example 2, as another implementation of the present invention, the bearing surface defect detection method based on improved YOLOv10 provided in the embodiment of the present invention includes:
[0156] Step 1, obtain bearing defect images. The bearing defect image dataset used in the present invention is the bearing defect image data obtained by a chemical company. The dataset contains a total of 6543 images with an image resolution of 1280×720 and 3 channels. These images cover a variety of common bearing defects, such as grooves, scratches, and wear.
[0157] Step 2: Image data enhancement and preprocessing. Figure 2 As shown in the figure, the experimental data used to train the network model in the present invention comes from a bearing defect dataset, which contains various common bearing defects such as grooves, wear and scratches. In order to enhance the generalization ability and robustness of the model, random scaling, image flipping and Mosaic data enhancement techniques are applied to expand the original dataset and increase its diversity. Data enhancement technology can not only effectively prevent overfitting and improve the generalization ability and stability of the model, but also help the model better understand the performance of bearing defects in different scenarios, thereby promoting better identification and detection of these defects and improving industrial production efficiency and quality.
[0158] In addition, the present invention uses gamma transform technology to automatically adjust the brightness and contrast of the image, thereby reducing the background noise in the defective image and enhancing the robustness of the model. Gamma transform is a nonlinear transform used to adjust the brightness and contrast of the image. It is based on the nonlinear perception characteristics of human vision to brightness and realizes brightness adjustment by changing the mapping relationship of pixel values in the image. The conversion formula is as follows:
[0159]
[0160] In the formula, is the pixel value after gamma transformation, is a constant used to scale the transformed pixel values to the possible range, is the pixel value in the original image, is the gamma value used for brightness and contrast adjustment; it can be understood that this gamma transform is a classic image processing technology, which has been widely used in the early research of computer vision and image processing. The gamma transform formula mentioned in the present invention is used in different image processing application scenarios. The present invention applies the gamma transform technology to the brightness and contrast adjustment of the bearing defect image, with the aim of reducing the background noise in the image and enhancing the robustness of the model. Therefore, the specific application of the gamma transform formula in bearing defect detection combined with the processing flow adopted by the present invention can achieve good results. Including: Reducing background noise: The gamma transform can effectively reduce the background noise in the image by adjusting the brightness and contrast of the image, making the defect area more prominent. Enhance the robustness of the model: By adjusting the brightness and contrast of the training data, the model can better adapt to images under different lighting conditions and improve its robustness and generalization ability. In summary, the purpose and function of the gamma transform technology used in the present invention and the specific application are innovative to a certain extent. When applying the gamma transform, the pixel values of the image are first normalized to the range of 0 to 1, and then the normalized pixel values are raised to the power of the gamma value, which makes darker pixel values brighter and brighter pixel values darker. Finally, the transformed pixel values are rescaled back to the original pixel value range by multiplying them by the maximum possible value. Figure 2 shows the effect of applying a gamma transform to an image. Figure 2 It can be seen from the observation that the gamma transform adaptively adjusts the overall brightness of the image. In areas where defects exist and are affected by glare, it is necessary to reduce the contrast and brightness to clearly display these defects, which helps to reduce noise and smooth the image. However, due to the overall darker image in some parts, some defects may not be clearly visible. In this case, increasing the contrast and brightness can effectively display these defects.
[0161] Step 3. Construct a bearing surface defect dataset. The specific steps include:
[0162] (3.1) Defect type classification: The bearing surface defect image data after sample amplification and data enhancement is divided into three categories according to different types: grooves, abrasions and scratches. The difference between the defect type classification of the present invention and the prior art lies in the difference in the detection objects: the present invention focuses on the detection of bearing surface defects, and the detection objects are various bearings. As a key component in mechanical equipment, the surface defects of bearings will directly affect the operation and life of the equipment. Compared with steel surface defect detection, bearing defect detection has higher accuracy and sensitivity requirements. Although the defect types may have similarities in some names, the manifestation and detection difficulty of bearing surface defects are unique.
[0163] Specificity of defect type classification: The present invention classifies bearing surface defects into three categories: grooves, abrasions and scratches. This classification is based on the specific manifestations of bearing defects in actual use and their impact on bearing performance. The classification method and detection technology of the present invention are optimized specifically for the structural characteristics and use environment of the bearing.
[0164] Differences in detection methods: Although the defect types are similar in name to the prior art, the present invention uses an improved YOLOv10 model and combines specific preprocessing and enhancement techniques to improve the accuracy and robustness of bearing defect detection. The detection of the present invention is specially optimized and trained for subtle defects on the bearing surface to meet the needs of bearing industry application scenarios.
[0165] (3.2) Dataset division: The sample-augmented and data-enhanced bearing surface defect image data are divided into training set, test set, and validation set in a ratio of 8:1:1.
[0166] (3.3) Image annotation: Use labelimg image annotation tool to annotate the image at multiple points, and segment the actual defect area by multi-point annotation on the contour of the defect area. For images with multiple defects, use multiple anchor frames to mark the defect area. The label of the groove is 0 (aocao), the label of the abrasion is 1 (cashang), and the label of the scratch is 2 (huahen). After the annotation is completed, the generated json format data is saved, and the generated json format data is converted into txt format data that can be recognized by the neural network.
[0167] The image annotation proposed by the present invention is different from the prior art in that the analysis object is different: the present invention is aimed at the detection of defects on the bearing surface. As a key component of mechanical equipment, the surface defects of the bearing may directly affect the performance and life of the equipment, so the detection requirements for defects are higher. The existing method is aimed at the detection of steel surface defects. Although steel surface defects also need to be detected, their detection objectives and requirements are significantly different from those of bearings. In terms of the applicability of the annotation method, the method of the present invention: for bearing images containing multiple defects, multiple anchor frames are used to calibrate the defective area, and detailed classification and annotation are performed for grooves (label 0, aocao), abrasions (label 1, cashang), and scratches (label 2, huahen). This method aims to improve the detection accuracy of bearing defects.
[0168] Although the existing methods also use anchor frames to mark defect areas, their marking and classification methods are mainly aimed at specific defect types on the steel surface, and the application scenarios and purposes are different. In summary, although the present invention has similarities with the existing steel surface defect detection method in some technical details, due to the differences in analysis objects and specific application requirements, the two have obvious differences in practical application and effect.
[0169] (3.4) Data reading: Use the torch.utils.data function of the PyTorch library in Python software to read the dataset.
[0170] Step 4. Build a steel surface defect detection model based on the improved YOLO model.
[0171] (4.1) Configure the environment: Download the official source code of the YOLOv10 model from GitHub, and then use Anaconda to create a virtual environment. According to the requirements file of the YOLOv10 source code, install the following dependent libraries: matplotlib>=3.2.2, numpy>=1.18.5, opencv-python>=4.1.1, Pillow>=7.1.2, psutil, PyYAML>=5.3.1, requests>=2.23.0, scipy>=1.4.1, thop>=0.1.1, torch>=1.7.0, torchvision>=0.8.1, tqdm>=4.64.0, pandas>=1.1.4, seaborn>=0.11.0.
[0172] (4.2) Data input: Input the constructed bearing surface defect dataset into the YOLOv10 network structure model, including obtaining bearing surface defect images, bearing surface defect image labels, YOLOv10 network structure model pre-trained weights, and YOLOv10 network structure model configuration file.
[0173] (4.3) Configure hyperparameters: Set the optimal hyperparameter combination of learning rate, batch size, number of iterations, number of image channels, image cropping size and learning rate momentum. Specifically, learning rate lr=0.0002, batch size Batchsize=16, iteration number Epoch=500, image channel number Channels=3, image cropping size Cropsize=256×256, learning rate momentum momentum=0.937.
[0174] (4.4) Model improvement: The original model used in the present invention is YOLOv10, and the YOLOv10 network structure model is improved in the following three aspects.
[0175] The difference between the model improvement of the present invention and the prior art is that the analysis object is different:
[0176] The object of this invention is the defect detection of bearing surface, while the research object of the existing patent is the defect detection of steel surface. There are significant differences between bearings and steel in terms of usage environment, defect type, detection requirements, etc.:
[0177] Bearing surface: Defects are usually small and complex, such as grooves, abrasions and scratches. These defects have a great impact on the performance and life of the bearing and require high-precision detection methods.
[0178] Steel surface: Defect types and detection requirements are relatively simple, usually focusing on larger defects such as cracks and plaques.
[0179] In terms of model structure improvement, this paper has made a number of unique improvements based on the YOLOv10 model, which is specifically optimized for bearing defect detection, including the introduction of the EMAttention (EMA) attention module, specifically:
[0180] Module design: The EMA module improves feature extraction and representation capabilities by retaining the information of each channel and reducing computational overhead. The module divides the input feature map into multiple subgroups along the channel direction, and each subgroup is processed in a parallel subnetwork, including a 1×1 convolution branch and a 3×3 convolution branch.
[0181] Parallel subnetwork: The 1×1 convolution branch processes global information to recalibrate the channel weights in each parallel branch, and the 3×3 convolution branch further aggregates the output features of the two parallel branches through cross-dimensional interactions to capture pairwise relationships at the pixel level.
[0182] Cross-space learning: Finally, the output feature maps of the two parallel sub-networks are fused together to capture the pairwise relationship at the pixel level through matrix dot product operations, highlighting the global context, avoiding information loss, and improving detection accuracy and robustness.
[0183] Using the SPPELAN module of YOLOv9:
[0184] Module design: The SPPELAN module is designed based on convolution and maximum pooling operations. First, an initial convolution layer is used to reduce the number of channels of the input data.
[0185] Multi-scale max pooling: The output is applied to three parallel max pooling layers, each with a different spatial receptive field. The outputs of these pooling layers are concatenated to form a feature map containing multi-scale information.
[0186] Feature fusion: Finally, a concatenated feature map is converted to the required number of output channels through a convolutional layer to enhance the model’s performance in identifying complex, overlapping, or occluded defects.
[0187] Replace Backbone with FasterNeT:
[0188] PConv Design: FasterNeT reduces computational complexity and accelerates the training process by introducing local convolution (PConv) operations. The PConv layer effectively extracts spatial features and reduces computation and memory access.
[0189] Module structure: Each FasterNeT module contains a PConv layer followed by two point convolution (PWConv or 1×1Conv) layers, similar to a simplified version of the residual network, allowing input features to be reused, reducing computational requirements and accelerating forward propagation.
[0190] Feature transfer: The PConv layer extracts spatial features from the input feature map, and the PWConv layer passes the extracted features to subsequent processing.
[0191] The above improvements have jointly improved the feature extraction capability, detection accuracy and training efficiency of the YOLOv10 model, making it more suitable for bearing defect detection in actual industrial environments. These improved designs and implementations enable the model of the present invention to perform well in detecting bearing defects, which is significantly different from other steel surface defect detection methods.
[0192] The specific improvements to the YOLOv10 network structure model include:
[0193] (4.4.1) Introducing the EMAtattention (EMA) attention module:
[0194] (4.4.1.1) Module design: The EMA (Efficient Multi-Scale Attention) module improves feature extraction and representation capabilities by retaining information in each channel and reducing computational overhead. The EMA module first divides the input feature map into multiple subgroups along the channel direction. Each subgroup is processed in a parallel subnetwork, which includes a 1×1 convolution branch and a 3×3 convolution branch.
[0195] (4.4.1.2) Run a 1×1 convolution branch and a 3×3 convolution branch, including:
[0196] (i) Parallel subnetwork: The 1×1 convolution branch is responsible for processing global information to recalibrate the channel weights in each parallel branch; the specific implementation steps are as follows:
[0197] (i.1) 1×1 convolution operation, expressed as:
[0198]
[0199] In the formula, is the extracted global feature map, is a 1×1 convolution operation, is the input feature map;
[0200] The main function of the innovative 1×1 convolution operation proposed in this invention is to extract global feature information by weighted summing the channels of the input feature map at each spatial position. It reduces the channel dimension and recalculates the weights, so that the feature map can express global information more compactly while keeping the spatial resolution unchanged. The 1×1 convolution can also fuse information between channels and improve the expressiveness of feature representation.
[0201] (i.2) Global average pooling, expressed as:
[0202]
[0203] In the formula, It is the feature after global average pooling, which represents the global feature of each channel;
[0204] The main function of the innovative global average pooling proposed in this invention is to generate the global features of each channel by performing global average calculation on each channel of the feature map. This operation can convert the feature map of each channel into a single global feature value, reduce the data dimension, and retain the global information of each channel. This is crucial for subsequent feature processing and weight generation.
[0205] (i.3) Fully connected generation weight, the expression is:
[0206]
[0207] In the formula, The weight for each channel is generated through a fully connected layer;
[0208] The main function of the fully connected weight generation proposed in this invention is to convert the features after global average pooling into the weight of each channel through the fully connected layer. This operation can automatically generate the calibration weight of each channel based on the global features, ensuring that the importance of each channel in subsequent processing is fully reflected. The fully connected layer generates weight parameters for channel calibration by learning the importance of different channels.
[0209] (i.4) Channel weighted calibration, the expression is:
[0210]
[0211] In the formula, For the recalibrated feature map, calibration is achieved by multiplying the channel weights with the input feature map; The weight for each channel is generated through a fully connected layer;
[0212] The main purpose of the innovative channel weighted calibration proposed in this invention is to recalibrate each channel by multiplying the generated channel weights by the input feature map element by element. This operation can enhance the features of important channels while suppressing the features of unimportant channels, thereby improving the expressiveness and distinguishing ability of the feature map. The calibrated feature map can be more effectively used for subsequent feature extraction and classification tasks, improving the overall performance of the model.
[0213] (ii) The 3×3 convolution branch further aggregates the output features of the two parallel branches through cross-dimensional interaction to capture the pairwise relationship at the pixel level. The specific implementation steps are as follows:
[0214] (ii.1) 3×3 convolution operation, expressed as:
[0215]
[0216] In the formula, is the feature map after 3×3 convolution, It is a 3×3 convolution operation;
[0217] The 3×3 convolution operation extracts local spatial features by performing a sliding window operation on the input feature map in the spatial dimension. Each convolution kernel slides in the spatial position and performs a weighted sum operation on the local area to capture the detailed features in space. This operation can effectively extract the spatial information of the input feature map and generate a feature map with local perception capabilities, which helps the model capture local features and detailed information.
[0218] (ii.2) Cross-dimensional interaction and feature aggregation, expressed as:
[0219]
[0220] In the formula, is the feature map after aggregation, is the feature map after convolution;
[0221] This invention innovatively proposes cross-dimensional interaction and feature aggregation by adding the feature maps of 1×1 convolution and 3×3 convolution element by element, thus achieving the fusion of features of different scales. 1×1 convolution extracts global features, and 3×3 convolution extracts local features. Combining the two can retain global and local information at the same time, generating a richer and more comprehensive feature representation. This operation enables the model to focus on global context and local details in the same feature map at the same time, improving feature expression capabilities and model performance.
[0222] (ii.3) Capturing the pairwise relationship at the pixel level, the expression is:
[0223]
[0224] In the formula, is the attention weight, which is generated by performing element-wise dot product operation on the aggregated feature map; is the activation function, is the index;
[0225] The present invention innovatively proposes to capture the pairwise relationship at the pixel level by performing an element-by-element dot product operation on the aggregated feature map to generate attention weights. This operation can calculate the similarity and correlation between each pixel pair in the feature map. By using an activation function (such as sigmoid), these similarities and correlations are converted into attention weights. This step enables the model to identify and highlight highly correlated pixel pairs in the feature map, thereby capturing the pairwise relationship at the pixel level and improving the expressiveness of the feature map and the accuracy of the model.
[0226] (ii.4) Applying weight, the expression is:
[0227]
[0228] In the formula, For the final feature map, the pixel-level pairwise relationship is enhanced by applying attention weights to the aggregated feature map;
[0229] The present invention innovatively proposes to apply attention weights to reweight and calibrate feature maps by multiplying the generated attention weights element by element with the aggregated feature maps. This operation can enhance the highly correlated pixel pairs in the feature map while suppressing the weakly correlated pixel pairs, thereby improving the representation ability of the feature map and the detection accuracy of the model. The reweighted feature map can be more effectively used for subsequent feature extraction and classification tasks, improving the robustness and accuracy of the model in complex backgrounds.
[0230] (4.4.1.3) Cross-space learning: Finally, the cross-space learning method fuses the output feature maps of the two parallel sub-networks together and captures the pairwise relationship at the pixel level through matrix dot product operations, while highlighting the global context. This design effectively avoids information loss and improves the detection accuracy and robustness of the model under complex backgrounds.
[0231] Specifically, the 1×1 convolution branch is responsible for processing global information and recalibrating the channel weights in each parallel branch, while the 3×3 convolution branch further aggregates the output features of the two parallel branches through cross-dimensional interactions. Feature map fusion is achieved by element-by-element addition or concatenation to ensure the combination of global and local information. Subsequently, the correlation matrix is generated through the matrix dot product operation to capture the pairwise relationship at the pixel level, and the attention weight is generated through the activation function and applied to the feature map to enhance the pixel pairs with strong correlation and suppress the pixel pairs with weak correlation.
[0232] The EMA module, through its unique design and implementation, provides an efficient and effective method to enhance the feature extraction capability of deep learning models, especially in the visual task of bearing defect detection. It extracts features at different scales and focuses on key areas through the attention mechanism, improving the detection accuracy of the model.
[0233] (4.4.2) Use the SPPELAN module of YOLOv9, including:
[0234] a,Module design:,The SPPELAN (Spatial Pyramid Pooling Enhanced Local Aggregation Network) module is designed based on,convolution and max pooling operations.,First, an initial convolution layer (cv1) is used to reduce the number of,channels of the input data.
[0235] b. Multi-scale max pooling: The output is then applied to three parallel max pooling layers (cv2, cv3, cv4), each with a different spatial receptive field (implicitly achieved through different padding and stride lengths). The outputs of these pooling layers are then concatenated to form a feature map containing multi-scale information. The specific process of implementing multi-scale max pooling is as follows:
[0236] b.1, input feature map processing:
[0237] First, the input feature map is processed through an initial convolutional layer (cv1) to reduce the number of channels and extract preliminary features.
[0238] b.2, multi-scale maximum pooling:
[0239] The preliminarily processed feature maps are applied to three parallel max pooling layers (cv2, cv3, cv4) simultaneously. Each max pooling layer has a different spatial receptive field, which is achieved by setting different padding and stride.
[0240] Max pooling layer 1 (cv2):
[0241] The receptive field is small and can capture more detailed local information.
[0242] The padding and stride are set so that it covers a smaller area and extracts high-resolution features.
[0243] Max pooling layer 2 (cv3):
[0244] The receptive field is medium, balancing local and global information.
[0245] The padding and stride are set to cover a medium range area and extract medium resolution features.
[0246] Max pooling layer 3 (cv4):
[0247] The receptive field is large and can capture global information.
[0248] The padding and stride are set to cover a larger area and extract low-resolution features with a global view.
[0249] b.3, feature map connection:
[0250] The output feature maps of the three parallel maximum pooling layers are concatenated. Specifically, the pooled feature maps are concatenated in the channel dimension to form a feature map containing multi-scale information.
[0251] The concatenated feature map combines detailed local information, medium-range balanced information, and global information, allowing the model to focus on features of different scales simultaneously.
[0252] c. Feature fusion: Finally, a convolutional layer (cv5) is used to convert the concatenated feature map into the required number of output channels. The specific process is as follows:
[0253] c.1, Input feature map: The input feature map is generated by multi-scale maximum pooling operation and feature concatenation operation, which contains multi-scale information from different receptive fields. These feature maps are concatenated in the channel dimension to form a feature map containing information of multiple scales.
[0254] c.2, convolution layer (cv5) design: Convolution kernel size: select a 1×1 convolution kernel for convolution operation. The function of 1×1 convolution kernel is to convert the number of channels of the input feature map without changing the spatial dimension.
[0255] Number of convolution kernels: The number of filters in the convolution layer determines the number of channels of the output feature map. For example, if you need to convert the feature map to 64 channels, set the number of filters in the convolution layer to 64.
[0256] c.3, Convolution operation: Apply convolution kernel: Apply a 1×1 convolution kernel to each spatial position of the input feature map. Specifically, the convolution kernel slides over each pixel position of the input feature map and performs a weighted sum of the pixels at that position and its surroundings to generate the output feature. In the convolution operation, the input feature map is represented as , the output feature map is expressed as , the 1×1 convolution kernel is expressed as The specific process is as follows:
[0257] c.3.1, Input feature map: Input feature map The dimensions are: ,in, is the height, is the width, is the number of channels;
[0258] c.3.2, convolution kernel: 1×1 convolution kernel The size is ,in, is the number of channels of the output feature map.
[0259] For the input feature map Each position in , output feature map The value of the corresponding position in is calculated by the following formula:
[0260]
[0261] In the formula, The output feature map is at position and Channel The value of For the input feature map at position and Channel The value of For 1×1 convolution in channel and Channel The weight of
[0262] This formula means that the weight of the 1×1 convolution kernel is multiplied element by element with the value of the input feature map at the corresponding position and its surrounding pixels, and all channels are summed to obtain the value of the output feature map at the corresponding position. In this way, the convolution operation can extract and fuse the spatial and channel information of the input feature map to generate the output feature.
[0263] Calculate weighted sum: For each channel, the convolution kernel is applied independently to each position in the input feature map, and the input feature map is converted to the desired number of output channels by calculating the weighted sum.
[0264] d. Channel number conversion: The result of the convolution operation is a new feature map whose number of channels is equal to the number of filters in the convolution layer. Through the 1×1 convolution operation, the number of channels can be effectively adjusted while keeping the spatial resolution unchanged.
[0265] It can be understood that in a convolutional neural network, the result of the convolution operation is a new feature map whose number of channels is equal to the number of filters in the convolution layer. The feature map itself is a tensor containing multidimensional data. The entire feature map is a multidimensional data structure, and its content and form are described by data representation or tensor operations. Therefore, the specific characteristics and representation of the feature map are usually realized through tensor operations and the computational graph of the neural network framework.
[0266] The output feature map contains fused multi-scale information, and the feature representation capability is enhanced by channel number conversion. This design enhances the model's performance in identifying complex, overlapping or occluded defects, making it possible to detect these problems more accurately in practical applications.
[0267] The SPPELAN module captures different spatial context information of the input data through parallel multi-scale maximum pooling operations, and then fuses this information to produce a richer feature representation. This design helps the network to simultaneously focus on details of different scales when processing image data, thereby improving its performance. The specific process is as follows:
[0268] d.1, capturing different spatial context information of input data: Multi-scale maximum pooling: The input feature map passes through multiple parallel maximum pooling layers at the same time, and each pooling layer has a different spatial receptive field (implicitly achieved through different padding and stride lengths). This multi-scale pooling operation can capture spatial context information of different scales. Small receptive field pooling layer (cv2): captures more detailed local information and is suitable for identifying small-sized detail features. Medium receptive field pooling layer (cv3): balances local and global information and is suitable for identifying medium-sized features. Large receptive field pooling layer (cv4): captures larger global information and is suitable for identifying large-sized features and global context.
[0269] d.2, Fusion to produce richer feature representation: Feature map concatenation: The output feature map of each pooling layer is concatenated in the channel dimension to form a feature map containing multi-scale information. This step ensures that information from different receptive fields is integrated into a unified feature representation.
[0270]
[0271] In the formula, is the concatenated multi-scale feature map, For splicing operation, They are the output feature maps of the pooling layers with different receptive fields;
[0272] The main function of the feature map splicing proposed in this invention is to splice the feature maps from different pooling layers in the channel dimension to form a multi-scale feature representation. Each pooling layer has a different receptive field and can capture information of different scales. Through the splicing operation, these different scales of information are integrated into a unified feature representation, thereby enhancing the expressive power and diversity of the feature map, enabling the model to focus on details and global information at the same time, and improving detection accuracy.
[0273] Convolutional layer conversion: The concatenated multi-scale feature maps are converted to the required number of output channels through a convolutional layer (cv5). 1×1 convolution operation is often used in this process because it can adjust the number of channels without changing the spatial resolution.
[0274]
[0275] In the formula, is the final output feature map, It is a 1×1 convolution operation.
[0276] The main function of the convolutional layer conversion proposed in this invention is to adjust the number of channels of the spliced feature map through a 1×1 convolution operation to meet the input requirements of the model. Without changing the spatial resolution, the 1×1 convolution achieves compression and reconstruction of the feature map by adjusting the number of channels, thereby generating the required output feature map. This operation not only optimizes the dimension of the feature map, making it more compact, but also maintains the richness and expressiveness of multi-scale features, further improving the overall performance and accuracy of the model.
[0277] Through the above capture and fusion process, the SPPELAN module can effectively integrate spatial context information from different scales to generate richer and more expressive feature representations. This design can simultaneously pay attention to details of different scales when processing image data, thereby improving the overall performance and accuracy of the model.
[0278] (4.4.3) Replace Backbone with FasterNeT:
[0279] (A) PConv design: FasterNeT is an efficient neural network architecture that reduces computational complexity and accelerates the training process by introducing a new local convolution (PConv) operation. The specific implementation process is as follows:
[0280] (A.1) Local convolution (PConv) operation: Convolution kernel size: PConv operation uses smaller convolution kernels (such as 3×3 or 1×1) to reduce the amount of computation while maintaining high feature extraction capabilities. Grouped convolution: The PConv layer reduces computational complexity by performing grouped convolution. The channels of the input feature map are divided into several groups, each of which is convolved separately, and then the results are merged. This method effectively reduces the total amount of convolution calculations. Sparse convolution: In the PConv layer, sparse convolution technology can be used to calculate only a portion of the activation units, thereby further reducing the amount of computation and memory access.
[0281] (A.2) Reduced computation and memory access: Advantages of grouped convolution: Grouped convolution reduces the number of convolution kernels in each group, thus reducing computational complexity and memory access requirements. For example, if the channels of the feature map are divided into two groups, each group uses half of the convolution kernels for calculation, the amount of computation will be reduced by half. Efficient memory management: The PConv layer reduces the number of times data is moved in memory through efficient memory management techniques, thereby speeding up the training process. Using small-sized convolution kernels and grouped convolution can reduce the amount of data and memory required for each calculation.
[0282] (A.3) Accelerate the training process: Parallel computing: The PConv layer combines grouped convolution and sparse convolution to allow the computation process to be performed in parallel, thereby improving computational efficiency and training speed. Reduce the number of parameters: Since the PConv layer uses fewer convolution kernels and grouped convolution, the overall number of parameters is smaller, and the time required for model training is also reduced accordingly. This design enables the network to complete training in a shorter time, improving the efficiency of the training process. The PConv layer extracts spatial features more efficiently by reducing both computation and memory access.
[0283] (B) Module structure: Each FasterNeT module contains a PConv layer followed by two point convolution (PWConv or 1×1Conv) layers. The following is the functional principle of each layer:
[0284] (B.1) Local convolution (PConv) layer: Function: The PConv layer uses a smaller convolution kernel (such as 3×3 or 1×1) for convolution operations. Its main purpose is to extract local spatial features of the input feature map. Principle: Through grouped convolution and sparse convolution techniques, the PConv layer can reduce computational complexity and memory access requirements while maintaining efficient feature extraction capabilities. Grouped convolution divides the channels of the input feature map into several groups, performs convolution operations on each group, and then merges the results. This method effectively reduces the total amount of convolution calculations.
[0285] (B.2) Point convolution (PWConv or 1×1Conv) layer: Function: Point convolution layer (also known as 1×1 convolution layer) is used for channel fusion and feature conversion. Principle: The first point convolution layer: channels the local features extracted by the PConv layer are fused, and the weight of each channel is recalculated through 1×1 convolution operation to generate a new feature map. This step helps to integrate the features generated by grouped convolution and improve the expressiveness of feature representation. The second point convolution layer: further optimizes the feature representation, usually used to reduce the number of channels of the feature map or increase the dimension of the feature map to adapt it to the input requirements of subsequent network layers. Through the continuous operation of these two point convolution layers, the feature map is fully processed and optimized. This design enables the entire module to exhibit efficient computing performance in visual tasks.
[0286] (C) Feature transfer: The PConv layer is responsible for extracting spatial features from the input feature map, while the PWConv layer passes the extracted features to subsequent processing. The feature transfer structure is similar to a simplified residual network, in which the "shortcut connection" allows the input features to be reused, thereby reducing the computational requirements and speeding up the forward propagation process of the network. The details are as follows:
[0287] (C.1) PConv (local convolution) layer extracts spatial features by:
[0288] Convolution kernel size: The PConv layer uses a smaller convolution kernel (e.g., 3×3) and performs convolution operations in the spatial dimension to capture local spatial features.
[0289] Grouped convolution: The PConv layer uses grouped convolution technology to divide the channels of the input feature map into several groups, and each group performs a convolution operation separately. This method reduces the amount of calculation and can effectively extract spatial features.
[0290] Sparse convolution: The PConv layer can use sparse convolution technology to calculate only a portion of the activation units, further reducing the computational complexity while maintaining efficient feature extraction capabilities.
[0291] (C.2) The subsequent processing includes:
[0292] Input feature map processing: The input feature map is first processed by the PConv layer, using smaller convolution kernels and grouped convolution operations to extract local spatial features.
[0293] Channel fusion and feature conversion: The first point convolution layer (PWConv1) performs channel fusion and feature conversion on the feature map processed by the Pconv layer, and recalculates the weight of each channel.
[0294] Further optimize feature representation: The second convolutional layer (PWConv2) further optimizes feature representation, adjusts the number of channels or increases the dimension of feature maps to adapt them to the input requirements of subsequent network layers
[0295] Exemplarily, the feature transfer structure is similar to a simplified residual network, which is described as follows:
[0296] "Shortcut connection" of residual network: In the residual network, the input feature map is directly passed to the subsequent layer through a "shortcut connection" and added to the feature map after the convolution operation, thereby achieving feature reuse.
[0297] Simplified residual network: In the FasterNeT module, although there is no explicit "shortcut connection", the continuous operation of the PConv layer and the PWConv layer is similar to the feature reuse mechanism of the residual network. The input feature map is extracted through the PConv layer, and then passed through two PWConv layers for channel fusion and feature optimization, and finally passed to the subsequent processing.
[0298] Functional principle:
[0299] PConv layer: extracts local spatial features and reduces computational complexity.
[0300] PWConv layer (PWConv1 and PWConv2): channel fusion, feature conversion and optimization, recalculating the weights and dimensions of the feature map through 1×1 convolution operations.
[0301] Through the above processing, the FasterNeT module can efficiently extract and process features, allowing the network to perform well in visual tasks while reducing computational requirements and accelerating the forward propagation process.
[0302] FasterNeT improves the model's efficiency in processing large-scale industrial datasets while maintaining high-precision detection capabilities by simplifying the network structure and reducing memory access. This allows the model to run faster on multiple devices without compromising the accuracy of visual tasks.
[0303] These improvements together enhance the feature extraction capability, detection accuracy, and training efficiency of the YOLOv10 model, making it more suitable for bearing defect detection in actual industrial environments.
[0304] Step 5: Use the improved YOLO model for training, including:
[0305] (5.1) The built bearing defect data set is input into the improved YOLO model with set hyperparameters for training. The configuration used in the present invention is: CPU: Intel Core i9-12900K, CPU main frequency: 3.2GHz, memory: 32G, GPU: NVIDIA GeForce RTX 3090, video memory: GDDR6X 24G. The deep learning framework is PyTorch, and the development environment is PyTorch 1.12.1, Python 3.8, Cuda 11.3. The set hyperparameters include: learning rate lr=0.0001, batch size Batchsize=32, iteration number Epoch=1000, image channel number Channels=3, image crop size Cropsize=512×512, learning rate momentum momentum=0.9.
[0306] (5.2) Model training: The training set of the constructed bearing surface defect dataset is input into the improved YOLOv10 model for training.
[0307] First, the improved DBSCAN (density clustering algorithm) method is used to automatically generate a priori boxes, and the boundary size is obtained through bounding box regression prediction. The improved DBSCAN algorithm is optimized on the basis of traditional DBSCAN, and introduces adaptive density threshold and dynamic radius adjustment mechanism. The adaptive density threshold enables the density threshold of each data point to be dynamically adjusted according to its local data density. Through local density calculation and dynamic adjustment, the algorithm can more flexibly adapt to the density changes in the data set. Specifically, for each data point, the point density in its local area is calculated, and a minimum point number threshold (MinPts) that adapts to the current regional density is determined. According to the change of local density, the density threshold is adaptively adjusted, for example, a higher density threshold is used in high-density areas, and a lower density threshold is used in low-density areas. The dynamic radius adjustment mechanism enables the neighborhood radius of each data point to be dynamically adjusted according to its local data distribution. Through neighborhood density evaluation and dynamic adjustment, the algorithm can more accurately define the neighborhood range of different areas. Specifically, the neighborhood density of each data point in its local area is evaluated, and the neighborhood radius is dynamically adjusted according to the density situation. For example, a smaller radius is used in dense areas and a larger radius is used in sparse areas. Through these improvements, the improved DBSCAN algorithm can more flexibly adapt to the density changes and distribution characteristics of different scales in the data set, thereby more accurately generating the prior box of the dense area, and the boundary of each cluster is the position and size of the prior box.
[0308] It is understandable that the model training proposed by the present invention is different from the prior art in that the basic algorithms are different: the method of the present invention uses the improved YOLOv10 model for training, while other patents may use different basic algorithms (such as YOLOv5, Faster R-CNN, etc.). Different basic algorithms have obvious differences in model architecture, feature extraction and processing methods.
[0309] Different processing objects: The object of this invention is the defect detection of bearing surface, while other patents may deal with steel surface defects or other types of defect detection tasks. Different processing objects will have different model requirements and optimization strategies.
[0310] Different methods are used: In the generation of the prior box, the present invention uses the improved DBSCAN (density clustering algorithm) method to automatically generate the prior box, and obtains the boundary size through bounding box regression prediction. Other patents may use different clustering algorithms (such as K-Means) to generate the prior box.
[0311] Classification method: The present invention uses the advanced classifier XGBoost to classify bounding boxes, while other patents may use traditional neural network classifiers or other machine learning algorithms for classification.
[0312] Non-maximum suppression (NMS) method: The present invention uses a soft non-maximum suppression (Soft-NMS) method to sort the classification probability of each bounding box, while other patents may use a standard non-maximum suppression method.
[0313] Loss function: The present invention uses an optimized loss function Shape-IoU to calculate the loss value between the predicted value and the true value, while other patents may use traditional IoU loss or other loss functions.
[0314] Optimizer: The present invention uses the AdamW optimizer, which combines Adam and weight decay strategies and can better handle large-scale data sets, while other existing technologies use standard Adam optimizers or other optimization algorithms.
[0315] Difference in training process: During the training process of the present invention, the model is verified on the validation set after every 50 iterations, the accuracy and recall of the model are evaluated, and the learning rate is dynamically adjusted according to the verification results to prevent overfitting and underfitting. The training process is completed until the preset number of iterations is reached. Other patents may have different training and verification strategies.
[0316] In summary, the method of the present invention is significantly different from other patents in many aspects, such as basic algorithm, prior frame generation, classification method, non-maximum suppression, loss function, optimizer, and training process. These differences make the method of the present invention more suitable for bearing defect detection tasks and meet the specific needs and goals of the present invention. Specifically, it includes:
[0317] (5.2.1) Use the advanced classifier XGBoost to classify the bounding boxes and obtain the defect type probability classification method corresponding to each bounding box. The specific details are as follows:
[0318] (I) Advanced Classifier XGBoost: Each bounding box is classified using the XGBoost classifier. XGBoost is a gradient boosting based tree model with efficient classification performance.
[0319] (II) Feature Extraction: Extract the features of each bounding box from the convolutional feature map and use these features as input to XGBoost.
[0320] (III) Classification process: XGBoost classifies each bounding box and outputs the probability of the defect type corresponding to each bounding box. The classification result is the defect category and its probability distribution for each bounding box.
[0321] (IV) Next, the classification probability of each bounding box is sorted by the soft non-maximum suppression method to obtain the bounding box prediction value with the highest confidence. Soft-NMS does not directly delete bounding boxes with high overlap, but attenuates the confidence according to the overlap. The adjustment formula is:
[0322]
[0323] In the formula, is the initial confidence of the boundary, is the overlap between the current bounding box and other boxes, is the attenuation coefficient; the confidence threshold is set to 0.5, The threshold is set to 0.3;
[0324] (V) Subsequently, the loss value between the predicted value and the true value is calculated by the optimized loss function Shape-IoU. Shape-IoU introduces the concept of shape similarity based on the traditional IoU. The invention innovatively proposes the calculation formula as follows:
[0325]
[0326] In the formula, is a loss function, which is used to calculate the loss value between the predicted value and the true value. The smaller the loss value, the higher the match between the predicted box and the true box. To measure the similarity between the predicted box and the true box, To adjust the parameters, To measure the difference in aspect ratio between the predicted box and the real box;
[0327] (VI) Back propagate the loss value of the optimized loss function Shape-IoU. The specific operations are as follows:
[0328] Loss function calculation: The loss value of each predicted bounding box is calculated through the Shape-IoU loss function.
[0329] Gradient calculation: Calculate the gradient based on the loss value and use the back-propagation algorithm to propagate the gradient back to each layer of the network.
[0330] Weight update: The AdamW optimizer is used for model training. This optimizer combines Adam and weight decay strategies to better handle large-scale data sets such as bearing defects in industrial production.
[0331] (5.2.2) During the model training process, iterative training is first performed. During the model training process, the model is verified on the validation set every 50 iterations to evaluate the model's accuracy and recall.
[0332] Secondly, the learning rate is adjusted, and the learning rate is dynamically adjusted according to the verification results to prevent overfitting and underfitting. The learning rate decay strategy (Learning Rate Decay) is used to gradually reduce the learning rate to maintain the stability of the training process.
[0333] Finally, the training process continues until the preset number of iterations is reached or the performance of the validation set no longer improves, and the network model training is completed.
[0334] Step 6: Test and evaluate the improved YOLO model.
[0335] Model testing and evaluation: The weight file generated after model training is loaded into the test file for model testing. The test results of the improved bearing defect detection model on the test set are obtained, including defect location, defect category and confidence, and compared with the YOLOv10 model.
[0336] The improved bearing defect detection model is constructed by improving the YOLOv10 model, introducing the EMAttention (EMA) attention module and the SPPELAN module of YOLOv9, and replacing Backbone with FasterNeT.
[0337] The comparison results are as follows Figure 6 As shown, Figure 6 The test results of the YOLOv10 model for scratches and grooves, with confidence levels of 0.76 and 0.79 respectively; Figure 8 The test results of the improved model for scratch and groove defects are 0.94 and 0.96 respectively. Figure 7 The test results of the YOLOv10 model for groove and scratch defects are 0.79 and 0.73 respectively. Fig. 9 The test results of the improved YOLOv10 model for groove and scratch defects, with confidence levels of 0.94 and 0.95 respectively.
[0338] The improved algorithm not only performs better in overall detection accuracy, but also significantly improves the ability to identify subtle defects in complex backgrounds. By introducing the EMAttention (EMA) attention module, the model can better focus on key feature areas in the image, especially edge areas and subtle defects. This makes the model particularly good at identifying small targets with complex edges and irregular positions. Compared with the traditional YOLOv10 model, the improved model shows higher robustness and accuracy when dealing with multiple types of defects and small defects, and can more accurately locate and classify defects, reducing missed detections and false detections. Overall, the improved YOLOv10 model not only improves the accuracy and confidence of detection, but also enhances the generalization and robustness of the model, fully meeting the needs of industrial real-time detection.
[0339] Step 7: Use the improved YOLO model to detect the bearing surface defect image. The bearing surface defect image is input into the improved YOLO model to complete the detection of the bearing surface defect image.
[0340] Embodiment 3, the present invention also provides a bearing surface defect detection system based on improved YOLOv10, the system comprising:
[0341] A defect image acquisition module is used to collect bearing defect images, which include bearing groove images, bearing wear images and bearing scratch images;
[0342] A data enhancement and preprocessing module, used for performing data enhancement and preprocessing on the collected bearing defect images;
[0343] A complete dataset building module, which is used to build a complete dataset from bearing defect images that have undergone data enhancement and preprocessing;
[0344] A YOLOv10 model improvement module is used to introduce the EMAttention attention module and the SPPELAN module of YOLOv9, and use FasterNeT to replace Backbone to build an improved bearing defect detection model, where the improved bearing defect detection model is an improved YOLOv10 model;
[0345] The model training module is used to input the constructed bearing defect dataset into the improved YOLOv10 model for training. By optimizing the loss function, adding the attention mechanism and feature fusion module, the detection accuracy and generalization ability of the improved YOLOv10 model are optimized.
[0346] The comparison module is used to test the trained YOLOv10 model and the improved YOLOv10 model on the test set, compare the experimental results, and verify the accuracy and efficiency of the two in detecting bearing defects; compare the improved YOLOv10 model with the mainstream algorithm, and comprehensively evaluate the detection performance, computational efficiency, and number of parameters of different models.
[0347] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered within the protection scope of the present invention.
Claims
1. A bearing surface defect detection method based on improved YOLOv10, characterized in that: The method includes: S1, collecting bearing defect images, which include bearing groove images, bearing wear images and bearing scratch images; S2, data enhancement and preprocessing of the collected bearing defect images; S3, constructs a complete dataset of bearing defect images after data enhancement and preprocessing; S4, based on the YOLOv10 model, the EMAttention attention module and the SPPELAN module of YOLOv9 are introduced, and FasterNeT is used to replace Backbone to build an improved bearing defect detection model, where the improved bearing defect detection model is an improved YOLOv10 model; S5, input the constructed bearing defect dataset into the improved YOLOv10 model for training, and optimize the detection accuracy and generalization ability of the improved YOLOv10 model by optimizing the loss function, adding the attention mechanism and feature fusion module; S6, on the test set, the trained YOLOv10 model and the improved YOLOv10 model were tested and the experimental results were compared to verify the accuracy and efficiency of the two in detecting bearing defects, including defect location, defect category and confidence; S7, compares the improved YOLOv10 model with mainstream algorithms, and comprehensively evaluates the detection performance, computational efficiency, and number of parameters of different models; In step S4, an improved bearing defect detection model is constructed, including: (4.1) Configure the environment: Use Anaconda to create a virtual environment for the source code of the YOLOv10 model; (4.2) Data input: Input the constructed bearing surface defect dataset into the YOLOv10 network structure model, including obtaining bearing surface defect images, bearing surface defect image labels, YOLOv10 network structure model pre-training weights, and YOLOv10 network structure model configuration file; (4.3) Configure hyperparameters: set the optimal hyperparameter combination of learning rate, batch size, number of iterations, number of image channels, image cropping size, and learning rate momentum; (4.4) The original model used is YOLOv10, and the YOLOv10 network structure model is improved; In step (4.4), the YOLOv10 network structure model is improved, including: (4.4.1) Introduce the attention module EMA; (4.4.2) Use the SPPELAN module of YOLOv9; (4.4.3) Replace Backbone with FasterNeT; In step (4.4.1), the attention module EMA is introduced, including: (4.4.1.1) Module design: The attention module EMA divides the input feature map into multiple subgroups along the channel direction; each subgroup is processed in a parallel subnetwork, including a 1×1 convolution branch and a 3×3 convolution branch; (4.4.1.2) Run a 1×1 convolution branch and a 3×3 convolution branch, including: (i) Parallel subnetwork: The 1×1 convolution branch is responsible for processing global information to recalibrate the channel weights in each parallel branch; the specific implementation steps are as follows: (i.1) 1×1 convolution operation, expressed as: F global =Conn 1×1 (F input ) (2) In the formula, F global is the extracted global feature map, COnv 1×1 is a 1×1 convolution operation, F input is the input feature map; (i.2) Global average pooling, the expression is: G pool =Global Average Pooling(F global ) (3) In the formula, G pool It is the feature after global average pooling, which represents the global feature of each channel; (i.3) Full connection generates weight, the expression is: W calibrated =Fully Connected(G pool ) (4) Where W calibrated The weight for each channel is generated through a fully connected layer; (i.4) Channel weight calibration, the expression is: F calibrated =F input ×W chanel (5) In the formula, F calibrated is the recalibrated feature map, which is calibrated by multiplying the channel weight with the input feature map; W channel The weight for each channel is generated through a fully connected layer; (ii) The 3×3 convolution branch further aggregates the output features of the two parallel branches through cross-dimensional interaction to capture the pairwise relationship at the pixel level. The specific implementation steps are as follows: (ii.1) 3×3 convolution operation, expressed as: F 3×3 =Conv 3×3 (F input ) (6) In the formula, F 3×3 is the feature map after 3×3 convolution, Conv 3×3 It is a 3×3 convolution operation; (ii.2) Cross-dimensional interaction and feature aggregation, expressed as: F aggregated =F 1×1 +F 3×3 (7) In the formula, F aggregated is the feature map after aggregation, F 1×1 is the feature map after convolution; (ii.3) Capturing the pairwise relationship at the pixel level, the expression is: In the formula, A pixel is the attention weight, which is generated by performing element-by-element dot product operation on the aggregated feature map; sigmoid() is the activation function, and T is the exponent; (ii.4) Apply the weight, the expression is: F final =F aggregated ×A pixel (9) In the formula, F final For the final feature map, the pixel-level pairwise relationship is enhanced by applying attention weights to the aggregated feature map; (4.4.1.3) Cross-space learning: By fusing the output feature maps of two parallel sub-networks together, the matrix dot product operation is used to capture the pairwise relationship at the pixel level. The 1×1 convolution branch is responsible for processing global information and recalibrating the channel weights in each parallel branch, while the 3×3 convolution branch further aggregates the output features of the two parallel branches through cross-dimensional interaction. Feature map fusion is achieved by element-by-element addition or concatenation. The correlation matrix is generated by the matrix dot product operation to capture the pairwise relationship at the pixel level, and the attention weight is generated by the activation function and applied to the feature map to enhance the pixel pairs with strong correlation and suppress the pixel pairs with weak correlation.
2. The bearing surface defect detection method based on improved YOLOv10 according to claim 1 is characterized in that: In step S2, data enhancement and preprocessing are performed on the collected bearing defect images, including: Gamma transform technology is used to adjust the brightness and contrast of the image, reduce the background noise in the defective image, and enhance the robustness of the model. The conversion formula is: I′=c×I γ (1) Where I′ is the pixel value after gamma transformation, c is a constant used to scale the transformed pixel value to a possible range, I is the pixel value in the original image, and γ is the gamma value used for brightness and contrast adjustment; In step S3, a complete data set is constructed, including: (3.1) Defect classification: The bearing surface defect image data after sample amplification and data enhancement are classified into three categories: grooves, abrasions and scratches according to their types; (3.2) Dataset division: The sample-augmented and data-enhanced bearing surface defect image data are divided into a training set, a test set, and a validation set in a ratio of 8:1:1; (3.3) Image annotation: Use labelimg image annotation tool to perform multi-point annotation on the image, and use multi-point annotation to segment the actual defect area on the contour of the defect area; (3.4) Data reading: Use the torch.utils.data function of the PyTorch library in Python software to read the dataset.
3. The bearing surface defect detection method based on improved YOLOv10 according to claim 1 is characterized in that: In step (4.4.2), use the SPPELAN module of YOLOv9, including: a. Module design: The SPPELAN module uses an initial convolutional layer cv1 to reduce the number of channels of the input data; b. Multi-scale maximum pooling: The output is applied to three parallel maximum pooling layers cv2, cv3, and cv4. Each maximum pooling layer has a different spatial receptive field. The outputs of the pooling layers are then connected to form a feature map containing multi-scale information to achieve multi-scale maximum pooling. The specific process is as follows: b.
1. Input feature map processing: Process through an initial convolution layer cv1 to reduce the number of channels and extract preliminary features; b.
2. Multi-scale max pooling: The preliminarily processed feature map is simultaneously applied to three parallel max pooling layers cv2, cv3, and cv4; each max pooling layer has a different spatial receptive field, which is achieved by setting different padding and step sizes; b.
3. Feature map connection: The output feature maps of the three parallel maximum pooling layers are connected to form a feature map containing multi-scale information; c. Feature fusion: The concatenated feature map is converted into the required number of output channels through a convolutional layer cv5. The specific process is as follows: c.
1. Input feature map; c.
2. Design of convolutional layer cv5, including convolution kernel size and number of convolution kernels; c.
3. Convolution operations, including: c.3.
1. Input feature map: The size of the input feature map X is: H×W×C, where H is the height, W is the width, and C is the number of channels; c.3.2, Convolution kernel: 1×1 The size of the convolution kernel K is: 1×1×C×N, where N is the number of channels of the output feature map; for each position (i, j) in the input feature map X, the value of the corresponding position in the output feature map Y is calculated by the following formula: Where Y i,j,n is the value of the output feature map at position (i, j) and channel n, X i,j,c is the value of the input feature map at position (i, j) and channel c, K 1,1,c,n is the weight of 1×1 convolution in channel c and channel n; d. Channel number conversion, including: d.
1. Capture different spatial context information of input data; d.
2. Fusion to generate rich feature representations, including: multi-scale feature map concatenation, concatenating the output feature maps of each pooling layer in the channel dimension to form a feature map containing multi-scale information, expressed as: F multi-scale =Concat(F cv2 ,F cv3 ,F cv4 ) (11) In the formula, F multi-scale is the concatenated multi-scale feature map, Concat() is the concatenation operation, and F cv2 , F cv3 , F cv4 They are the output feature maps of the pooling layers with different receptive fields; Convolutional layer conversion, through a convolutional layer cv5, converts the spliced multi-scale feature map into the required number of output channels, the expression is: F output =Conv 1×1 (F multi-scale ) (12) In the formula, F output is the final output feature map, Conv 1×1 It is a 1×1 convolution operation.
4. The bearing surface defect detection method based on improved YOLOv10 according to claim 1 is characterized in that: In step (4.4.3), replace Backbone with FasterNeT, including: (A) PConv design: By introducing a novel local convolution PConv operation, the computational complexity is reduced and the training process is accelerated; (B) FasterNeT module structure: It contains a local convolution PConv layer and two point convolution PWConv or 1×1Conv layers; the local convolution PConv layer is used to extract the local spatial features of the input feature map; Point convolution PWConv or 1×1Conv layer is used for channel fusion and feature conversion; (C) Feature transfer: The PConv layer extracts spatial features from the input feature map, and the PWConv layer transfers the extracted features to subsequent processing.
5. The bearing surface defect detection method based on improved YOLOv10 according to claim 1 is characterized in that: In step S5, the constructed bearing defect dataset is input into the improved YOLOv10 model for training, including: (5.1) Input the constructed bearing defect dataset into the improved YOLO model with set hyperparameters for training; (5.2) Model training: The training set of the constructed bearing surface defect dataset is input into the improved YOLOv10 model for training, including: (5.2.1) Using the advanced classifier XGBoost to classify the bounding boxes, a probability classification method for the defect type corresponding to each bounding box is obtained, including: (I) Advanced Classifier XGBoost: Use XGBoost classifier to classify each bounding box; (II) Feature extraction: Extract the features of each bounding box from the convolutional feature map and use these features as input to XGBoost; (III) Classification process: XGBoost classifies each bounding box and outputs the probability of the defect type corresponding to each bounding box. The classification result is the defect category and its probability distribution of each bounding box; (IV) The classification probability of each bounding box is sorted by the soft non-maximum suppression method Soft-NMS to obtain the bounding box prediction value with the highest confidence. Soft-NMS does not directly delete the bounding boxes with high overlap, but attenuates the confidence according to the overlap. The expression is: In the formula, S i is the initial confidence of the boundary, IOU is the overlap between the current bounding box and other boxes, and σ is the attenuation coefficient; the confidence threshold is set to 0.5, and the IOU threshold is set to 0.3; (V) The loss value between the predicted value and the true value is calculated through the optimized loss function Shape-IoU. Shape-IoU introduces the concept of shape similarity based on the traditional IoU, and the expression is: In the formula, Shape-IOU is a loss function used to calculate the loss value between the predicted value and the true value. The smaller the loss value, the higher the match between the predicted box and the true box. Shape-Similarity is used to measure the similarity between the predicted box and the true box, α is an adjustment parameter, and Aspect-Ratio-Difference is used to measure the difference in aspect ratio between the predicted box and the true box. (VI) Back-propagation is performed based on the loss value of the optimized loss function Shape-IoU; (5.2.2) During the model training process, iterative training is performed, the model is validated on the validation set, and the accuracy and recall of the model are evaluated; Then adjust the learning rate and dynamically adjust the learning rate according to the verification results; The training process continues until the preset number of iterations is reached or the performance of the validation set no longer improves, and the network model training is completed.
6. The bearing surface defect detection method based on improved YOLOv10 according to claim 1 is characterized in that: In step S6, the trained YOLOv10 model and the improved YOLOv10 model are tested, including: loading the weight file generated after the model training is completed into the test file for model testing, obtaining the test results of the improved bearing defect detection model on the test set, including defect location, defect category and confidence, and comparing with the YOLOv10 model; In step S7, the detection performance, computational efficiency and number of parameters of different models are comprehensively evaluated, including: mAP@0.5%, mAP@0.5-0.95%, FLOPs and number of parameters Params are selected as evaluation indicators.
7. A bearing surface defect detection system based on improved YOLOv10, characterized in that: The system is implemented by the bearing surface defect detection method based on improved YOLOv10 according to any one of claims 1 to 6, and the system includes: A defect image acquisition module is used to collect bearing defect images, which include bearing groove images, bearing wear images and bearing scratch images; A data enhancement and preprocessing module, used for performing data enhancement and preprocessing on the collected bearing defect images; A complete dataset building module, which is used to build a complete dataset from bearing defect images that have undergone data enhancement and preprocessing; A YOLOv10 model improvement module is used to introduce the EMAttention attention module and the SPPELAN module of YOLOv9, and use FasterNeT to replace Backbone to build an improved bearing defect detection model, where the improved bearing defect detection model is an improved YOLOv10 model; The model training module is used to input the constructed bearing defect dataset into the improved YOLOv10 model for training. By optimizing the loss function, adding the attention mechanism and feature fusion module, the detection accuracy and generalization ability of the improved YOLOv10 model are optimized. The comparison module is used to test the trained YOLOv10 model and the improved YOLOv10 model on the test set, compare the experimental results, and verify the accuracy and efficiency of the two in detecting bearing defects; compare the improved YOLOv10 model with the mainstream algorithm, and comprehensively evaluate the detection performance, computational efficiency, and number of parameters of different models.
