Method, device and equipment for detecting impurities in motor stator and storage medium

By using the YOLOv model architecture to build a target detection model, embedding a coordinate attention module and a multi-target detection head, and combining it with a time series filter, the problem of low efficiency and insufficient accuracy in detecting impurities in the stator winding slots of motors is solved, and automated and accurate impurity identification is achieved.

CN121169878APending Publication Date: 2025-12-19BAOTOU CRRC MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511337224.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

In the existing technology, the detection efficiency of impurities in the stator winding slots of motors is low and the accuracy is difficult to guarantee. Manual visual inspection is easily affected by the deep and narrow structure of the winding slots and the shadow obstruction.

Method used

A target detection model trained using the YOLOv model architecture is embedded with a coordinate attention module and a multi-target detection head, combined with a time series consistency filter, to automatically identify minute impurities in the motor stator.

Benefits of technology

It enables accurate and efficient detection of minute impurities in motor stators, improving detection efficiency and reducing manpower consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121169878A_ABST
    Figure CN121169878A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a device and equipment for detecting impurities in a motor stator and a computer readable storage medium. The impurity detection method comprises the following steps: acquiring a sampling image of the motor stator; a target detection model obtained through training based on a YOLOv model architecture in advance is used for identifying and analyzing the sampled image, and an image impurity detection result is obtained; wherein the impurity detection result comprises an impurity position and a result confidence coefficient; a coordinate attention module is embedded in a neck network of the target detection model; target detection heads in the target detection model comprise a tiny target detection head, a small target detection head, a medium target detection head and a large target detection head; and obtaining an impurity detection result of the motor stator according to the image impurity detection result. The impurities can be accurately, reliably and automatically detected only by scanning and shooting the sampling image of the motor stator, the working efficiency of impurity detection is improved, and the labor cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of motor stator impurity detection, and in particular to a motor stator impurity detection method, device, equipment and computer readable storage medium. BACKGROUND

[0002] The motor stator is a core component of energy conversion, and the cleanliness in the winding slot of the motor stator is directly related to the insulation performance and overall quality of the motor; the conductive or non-conductive impurities remaining in the winding slot may cause interlayer or interphase short circuit under the high-voltage and high-temperature environment of the motor operation, and may cause serious electrical faults. Therefore, accurate and reliable impurity detection in the winding slot is a key quality control link in the motor manufacturing process. At present, the industry mainly adopts manual visual detection, that is, the operator holds a strong light flashlight and looks into the slot opening of the winding slot from different angles, and relies on the naked eye to find, which has low efficiency, and the structure of the winding slot is deep and narrow, which is easy to form a large area of shadow and block the small impurities, so that the accuracy of the detection result is difficult to guarantee. SUMMARY

[0003] The purpose of the present application is to provide a motor stator impurity detection method, device, equipment and computer readable storage medium, which can accurately and efficiently identify small metal debris impurities in the motor stator.

[0004] To solve the above technical problems, the present application provides a motor stator impurity detection method, comprising:

[0005] Collecting a sampling image of the motor stator;

[0006] Using a target detection model obtained by pre-training based on a YOLOv model architecture to identify and analyze the sampling image, and obtaining an image impurity detection result; wherein the impurity detection result includes impurity position and result confidence; a coordinate attention module is embedded in the neck network of the target detection model; the target detection head in the target detection model includes a small target detection head, a small target detection head, a medium target detection head and a large target detection head;

[0007] According to the image impurity detection result, the impurity detection result of the motor stator is obtained.

[0008] In an optional embodiment of the present application, the target detection model includes a FasterNet backbone network, a BiFPN neck network, the target detection head and a result processing module;

[0009] Using a target detection model obtained by pre-training based on a YOLOv model architecture to identify and analyze the sampling image, and obtaining an image impurity detection result includes:

[0010] extracting features of the sampling image through the FasterNet backbone network, and outputting C3 feature maps, C4 feature maps and C5 feature maps;

[0011] obtaining first fusion feature data by sequentially performing convolution operation and up-sampling operation on the C5 feature maps in the neck network, and sequentially performing fusion operation, operation of the coordinate attention module and convolution operation on the C4 feature maps;

[0012] obtaining second fusion feature data by sequentially performing fusion operation, operation of the coordinate attention module and convolution operation on the C3 feature maps after up-sampling operation on the first fusion feature data, outputting the second fusion feature data to the result processing module through the small target detection head, and outputting the second fusion feature data to the result processing module through the micro-small target detection head after up-sampling operation on the second fusion feature data;

[0013] obtaining third fusion feature data by sequentially performing fusion operation, operation of the coordinate attention module and convolution operation on the first fusion feature data after down-sampling operation on the second fusion feature data, outputting the third fusion feature data to the result processing module through the medium target detection head;

