Bearing surface defect detection method based on YOLOv8n-GSS neural network model
By introducing the SENetV2 attention module and GSConv lightweight convolution module into the YOLOv8n-GSS neural network model, combined with mosaic data enhancement, the problem of low bearing surface defect detection accuracy and efficiency in the existing technology is solved, achieving efficient and accurate detection effect.
Patent Information
- Application Number
- CN202410576056.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-10
- Publication Date
- 2024-08-27
AI Technical Summary
Bearing surface defect detection methods based on detection models in the existing technology have high calculation costs and low calculation efficiency while ensuring detection accuracy, and cannot meet high-demand production needs.
Using the YOLOv8n-GSS neural network model, by constructing improved backbone network units, neck units and head units, introducing the SENetV2 attention module and GSConv lightweight convolution module, combined with the mosaic data enhancement method, to improve detection accuracy and efficiency .
Under the condition of ensuring the detection speed, the accuracy of bearing surface defect detection is significantly improved, the calculation cost is reduced, and the robustness and generalization ability of the model are improved.
Smart Images

Figure BDA0004832470930000091 
Figure BDA0004832470930000101 
Figure HDA0004832470940000011
Abstract
Description
Technical Field
[0001] The present invention relates to a bearing defect detection method, and in particular to a bearing surface defect detection method based on a YOLOv8n-GSS neural network model, and belongs to the technical field of bearing detection. Background Art
[0002] During the production and assembly of bearings, affected by various factors such as materials, processing, assembly and transportation, some defects will inevitably appear on the surface of the bearing rings, such as cracks, black spots, scratches, dents, forging waste and spiral patterns, etc. These defects not only affect the appearance quality of the bearing, but also have a negative impact on the service life and performance of the bearing.
[0003] Traditional bearing surface defect detection methods have low accuracy and are time-consuming, and cannot meet high-demand production needs. With the advancement of image detection technology, there are more and more studies on bearing surface defect detection using relevant knowledge such as machine vision and deep learning. However, in the image detection method based on the detection model in the prior art, when performing bearing surface defect detection, in order to ensure the detection accuracy, the number of model neurons is set to be large. Although the nonlinear expression ability of the model is improved, the cost is high computational cost. In addition, due to the limitation of the attention mechanism, the model is not able to effectively represent important features in the image, which affects the computational efficiency and detection efficiency. Therefore, how to improve the detection accuracy of bearing surface defects while ensuring the detection speed is a technical problem that technicians in this field urgently need to solve. Summary of the invention
[0004] Based on the above background, the purpose of the present invention is to provide a bearing surface defect detection method based on the YOLOv8n-GSS neural network model to solve the problems described in the background technology.
[0005] In order to achieve the above-mentioned object of the invention, the present invention provides the following technical solutions:
[0006] A bearing surface defect detection method based on a YOLOv8n-GSS neural network model, the method comprising the following steps:
[0007] A YOLOv8n-GSS neural network model is constructed based on the YOLOv8n neural network model, wherein the YOLOv8n-GSS neural network model includes a backbone network unit, a neck unit and a head unit connected in sequence, wherein the backbone network unit includes four Conv modules, four C2f modules, a SENetV2 attention module and an SPPF module, wherein the SENetV2 attention module is located between the SPPF module and the last C2f module adjacent to the end of the backbone network unit, wherein the neck unit includes two upsampling modules, four Concat modules, four C2f modules and two GSConv modules, wherein the three C2f modules are respectively connected to the head unit, and wherein the two C2f modules are respectively connected to a Concat module through a GSConv module, wherein the head unit includes three detection head modules;
[0008] Obtain a bearing surface defect data set, and divide the data set into a training set, a validation set, and a test set, and set training parameters based on the data set to train the YOLOv8n-GSS neural network model;
[0009] The real-time collected bearing surface image is traversed and cut using a window of fixed size. The cut window image is input into the trained YOLOv8n-GSS neural network model for defect detection.
[0010] Preferably, the SENetV2 attention module includes a squeezing module, an aggregation module, an excitation module and a scaling module, the squeezing module is used to extract channel-level representation from the input feature image, the aggregation module includes multiple parallel fully connected layer branches, each of the branches independently learns a global representation from the output of the squeezing module, the excitation module is used to combine the multiple global representations learned by the aggregation module into a single channel-level representation and normalize its value range, and the scaling module is used to multiply the channel-level weight vector output by the excitation module by the input feature image channel by channel.
[0011] Preferably, the GSConv module includes a Conv module, a DWConv module, a Concat module and a Shuffle module. After the input feature image is convolved by the Conv module, it is subjected to a depthwise separable convolution by the DWConv module. After that, the Concat module concatenates the output of the Conv module and the output of the DWConv module, and then randomly arranges them through the Shuffle module to rearrange the feature channels, and finally outputs the feature image.
[0012] Preferably, the connection structure of the backbone network unit is that the Conv module and the C2f module are alternately connected in sequence, the second C2f module is also connected to a Concat module of the neck unit, the third C2f module is also connected to another Concat module of the neck unit, the fourth C2f module is connected to the SENetV2 attention module and the SPPF module in sequence, the SPPF module is connected to an upsampling module of the neck unit, and the SPPF module is also connected to another Concat module of the neck unit.
[0013] Preferably, the connection structure of the neck unit is that the first upsampling module, the first Concat module, the first C2f module, the second upsampling module, the second Concat module and the second C2f module are connected in sequence, the second C2f module is connected to the first detection head module of the head unit, and the second C2f module is also connected to the first GSConv module, the third Concat module and the third C2f module in sequence, the third C2f module is connected to the second detection head module of the head unit, and the third C2f module is also connected to the second GSConv module, the fourth Concat module and the fourth C2f module in sequence, the fourth C2f module is connected to the third detection head module of the head unit, the first Concat module is also connected to the third C2f module of the backbone network unit, the second Concat module is also connected to the second C2f module of the backbone network unit, the third Concat module is also connected to the first C2f module of the neck unit, and the fourth Concat module is also connected to the SPPF module of the backbone network unit.
[0014] Preferably, the setting of training parameters includes a batch size of 32, a dynamic parameter of 0.937, a learning rate of 0.01, a cosine annealing learning rate of 0.1, a data enhancement of 1.0, an image size of 640×640, and a training number of 100.
[0015] Preferably, the division ratio of the training set, the validation set and the test set is 6:2:2.
[0016] Preferably, a mosaic data enhancement method is used in the process of training the YOLOv8n-GSS neural network model.
[0017] Compared with the prior art, the present invention has the following advantages:
[0018] The present invention discloses a bearing surface defect detection method based on the YOLOv8n-GSS neural network model, constructs a YOLOv8n-GSS neural network model improved based on the YOLOv8n neural network model, integrates the GsConv lightweight convolution and SENetV2 attention mechanism, and improves the detection accuracy of bearing surface defects while ensuring the detection speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0020] Figure 1 It is a detection flow diagram of a bearing surface defect detection method based on a YOLOv8n-GSS neural network model of the present invention;
[0021] Figure 2 It is a structural diagram of the YOLOv8n-GSS neural network model in the present invention;
[0022] Figure 3 This is a comparison diagram of the differences between the SENetV2 attention module and the SENet attention module in the present invention;
[0023] Figure 4 It is a structural diagram of the GsConv module in the present invention;
[0024] Figure 5 is a schematic diagram of bearing surface defects in the present invention;
[0025] Figure 6 It is a convergence curve graph of YOLOv8n on the bearing surface defect data set in the present invention;
[0026] Figure 7 It is a convergence curve diagram of YOLOv8n-GSS on the bearing surface defect data set in the present invention;
[0027] Figure 8 It is a comparison chart of the detection effects of different models in the comparative experiment of the present invention on the bearing defect data set. DETAILED DESCRIPTION
[0028] The technical solution of the present invention is further described in detail below through specific embodiments and in conjunction with the accompanying drawings. It should be understood that the implementation of the present invention is not limited to the following embodiments, and any form of modification and / or change made to the present invention will fall within the protection scope of the present invention.
[0029] In the present invention, unless otherwise specified, all parts and percentages are weight units, and the equipment and raw materials used can be purchased from the market or are commonly used in the art. The methods in the following embodiments, unless otherwise specified, are conventional methods in the art. The components or equipment in the following embodiments, unless otherwise specified, are universal standard parts or components known to those skilled in the art, and their structures and principles are known to those skilled in the art through technical manuals or conventional experimental methods.
[0030] An embodiment of the present invention discloses a bearing surface defect detection method based on a YOLOv8n-GSS neural network model, the method comprising the following steps:
[0031] A YOLOv8n-GSS neural network model is constructed based on the YOLOv8n neural network model. The YOLOv8n-GSS neural network model includes a backbone network unit, a neck unit and a head unit connected in sequence; the backbone network unit includes four Conv modules, four C2f modules, a SENetV2 attention module and an SPPF module. The SENetV2 attention module is located between the SPPF module and the last C2f module at the end of the adjacent backbone network unit. The neck unit includes two upsampling modules, four Concat modules, four C2f modules and two GSConv modules. The three C2f modules are respectively connected to the head unit, and two of the C2f modules are also connected to a Concat module through a GSConv module respectively. The head unit includes three detection head modules;
[0032] Obtain a bearing surface defect data set, and divide the data set into a training set, a validation set, and a test set, and set training parameters based on the data set to train the YOLOv8n-GSS neural network model;
[0033] The real-time collected bearing surface image is traversed and cut using a window of fixed size. The cut window image is input into the trained YOLOv8n-GSS neural network model for defect detection.
[0034] The steps of the method are described in detail below with reference to the accompanying drawings.
[0035] The design idea of the bearing surface defect detection method is that, considering that the resolution of the bearing surface image is large and cannot be directly input into the neural network model for detection, when the bearing surface image is detected for defects, the method will traverse the collected bearing image, cut it using a fixed-size window, and then input the cut window image into the constructed and trained YOLOv8n-GSS neural network model for defect detection. Finally, the products are sorted according to the detection results of the model. The whole process is as follows: Figure 1 shown.
[0036] The specific process of building the YOLOv8n-GSS neural network model is as follows.
[0037] The YOLOv8n-GSS neural network model is built based on the YOLOv8n neural network model. YOLOv8 is a new SOTA model that provides five models of different scales, such as N / S / M / L / X, according to the scaling factor of the network. The YOLOv8 neural network model includes an input layer, a backbone network (Backbone), a feature fusion layer (Neck), and three decoupling heads (Head). Compared with YOLOv5, YOLOv8 improves the first layer of convolution on Backbone. The original 6x6 convolution was replaced with a 3x3 convolution. At the same time, referring to the ELAN design idea of YOLOv7, the C3 module was changed to a C2f module, and the depth of the module was adjusted. In the Neck part, the downsampling layer of the 1x1 convolution was removed, and the original C3 module was replaced with a C2f module. In the Head part, the decoupling head structure is used to decouple the classification task and the regression task. In addition, Anchor-Based was changed to Anchor-Free, and BCE Loss was used as the classification loss, and DFL Loss+CIOU Loss was used as the regression loss. In terms of sample matching strategy, the Task-AlignedAssigner sample allocation strategy was adopted. In terms of training strategy, the Mosaic data enhancement operation was turned off in the last round, which can effectively improve accuracy.
[0038] Since the bearing surface defect detection in this embodiment is an industrial application, it is necessary to consider both detection accuracy and detection speed. Therefore, the YOLOv8n network model is adopted as the basis, and two improvements are mainly made to Backbone and Neck, namely, the SENetV2 attention mechanism and the GSConv lightweight convolution module are introduced respectively.
[0039] The structure diagram of the constructed YOLOv8n-GSS neural network model is as follows Figure 2 shown.
[0040] The connection structure of the backbone network unit is that the Conv module and the C2f module are connected alternately in sequence, the second C2f module is also connected to a Concat module of the neck unit, the third C2f module is also connected to another Concat module of the neck unit, and the fourth C2f module is connected to the SENetV2 attention module and the SPPF module in sequence, the SPPF module is connected to an upsampling module of the neck unit, and the SPPF module is also connected to another Concat module of the neck unit.
[0041] The connection structure of the neck unit is that the first upsampling module, the first Concat module, the first C2f module, the second upsampling module, the second Concat module and the second C2f module are connected in sequence, the second C2f module is connected to the first detection head module of the head unit, and the second C2f module is also connected to the first GSConv module, the third Concat module and the third C2f module in sequence, the third C2f module is connected to the second detection head module of the head unit, and the third C2f module is also connected to the second GSConv module, the fourth Concat module and the fourth C2f module in sequence, the fourth C2f module is connected to the third detection head module of the head unit, the first Concat module is also connected to the third C2f module of the backbone network unit, the second Concat module is also connected to the second C2f module of the backbone network unit, the third Concat module is also connected to the first C2f module of the neck unit, and the fourth Concat module is also connected to the SPPF module of the backbone network unit.
[0042] The head unit consists of three decoupling heads, which have the same structure as the YOLOv8n neural network model.
[0043] The introduction of SENetV2 attention mechanism is achieved by adding SENetV2 attention module between the fourth C2f module and SPPF module. SENetV2 attention module includes squeeze module, aggregation module, excitation module and scaling module. The squeeze module is used to extract channel-level representation from the input feature image. The aggregation module includes multiple parallel fully connected layer branches, each branch independently learns global representation from the output of the squeeze module. The excitation module is used to combine multiple global representations learned by the aggregation module into a single channel-level representation and normalize its value range. The scaling module is used to multiply the channel-level weight vector output by the excitation module with the input feature image channel by channel.
[0044] The significance of introducing the SENetV2 attention mechanism is that the attention mechanism can help the network model learn the importance of input information. By assigning different weights to different parts of the input data, the model can pay more attention to important information, thereby improving the performance and accuracy of the model, and helping to avoid overfitting and improve the robustness of the model. The SENetV2 attention mechanism is a channel attention module, which is an improvement on the SENet attention mechanism. The difference between SENetV2 and SENet is as follows: Figure 3As shown in the figure, the smaller rectangles represent fully connected layers or dense layers. SENet uses an additional neural network to obtain the importance of each feature channel on the feature map and assigns a weight value to each feature channel to manually guide the model to pay more attention to important channels. However, SENet may ignore a lot of spatial information by global average pooling when achieving this. SENetV2 introduces a novel converged multi-layer perceptron, namely a multi-branch dense layer, into which the compressed excitation residual module designed to surpass the existing architecture is incorporated. Better feature representation is achieved by enhancing the network's capture of channel patterns and understanding of global knowledge. Compared with SENet, SENetV2 has almost no additional parameters. By using an aggregation module containing multiple convolution operations to process branch inputs, rather than selecting a deeper network or a wider layer, it can more effectively capture complex spatial representations, especially in the convolutional layer of the aggregation module. In addition, the SENetV2 attention module has a small amount of computation and is more computationally efficient than some other attention modules, which is conducive to saving the computational cost of the model.
[0045] The GSConv lightweight convolution module is introduced, that is, the standard convolution between the C2f module and the Concat module in the Neck of the YOLOv8n neural network model is replaced with the GSConv module. The computational cost of the GSConv module is about 60% to 70% of the standard convolution.
[0046] The GSConv module includes a Conv module, a DWConv module, a Concat module, and a Shuffle module. Figure 4 As shown, after the input feature image is convolved by the Conv module, the DWConv module performs a depth-separable convolution, and then the Concat module splices the output of the Conv module and the output of the DWConv module, and then randomly arranges them through the Shuffle module to rearrange the feature channels, and finally outputs the feature image. By using the shuffle module, the information generated by the standard convolution is infiltrated into each part of the information generated by the depth-separable convolution, so that the information from the standard convolution is completely mixed in the output of the depth-separable convolution. However, if the GsConv module is used in all stages of the model, the number of network layers will increase, increasing the resistance of the data flow, thereby significantly increasing the reasoning time. Therefore, this embodiment only uses the GsConv module in the neck unit. At the neck unit stage, the feature map has become slender, that is, the channel dimension is the largest and the width and height dimension is the smallest, and no further transformation is required. The GsConv module is used to process the feature map spliced at this stage, with less redundant and repeated information, no compression is required, and the effect is better.
[0047] After the YOLOv8n-GSS neural network model is built, the bearing surface defect dataset is acquired.
[0048] The bearing surface defect dataset (hereinafter referred to as DO-BSD) used in this example comes from the industrial field and is collected using a camera on a factory production line. The image resolution is 5472×3468, and the size of each image is about 19M. After processing, the image windows containing defects are intercepted, and the size of each window is 640×640, forming the following Figure 5 The image dataset shown in FIG. 1 is a dataset of images containing defects. This embodiment selects images containing defects and divides the dataset into five categories according to the types of defects: spiral marks, forging waste, black spots, dents, and scratches. Since the number of each defect type varies in actual production, in order to ensure the rationality of training and the balance between various defect types, the number of each defect is expanded to 5660. The statistical data of various defects after expansion are shown in Table 1.
[0049] Table 1 Expanded DO-BSD
[0050] Spiral pattern Forging waste Dark spots dent Scratching Original quantity 570 217 574 280 389 After expansion 1140 1085 1148 1120 1167
[0051] Before using the data set for network training, it needs to be divided. In this embodiment, according to the number of data set samples and the rationality of training, the defect sample data set is divided into a training set, a validation set, and a test set in a ratio of 6:2:2. The specific division results are shown in Table 2.
[0052] Table 2 Statistics of DO-BSD training set, validation set and test set
[0053] train verify test total Spiral pattern 747 197 196 1140 Forging waste 721 182 182 1085 Dark spots 761 193 194 1148 dent 753 184 183 1120 Scratching 783 192 192 1167
[0054] The hardware environment and software versions for model training and running experiments are shown in Table 3.
[0055] Table 3 Hardware environment and software version
[0056]
[0057] The model training parameters are shown in Table 4.
[0058] Table 4 Training parameters
[0059]
[0060]
[0061] In order to increase the information of the detected object and improve the robustness of the network, the mosaic data augmentation method is used in the training process. Mosaic data augmentation is a method of stitching four images into one image. First, four pictures are selected and scaled to the same size. Then, a cut point is randomly selected to cut each image into four parts, and the corresponding parts of different images are stitched into a new image while retaining the labels of the original images. Finally, other data augmentation operations are performed on the new image, such as random rotation, cropping, scaling, and adjusting brightness. Mosaic data augmentation can improve the performance of object detection tasks, especially for small objects and dense scenes, enriching the dataset of small objects. In addition, it can also increase the diversity and complexity of training images, thereby improving the generalization ability of the model.
[0062] In order to verify the convergence performance of the model on the data set, this embodiment compares the convergence of the YOLOv8n neural network model and the YOLOv8n-GSS neural network model. Figure 6 The loss curves for bounding box loss, confidence loss, and category loss of the YOLOv8n neural network model are shown. Figure 7 The loss curves of bounding box loss, confidence loss, and category loss of the YOLOv8n-GSS neural network model are shown. By comparing the loss curves on the training set and the validation set, it can be seen that the loss values of the YOLOv8n-GSS neural network model and the YOLOv8n neural network model are kept at a low level. However, the YOLOv8n-GSS model is slightly better than the YOLOv8n model in terms of classification loss and confidence loss. In the comparison of the four performance metric curves, it can be seen that the YOLOv8n-GSS model performs better in terms of precision and recall, and its convergence curve is smoother. In short, the YOLOv8n-GSS model has better convergence performance.
[0063] Different training parameters will affect the performance of the model, including input image size, number of training times, batch size, learning rate, and optimizer selection. In order to verify the effect of the selection of training parameters, multiple experiments were conducted to adjust the training parameters and observe the changes in the performance of the YOLOv8n-GSS model on the bearing surface defect dataset. The experimental results are shown in Table 5.
[0064] Table 5. Training effect of the model under different training parameters
[0065]
[0066]
[0067] As can be seen from Table 5, when the number of training times approaches 100, the change of the loss function tends to be stable. Therefore, this embodiment sets the number of training times to 100. Under the training parameter setting of the experiment number exp1, the model has the highest mAP, which also verifies the rationality of the training parameter setting of this embodiment. In contrast, the mAP of the experiment number exp7 is the lowest, which shows that the choice of optimizer and learning rate has a great influence on the training effect of the model.
[0068] In order to verify the effectiveness of the combination of the two main improvements of the YOLOv8n-GSS model compared to the YOLOv8n model, this embodiment conducted an ablation experiment. The experimental results are shown in Table 6.
[0069] Table 6 Ablation experiment results
[0070] Model GS SENetV2 map FPS Parameters YOLOv8n 95.9% 111 3011823 YOLOv8n+GS √ 96.1% 120 2922063 YOLOv8n+SENetV2 √ 97.2% 107 3028207 YOLOv8n-Gss √ √ 98.0% 115 2938447
[0071] As can be seen from Table 6, the mAP of YOLOv8n is 95.9%. When the GSconv module is added, the mAP is increased to 96.1%, while the number of parameters is reduced by 89760 and the FPS is increased by 9. This shows that the use of GSConv lightweight convolution helps to improve the speed of bearing surface defect detection and reduce the number of parameters. In addition, after using the SENetV2 attention mechanism, the mAP is increased to 97.2%, but the FPS is reduced by 4. This shows that the use of this attention mechanism helps to improve the detection accuracy of bearing surface defects. After combining GSConv and SENetV2, the mAP is increased by 2.1%, the FPS is increased by 4, and the number of parameters is reduced by 73376. This shows that the combination of the two not only improves the feature extraction capability in the backbone network, but also improves the detection accuracy and reduces the number of parameters, thereby improving the detection speed.
[0072] In order to verify the effectiveness of this method using the YOLOv8n-GSS model for bearing surface defect detection, comparative experiments were carried out with one-stage target detection networks (such as SSD, YOLOv6n) and two-stage target detection networks (such as Faster-RCNN). The experimental results are shown in Table 7.
[0073] Table 7 Comparative experimental results
[0074]
[0075] As can be seen from Table 7, the method using the YOLOv8n-GSS model is significantly better than other target detection methods. Faster-RCNN has the lowest mAP, only 83.6%, and an FPS of 30, which does not meet the detection requirements. The detection accuracy of YOLOv8n is 95.9%. The mAP of the improved YOLOv8n-GSS model reached 98.0%, which is 2.1% higher than the original model. In particular, the detection accuracy of black spots has been improved by 3.5%, and the detection accuracy of scratches has been improved by 3%. In addition, the FPS has also been improved by 4.
[0076] Five images were randomly selected from the bearing defect dataset and each model was tested. The test results are as follows: Figure 8 As shown in Figure 2, it is clear that compared with other target detection methods, this method using the YOLOv8n-GSS model has better detection performance.
[0077] In summary, this method constructs an improved YOLOv8n-GSS neural network model based on the YOLOv8n neural network model, which integrates the GsConv lightweight convolution and SENetV2 attention mechanism to improve the detection accuracy of bearing surface defects while ensuring the detection speed.
[0078] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made to the present invention without departing from the principles of the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A bearing surface defect detection method based on the YOLOv8n-GSS neural network model, characterized in that: The method comprises the following steps: A YOLOv8n-GSS neural network model is constructed based on the YOLOv8n neural network model, wherein the YOLOv8n-GSS neural network model includes a backbone network unit, a neck unit and a head unit connected in sequence, wherein the backbone network unit includes four Conv modules, four C2f modules, a SENetV2 attention module and an SPPF module, wherein the SENetV2 attention module is located between the SPPF module and the last C2f module adjacent to the end of the backbone network unit, wherein the neck unit includes two upsampling modules, four Concat modules, four C2f modules and two GSConv modules, wherein the three C2f modules are respectively connected to the head unit, and wherein the two C2f modules are respectively connected to a Concat module through a GSConv module, wherein the head unit includes three detection head modules; Obtain a bearing surface defect data set, and divide the data set into a training set, a validation set, and a test set, and set training parameters based on the data set to train the YOLOv8n-GSS neural network model; The real-time collected bearing surface image is traversed and cut using a window of fixed size. The cut window image is input into the trained YOLOv8n-GSS neural network model for defect detection.
2. The bearing surface defect detection method based on the YOLOv8n-GSS neural network model according to claim 1 is characterized in that: The SENetV2 attention module includes a squeezing module, an aggregation module, an excitation module and a scaling module. The squeezing module is used to extract channel-level representation from the input feature image. The aggregation module includes multiple parallel fully connected layer branches, each of which independently learns a global representation from the output of the squeezing module. The excitation module is used to combine the multiple global representations learned by the aggregation module into a single channel-level representation and normalize its value range. The scaling module is used to multiply the channel-level weight vector output by the excitation module with the input feature image channel by channel.
3. The bearing surface defect detection method based on the YOLOv8n-GSS neural network model according to claim 1 is characterized in that: The GSConv module includes a Conv module, a DWConv module, a Concat module and a Shuffle module. After the input feature image is convolved by the Conv module, it is subjected to a depthwise separable convolution by the DWConv module. After that, the Concat module concatenates the output of the Conv module and the output of the DWConv module, and then randomly arranges them through the Shuffle module to rearrange the feature channels, and finally outputs the feature image.
4. The bearing surface defect detection method based on the YOLOv8n-GSS neural network model according to claim 1 is characterized in that: The connection structure of the backbone network unit is that the Conv module and the C2f module are connected alternately in sequence, the second C2f module is also connected to a Concat module of the neck unit, the third C2f module is also connected to another Concat module of the neck unit, the fourth C2f module is connected to the SENetV2 attention module and the SPPF module in sequence, the SPPF module is connected to an upsampling module of the neck unit, and the SPPF module is also connected to another Concat module of the neck unit.
5. The bearing surface defect detection method based on the YOLOv8n-GSS neural network model according to claim 1 is characterized in that: The connection structure of the neck unit is that the first upsampling module, the first Concat module, the first C2f module, the second upsampling module, the second Concat module and the second C2f module are connected in sequence, the second C2f module is connected to the first detection head module of the head unit, and the second C2f module is also connected to the first GSConv module, the third Concat module and the third C2f module in sequence, the third C2f module is connected to the second detection head module of the head unit, and the third C2f module is also connected to the second GSConv module, the fourth Concat module and the fourth C2f module in sequence, the fourth C2f module is connected to the third detection head module of the head unit, the first Concat module is also connected to the third C2f module of the backbone network unit, the second Concat module is also connected to the second C2f module of the backbone network unit, the third Concat module is also connected to the first C2f module of the neck unit, and the fourth Concat module is also connected to the SPPF module of the backbone network unit.
6. The bearing surface defect detection method based on the YOLOv8n-GSS neural network model according to claim 1 is characterized in that: The set training parameters include a batch size of 32, a dynamic parameter of 0.937, a learning rate of 0.01, a cosine annealing learning rate of 0.1, a data enhancement of 1.0, an image size of 640×640, and a training number of 100.
7. The bearing surface defect detection method based on the YOLOv8n-GSS neural network model according to claim 1 is characterized in that: The division ratio of the training set, validation set and test set is 6:2:
2.
8. The bearing surface defect detection method based on the YOLOv8n-GSS neural network model according to claim 1 is characterized in that: The mosaic data augmentation method is used in the process of training the YOLOv8n-GSS neural network model.
