A motor magnetic tile surface defect detection method and system
By using an improved YOLOv8n model and image enhancement technology, the problems of low efficiency and low accuracy in the detection of surface defects in permanent magnet motor tiles have been solved, achieving efficient and accurate defect detection and improving the service life of permanent magnet motors.
Patent Information
- Application Number
- CN202510419027.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-04-03
AI Technical Summary
Existing technologies for detecting surface defects in permanent magnet motor tiles suffer from low efficiency, low accuracy, and poor robustness. In particular, the generalization ability of deep learning models is insufficient when dealing with small targets, small samples, and imbalanced data.
An improved YOLOv8n model is adopted, which introduces a hybrid convolutional module ADconv in the backbone part and a hybrid attention module HAM in the neck part, and optimizes the loss function to Focal-EIOU. Combined with image enhancement technology, the surface image data of motor magnetic tiles is processed to improve the feature extraction and information fusion capabilities.
This improves the efficiency and accuracy of detecting surface defects in motor magnets, enhances the robustness of the model, ensures the stability and accuracy of the detection results, and extends the service life of permanent magnet motors.
Smart Images

Figure CN120298827B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of defect detection, specifically relating to a method and system for detecting surface defects in motor magnet tiles. Background Technology
[0002] Permanent magnet motors, as a type of electric motor, possess advantages such as simple structure, convenient maintenance, light weight, small size, and low energy consumption, and are widely manufactured and used in all aspects of production and daily life. Magnet tiles, as a crucial component of permanent magnet motors, directly affect the motor's performance and lifespan. During the industrial production of magnet tiles, various defects can occur on the surface due to factors such as raw materials, processes, and equipment. These defects can weaken the magnetic field effect, shorten the lifespan, and even pose significant production safety hazards. Given the importance of magnet tiles to permanent magnet motors, defect detection is essential in industrial production, and defective magnet tiles must be discarded.
[0003] Currently, methods for detecting defects in motor magnetic tiles mainly include manual inspection, traditional image inspection, traditional machine vision inspection, and deep learning inspection. Manual defect inspection is inefficient and has a high false positive rate, increasing enterprise costs, limiting inspection efficiency, and failing to guarantee the stability and accuracy of the results. Traditional image inspection primarily relies on threshold segmentation, edge detection, and morphological processing to detect defects in magnetic tiles. While relatively simple and with clear judgment rules, traditional image inspection methods suffer from several drawbacks, such as sensitivity to color grayscale differences, high requirements for lighting conditions, lack of spatial correlation, and the need for fixed regions to reduce the computational load of pixel traversal and noise interference. Traditional machine vision inspection, based on the industrial production environment and product characteristics, selects appropriate industrial cameras and light sources to acquire product images, designs corresponding feature extraction algorithms based on the defect targets in the images, and then uses defect detection algorithms for feature recognition and extraction. Based on the different features, they are mainly divided into three categories: texture features, color features, and shape features. Compared with manual inspection, machine vision inspection technology has advantages such as fast detection speed, good stability, and high detection accuracy. However, traditional machine vision inspection methods rely on manual settings to extract features, which is difficult to extract and has poor robustness. Further improvements are needed to enhance the system's adaptability and robustness.
[0004] Deep learning has seen rapid development in fields such as computer vision, speech recognition, and natural language processing. Along with its widespread application in computer vision, deep learning-based defect detection methods have also been developed and applied. These include using CrackNet, a convolutional neural network structure, to detect asphalt pavement cracks at the pixel level, and combining image pyramid hierarchical structures with convolutional denoising autoencoder networks to detect defects in texture images. However, deep learning-based methods still face the following challenges in detecting surface defects on permanent magnet motor tiles: the tiles are small in size, leading to limited defect area information, low resolution, and high noise levels in industrial production. This results in small, imbalanced defect or abnormal sample data sets, affecting the model's generalization and predictive ability on test data, leading to missed detections or poor detection results. Summary of the Invention
[0005] To address the problem of detecting surface defects in permanent magnet motor magnetic tiles, this invention provides a method and system for detecting surface defects in motor magnetic tiles.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A method for detecting surface defects in motor magnets, specifically including the following steps:
[0008] Acquire image data of the surface of the motor magnetic tile, and enhance the image data of the motor magnetic tile surface to obtain an enhanced sample dataset;
[0009] A hybrid convolutional module ADconv is introduced into the backbone of the original YOLOv8n model to replace the ordinary convolutional conv in the original model CSP. A hybrid attention module HAM is introduced into the neck part. A cost-sensitive factor and an optimized loss function Focal-EIOU are introduced into the objective function to obtain an improved YOLOv8n model. The improved YOLOv8n model is trained using the enhanced sample dataset to obtain a model for detecting surface defects of motor magnetic tiles.
[0010] The image of the motor magnet tile is obtained and input into the surface defect detection model of the motor magnet tile. Feature extraction is performed through the Backbone part, and the ADconv module captures structural feature information to obtain a feature map. The feature map is input into the Neck part, and the Hybrid Attention Module (HAM) analyzes the channel attention and spatial attention dimensions. The image processed by the Neck part is input into the Head part to obtain the surface defect detection result of the motor magnet tile.
[0011] Preferably, the image data of the motor magnetic tile surface has various sample problems, including small targets, small samples, and imbalance; wherein, small samples refer to the number of image samples being less than 30, and small targets refer to targets with a resolution of less than 20×20 pixels.
[0012] Preferably, the method further includes enhancing the image using a motor magnetic tile surface image enhancement model. The motor magnetic tile surface image enhancement model includes an input layer, a feature extraction layer, an enhancement layer, and an output layer. The input layer is used to receive the motor magnetic tile surface image data. The feature extraction layer extracts features from the motor magnetic tile surface image using a convolutional neural network structure. The enhancement layer performs enhancement processing based on the feature-extracted image. The output layer is used to output the enhanced motor magnetic tile surface image.
[0013] Preferably, the feature extraction layer extracts edge, texture, pattern, and color information from the surface image of the motor magnetic tile.
[0014] Preferably, in the image enhancement model for the surface of the motor magnetic tile, for images containing the small target defects, image enhancement is performed by image slicing, multi-level feature fusion, attention mechanism, or small defect upsampling; for images containing the small sample defects, image enhancement is performed by image enhancement, feature extraction or feature fusion, anomaly detection, few sample learning, or generative adversarial network algorithm; for images containing the imbalance defects, image enhancement is performed by rotation, translation, or scaling.
[0015] Preferably, the surface defect detection results of the motor magnet include the defect type and the defect location.
[0016] Preferably, the defect categories specifically include porosity, cracks, fissures, wear, unevenness, and normal.
[0017] This invention provides a system for detecting surface defects in motor magnets, specifically comprising:
[0018] The data acquisition module is used to acquire image data of the surface of the motor's magnetic tile.
[0019] The data processing module is used to enhance the image data of the motor magnetic tile surface to obtain an enhanced sample dataset.
[0020] The model building module is used to introduce a hybrid convolutional module ADconv into the backbone part of the original YOLOv8n model, replacing the ordinary convolutional conv in the original model CSP. A hybrid attention module HAM is introduced into the neck part. A cost-sensitive factor and an optimized loss function Focal-EIOU are introduced into the objective function to obtain an improved YOLOv8n model. The improved YOLOv8n model is trained using the enhanced sample dataset to obtain a model for detecting surface defects on motor magnetic tiles.
[0021] The defect detection module is used to acquire images of motor magnet tiles and input them into the surface defect detection model of the motor magnet tiles. Feature extraction is performed through the Backbone part, and the ADconv module captures structural feature information to obtain a feature map. The feature map is then input into the Neck part, and the Hybrid Attention (HAM) module analyzes the two dimensions of channel attention and spatial attention. The image processed by the Neck part is then input into the Head part to obtain the surface defect detection result of the motor magnet tiles.
[0022] The method for detecting surface defects in motor magnets provided by this invention has the following beneficial effects:
[0023] This invention acquires surface image data of motor magnet tiles and constructs an image enhancement model to enhance the surface image data, resulting in an enhanced sample dataset. Improving image quality is beneficial for improving the processing accuracy of subsequent models. A hybrid convolutional module, ADconv, is introduced into the backbone part of the original YOLOv8n model, replacing the ordinary convolutional module conv (CSP) in the original YOLOv8n model, capturing global and local features in the image. A hybrid attention module, HAM, is introduced into the neck part, selectively focusing on regions of interest in the surface defect images of industrial product magnet tiles, improving information transfer and fusion capabilities. The loss function is optimized to adjust the model's attention to high-quality samples, resulting in an improved YOLOv8n model. The improved YOLOv8n model is trained using the enhanced data to obtain a motor magnet tile surface defect detection model. This model detects defects in motor magnet tile images and outputs the defect type and location. This enhances the efficiency and accuracy of motor magnet tile surface defect detection, extending the service life of permanent magnet motors. Attached Figure Description
[0024] To more clearly illustrate the embodiments and design schemes of the present invention, the accompanying drawings required for this embodiment will be briefly described below. The drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1This is a flowchart of a method for detecting surface defects in motor magnets according to the present invention.
[0026] Figure 2 This is a schematic diagram of surface defects of the motor magnet in an embodiment of the present invention.
[0027] Figure 3 This is a network structure diagram of the motor magnet surface defect detection model in an embodiment of the present invention.
[0028] Figure 4 This is a structural diagram of the hybrid convolution module ADconv in an embodiment of the present invention.
[0029] Figure 5 This is a structural diagram of the Hybrid Attention Module (HAM) in an embodiment of the present invention.
[0030] Figure 6 This is a technical roadmap for a method and system for detecting surface defects in motor magnets according to the present invention. Detailed Implementation
[0031] To enable those skilled in the art to better understand and implement the technical solutions of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and should not be construed as limiting the scope of protection of the present invention.
[0032] Example
[0033] This invention provides a method for detecting surface defects in motor magnets, specifically including the following steps:
[0034] S1: Acquire image data of the motor magnetic tile surface. This includes two methods: open-source datasets for magnetic tile surface detection and automatically collected data from the motor magnetic tile surface in real industrial manufacturing environments. The open-source dataset for magnetic tile surface detection uses the Magnetic Tile Surface Defects dataset from the Chinese Academy of Sciences, covering six common types of magnetic tile surface detection data: blowhole, crack, break, fray, unevenness, and normal free. Figure 2 As shown. It is built using industrial-grade embedded devices, and instruments or equipment can be directly connected to it via serial cables. At the same time, product-related information can be set, making it flexible and versatile, and it can automatically collect magnetic tile images in industrial production.
[0035] S2: The acquired image data of the motor magnetic tile surface usually has problems such as small targets, small samples and imbalanced samples. Among them, small targets are targets with a resolution of less than 20 pixels × 20 pixels, and small samples are those with a sample number of less than 30.
[0036] A model for enhancing the surface image of motor magnetic tiles is constructed based on sample problems. This model addresses three issues in the enhancement of defective images on the surface of motor magnetic tiles, selecting the method with the best enhancement effect to output the enhanced sample dataset. The model comprises an input layer, a feature extraction layer, an enhancement layer, and an output layer. Deep networks are used to extract features and learn representations from the magnetic tile surface images to enhance the defective image data. The input layer receives and preprocesses the input motor magnetic tile surface image data, ensuring that the image size and data format meet the model requirements. The feature extraction layer uses convolutional neural networks and other structures to extract features from the magnetic tile surface image, including edges, textures, patterns, and colors. The enhancement layer employs generative adversarial networks and residual networks to enhance the image based on the extracted features. The output layer outputs the enhanced magnetic tile surface image data to the corresponding application scenario.
[0037] For the small target problem, methods such as image segmentation, multi-level feature fusion, attention mechanism, and small defect upsampling are mainly used. For the few sample problem, methods such as image enhancement, feature extraction, feature fusion, anomaly detection, few sample learning, and generative adversarial network algorithms are mainly used to train defects. For the imbalanced sample problem, image enhancement methods such as rotation, translation, and scaling or generative adversarial networks are mainly used to generate more defect samples, increase the number of training samples, improve the robustness of the model, and thus balance the dataset.
[0038] S3: The improved YOLOv8n model is trained using the enhanced sample dataset to obtain a model for detecting surface defects in motor magnetic tiles. The original YOLOv8n model mainly consists of three parts: Backbone, Neck, and Head. This invention is based on the YOLOv8n backbone network, introducing hybrid convolution ADconv in the Backbone to replace the ordinary convolution conv in the original model CSP, introducing a hybrid attention module HAM in the Neck part, and optimizing the introduced loss function Focal-EIOU. This constitutes an improved YOLOv8n model, which completes the feature information extraction, fusion, and detection of surface defect images of magnetic tiles. The specific network structure is as follows: Figure 3 As shown.
[0039] The improved YOLOv8n model's backbone is primarily responsible for feature extraction, consisting of CBS1, C2f1, and SPPF modules. The CBS1 module, as a convolutional module, is composed of ADconv, BN, and SILU, enabling dimensionality reduction and channel expansion. In this model, a hybrid convolutional module, ADconv, is introduced into the CBS1 module of the backbone, replacing the ordinary convolution conv(3,2) in the original model's CSP module. The hybrid convolutional module ADconv is as follows: Figure 4As shown, firstly, by using dilated convolution and introducing a dilation parameter K, a larger receptive field can be obtained compared to ordinary convolution, capturing multi-scale information without changing the size of the image output feature map. Then, depthwise separable convolution is used to further extract detailed image features. Depthwise separable convolution consists of two steps: depthwise convolution and pointwise convolution. First, depthwise convolution is applied to the input layer, using three 3x3 convolution kernels to perform convolution calculations on the three channels of the input layer, extracting features from each channel, and then stacking them together. Then, a 1x1 convolution of the three channels is used to calculate, resulting in a result with only one channel as the output. This approach can take into account both global and local information, thus more accurately capturing the complex features of defects. Batch normalization (BN) accelerates training and improves stability, while SILU introduces non-linear capabilities. C2f1 mainly implements cross-stage partial aggregation to increase feature diversity. The SPPF module stitches feature maps of different scales together to enhance the feature representation capability of the backbone.
[0040] In the improved YOLOv8n model, the Neck part is located between the backbone network and the head network, and is mainly responsible for feature information fusion. A Hybrid Attention Module (HAM) is introduced into the Neck part, such as... Figure 5 As shown, this paper analyzes channel attention and spatial attention in two dimensions by adopting a parallel attention structure of spatial and channel dimensions. In the channel attention dimension, feature learning is first performed on each channel. Global average pooling is applied to each channel of the HxWxC dimension input feature map X, turning each channel's feature map into a single numerical value. The pooled features are compressed into a one-dimensional vector 1x1xC. Then, the correlation between feature channels is learned. The channels are scaled n times by a 1x1 convolution, ReLU activation is performed, and the channels are restored to C by another 1x1 convolution. The Sigmoid activation function is used to limit the weight values of each channel to the interval [0,1]. In the spatial attention dimension, global max pooling and global average pooling are first performed on the HxWxC dimension input feature map X, resulting in two H×W×1 feature maps. Then, the results of global max pooling and global average pooling are concatenated by channel to obtain a feature map of dimension HxWx2. The concatenated result is then subjected to a 7x7 convolution operation to obtain a feature map with dimensions HxWx1. Finally, a sigmoid activation function is applied to obtain the spatial attention weight matrix. Ultimately, the feature map is recalibrated by multiplying the channel and spatial weights obtained from the previous processing of the input feature map X by the input feature map X, and then applying them to the corresponding channels and spatial dimensions respectively to obtain the final output feature map X', mathematically represented as:
[0041] ;
[0042] ;
[0043] =X ;
[0044] It selectively focuses on regions of interest in images of defects on the surface of magnetic tiles used in industrial products, and addresses the problem of shallow feature loss in the network. This enhances the network's ability to perceive remote location information and learn local features, enabling bidirectional feature fusion from bottom to top and top to bottom, thereby strengthening feature information at different scales.
[0045] The improved YOLOv8n model's Head section contains three detection heads for object detection and classification, producing the final detection results. In the objective function, a balance is struck between the contributions of high-quality and low-quality samples to the loss function. This is achieved by introducing a cost-sensitive factor and optimizing the Focal-EIOU loss function to adjust the model's attention to high-quality samples.
[0046] The loss function was optimized. The YOLOv8n model uses CIOU as the loss function for bounding box regression. While this function considers the overlapping area, center point distance, and aspect ratio of the bounding boxes, the aspect ratio is not the true difference from the confidence score, which may lead to inaccurate model regression. The improved YOLOv8n model introduces the Focal-EIOU loss function. EIOU comprehensively considers the true difference of overlapping area, center point distance, and aspect ratio, solves the fuzzy definition of aspect ratio based on CIOU, and adds FocalLoss to solve the sample imbalance problem in bounding box regression, thus achieving better localization and accelerating convergence. The optimized loss function is as follows:
[0047] = ;
[0048] =1- + + + ;
[0049] ;
[0050] in, Represents the true frame. Represents the prediction box. It represents the diagonal length of the smallest bounding box between the true bounding box and the predicted bounding box. and These represent the center coordinates of the ground truth bounding box and the predicted bounding box, respectively. and These represent the width and height of the minimum bounding box, respectively. Allocate higher costs to high-quality samples and lower costs to low-quality samples to balance the differences in sample size.
[0051] S4: Acquire the image of the motor magnet tile and input it into the motor magnet tile surface defect detection model to obtain the surface defect detection results of the magnet tile, including the defect type and location.
[0052] The present invention also provides a system for detecting surface defects in motor magnets, specifically comprising:
[0053] The data acquisition module is used to acquire image data of the surface of the motor's magnetic tile.
[0054] The data processing module is used to enhance the image data of the motor magnet surface to obtain an enhanced sample dataset.
[0055] The model building module introduces the hybrid convolution module ADconv into the backbone part of the original YOLOv8n model, replacing the ordinary convolution conv in the original model CSP. It also introduces the hybrid attention module HAM into the neck part and introduces a cost-sensitive factor and optimizes the loss function Focal-EIOU into the objective function to obtain an improved YOLOv8n model. The improved YOLOv8n model is then trained using the enhanced sample dataset to obtain a model for detecting surface defects in motor magnetic tiles.
[0056] The defect detection module is used to acquire images of motor magnets and input them into the motor magnet surface defect detection model. Feature extraction is performed through the Backbone part, and the ADconv module captures structural feature information to obtain a feature map. The feature map is then input into the Neck part, where the Hybrid Attention (HAM) module analyzes the channel attention and spatial attention dimensions. The image processed by the Neck part is then input into the Head part to obtain the surface defect detection result of the motor magnet.
[0057] The modules in the aforementioned motor magnetic tile surface defect detection system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can call and execute the corresponding operations of each module.
[0058] It should be noted that the specific embodiments described above enable those skilled in the art to more fully understand the present invention, but do not limit the present invention in any way. Therefore, although the present invention has been described in detail in this specification and embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the present invention; and all technical solutions and improvements that do not depart from the spirit and scope of the present invention are covered within the protection scope of the present invention patent. No reference numerals in the claims should be construed as limiting the scope of the claims. Any simple variations or equivalent substitutions of technical solutions that can be readily obtained by those skilled in the art within the scope of the technology disclosed in the present invention are within the protection scope of the present invention.
Claims
1. A method for detecting surface defects in motor magnets, characterized in that, Includes the following steps: Acquire surface image data of motor magnetic tile, and enhance the surface image data of motor magnetic tile using a motor magnetic tile surface image enhancement model to obtain an enhanced sample dataset; A hybrid convolutional module, ADconv, is introduced into the backbone of the original YOLOv8n model to replace the ordinary convolutional module conv in the original CSP model. A hybrid attention module, HAM, is introduced into the neck part. A cost-sensitive factor and an optimized loss function, Focal-EIOU, are incorporated into the objective function to obtain an improved YOLOv8n model. The improved YOLOv8n model is trained using the enhanced sample dataset to obtain a model for detecting surface defects on motor magnetic tiles. The hybrid convolutional module uses dilated convolution to process the input image, introducing a dilation parameter K to obtain multi-scale information, and then further extracts image detail features through depthwise separable convolution. The hybrid attention module adopts a parallel structure of spatial attention and channel attention, with channel attention learning features for each channel. Global average pooling is performed on each channel of the HxWxC dimension input feature map. The pooled features are then compressed into a one-dimensional vector 1x1xC. The channels are scaled by a factor of n through 1x1 convolution to learn the correlation between feature channels. ReLU activation is performed, and the channels are restored through 1x1 convolution. The channel attention weight matrix is obtained by processing with the Sigmoid activation function. The spatial attention performs channel-dimensional global max pooling and global average pooling on the HxWxC dimension input feature map to obtain two H×W×1 feature maps. The two H×W×1 feature maps are concatenated according to channels to obtain a feature map of dimension HxWx2. A 7x7 convolution operation is performed on the HxWx2 feature map to obtain a feature map of dimension HxWx1. The spatial attention weight matrix is obtained by applying the Sigmoid activation function. The image of the motor magnet tile is obtained and input into the surface defect detection model of the motor magnet tile. Feature extraction is performed through the Backbone part, and the ADconv module captures structural feature information to obtain a feature map. The feature map is input into the Neck part, and the Hybrid Attention Module (HAM) analyzes the channel attention and spatial attention dimensions. The image processed by the Neck part is input into the Head part to obtain the surface defect detection result of the motor magnet tile.
2. The method for detecting surface defects in motor magnets according to claim 1, characterized in that, The image data of the motor magnetic tile surface has various sample problems, including small targets, small samples, and imbalance; where small samples refer to fewer than 30 image samples, and small targets refer to targets with a resolution of less than 20×20 pixels.
3. The method for detecting surface defects in motor magnets according to claim 2, characterized in that, The motor magnetic tile surface image enhancement model includes an input layer, a feature extraction layer, an enhancement layer, and an output layer. The input layer is used to receive the motor magnetic tile surface image data. The feature extraction layer extracts features from the motor magnetic tile surface image using a convolutional neural network structure. The enhancement layer performs enhancement processing based on the feature-extracted image. The output layer is used to output the enhanced motor magnetic tile surface image.
4. The method for detecting surface defects in motor magnets according to claim 3, characterized in that, The feature extraction layer extracts edge, texture, pattern, and color information from the surface image of the motor magnetic tile.
5. The method for detecting surface defects in motor magnets according to claim 3, characterized in that, In the enhancement layer, for images containing the small target defects, image enhancement is performed by selecting image tiling, multi-level feature fusion, attention mechanism, or small defect upsampling; for images containing the few sample defects, image enhancement is performed by selecting image enhancement, feature extraction or feature fusion, anomaly detection, few sample learning, or generative adversarial network algorithm; for images containing the imbalance defects, image enhancement is performed by selecting rotation, translation, or scaling.
6. A system for detecting surface defects in motor magnetic tiles, characterized in that, include: The data acquisition module is used to acquire image data of the surface of the motor magnet. The data processing module is used to enhance the surface image data of the motor magnetic tile using a motor magnetic tile surface image enhancement model to obtain an enhanced sample dataset. The model building module introduces a hybrid convolutional module (ADconv) into the backbone of the original YOLOv8n model, replacing the ordinary convolutional module (conv) in the original CSP model. A hybrid attention module (HAM) is introduced into the neck part. Cost-sensitive factors and Focal-EIOU are incorporated into the objective function to obtain an improved YOLOv8n model. The improved YOLOv8n model is trained using the enhanced sample dataset to obtain a model for detecting surface defects in motor magnetic tiles. The hybrid convolutional module uses dilated convolution to process the input image, introducing a dilation parameter K to obtain multi-scale information, and then further extracts image detail features through depthwise separable convolution. The hybrid attention module adopts a parallel structure of spatial attention and channel attention, with the channel attention focusing on the channels. Feature learning involves performing global average pooling on each channel of the HxWxC dimension input feature map, then compressing the pooled features into a one-dimensional vector 1x1xC. A 1x1 convolution is then applied to scale the channels by a factor of n to learn the correlation between feature channels. ReLU activation is then performed, and the channels are restored using a 1x1 convolution. The Sigmoid activation function is then applied to obtain the channel attention weight matrix. Spatial attention involves performing channel-dimensional global max pooling and global average pooling on the HxWxC dimension input feature map to obtain two H×W×1 feature maps. These two H×W×1 feature maps are concatenated by channel to obtain a feature map of dimension HxWx2. A 7x7 convolution is then performed on the HxWx2 feature map to obtain a feature map of dimension HxWx1. The Sigmoid activation function is then applied to obtain the spatial attention weight matrix. The defect detection module is used to acquire images of motor magnet tiles and input them into the surface defect detection model of the motor magnet tiles. Feature extraction is performed through the Backbone part, and the ADconv module captures structural feature information to obtain a feature map. The feature map is then input into the Neck part, and the Hybrid Attention (HAM) module analyzes the two dimensions of channel attention and spatial attention. The image processed by the Neck part is then input into the Head part to obtain the surface defect detection result of the motor magnet tiles.
Citation Information
Patent Citations
Image enhancement method and system based on attention mechanism and related equipment
CN114494044A
Method and system for detecting tomato fruits in natural environment
CN117115655A
Yolo magnetic shoe surface defect detection method and system based on lightweight convolution
CN118196023A