[0014] obtaining fourth fusion feature data by sequentially performing fusion operation, operation of the coordinate attention module and convolution operation on the C5 feature maps after convolution operation on the third fusion feature data after down-sampling operation, outputting the fourth fusion feature data to the result processing module through the large target detection head;

[0015] processing feature data respectively output by the micro-small target detection head, the small target detection head, the medium target detection head and the large target detection head through the result processing module, and outputting the impurity detection result.

[0016] In an optional embodiment of the present application, processing feature data respectively output by the micro-small target detection head, the small target detection head, the medium target detection head and the large target detection head through the result processing module, and outputting the image impurity detection result, comprising:

[0017] performing result aggregation processing on the input feature data;

[0018] performing non-maximum suppression processing on each of the feature data after result aggregation, and outputting the image impurity detection result.

[0019] In an optional embodiment of the present application, the sampling image of the motor stator is collected and acquired, comprising:

[0020] acquire a plurality of frames of the sampling images successively collected along the outside of the motor stator;

[0021] Accordingly, according to the image impurity detection result, an impurity detection result of the motor stator is obtained, including:

[0022] The image impurity detection result corresponding to each frame of the sampling image is filtered by a time sequence consistency filter to determine whether the same impurity position exists in the image impurity detection results corresponding to the sampling images of the continuous preset frame number, and the result confidence is not less than the confidence threshold, if yes, the impurity detection result of the motor stator is that there is impurity.

[0023] In an optional embodiment of the present application, the process of obtaining the target detection model based on pre-training of the YOLOv model architecture includes:

[0024] Image sampling is performed on each sampling target from different visual angle directions and different light conditions to obtain image samples;

[0025] The impurity imaging area in the image sample is labeled;

[0026] The labeled image sample is used to learn and train the YOLOv8 model to obtain the target detection model.

[0027] In an optional embodiment of the present application, when the impurity imaging area in the image sample is labeled, it further includes:

[0028] The image sample is subjected to noise processing of adding virtual reflection noise and virtual shadow noise;

[0029] Accordingly, the image sample is used to learn and train the YOLOv8 model to obtain the target detection model, including:

[0030] The image sample after noise processing is used to learn and train the YOLOv8 model to obtain the target detection model.

[0031] In an optional embodiment of the present application, the image sample is used to learn and train the YOLOv8 model to obtain the target detection model, including:

[0032] The image sample is used to learn and train the YOLOv8 model, and a (WIoU) loss function is used to optimize the parameters of the YOLOv8 model to obtain the target detection model.

[0033] A motor stator impurity detection device, comprising:

[0034] The data acquisition module is configured to collect a sampling image of the motor stator.

[0035] The data operation module is configured to identify and analyze the sampling image by using a target detection model obtained by pre-training based on a YOLOv model architecture, to obtain an image impurity detection result.

[0036] The result analysis module is configured to obtain an impurity detection result of the motor stator according to the image impurity detection result.

[0037] An impurity detection device for a motor stator includes:

[0038] The camera is configured to collect a sampling image of the motor stator.

[0039] The memory is configured to store a computer program.

[0040] The processor is configured to execute the computer program to implement the steps of the impurity detection method for the motor stator according to any one of the above.

[0041] A computer readable storage medium stores a computer program, and the computer program is executed to implement the steps of the impurity detection method for the motor stator according to any one of the above.

[0042] The impurity detection method, device, equipment and computer readable storage medium provided by the application, the impurity detection method includes collecting a sampling image of the motor stator; identifying and analyzing the sampling image by using a target detection model obtained by pre-training based on a YOLOv model architecture, to obtain an image impurity detection result; wherein the impurity detection result includes impurity position and result confidence; the neck network of the target detection model is embedded with a coordinate attention module; the target detection head in the target detection model includes a micro target detection head, a small target detection head, a medium target detection head and a large target detection head; and the impurity detection result of the motor stator is obtained according to the image impurity detection result.

[0043] The target detection model obtained by learning and training in advance based on the YOLOv model architecture in the application has a coordinate attention module embedded in the neck network and an additional micro target detection head, so that the target detection model can more accurately identify the micro impurities in the sampling image, thereby improving the accuracy and reliability of impurity detection in the motor stator to a certain extent. Moreover, when detecting impurities in the motor stator, the application only needs to scan and photograph the sampling image of the motor stator to realize computer automatic identification, thereby improving the work efficiency of impurity detection and reducing the required human resources on the basis of ensuring the accuracy and reliability of impurity detection in the motor stator. BRIEF DESCRIPTION OF DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0045] Figure 1 The flowchart of the motor stator impurity detection method provided by the embodiment of the application is shown.

