Product defect detection method of fully automatic BLDC motor winding machine based on machine vision
Through the deep learning target detection method based on machine vision, using the improved YOLOv4 model and ShuffleNet network, the problem of insufficient efficiency and accuracy in coil defect detection of fully automatic BLDC motor winding machines is solved, and efficient and accurate automatic detection is achieved.
Patent Information
- Application Number
- CN202111611195.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-12-27
AI Technical Summary
The existing technology cannot effectively automatically detect coil defects of fully automatic BLDC motor winding machines, resulting in low detection efficiency, insufficient accuracy and high cost.
The deep learning target detection method based on machine vision is used, the ShuffleNet network is used to improve the YOLOv4 model, and the depth separable convolution and residual shrinkage network are combined to conduct fully automatic BLDC motor winding machine product defect detection.
It improves the detection efficiency and accuracy, reduces the calculation amount and noise error, enhances the model generalization ability and the quality of detection results, and solves the real-time and accuracy problems of manual detection.
Smart Images

Figure CN114240923B
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of defect detection of winding machine products, and specifically discloses a full-automatic BLDC motor winding machine product defect detection method based on machine vision. Background Art
[0002] In recent years, in order to meet the production requirements of high efficiency and high output, fully automatic winding machines have gradually replaced traditional winding machines. Fully automatic machines generally adopt a multi-head linkage design, use a programmable controller as the control core of the equipment, and cooperate with manipulators, pneumatic control components and execution accessories to complete automatic wiring, automatic foot winding, automatic wire cutting, automatic loading and unloading of skeletons and other functions. This type of machine has extremely high production efficiency, greatly reduces dependence on manual labor, and has relatively stable production quality, which is very suitable for processing occasions with high output requirements.
[0003] Brushless Direct Current Motor (BLDC motor) has a longer life and less operating noise, so it gradually replaces the brush motor. The fully automatic BLDC motor winding machine is one of the key equipment for producing this motor. With the rise of brushless DC motors, the number of fully automatic BLDC motor winding machines has gradually increased. Due to the matching error between the guide pin and the rotation of the skeleton, vibration and other reasons when the fully automatic BLDC motor winding machine is winding the coil, defects such as bulges, flying out, broken wires and cross-wires will inevitably occur. These defects will cause the magnetic field generated by the coil to be uneven, affecting the performance of the coil. Coil bulges, flying out, broken wires and cross-wires can be directly identified by appearance. At present, manual detection is the main method in the industry. Manual detection has many uncertain factors, insufficient reliability, missed detection problems, low efficiency, high cost, etc., which has prompted the industry to develop in the direction of automatic identification and intelligent detection.
[0004] Currently, the commonly used detection methods for coils are CT detection and ultrasonic detection, but they have high requirements on the working environment, are difficult to achieve automated detection, and cannot be widely used.
[0005] There is also the use of industrial cameras to directly replace human eye detection. Although this method is safe, reliable, radiation-free, and has significantly improved accuracy and flexibility compared to manual detection, its level of intelligence is relatively low.
[0006] In order to overcome the above problems, deep learning technology can be used to achieve deep learning target detection. At present, deep learning algorithms in the field of target detection are mainly divided into two categories: two-stage target detection algorithm and one-stage target detection algorithm. YOLO deep learning detection algorithm is a typical one-stage algorithm model. Its network structure is mainly composed of three main components: backbone network (Backbone), enhanced feature extraction network (Neck) and prediction network (Head). Backbone is a convolutional neural network that aggregates and forms image features at different image granularity. Neck is a series of network layers that mix and combine image features and pass image features to the prediction layer. Head is used to predict image features and generate bounding boxes and prediction categories. Summary of the invention
[0007] Aiming at the problem of product defects of fully automatic BLDC motor winding machines, this paper proposes a method for detecting product defects of fully automatic BLDC motor winding machines based on machine vision. The coils of fully automatic BLDC motor winding machines are taken as the research objects, and their appearance qualification is detected. The defect detection method combined with deep learning target detection solves the shortcomings of existing methods and performs accurate visual detection of coil surface defects.
[0008] To achieve the above object, the present invention provides a fully automatic BLDC motor winding machine product defect detection method based on machine vision, which specifically includes the following steps:
[0009] S1: Select the image data of defective products of the fully automatic BLDC motor winding machine and construct a dataset of defective products of the fully automatic BLDC motor winding machine;
[0010] S2: Preprocess the defective product dataset to obtain a preprocessed dataset, and divide it into a training set, a test set, and a validation set according to the VOC format;
[0011] S3: Use the ShuffleNet network as the backbone network to build a lightweight improved YOLOv4 network;
[0012] S4: Use the preprocessed dataset to train the improved YOLOv4 network to obtain a defect detection network;
[0013] S5: Input the product data of the fully automatic BLDC motor winding machine into the defect detection network to obtain the defect detection result of the product.
[0014] Furthermore, the step S1 is specifically as follows: the selected defective product images of the fully automatic BLDC motor winding machine include bulge images, fly-out images, broken wire images and crossed wire images of the product coils of the fully automatic BLDC motor winding machine.
[0015] Furthermore, the step S2 preprocesses the defective product data set to obtain a preprocessed data set, which specifically includes the following steps:
[0016] (1) Image screening: Screen the selected defective product images and retain the defective product images that meet the input size requirements;
[0017] (2) Image enhancement: In order to avoid overfitting of the trained network model due to the small defective product data set, it is necessary to use data enhancement methods on defective product images to improve the robustness and generalization ability of the model. Common data augmentation methods include data enhancement of defective images, such as changing image exposure, saturation, hue, and position rotation transformation;
[0018] (3) Defect labeling: Use labelImg (image labeling tool) to label defective product images after screening and enhancement, including bulges, flyouts, broken lines, and crossed lines.
[0019] Furthermore, the annotated preprocessed dataset is divided into training set, test set and validation set according to the VOC data format and the ratio of 7:2:1.
[0020] Furthermore, the step S3 is specifically as follows:
[0021] The improved YOLOv4 backbone network is the ShuffleNet network, the convolution layer in the enhanced feature extraction network is the depth-wise separable convolution, the activation function in the network is the Mish activation function, and the Resblock-body module in its lightweight is improved accordingly.
[0022] Preferably, the ShuffleNet network is a ShuffleNetv2 network. The advantage of ShuffleNetv2 is that it introduces point-by-point grouped convolution (reducing the number of parameters and the amount of calculation) and channel shuffling (ensuring full fusion of information).
[0023] The number of parameters in the standard convolution process is:
[0024] C in ×K×K×C out (1)
[0025] The number of parameters for grouped convolution is:
[0026]
[0027] In the above formula, C in is the number of input channels, C out is the number of output channels, K×K is the size of the convolution kernel, and G is the number of groups. Comparing equations (1) and (2), group convolution can reduce the number of parameters to 1 / G of the original.
[0028] Preferably, depthwise separable convolution = depthwise convolution + pointwise convolution, which has fewer parameters and faster calculation speed than standard convolution. Depthwise separable convolution can compress the calculation amount of traditional convolution to:
[0029]
[0030] In formula (3), H×W is the spatial size of the output feature map. From the formula, we can see that the calculation speed is about 1 / K of the traditional convolution. 2 .
[0031] Preferably, the activation function in the network is the Mish activation function. The Mish activation function is a smooth function with good generalization ability and effective optimization ability of the results, which can improve the quality of the results. The formula is as follows:
[0032] Mish = x*tanh(ln(1+e x )) (4)
[0033] Its derivative is:
[0034]
[0035] ω=4(x+1)+4e 2x +e 3x +e x (4x+6) (6)
[0036] δ=2e x +e 2x +2 (7)
[0037] Preferably, the ResNet (residual network) module in the Resblock-body is replaced with a DRSN (residual shrinkage network) module. The residual shrinkage network is a deep learning + soft thresholding + attention mechanism, where soft thresholding is the core step of the signal denoising algorithm and can be achieved by the following formula:
[0038]
[0039] The derivative of its output with respect to its input is:
[0040]
[0041] In the above formula, x is the variable, y is the output, and τ is the threshold (non-negative value). From formula (9), we can see that the derivative of soft thresholding is 0 or 1, which can reduce the risk of gradient diffusion and gradient explosion encountered by deep learning algorithms.
[0042] Furthermore, the step S4 specifically includes the following steps:
[0043] (1) Using the training set to train a lightweight improved YOLOv4 network, a fully automatic BLDC motor winding machine product defect detection network is obtained;
[0044] (2) using the test set to evaluate the performance of the product defect detection network model of the fully automatic BLDC motor winding machine;
[0045] (3) The verification set is used to adjust the parameters of the network model for product defect detection of the fully automatic BLDC motor winding machine.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] (1) The present invention introduces a deep learning target detection network into coil defect detection, which solves the real-time and accuracy problems that are missing in manual detection, and effectively improves the detection efficiency and success rate of coil defects in fully automatic BLDC motor winding machine products;
[0048] (2) The present invention replaces the CSPDarkNet53 network, the backbone extraction network of YOLOv4, with the ShuffleNet network, which greatly reduces the network parameters, thereby reducing the amount of calculation and improving the detection network speed;
[0049] (3) The convolution layer of the present invention is a depth-separable convolution, which uses different convolution kernels on each channel to extract different features, greatly saving the number of parameters;
[0050] (4) The activation function in the network of the present invention is the Mish activation function, which improves the generalization ability of the model and the effective optimization ability of the results, and can improve the quality of the detection results;
[0051] (5) The present invention adopts a residual shrinkage network model for defect detection, which effectively solves the error problem of noise in detection. It not only improves the accuracy of detection, but also enhances the ability of deep learning networks to extract features from noisy images. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is a step diagram of the method for detecting product defects of a fully automatic BLDC motor winding machine based on machine vision of the present invention;
[0053] Figure 2 This is a typical defect diagram of the fully automatic BLDC motor winding machine;
[0054] Figure 3 A structural diagram of a defect detection network provided by an embodiment of the present invention;
[0055] Figure 4 To improve the ShuffleNetv2 network structure diagram;
[0056] Figure 5 To improve the overall structure of the residual shrinkage network. DETAILED DESCRIPTION
[0057] The specific implementation method of the present invention is further described in detail below in conjunction with the accompanying drawings. The process, conditions, experimental conditions, etc. for implementing the present invention, except for the contents specifically mentioned below, are all common knowledge and common common sense in the art, and the present invention has no special restrictions.
[0058] In order to accurately visually detect the surface winding defects of the coils of fully automatic winding machine products, the embodiment of the present invention provides a fully automatic winding machine defect detection method based on machine vision, combined with a typical one-stage algorithm model in deep learning target detection - YOLOv4, and performs lightweight improvements on it. Figure 1 As shown, the fully automatic BLDC motor winding machine defect detection method based on machine vision of the present invention mainly includes the following steps:
[0059] S1: Select the image data of defective products of the fully automatic BLDC motor winding machine and construct the product defect dataset of the fully automatic BLDC motor winding machine;
[0060] S2: preprocessing the defective product dataset to obtain a preprocessed dataset, and dividing the preprocessed dataset into a training set, a test set, and a validation set according to the VOC format;
[0061] S3: Use the ShuffleNet network as the backbone network to build a lightweight improved YOLOv4 network;
[0062] S4: Using the preprocessed data set to train the improved YOLOv4 network to obtain a defect detection network;
[0063] S5: Input the product data of the fully automatic BLDC motor winding machine into the defect detection network to obtain the defect detection result of the product.
[0064] For step S1: the selected defective product images of the fully automatic BLDC motor winding machine include bulge images, fly-out images, broken wire images and crossed wire images of the product coils of the fully automatic BLDC motor winding machine.
[0065] Select as Figure 2 The numerous image data shown constitute a defect dataset. Figure 2 As shown in (a), the selected image is a qualified product image of a fully automatic BLDC motor six-axis internal winding machine, which is used for comparison with the defective image; Figure 2As shown in (b), a fully automatic BLDC motor three-axis internal winding machine is selected. The defect is that the coil wire is not neatly wound due to too many winding layers, resulting in a coil bulge problem; Figure 2 As shown in (c), a fully automatic BLDC motor twelve-axis internal winding machine is selected. The defect is that the winding speed at both ends is too fast, causing the wire to fly out and deviate from the main axis; Figure 2 As shown in (d), the defect is that the fully automatic BLDC motor winding machine deviates from the set winding distance and cross-wire occurs.
[0066] Step S2: preprocessing the defective product data set selected in step S1 to obtain a preprocessed data set, specifically comprising the following steps:
[0067] (1) Image screening: Screen the selected defective product images and retain the defective product images that meet the input size requirements;
[0068] (2) Image processing: In order to avoid overfitting of the trained network model due to the small size of the defective product data set, it is necessary to use data enhancement methods for defective product images to improve the robustness and generalization ability of the model. Common data augmentation methods are used to enhance the data of defective images, such as changing the image exposure, saturation, hue, and position rotation transformation;
[0069] (3) Defect labeling: Use labelImg (image labeling tool) to label the defect images after screening and enhancement, including protrusions, flyouts, broken lines, and crossed lines.
[0070] For step S2: the annotated preprocessed data set is divided into a training set, a test set, and a validation set according to the VOC data format and a ratio of 7:2:1.
[0071] For step S3: constructing a lightweight improved YOLOv4 network, in order to facilitate understanding of the embodiments of the present invention, firstly Figure 3 The defect detection network model shown in the figure is introduced, which includes the backbone network (Backbone), enhanced feature extraction network (Neck) and prediction network (Head) from left to right.
[0072] Backbone is a convolutional neural network that aggregates and forms image features at different image granularities. Neck is a series of network layers that mix and combine image features and pass image features to the prediction layer. Head is used to predict image features, generate bounding boxes and predict categories.
[0073] In order to reduce the amount of calculation and improve the speed of the detection network, the backbone network uses the ShuffleNetv2 network. The advantage of ShuffleNetv2 is that it introduces point-by-point group convolution (reducing the number of parameters and calculations) and channel shuffling (ensuring full information fusion). This structure can greatly reduce network parameters, thereby reducing the amount of calculation and improving the speed of the detection network.
[0074] In the standard convolution process, all feature information of each channel in the feature map of the previous layer is output to each channel of the feature map of the next layer through the convolution operation.
[0075] The number of parameters in the standard convolution process is:
[0076] C in ×K×K×C out (1)
[0077] Group Convolution (GC) groups input features and convolution kernels based on standard convolution. The grouped convolution kernels only perform convolution operations with input features in the same group, thereby reducing the number of parameters.
[0078] The number of parameters for grouped convolution is:
[0079]
[0080] In the above formula, C in is the number of input channels, C out is the number of output channels, K×K is the size of the convolution kernel, and G is the number of groups. Comparing equations (1) and (2), group convolution can reduce the number of parameters to 1 / G of the original.
[0081] like Figure 4 As shown in (a), at the beginning of each unit, the input of the c feature channel is divided into two branches with c-c' and c' channels respectively through channel splitting. The left branch does not take any operation, and the right branch performs 2 times of Covn1*1 and 1 time of DWCovn3*3, with the same input and output channels. After convolution, the two branches are concatenated (Concat) so that the number of channels remains unchanged, and then the channel shuffle (Channel Shuffle) operation is performed to ensure that the information of the two branches is fully integrated.
[0082] like Figure 4 (b) shows a downsampling module. Each branch has a convolution operation with a stride of 2. The dimension of the feature map is halved and the number of output channels is doubled. It mainly reduces the dimension of the feature map and further reduces the computational complexity of the network model.
[0083] Among them, DWCovn3*3 is a depth-wise separable convolution with a convolution kernel of 3. Depth-wise separable convolution = depth-wise convolution + point-by-point convolution. Compared with standard convolution, it has fewer parameters and the calculation speed is about 1 / 9 of the traditional convolution.
[0084] The number of multiplications for standard convolution is:
[0085] H×W×C in ×C out ×3×3 (3)
[0086] The number of parameters for standard convolution is:
[0087] C in ×C out ×3×3 (4)
[0088] The total number of multiplications for depthwise separable convolution is:
[0089] H×W×C in ×3×3+H×W×C in ×C out (5)
[0090] The number of parameters for depthwise separable convolution is:
[0091] C out ×3×3+C in ×C out ×3×3 (6)
[0092] Depthwise separable convolution compresses the computation of traditional convolution to:
[0093]
[0094] In the above formula, H×W is the spatial size of the output feature map, C in is the number of input channels, C out is the number of output channels, and 3×3 is the size of the convolution kernel.
[0095] The advantages of the Mish activation function over the ReLU activation function are: it is not completely truncated at negative values, which better ensures the inflow of information; the above unboundedness avoids saturation due to capping; the most important point is that the gradient descent effect is better, thus ensuring the smoothness of almost all points on the curve. The smooth activation function allows better information to penetrate the neural network, ensuring that the model has higher accuracy and generalization. Therefore, the activation function in the network of the present invention uses the Mish activation function, and the Mish activation function formula is as follows:
[0096] Mish = x*tanh(ln(1+e x )) (8)
[0097] Its derivative is:
[0098]
[0099] ω=4(x+1)+4e 2x +e 3x +e x (4x+6) (10)
[0100] δ=2e x +e 2x +2 (11)
[0101] The present invention detects defects in fully automatic BLDC motor winding machines, and has extremely high requirements for accuracy. A simple lightweight structural design will sacrifice the ability to extract complex features of some network models. Therefore, when analyzing defects in fully automatic BLDC motor winding machines with complex components and severe noise interference, the model performance will be greatly affected and the detection accuracy will be low. In order to take into account both lightweight structural design and improved image defect detection performance, the present invention improves the residual block on this lightweight basis, replacing the ResNet module in the Resblock-body with a DRSN module.
[0102] The residual shrinkage network is a combination of deep learning + soft thresholding + attention mechanism. The combination of soft thresholding and deep learning is an effective way to eliminate noise information and build highly discriminative features. The residual shrinkage network model is established by adding the attention mechanism on the basis of the residual network model. The attention mechanism pays attention to important features and retains them, thereby enhancing the ability of the deep neural network to extract useful features from noisy signals.
[0103] The attention mechanism is a mechanism that focuses attention on local key information, which can be divided into two steps: first, discover local useful information through global scanning; second, enhance useful information and suppress redundancy.
[0104] Soft thresholding is the core step of the signal denoising algorithm. Its purpose is to set the features with absolute values below a certain threshold to zero, and to move other features towards zero. Features with absolute values above a certain threshold are deleted, and features with absolute values greater than this threshold are shrunk towards zero. This can be achieved by the following formula:
[0105]
[0106] The derivative of the soft thresholded output with respect to the input is:
[0107]
[0108] In the above formula, x is the variable, y is the output, and τ is the threshold (non-negative value). From formula (13), it can be seen that the derivative of soft thresholding is either 1 or 0, which can reduce the risk of gradient diffusion and gradient explosion encountered by deep learning algorithms.
[0109] The residual shrinkage network first calculates the absolute values of all features of the input feature map, and then passes through the global average pooling layer (GlobalAverage Pooling, GAP) and the parameter average to obtain a feature, denoted as A. In another path, the feature map after GAP is input into a small fully connected network. The fully connected network uses the Sigmoid function as the last layer to normalize the output to the interval [0, 1] to obtain a coefficient, denoted as α, and the final threshold can be expressed as α×A. Therefore, the threshold represents a number between 0 and 1 × the average of the absolute value of the feature map. In this way, it is ensured that the threshold is positive and not too large. Finally, a certain number of basic modules as well as convolutional layers, batch normalization (BatchNormalization, BN), activation function (Activation function), global average pooling (GlobalAveragePooling, GAP) and fully connected output layer (Fully Connected, FC) are stacked to obtain the following Figure 5 The overall structure diagram of the deep residual shrinkage network shown.
[0110] Step S4: using the preprocessed data set to train the lightweight improved YOLOv4 network specifically includes the following steps:
[0111] (1) Using the training set to train a lightweight improved YOLOv4 network, a fully automatic BLDC motor winding machine product defect detection network is obtained;
[0112] (2) using the test set to evaluate the performance of the product defect detection network model of the fully automatic BLDC motor winding machine;
[0113] (3) The verification set is used to adjust the parameters of the network model for product defect detection of the fully automatic BLDC motor winding machine.
[0114] If the test results meet the expected effects, they will be applied to the actual project. Otherwise, the validation set is needed to adjust the structure and parameters of the network and rebuild the defective product detection network model.
[0115] For step S5: input the product image data of the fully automatic BLDC motor winding machine into the defect detection network to obtain the defect detection result of the product. The operator can refer to the detection result to inspect and repair the fully automatic BLDC motor winding machine to quickly restore it to normal operation.
[0116] The details are as follows: Figure 2 The image of the defective product of the fully automatic BLDC motor winding machine shown in the figure is input into the defect detection network. The image is lightweighted through the point-by-point grouped convolution and channel shuffling operations in the backbone network ShuffleNetv2 network to reduce the number of parameters and calculations. The attention mechanism in the residual shrinkage network notices the important features of the fully automatic winding machine product and retains them. Then, the "noise" is shrunk toward zero through soft thresholding, thereby improving the accuracy of the defect detection results. Then, the enhanced feature extraction network is entered to change the original standard convolution to a depth-separable convolution, which reduces the number of parameters and calculations on the original basis, thereby improving the network calculation speed and making the detection results generated by the prediction network more efficient and accurate.
[0117] In summary, the method for detecting product defects based on the fully automatic BLDC motor winding machine proposed in the embodiment of the present invention is a ShuffleNetv2 lightweight network after the improved YOLOv4 backbone network. According to the actual needs of the fully automatic BLDC motor winding machine defect product detection, the ShuffleNetv2 network is improved, wherein the convolution layer is a depth-separable convolution, and the ResNet module in the Resblock-body in the lightweight network is replaced by a DRSN module. Through the above improvements, the network parameters can be greatly reduced, the amount of calculation can be reduced, the speed and accuracy of detection can be improved, and the ability of the deep learning network to extract features from noisy images can be enhanced, solving the problems of real-time and accuracy that are missing during manual detection.
[0118] Although the present invention has been disclosed as above with preferred embodiments, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, so the protection scope of the present invention should be subject to the scope defined by the claims.
Claims
1. A fully automatic BLDC motor winding machine product defect detection method based on machine vision, characterized in that: The following steps are involved: S1: Select the image data of defective products of the fully automatic BLDC motor winding machine and construct a dataset of defective products of the fully automatic BLDC motor winding machine; S2: Preprocess the defective product dataset to obtain a preprocessed dataset, and divide it into a training set, a test set, and a validation set according to the VOC format; S3: Build a lightweight improved YOLOv4 network. The backbone network of the improved YOLOv4 is the ShuffleNet network, the network type is ShuffleNetv2, the network convolution layer is the depth-separable convolution, and the network activation function is the Mish function, where: The advantage of ShuffleNetv2 is that it introduces point-by-point grouped convolution and channel shuffling. The number of parameters in the standard convolution process is: C in ×K×K×C out (1) The number of parameters for grouped convolution is: In the above formula, C in is the number of input channels, C out is the number of output channels, K×K is the size of the convolution kernel, and G is the number of groups. Comparing equations (1) and (2), group convolution can reduce the number of parameters to 1 / G of the original number. The advantage of depth-wise separable convolution is that it is equal to the sum of depth-wise convolution and point-wise convolution. The amount of multiplication calculation for standard convolution is: H×W×C in ×C out ×K×K(3) The number of parameters of the standard convolution is: C in ×C out The total multiplication computation of ×K×K(4) depth-wise separable convolution is: H×W×C in ×K×K+H×W×C in ×C out (5) The number of parameters for depthwise separable convolution is: C out ×K×K+C in ×C out ×K×K(6) depthwise separable convolution can compress the computation of traditional convolution to: In the above formula, H×W is the spatial size of the output feature map. From formula (7), we can see that the calculation speed is about 1 / K of the traditional convolution. 2 ; The advantage of the Mish activation function is that it is a smooth function. The formula of the Mish activation function is as follows: Mish=x*tanh(ln(1+e x )) (8) Its derivative is: ω=4(x+1)+4e 2x +e 3x +e x (4x+6) (10) δ=2e x +e 2x +2 (11) From formula (8), we can see that the Mish function is smooth at all points on the curve, which can input more information into the neural network and has high recognition accuracy; S4: Use the preprocessed data set to train the improved YOLOv4 network to obtain a defect detection network; S5: Input the product data of the fully automatic BLDC motor winding machine into the defect detection network to obtain the defect detection result of the product.
2. The method for detecting product defects of a fully automatic BLDC motor winding machine based on machine vision according to claim 1, characterized in that: The step S4 uses the preprocessed data set for training, and specifically includes the following steps: (1) Using the training set data to train a lightweight improved YOLOv4 network to obtain a fully automatic BLDC motor winding machine product defect detection network; (2) using the test set to evaluate the performance of the product defect detection network model of the fully automatic BLDC motor winding machine; (3) The verification set is used to adjust the parameters of the network model for product defect detection of the fully automatic BLDC motor winding machine.
3. The method for detecting product defects of a fully automatic BLDC motor winding machine based on machine vision according to claim 1, characterized in that: The step S5: inputting the product image data of the fully automatic BLDC motor winding machine into the defect detection network to obtain the defect detection result of the product. The specific steps are: selecting the product image data of the fully automatic BLDC motor winding machine, performing image preprocessing, extracting features through the backbone network ShuffleNetv2 network in S3, and then using the optimized defect detection network model in S4 to perform defect detection, and finally outputting the defect recognition result.