[0046] Figure 2 The architecture diagram of the target detection model provided by the embodiment of the application is shown.

[0047] Figure 3 The flowchart of the filtering operation process of the time series consistency filter in the embodiment is shown.

[0048] Figure 4 The flowchart of the learning and training of the target detection model provided by the embodiment of the application is shown.

[0049] Figure 5 The structure block diagram of the motor stator impurity detection device provided by the embodiment of the application is shown. DETAILED DESCRIPTION

[0050] It can be understood that during the process of forming the winding slot structure of the motor stator, the stator core needs to be cut, so that a small amount of metal debris, i.e. impurities, will inevitably remain in the winding slot. Obviously, the size of such metal debris is very small, basically in millimeter level, and manual visual inspection is easy to cause visual fatigue, thereby affecting the accuracy and reliability of impurity detection.

[0051] Based on this, the core of the present application is to provide a motor stator impurity detection method, device, equipment and computer readable storage medium, which can realize accurate and effective detection of small debris impurities in the motor stator, improve the impurity detection effect and reduce the labor cost of impurity detection.

[0052] In order to enable personnel in the art to better understand the present application scheme, the present application will be further described in detail below in combination with the drawings and specific embodiments. Obviously, the described embodiments are only part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0053] As Figure 1 and Figure 2 shown, Figure 1 the flowchart of the motor stator impurity detection method provided by the embodiment of the present application; Figure 2 the architecture diagram of the target detection model provided by the embodiment of the present application.

[0054] In one specific embodiment of the present application, the motor stator impurity detection method can include:

[0055] S1: Collecting and acquiring a sampling image of the motor stator.

[0056] The sampling image in the present embodiment can be directly obtained by manually holding a mobile phone or other device with camera function to scan and collect the winding slot of the motor stator in turn, or can be obtained by using a patrol robot with camera function, or a movable camera and other devices to scan and collect along the outside of the motor stator.

[0057] In the actual process of scanning and collecting the sampling image of the motor stator, the camera can be configured with a fill light to ensure that the camera can clearly capture the sampling image of the corner inside the motor stator. In addition, for the same winding slot of the motor stator, multiple images can also be collected from different angles to ensure the accuracy and reliability of subsequent impurity detection.

[0058] In addition, no matter which device is used to collect the motor stator, the camera can be controlled to move along the outside of the motor stator and continuously collect multiple frames of sampling images to ensure the accuracy of the thickness impurity detection.

[0059] S2: identifying and analyzing the sampling image by using the target detection model obtained by pre-training based on the YOLOv model architecture to obtain an image impurity detection result; wherein the impurity detection result includes impurity position and result confidence; the coordinate attention module is embedded in the neck network of the target detection model; the target detection head in the target detection model includes a micro target detection head, a small target detection head, a medium target detection head and a large target detection head.

[0060] The YOLOv model in the embodiment can be a YOLOv8 model. Based on the basic structure of the YOLOv model architecture, the YOLOv model includes a backbone network, a neck network and a target detection head. The backbone network mainly performs multi-dimensional feature extraction on the input image data, the neck network performs different fusion operation processing on the dimensional feature data extracted by the backbone network, and finally outputs target feature data of different dimensions from three different target detection heads. The target detection head in the conventional YOLOv model generally only includes three, i.e. a large target detection head, a medium target detection head and a small target detection head, and the neck network does not include a coordinate attention module.

[0061] On this basis, further considering the characteristics and greatest identification difficulty of the impurities needed to be identified and detected in the motor stator, i.e. the very small size of the debris impurities, based on this, in the present application, a coordinate attention module is further embedded in the neck network based on the basic YOLOv model architecture, and a micro target detection head is added, so that the target detection model obtained by final training and learning has more sensitive identification ability for relatively small size impurity debris, thereby ensuring the accuracy and reliability of the impurity detection of the sampling image based on the target detection model.

[0062] S3: obtaining the impurity detection result of the motor stator according to the image impurity detection result.

[0063] Based on the above discussion, after the image impurity detection result of whether each frame of sampling image in the same motor stator contains impurities is identified in sequence, whether there is impurity in the motor stator assembly can be determined based on the image impurity detection result, if there is, the impurity detection result containing the position of the impurity, the type of the impurity and the result confidence corresponding to each impurity position is output, so that the staff can further verify and clean the impurities in the motor stator based on the impurity detection result. In the embodiment, the impurities such as metal debris and welding tumor slag are detected.

[0064] In addition, as shown above, the camera continuously collects images during the process of collecting and identifying the sampling images of the motor stator, with the relative movement between the camera and the motor stator. Therefore, the impurities in the same position area of the motor stator will inevitably appear in the continuous multiple frames of sampling images, and if it is only the reflection of the winding coil, the shooting angle will also change accordingly with the movement of the camera, and it will not appear in the continuous multiple frames of images. Therefore, in order to avoid misidentification of the target impurities, after obtaining the image impurity detection results corresponding to each frame of sampling images, the process can further include:

[0065] The image impurity detection results corresponding to each frame of sampling images are filtered by a time sequence consistency filter to determine whether the same impurity position exists in the image impurity detection results corresponding to the continuous preset number of frames of sampling images, and the result confidence is not less than the confidence threshold. If so, the impurity detection result of the motor stator is that there is impurity.

[0066] As shown in Figure 3 , the flowchart of the filtering operation process of the time sequence consistency filter in this embodiment is shown. Figure 3

[0067] The preset number of frames in this embodiment can be determined based on the speed of the relative movement between the camera and the motor stator. In addition, the impurity position referred to in this embodiment is not the position in a single frame of sampling image, but the position on the motor stator.

[0068] In summary, the target detection model obtained by pre-learning and training based on the YOLOv model architecture in this application can more accurately identify the micro impurities in the sampling images, thereby improving the accuracy and reliability of the impurity detection in the motor stator to a certain extent. In addition, in this application, only the sampling images of the motor stator need to be scanned to realize computer automatic identification, which improves the work efficiency of impurity detection and reduces the human resources required on the basis of ensuring the accuracy and reliability of impurity detection in the motor stator.

[0069] Based on the above discussion, referring to Figure 2 , the process of identifying and detecting impurities in the sampling images by the target detection model will be described in detail.

[0070] ​In an optional embodiment of the present application, the target detection model comprises a FasterNet backbone network, a BiFPN neck network, a target detection head, and a result processing module. Correspondingly, the process of identifying and analyzing the sampling image by using the target detection model in step S2 can comprise the following steps:

[0071] S21: performing feature extraction on the sampling image by using the FasterNet backbone network to output C3 feature maps, C4 feature maps, and C5 feature maps;

[0072] S22: performing convolution operation and up-sampling operation on the C5 feature maps in sequence by using the neck network, and then performing fusion operation, coordinate attention module operation, and convolution operation on the C4 feature maps in sequence to obtain first fusion feature data;

[0073] S23: performing up-sampling operation on the first fusion feature data, and then performing fusion operation, coordinate attention module operation, and convolution operation on the C3 feature maps in sequence to obtain second fusion feature data, outputting the second fusion feature data to the result processing module through the small target detection head, and performing up-sampling operation on the second fusion feature data and then outputting the second fusion feature data to the result processing module through the micro-small target detection head;

[0074] S24: performing down-sampling operation on the second fusion feature data, and then performing fusion operation, coordinate attention module operation, and convolution operation on the first fusion feature data in sequence to obtain third fusion feature data, outputting the third fusion feature data to the result processing module through the medium target detection head;

[0075] S25: performing fusion operation, coordinate attention module operation, and convolution operation on the third fusion feature data after down-sampling operation and the C5 feature maps after convolution operation in sequence to obtain fourth fusion feature data, outputting the fourth fusion feature data to the result processing module through the large target detection head;

[0076] S26: processing the feature data output by the micro-small target detection head, the small target detection head, the medium target detection head, and the large target detection head through the result processing module to output the impurity detection result.

[0077] It can be understood that, in the embodiment shown in Figure 2 , the three different feature maps C3, C4, and C5 output by the FasterNet backbone network are multiple feature maps output by the FasterNet backbone network (Backbone) at different depth stages, respectively, so that the model obtains high-resolution detail information and high-level semantic information at the same time, which prepares for detecting targets of different sizes. This process is also called feature pyramid (Feature Pyramid).

[0078] Secondly, inFigure 2 In the BiFPN neck network shown, Conv represents a convolutional layer, which generally refers to a 1x1 convolution operation on the input data.

[0079] Upsample represents an up-sampling operation, and Downsample represents a down-sampling operation; Upsample and Downsample are two kinds of feature map size adjustment operations that are opposite to each other. Downsample reduces the spatial size (width and height) of the feature map; as the network deepens, gradually reducing the feature map size can expand the "receptive field" (allowing the neuron to see a wider area of the original image) and extract more advanced and abstract semantic information. At the same time, it can also effectively reduce the amount of calculation. Upsample enlarges the spatial size (width and height) of the feature map; in the neck network, it is necessary to enlarge the deep feature map containing high-level semantic information but with small size, so as to align with the shallow feature map containing rich position information but with large size, in order to prepare for subsequent fusion.

[0080] Fusion represents a fusion layer, which is used for information merging operation, mainly between two (or more) feature maps with the same size, the purpose is to combine the information contained in each of them (such as the semantic information of one and the position information of the other), to create a new feature map with richer information and stronger expression ability.

[0081] Coordinate Attention represents a coordinate attention module, which is an operation and processing of coordinate attention on feature data, which can capture channel relationship and direction perception, position sensitive information at the same time. Coordinate Attention helps the model not only to know "what to look at" (channel), but also to know "where to look" (spatial position), so as to more accurately locate and identify the target of interest.

[0082] Reference Figure 2 As shown, in this embodiment, the coordinate attention module is used for operation and processing once for each feature fusion of data of different depths, that is, the coordinate attention module is strategically placed at the key node of feature fusion in the architecture of the target detection module of this embodiment, and the role is to help the model intelligently judge which information is important after fusion, so as to "purify" and "select" the just merged features; for example, after the convolution operation and the up-sampling operation on the C5 feature map in turn, the fusion operation is performed with the C4 feature map, and the feature map after the fusion operation is processed by the coordinate attention module, thereby it can be determined that in which position of the C4 feature map, the semantic information transmitted from the C5 feature map is important and needs to be paid more attention to.

[0083] In addition, Coordinate Attention is a relatively lightweight attention mechanism that integrates coordinate information coding on the basis of channel attention, can simultaneously focus on "channel importance" and "spatial position characteristics", improves the performance of the model while keeping a relatively low computational overhead; compared with some complex attention modules, it can bring considerable performance improvement without significantly increasing the number of model parameters (Parameters) and computational load (FLOPs), and well balances accuracy and speed.

[0084] Further, the target detection head in the embodiment includes four target detection heads, i.e., a micro target detection head, a small target detection head, a medium target detection head, and a large target detection head. Compared with the conventional YOLOv8 model that outputs detection results at three scales (i.e., only including a small target detection head, a medium target detection head, and a large target detection head), the micro target detection head is specially added to improve the sensitivity of 50 μm level micro impurities. The feature data output by the small target detection head is up-sampled to generate a higher resolution feature map (e.g., with a size of 160x160, corresponding to an input of 640x640), and based on the feature map, an independent micro target detection head with fewer parameters is added to detect extremely small impurity targets, thereby greatly improving the recall rate of the model.

[0085] For each target detection head, a candidate box that encloses a target of different size is output, for example, the micro target detection head outputs a candidate box that encloses a small target, and the medium target detection head outputs a candidate box that encloses a medium-sized target. Each candidate box includes a position coordinate (x, y, w, h) and a confidence score (Confidence Score) representing how confident the model is that there is a target in the box. In addition, it should be noted that the candidate box in the embodiment is generally a rectangular box, and accordingly, the x coordinate of the candidate box represents the horizontal coordinate of the center point of the rectangular box, the y coordinate represents the vertical coordinate of the center point of the rectangular box, the w represents the width of the rectangular box, and the h represents the height of the rectangular box. The four coordinate values represent the position and size of the rectangular box on the detection interface, for example, when a target is detected, the target detection model outputs the coordinates (x, y, w, h) of the target to the system, and the system converts the coordinates (x, y, w, h) into a rectangular box in the form of a rectangular box and displays the rectangular box on the detection interface, so that the user can see a rectangular box (candidate box) that encloses the target. To The rectangular box is displayed in the form of a rectangular box on the detection interface, and the user can see a rectangular box (candidate box) that encloses the target.

[0086] Based on the above description, in another optional embodiment of the present application, the process of processing the feature data output by the micro target detection head, the small target detection head, the medium target detection head, and the large target detection head by the result processing module to output the image impurity detection result can include:

[0087] perform result aggregation processing on the input feature data;

[0088] perform non-maximum suppression processing on each feature data after result aggregation, and output an image impurity detection result.

[0089] In this embodiment, the feature data output by each target detection head is first subjected to result aggregation processing, that is, all original and massive candidate boxes from different target detection heads are collected together, and are ready for the next step of screening.

[0090] After result aggregation, the total number of candidate boxes output by each target detection head is huge, and the same target impurity may output several highly overlapping candidate boxes. The task of non-maximum suppression processing is to pick out the best and most representative one from this pile of overlapping boxes and suppress all other redundant boxes, so that the original hundreds of chaotic original predictions become the clean and accurate detection result that we finally see, that is, so that each target impurity has only one bounding box.

[0091] Based on any of the above embodiments, the creation process of the target detection model in each of the above embodiments is further described below.

[0092] As shown in Figure 4 , it is a flowchart of learning and training of the target detection model provided by the embodiments of the present application. Figure 4

[0093] In a specific embodiment of the present application, the process of training the target detection model based on the YOLOv model architecture can include:

[0094] S101: Image sampling is performed on each sampling target from different viewing directions and different lighting conditions to obtain image samples.

[0095] S102: Labeling the impurity imaging area in the image sample.

[0096] S103: Learning and training the YOLOv8 model using the labeled image sample to obtain the target detection model.

[0097] ​In order to ensure the authenticity and reliability of the training samples, for each part of the sampling target (i.e. the motor stator assembly), multiple image samples can be collected under different viewing angle directions and different lighting conditions. Then, the impurity imaging area in the image sample is labeled, i.e. the impurity label is obtained, which can be that the image sample is displayed on the display screen and the impurity imaging area in each frame of image sample is manually circled as the impurity label. During the labeling of the impurity label, the image samples of the same position region continuously collected on the sampling target can be displayed simultaneously for comparison, so that the staff can more accurately select the impurity imaging area, avoiding interference from the reflection points or shadows in the image to the labeling of the impurity imaging area, and ensuring the accuracy and reliability of the impurity label. Of course, during the subsequent model learning and training process, the continuously collected image samples should be shuffled and input.

[0098] On the basis of completing the labeling of the impurity imaging area in the image sample, in order to improve the robustness of the model obtained in the subsequent training, further noise processing can be added to the image sample, which can specifically be virtual reflection noise and virtual shadow noise. Adding virtual reflection noise means randomly superimposing white or light yellow patches with different shapes, brightness, transparency and edge blur on the metal area of the image sample to simulate various mirror reflections that have never been seen. Adding virtual shadow noise means randomly superimposing semi-transparent dark polygons with different shapes and transparency on the image sample to simulate various shadow obstructions; thus, the model can more accurately and automatically induce the deep visual features of "real impurities" and "background (including reflection and shadow)" in the learning and training process based on the labeled impurity imaging area.

[0099] After the image sample is labeled with the impurity label and noise processing, the image sample can be further input into the initially created YOLOv8 model for learning and training. Similar to the conventional neural network model training process, the image sample is first divided into a training sample set, a test sample set and a validation sample set; each training image sample in the training sample set is input into the initially created YOLOv8 model for learning and training, and each test image sample in the test sample set is used to test the learned and trained YOLOv8 model, and a (WIoU) loss function is used to evaluate the accuracy and reliability of the learned and trained YOLOv8 model. Based on the evaluation result, the parameters in the YOLOv8 model are optimized, and finally the target detection model is obtained. After obtaining the target detection model, the validation image sample in the validation sample set can be further used to identify and verify the target detection model. If the target detection model has high accuracy in identifying the impurities in the validation image sample, it means that the target detection model has been successfully learned and trained, otherwise, new image samples can be selected for learning and training in a similar manner.

[0100] The motor stator impurity detection device provided by the embodiment of the present application is described below. The motor stator impurity detection device described below can be referred to in combination with the motor stator impurity detection method described above.

[0101] Figure 5 The structure block diagram of the motor stator impurity detection device provided by the embodiment of the present application can include: Figure 5

[0102] The data acquisition module 100 is configured to acquire a sampling image of the motor stator.

[0103] The data operation module 200 is configured to identify and analyze the sampling image by using a target detection model obtained based on a YOLOv model architecture, to obtain an image impurity detection result. The impurity detection result includes an impurity position and a result confidence. A coordinate attention module is embedded in a neck network of the target detection model. The target detection head in the target detection model includes a micro target detection head, a small target detection head, a medium target detection head, and a large target detection head.

[0104] The result analysis module 300 is configured to obtain an impurity detection result of the motor stator according to the image impurity detection result.

[0105] In an optional embodiment of the present application, the target detection model includes a FasterNet backbone network, a BiFPN neck network, the target detection head, and a result processing module.

[0106] The data operation module 200 specifically includes:

[0107] The first operation unit is configured to perform feature extraction on the sampling image by using the FasterNet backbone network, to output a C3 feature map, a C4 feature map, and a C5 feature map.

[0108] The second operation unit is configured to perform convolution operation and upsampling operation on the C5 feature map in sequence by using the neck network, and then perform fusion operation, operation of the coordinate attention module, and convolution operation on the C4 feature map in sequence, to obtain first fusion feature data.

[0109] The third operation unit is configured to perform upsampling operation on the first fusion feature data, and then perform fusion operation, operation of the coordinate attention module, and convolution operation on the C3 feature map in sequence, to obtain second fusion feature data. The second fusion feature data is output to the result processing module by using the small target detection head, and the second fusion feature data is output to the result processing module by using the micro target detection head after being subjected to upsampling operation.​

[0110] a fourth operation unit, configured to sequentially perform fusion operation, operation of the coordinate attention module and convolution operation on the second fusion feature data and the first fusion feature data after down-sampling operation on the second fusion feature data, to obtain third fusion feature data, and output the third fusion feature data to the result processing module through the medium target detection head;

[0111] a fifth operation unit, configured to sequentially perform fusion operation, operation of the coordinate attention module and convolution operation on the third fusion feature data after down-sampling operation and the C5 feature map after convolution operation, to obtain fourth fusion feature data, and output the fourth fusion feature data to the result processing module through the large target detection head;

[0112] a sixth operation unit, configured to process the feature data output by the micro target detection head, the small target detection head, the medium target detection head and the large target detection head respectively, and output the impurity detection result.

[0113] In an optional embodiment of the present application, the sixth operation unit is specifically configured to perform result aggregation processing on the input feature data, and perform non-maximum suppression processing on each of the result aggregated feature data, and output the image impurity detection result.

[0114] In an optional embodiment of the present application, the data acquisition module 100 is specifically configured to acquire a plurality of sampling images continuously collected by the camera moving along the outer side of the motor stator;

[0115] Correspondingly, the result analysis module 300 is specifically configured to perform filtering operation on the image impurity detection results corresponding to each of the sampling images through a time sequence consistency filter, to determine whether the same impurity position exists in the image impurity detection results corresponding to the continuous preset number of sampling images, and whether the result confidence is not less than a confidence threshold, and if so, the impurity detection result of the motor stator is that there is impurity.

[0116] In an optional embodiment of the present application, further comprising a model creation module, configured to perform image sampling on each sampling target from different perspective directions and different illumination conditions to obtain image samples, mark impurity imaging areas in the image samples, and learn and train the YOLOv8 model by using the image samples to obtain the target detection model.

[0117] In an optional embodiment of the present application, the model creation module is further configured to perform noise processing on the image sample by adding virtual reflection noise and virtual shadow noise when marking the impurity imaging region in the image sample; and the YOLOv8 model is trained using the noise-processed image sample to obtain the target detection model.

[0118] In an optional embodiment of the present application, the model creation module is specifically configured to train the YOLOv8 model using the image sample, and to optimize the parameters of the YOLOv8 model using a (WIoU) loss function to obtain the target detection model.

[0119] The motor stator impurity detection device of the present embodiment is used to implement the motor stator impurity detection method described above, and the specific embodiments of the motor stator impurity detection device can be found in the foregoing embodiments of the motor stator impurity detection method. The specific embodiments can be described with reference to the descriptions of the respective embodiments, and will not be described here again.

[0120] The present application also provides a motor stator impurity detection device, comprising:

[0121] a camera configured to acquire a sampling image of a motor stator;

[0122] a memory configured to store a computer program;

[0123] a processor configured to execute the computer program to implement the steps of the motor stator impurity detection method according to any one of the preceding embodiments.

[0124] The steps of the motor stator impurity detection method performed by the processor in the present embodiment can include:

[0125] acquiring a sampling image of a motor stator; identifying and analyzing the sampling image using a target detection model obtained by pre-training based on a YOLOv model architecture to obtain an image impurity detection result; wherein the impurity detection result includes impurity position and result confidence; the neck network of the target detection model is embedded with a coordinate attention module; the target detection head in the target detection model includes a micro target detection head, a small target detection head, a medium target detection head, and a large target detection head; and obtaining an impurity detection result of the motor stator according to the image impurity detection result.

[0126] The present application also provides an embodiment of a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed to implement the steps of the motor stator impurity detection method according to any one of the preceding embodiments.

[0127] The computer readable storage medium can include random access memory (RAM), read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other forms of storage medium known in the art.

[0128] It should be noted that the relative terms such as first and second, and the like are used herein only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between such entities or operations. Moreover, the terms "comprising", "including", or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article, or apparatus that comprises a list of elements does not exclude additional identical elements not expressly listed. In addition, the above technical solutions provided by the embodiments of the present application have not been described in detail, so as not to be too verbose.

[0129] The principles and implementation modes of the present application are described herein by applying specific examples, and the above description of the examples is only for the purpose of helping to understand the method of the present application and its core idea. It should be noted that for those skilled in the art, without departing from the principles of the present application, the present application can be improved and modified in several ways, and these improvements and modifications also fall within the scope of protection of the present application.

Claims

1. A method for detecting impurities in a stator of an electric machine, characterized in that, The method comprises the following steps: Collecting a sampling image of a motor stator; Using a target detection model obtained by pre-training based on a YOLOv model architecture to perform identification analysis on the sampling image to obtain an image impurity detection result; wherein the impurity detection result includes impurity position and result confidence; a coordinate attention module is embedded in the neck network of the target detection model; The target detection head in the target detection model includes a micro target detection head, a small target detection head, a medium target detection head, and a large target detection head; According to the image impurity detection result, an impurity detection result of the motor stator is obtained.

2. The method of detecting impurities in a motor stator of claim 1, wherein, The target detection model includes a FasterNet backbone network, a BiFPN neck network, the target detection head, and a result processing module; Using a target detection model obtained by pre-training based on a YOLOv model architecture to perform identification analysis on the sampling image to obtain an image impurity detection result includes: Feature extraction is performed on the sampling image through the FasterNet backbone network to output C3 feature maps, C4 feature maps, and C5 feature maps; After the C5 feature maps are sequentially subjected to convolution operation and up-sampling operation in the neck network, and the C4 feature maps are sequentially subjected to fusion operation, operation of the coordinate attention module, and convolution operation, first fusion feature data are obtained; After the first fusion feature data are subjected to up-sampling operation, and the C3 feature maps are sequentially subjected to fusion operation, operation of the coordinate attention module, and convolution operation, second fusion feature data are obtained, the second fusion feature data are output to the result processing module through the small target detection head, and the second fusion feature data are subjected to up-sampling operation and then output to the result processing module through the micro target detection head; After the second fusion feature data are subjected to down-sampling operation, and the first fusion feature data are sequentially subjected to fusion operation, operation of the coordinate attention module, and convolution operation, third fusion feature data are obtained, and the third fusion feature data are output to the result processing module through the medium target detection head; After the third fusion feature data subjected to down-sampling operation and the C5 feature maps subjected to convolution operation are sequentially subjected to fusion operation, operation of the coordinate attention module, and convolution operation, fourth fusion feature data are obtained, and the fourth fusion feature data are output to the result processing module through the large target detection head; The feature data output by the micro target detection head, the small target detection head, the medium target detection head, and the large target detection head are processed through the result processing module to output the impurity detection result.

3. The method of claim 2, wherein the step of detecting the impurities in the stator of the motor is performed by using a camera. The feature data output by the micro target detection head, the small target detection head, the medium target detection head, and the large target detection head are processed through the result processing module to output the image impurity detection result, including: The input feature data are subjected to result aggregation processing; Each of the feature data subjected to result aggregation processing is subjected to non-maximum suppression processing to output the image impurity detection result.

4. The method of detecting impurities in a motor stator of claim 1, wherein, Collecting a sampling image of a motor stator includes: acquire a plurality of frames of the sampling images successively collected while the camera moves along the outer side of the motor stator; Accordingly, the impurity detection result of the motor stator is obtained according to the image impurity detection result, comprising: The image impurity detection result corresponding to each frame of the sampling image is filtered by a time sequence consistency filter to determine whether the same impurity position exists in the image impurity detection result corresponding to the sampling image of the continuous preset frame number, and the result confidence is not less than the confidence threshold, if yes, the impurity detection result of the motor stator is that there is impurity.

5. The method of detecting impurities in a motor stator of any one of claims 1 to 4, wherein The process of obtaining the target detection model based on the pre-trained YOLOv model architecture includes: Image sampling is performed on each sampling target from different perspective directions and different light conditions to obtain image samples; Label the impurity imaging area in the image sample; The labeled image sample is used to learn and train the YOLOv8 model to obtain the target detection model.

6. The method of detecting impurities in a motor stator of claim 5, wherein, When labeling the impurity imaging area in the image sample, it further includes: The image sample is subjected to noise processing by adding virtual reflection noise and virtual shadow noise; Accordingly, the image sample is used to learn and train the YOLOv8 model to obtain the target detection model, comprising: The image sample is used to learn and train the YOLOv8 model to obtain the target detection model.

7. The method of detecting impurities in a motor stator of claim 5, wherein, The image sample is used to learn and train the YOLOv8 model to obtain the target detection model, comprising: The image sample is used to learn and train the YOLOv8 model, and the (WIoU) loss function is used to optimize the parameters of the YOLOv8 model to obtain the target detection model.

8. An apparatus for detecting impurities in a stator of an electric machine, characterized by It includes: The data acquisition module is used to collect and acquire the sampling image of the motor stator; The data operation module is used to identify and analyze the sampling image by using the target detection model obtained by pre-training based on the YOLOv model architecture to obtain the image impurity detection result; wherein the impurity detection result includes impurity position and result confidence; the neck network of the target detection model is embedded with a coordinate attention module; the target detection head in the target detection model includes a micro target detection head, a small target detection head, a medium target detection head and a large target detection head; The result analysis module is used to obtain the impurity detection result of the motor stator according to the image impurity detection result.

9. An apparatus for detecting impurities in a stator of an electric machine, characterized by It includes: The camera is used to collect the sampling image of the motor stator; The memory is used to store the computer program; The processor is used to execute the computer program to realize the steps of the impurity detection method in the motor stator as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium, and the computer program is executed to realize the steps of the impurity detection method in the motor stator as claimed in any one of claims 1 to 7.