Deep-learning-based target detection method for defects of image of inner side of commutator

Through deep learning technology, algorithms such as YOLOv3 and Darknet-53 are used to extract and integrate the image features on the inside of the commutator, solving the problem of rapid and accurate defect detection on the inside of the industrial commutator, achieving efficient defect detection, and is suitable for Industrial scene.

WO2024208102A1PCT designated stage expired Publication Date: 2024-10-10DONGGUAN POLYTECHNIC +1

Patent Information

Application Number
PCT/CN2024/084881
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-04
Filing Date
2024-03-29
Publication Date
2024-10-10

AI Technical Summary

Technical Problem

The existing technology cannot quickly and accurately detect defects on the inner side images of industrial commutators, resulting in low detection accuracy, large amount of calculation, long time consumption, and is not suitable for industrial scenarios.

Method used

A deep learning-based image defect target detection method inside the commutator is used to extract image features through the feature extraction network (using YOLOv3 algorithm and Darknet-53), the feature integration network integrates feature maps, and the feature reorganization network generates a multi-scale feature pyramid, and uses Feature attention mechanism for defect prediction.

Benefits of technology

The detection accuracy and speed are improved to adapt to the needs of industrial scenarios. The YOLOv3 algorithm is 2 times faster than Resnet-152, and the detection effect meets the preset standards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024084881_10102024_PF_FP_ABST
    Figure CN2024084881_10102024_PF_FP_ABST
Patent Text Reader

Abstract

The present invention relates to a deep-learning-based target detection method for defects of an image of the inner side of a commutator. The method comprises: step S1, by means of an image processing method, processing an original image of the inner side of a commutator to be tested, and performing normalization setting; step S2, inputting an image of a fixed size into a feature extraction network, and the feature extraction network acquiring feature maps of the image at different levels, wherein the feature extraction network extracts image features by means of depthwise separable convolution; step S3, a feature integration network scaling the feature maps at different levels to the same scale and then connecting the feature maps, and the feature integration network inputting the connected feature maps into a feature recombination network; step S4, a feature union network uniting, into a multi-stage multi-scale feature pyramid, a plurality of multi-scale features generated by the feature recombination network; and step S5, predicting defects of an expanded image of the inner side of the commutator according to the multi-stage multi-scale feature pyramid acquired by the feature union network.
Need to check novelty before this filing date? Find Prior Art

Description

Commutator inner side image defect detection method based on deep learning Technical Field

[0001] The present invention relates to the field of commutator detection, and in particular to a method for detecting commutator inner side image defects based on deep learning. Background Art

[0002] Industrial commutators will inevitably have some defects in the process from raw materials to processing, which will affect the quality of the commutator. In traditional industries, manual identification is mainly used, which easily leads to waste of human resources and makes it difficult to identify some minor defects. Currently, there is also a method of identifying commutator defects through visual inspection, but during the image processing process, it is impossible to quickly extract the expanded image of the inner side of the commutator and accurately detect defects. The detection process has a large amount of calculation, low detection accuracy, and is time-consuming, making it unsuitable for industrial scenarios.

[0003] Chinese patent ZL201711389321.5 discloses an automated visual inspection system for motor commutators, which performs dust removal during the commutator feeding process and uses an image acquisition device to capture images of the commutator after the dust removal. The image acquisition device processes images at a low speed and accuracy, which wastes time and cannot accurately determine defective products.

[0004] Summary of the Invention

[0005] To this end, the present invention provides a deep learning-based target detection method for commutator inner side image defects, which can solve the problem that the target detection method based on convolutional neural network cannot be applied to the defect detection of the commutator inner side expanded image, and improve the original deep learning-based target detection method to solve the technical problem that the commutator inner side image defects cannot be detected quickly and accurately.

[0006] To achieve the above objectives, the present invention provides a method for detecting defects in an image on the inside of a commutator based on deep learning, comprising:

[0007] Step S1, processing the original image of the inner side of the commutator to be inspected by an image processing method and performing normalization setting, wherein the image processing method includes rotation, translation, flipping, scaling, and contrast-limited adaptive histogram equalization algorithm;

[0008] Step S2, setting the normalized image to a fixed size, and inputting the fixed-size image into a feature extraction network, wherein the feature extraction network obtains feature maps of different layers of the image, wherein the feature extraction network extracts image features through depthwise separable convolution;

[0009] Step S3: The feature integration network scales the feature maps of different levels to the same scale and then connects them. The feature integration network inputs the connected feature maps into the feature recombination network.

[0010] Step S4: The feature union network combines the multiple multi-scale features generated by the feature recombination network into a multi-level multi-scale feature pyramid;

[0011] Step S5: predicting defects in the expanded image of the inner side of the commutator based on the multi-level and multi-scale feature pyramid obtained by the feature joint network, so that the detection effect meets the preset standard.

[0012] Furthermore, in step S2, the feature extraction network selects the YOLOv3 algorithm as the base algorithm of the commutator inner side image defect target detection method, wherein YOLOv3 uses Darknet-53 to implement feature extraction.

[0013] Furthermore, the feature extraction network includes a dilated convolution, wherein the output of the dilated convolution is y[i]

[0014] Among them, x[i] represents a one-dimensional input signal, ω[l] represents a convolution kernel of length l, and r represents the expansion coefficient, which is the constraint scale of the convolution kernel expansion.

[0015] Furthermore, the feature extraction network uses depthwise separable convolution for feature extraction. Depthwise separable convolution reduces the amount of computation. The ratio of the amount of computation of depthwise separable convolution to that of standard convolution is,

[0016] Among them, Dk is the convolution kernel size, M is the input channel, and N is the output channel.

[0017] The feature extraction network includes a separable residual structure, which can be quickly connected with a depth-wise separable convolution.

[0018] Furthermore, in step S3, the feature integration network compresses the channels of the input features using a 1×1 convolutional layer and concatenates the feature maps using a connection operation.

[0019] Furthermore, the feature reconstruction network adopts continuous 3×3 convolutional layers to perform convolution downsampling operations on the feature maps input by the feature integration network. In the reconstruction stage, 3×3 convolutional layers with a step size of 1 are used, and the feature map output of each layer is used as a reference feature set.

[0020] Furthermore, the feature reconstruction network adopts upsampling and pixel-by-pixel summation on the branches of the reconstruction stage.

[0021] Furthermore, in step S4, the feature union network combines features in an adaptive manner through a feature attention mechanism, including:

[0022] Step S41: In the channel attention mechanism, the global spatial information is compressed into one channel, and the joint features are globally averaged pooled to calculate x∈R C is generated by shrinking P in the spatial dimensions W×H, where the cth element of x is calculated as follows:

[0023] Among them, F sq (u c ) represents the global spatial statistics of the cth element of x, p c (i, j) represents the statistical information of the cth element at the (i, j)th position in the spatial dimension W×H;

[0024] Step S42, fully capturing channel dependency by activating the joint information in step S41, i.e., aggregated feature s, where s = F ex (x,W)=σ(W2δ(W1x))

[0025] Where σ represents the ReLU function: δ represents the sigmoid function:

[0026] r is the reduction ratio. The feature joint network uses two fully connected layers as the gate mechanism, that is, the dimension reduction layer parameter is W1, the dimension increase layer parameter is W2, and R is the dimension reduction ratio.

[0027] Furthermore, in step S5, the loss function used to predict the defects of the expanded image on the inner side of the commutator includes three parts: the bounding box coordinate error, the bounding box confidence error, and the classification error. The loss function is:

[0028] Among them, the first term is the loss function of the center coordinate of the bounding box, the second term is the loss function of the height and width of the bounding box, the third term is the loss function of the bounding box confidence when the object exists, the fourth term is the loss function of the bounding box confidence when the object does not exist, and the fifth term is the classification error of the unit grid where the object exists. S is the unit grid division coefficient of the image, B is the number of bounding boxes predicted for each grid, C is the total number of categories, and p is the category probability. It means that there is an object in the i-th unit grid, and the j-th bounding box in the cell predicts the target, λ coord and λ noobj are the weight coefficients of different loss functions.

[0029] Compared with the existing technology, the beneficial effect of the present invention lies in that the present invention applies the currently popular target detection method based on convolutional neural networks to the defect detection of the expanded image of the inner side of the commutator, and then improves the original target detection method based on deep learning according to the actual situation and existing limitations, thereby improving the detection accuracy and increasing the detection speed by reducing the amount of calculation, so that the deep learning-based commutator inner side image defect target detection method is suitable for industrial scenarios.

[0030] In particular, the feature extraction network is a feature extraction network based on the YOLOv3 backbone network Darknet-53. The accuracy of Darknet-53 is comparable to that of Resnet-152, but its speed is more than twice that of Resnet-152. Because the defects in the expanded image of the inner side of the commutator are small in size and difficult to distinguish from the background, in order to meet the speed requirements of industrial target detection during the detection process, the YOLOv3 algorithm is selected as the base algorithm of the commutator inner side expanded image defect detection algorithm. YOLOv3 uses Darknet-53 to implement feature extraction to improve the speed and accuracy of target detection.

[0031] In particular, by directly removing the feature pooling layer from the feature extraction network, the resolution of the convolutional layer following the feature pooling layer is correspondingly increased, and the corresponding feature loss is reduced. However, as the resolution increases, the corresponding receptive field decreases. This reduction in the receptive field leads to a loss of global information, affecting the classification effect and, consequently, the detection accuracy. Therefore, the feature extraction network is added with a dilated convolution to increase the network's receptive field, thereby ensuring the model's detection performance.

[0032] In particular, the feature reconstruction network adopts upsampling and pixel-by-pixel summation on the branches of the reconstruction stage, which can keep the feature map size the same, enhance learning ability and maintain feature smoothness.

[0033] In particular, the feature union network further strengthens the connection between different scales by combining multiple multi-scale features into a multi-level multi-scale feature pyramid, fully combining the semantic information of deep convolutional feature maps with the spatial information in shallow convolutional feature maps, and improving detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] FIG1 is a schematic diagram of the structure of a commutator inner side image defect target detection system based on deep learning according to an embodiment of the present invention;

[0035] FIG2 is a flow chart of a method for detecting defects in an image on the inner side of a commutator based on deep learning according to an embodiment of the present invention;

[0036] FIG3 is a schematic diagram of a separable residual structure according to an embodiment of the present invention;

[0037] FIG4 is a diagram showing the running interface of the dataset annotation software LabelImg and the generated annotation file according to an embodiment of the present invention;

[0038] FIG5 shows the performance of the YOLOv3 algorithm according to an embodiment of the present invention and the method of this invention in defect detection of the expanded image of the inner side of the commutator;

[0039] FIG6 shows the mAP of defect detection of the commutator inner side expanded image by Faster RCNN (res101) according to an embodiment of the present invention;

[0040] FIG7 is the mAP of defect detection of the FPN on the expanded view of the inner side of the commutator according to an embodiment of the present invention;

[0041] FIG8 is the mAP of defect detection of the commutator inner side expanded view by DSSD according to an embodiment of the present invention;

[0042] FIG9 shows the mAP of defect detection of the commutator inner side expansion image by YOLOv2 according to an embodiment of the present invention;

[0043] FIG10 is the mAP of defect detection on the expanded image of the inner side of the commutator by the method according to an embodiment of the present invention;

[0044] FIG11 is a comparison of the running time, BFLOPS, model size, number of parameters, and F-value between the method in this embodiment of the present invention and the YOLOv3 method. DETAILED DESCRIPTION

[0045] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are merely used to explain the present invention and are not intended to limit the present invention.

[0046] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0047] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside", and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings. This is only for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.

[0048] Furthermore, it should be noted that, in the description of the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; and internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0049] Please refer to FIG1 , which is a schematic diagram of the structure of a commutator inner side image defect target detection system based on deep learning according to an embodiment of the present invention, including:

[0050] A feature extraction network is used to extract feature maps at different levels of the commutator inner image;

[0051] A feature integration network, connected to the feature extraction network, is used to connect feature maps at different levels and serve as input to the feature recombination network;

[0052] A feature recombination network, connected to the feature integration network, for generating multiple multi-scale features;

[0053] A feature union network is connected to the feature recombination network and is used to combine the multiple multi-scale features generated by the feature recombination network into a multi-level multi-scale feature pyramid and predict the defects of the expanded image on the inside of the commutator.

[0054] Please refer to FIG2 , which is a flow chart of a method for detecting defects in an image on the inner side of a commutator based on deep learning according to an embodiment of the present invention, including:

[0055] Step S1, processing the original image of the inner side of the commutator to be inspected by an image processing method and performing normalization setting, wherein the image processing method includes rotation, translation, flipping, scaling, contrast-limited adaptive histogram equalization algorithm, etc.;

[0056] Step S2, setting the normalized image to a fixed size, and inputting the fixed-size image into a feature extraction network, wherein the feature extraction network obtains feature maps of different layers of the image, wherein the feature extraction network extracts image features through depthwise separable convolution;

[0057] Step S3: The feature integration network scales the feature maps of different levels to the same scale and then connects them. The feature integration network inputs the connected feature maps into the feature recombination network.

[0058] Step S4: The feature union network combines the multiple multi-scale features generated by the feature recombination network into a multi-level multi-scale feature pyramid;

[0059] Step S5: predicting defects in the expanded image of the inner side of the commutator based on the multi-level and multi-scale feature pyramid obtained by the feature joint network, so that the detection effect meets the preset standard.

[0060] In step S2, the feature extraction network selects the YOLOv3 algorithm as the base algorithm of the commutator inner side image defect target detection method, wherein YOLOv3 uses Darknet-53 to implement feature extraction.

[0061] Specifically, the feature extraction network is a feature extraction network based on the YOLOv3 backbone network Darknet-53. The accuracy of Darknet-53 is comparable to that of Resnet-152, but its speed is more than twice that of Resnet-152. Because the defects in the expanded image of the inner side of the commutator are small in size and difficult to distinguish from the background, in order to meet the speed requirements of industrial target detection during the detection process, the YOLOv3 algorithm is selected as the base algorithm of the commutator inner side expanded image defect detection algorithm. YOLOv3 uses Darknet-53 to implement feature extraction to improve the speed and accuracy of target detection.

[0062] The feature extraction network includes a dilated convolution, where the output of the dilated convolution is y[i]

[0063] Among them, x[i] represents a one-dimensional input signal, ω[l] represents a convolution kernel of length l, and r represents the expansion coefficient, which is the constraint scale of the convolution kernel expansion.

[0064] Specifically, by directly removing the feature pooling layer from the feature extraction network, the resolution of the convolutional layer following the feature pooling layer is increased, reducing the corresponding feature loss. However, this increase in resolution comes at the same time as a decrease in the receptive field. This decrease in receptive field leads to a loss of global information, affecting classification and, consequently, detection accuracy. Therefore, dilated convolutions are added to the feature extraction network to increase the network's receptive field, thereby ensuring the model's detection performance.

[0065] Specifically, the dilation coefficient is added to the original convolution, which can expand the convolution kernel to the scale constrained by the dilation coefficient and fill the unoccupied area of ​​the original convolution kernel with 0. The effective convolution kernel height is f h +(f h -1)·(r-1), width is f w +(f w -1)·(r-1), where f h Represents the height of the original convolution, f w Represents the width of the original convolution kernel.

[0066] The feature extraction network uses depth-wise separable convolution for feature extraction. Depth-wise separable convolution reduces the amount of computation. The ratio of the amount of computation of depth-wise separable convolution to standard convolution is,

[0067] Among them, Dk is the convolution kernel size, M is the input channel, and N is the output channel.

[0068] The feature extraction network includes a separable residual structure, which can be quickly connected with a depth-wise separable convolution.

[0069] Specifically, the present invention does not limit the adjustment method of the separable residual structure, as long as the feature extraction accuracy can be met. The embodiment of the present invention provides a preferred embodiment. Please refer to Figure 3, which is a schematic diagram of the separable residual structure of the embodiment of the present invention. If the residual structure is directly added to the depth-separable convolution, the input channel becomes a quarter of the original. When performing channel-by-channel convolution, the extracted features will also be a quarter of the original features, thereby affecting the detection effect. The separable residual structure turns the channel into four times the input channel during the first 1×1 convolution, which can ensure the accuracy of the feature extraction network.

[0070] In step S3, the feature integration network uses a 1×1 convolutional layer to compress the channels of the input features and uses a connection operation to splice the feature maps.

[0071] The feature recombination network uses continuous 3×3 convolutional layers to perform convolution downsampling operations on the feature maps input by the feature integration network. In the recombination stage, 3×3 convolutional layers with a step size of 1 are used, and the feature map output of each layer is used as a reference feature set.

[0072] The feature reconstruction network adopts upsampling and pixel-wise summation on the branches of the reconstruction stage.

[0073] Specifically, the feature reconstruction network adopts upsampling and pixel-by-pixel summation on the branches of the reconstruction stage, which can keep the size of the feature map the same, enhance the learning ability and maintain the smoothness of the features.

[0074] In step S4, the feature union network combines features in an adaptive manner through a feature attention mechanism, including:

[0075] Step S41: In the channel attention mechanism, the global spatial information is compressed into one channel, and the joint features are globally averaged pooled to calculate x∈R C It is generated by shrinking P in the spatial dimension W×H, where the cth element of x is calculated as follows:

[0076] Step S42, fully capturing channel dependency by activating the joint information in step S41, i.e., aggregated feature s, where s = F ex (x,W)=σ(W2δ(W1x))

[0077] Where σ represents the ReLU function: δ represents the sigmoid function:

[0078] r is the reduction ratio. The feature joint network uses two fully connected layers as the gate mechanism, that is, the dimension reduction layer parameter is W1, the dimension increase layer parameter is W2, and R is the dimension reduction ratio.

[0079] Specifically, the feature union network further strengthens the connection between different scales by combining multiple multi-scale features into a multi-level multi-scale feature pyramid, fully combining the semantic information of deep convolutional feature maps with the spatial information in shallow convolutional feature maps, and improving detection accuracy.

[0080] In step S5, the loss function used to predict the defects of the expanded image on the inner side of the commutator includes three parts: the bounding box coordinate error, the bounding box confidence error, and the classification error. The loss function is:

[0081] Among them, the first term is the loss function of the center coordinate of the bounding box, the second term is the loss function of the height and width of the bounding box, the third term is the loss function of the bounding box confidence when the object exists, the fourth term is the loss function of the bounding box confidence when the object does not exist, and the fifth term is the classification error of the unit grid where the object exists; S is the unit grid division coefficient of the image, B is the number of bounding boxes predicted for each grid, C is the total number of categories, and p is the category probability; It means that there is an object in the i-th unit grid, and the j-th bounding box in the cell predicts the target; coord and λ noobj are the weight coefficients of different loss functions.

[0082] Specifically, the present invention provides a preferred embodiment to illustrate the improvement of the detection accuracy and speed of the deep learning-based commutator inner side image defect target detection method, including:

[0083] In the study of commutator inner hole defect images, many imaging tools were used, as shown in Table 1:

[0084] Table 1 Tools used in the algorithm

[0085] Dataset

[0086] Four main defects are detected when expanding the image target on the inside of the commutator. To facilitate data collection and annotation of all images, this article uses the dataset annotation tool (Labelimg) to annotate the images with GroundTruth. This software generates a fixed-format TXT file containing the image number, the center coordinates of the defect location, and its width and height. Figure 4 shows the dataset being annotated using the image annotation software. The green box indicates GroundTruth.

[0087] As shown in Figure 4, the upper part shows the defect annotation process, and the lower part shows the annotation file after the annotation is completed. After all sample images are annotated, the MS-COCO dataset format is generated through the script.

[0088] Evaluation Criteria

[0089] In the field of general object detection, the detection performance of a model is generally evaluated by accuracy, precision, recall, F1 value, mAP, and IoU. In this article, we select precision, recall, F1 value, and mAP as the evaluation indicators of the model, and we divide the defect object detection into the following four cases:

[0090] TP——indicates the number of defect targets correctly identified;

[0091] TN——indicates the number of non-defect targets correctly identified;

[0092] FN——indicates the number of defective targets that are mistakenly identified as non-defective targets;

[0093] FP - represents the number of non-defective targets that are mistakenly identified as defective targets;

[0094] Accuracy:

[0095] It is the ratio of samples that are identified as defective images by the model to those that are actually positive samples in the recognition results of all samples (including positive and negative samples). The formula is:

[0096] Recall:

[0097] It is the proportion of all defect image samples in the test set that are correctly identified as defect images. The formula is:

[0098] F-number:

[0099] It is an important indicator for evaluating the monitoring model. The formula is as follows:

[0100] P represents precision, which is the ratio of the number of defects correctly detected by the model to the total number of defects detected by the model. R represents recall, which is the ratio of the number of defects correctly detected by the model to the total number of samples. The model is evaluated using algorithm runtime, FPS (frames per second), model size (MB), and number of parameters.

[0101] Experimental results and analysis

[0102] Comparison of the base model before and after improvement:

[0103] We first selected YOLOv3 as the comparison algorithm for this article. We applied the YOLOv3 object detection algorithm to defect detection in images of the inner side of a commutator, comparing it with the algorithm proposed in this article. In this experiment, we set the detection task to complete only when the IoU between the detected defect and the ground-truth defect is greater than 70%. Otherwise, the detection is still considered a failure. Based on this, we calculated the recall rate and precision to obtain the accurate F-value. Each sub-experiment was repeated three times, and the average of the three F-values ​​was taken as the final result. The experimental results are shown in Figure 5:

[0104] Table 2 Results of defect detection on the commutator inner side expansion image by the YOLOv3 algorithm and the proposed method

[0105] As shown in Figure 5, the proposed method improves by 6 percentage points compared to YOLOv3 in terms of overall results. This is mainly because the defects detected in the commutator's inner side image occupy a relatively small area of ​​the entire image, and the YOLOv3 method sometimes cannot accurately extract their features. However, the proposed method can better identify small targets. Furthermore, the figure shows that the two methods perform slightly less well when detecting defects such as color discrepancy than other defects. We believe this is because the boundaries of the color discrepancy defect cannot be well determined, resulting in a large gap between the IOU value of the recognition box and the true value, which in turn leads to unsatisfactory detection results. However, overall, the proposed method has higher accuracy than the original YOLOv3 method when detecting defects in the commutator's inner side image.

[0106] Comparison with the mAP of existing target detection methods:

[0107] This paper compares the proposed algorithm with existing target detection methods, including Faster R-CNN (res101), YOLOv2, FPN, and DSSD, on the image data of the inner side of the commutator. The mAP test results of the four defects are calculated. From the above images, it can be clearly seen that the proposed method has higher recall and precision than Faster R-CNN (res101), YOLOv2, FPN, and DSSD for pore defects, step defects, color inconsistency, and debris defects, and the mAP value of the proposed method is higher than that of the other comparison methods. Among them, pore defects have good detection effects on all detection algorithms compared with the other three defects. We consider that this is because pore defects have more obvious boundaries than the other three defects and are more different from the background, so they all have good detection results. As for the color difference defect, the results are the least satisfactory under different detection methods. This is mainly because the difference between the defect and the background is too small, which creates certain difficulties in feature extraction for target detection. However, compared with other methods, the detection accuracy of the color difference defect method in this paper is slightly higher.

[0108] Model size comparison:

[0109] First, we compared the accuracy and speed of the improved feature extraction network in this paper with the existing feature extraction network on the ImageNet dataset. The results are shown in Table 3:

[0110] Table 3 Comparison of backbone networks in terms of accuracy and speed

[0111] Next, we will analyze and compare the size of the models. We mainly select the base algorithm YOLOv3 model before improvement as the comparison algorithm in this article, as shown in the figure:

[0112] It can be clearly seen from Figure 11 that the proposed method has faster running time, smaller floating-point calculation amount, smaller model and smaller number of computable parameters compared to the YOLOv3 method, and achieves a higher F value.

[0113] Thus far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present invention.

Claims

1. A method for detecting commutator inner side image defects based on deep learning, characterized in that: include: Step S1, processing the original image of the inner side of the commutator to be inspected by an image processing method and performing normalization setting, wherein the image processing method includes rotation, translation, flipping, scaling, and contrast-limited adaptive histogram equalization algorithm; Step S2, setting the normalized image to a fixed size, and inputting the fixed-size image into a feature extraction network, wherein the feature extraction network obtains feature maps of different levels of the image, wherein the feature extraction network extracts image features through depthwise separable convolution; Step S3, the feature integration network scales the feature maps of different levels to the same scale and then connects them, and the feature integration network inputs the connected feature maps into the feature recombination network; Step S4, the feature union network combines the multiple multi-scale features generated by the feature recombination network into a multi-level multi-scale feature pyramid; Step S5, predicting the defects of the expanded image on the inner side of the commutator according to the multi-level and multi-scale feature pyramid obtained by the feature joint network, so that the detection effect meets the preset standard.

2. The method for detecting commutator inner side image defects based on deep learning according to claim 1, characterized in that: In step S2, the feature extraction network selects the YOLOv3 algorithm as the base algorithm of the commutator inner side image defect target detection method, wherein YOLOv3 uses Darknet-53 to implement feature extraction.

3. The method for detecting commutator inner side image defects based on deep learning according to claim 2, characterized in that: The feature extraction network includes a dilated convolution, where the output of the dilated convolution is y[i] Among them, x[i] represents a one-dimensional input signal, ω[l] represents a convolution kernel of length l, and r represents the expansion coefficient, which is the constraint scale of the convolution kernel expansion.

4. The method for detecting commutator inner side image defects based on deep learning according to claim 3, characterized in that: The feature extraction network uses deep separable convolution for feature extraction. Deep separable convolution reduces the amount of calculation. The ratio of the amount of calculation of deep separable convolution to standard convolution is, Among them, Dk is the convolution kernel size, M is the input channel, and N is the output channel.

5. The method for detecting commutator inner side image defects based on deep learning according to claim 3, characterized in that: The feature extraction network includes a separable residual structure, which can be quickly connected with a depth-wise separable convolution.

6. The method for detecting commutator inner side image defects based on deep learning according to claim 5, characterized in that: In step S3, the feature integration network uses a 1×1 convolutional layer to compress the channels of the input features and uses a connection operation to concatenate feature maps.

7. The method for detecting commutator inner side image defects based on deep learning according to claim 6, characterized in that: The feature recombination network uses continuous 3×3 convolutional layers to perform convolution downsampling operations on the feature maps input by the feature integration network. In the recombination stage, 3×3 convolutional layers with a step size of 1 are used, and the feature map output of each layer is used as a reference feature set.

8. The method for detecting commutator inner side image defects based on deep learning according to claim 7, characterized in that: The feature reconstruction network adopts upsampling and pixel-wise summation on the branches of the recombination stage.

9. The method for detecting commutator inner side image defects based on deep learning according to claim 8, characterized in that: In step S4, the feature joint network combines features in an adaptive manner through a feature attention mechanism, including: Step S41: In the channel attention mechanism, the global spatial information is compressed into one channel, and the joint features are globally averaged and pooled to obtain the statistics x∈R C is generated by shrinking P in the spatial dimensions W×H, where the cth element of x is calculated as follows: Among them, F sq (u c ) represents the global spatial statistics of the cth element of x, p c (i, j) represents the statistical information of the cth element at the (i, j)th position in the spatial dimension W×H; Step S42, fully capturing channel dependency by activating the joint information in step S41, i.e., aggregating features s, wherein, s=F ex (x,W)=σ(W2δ(W1x)) Among them, σ represents the ReLU function: δ represents the sigmoid function: r is the reduction ratio. The feature joint network uses two fully connected layers as the gate mechanism, that is, the dimension reduction layer parameter is W1, the dimension increase layer is W2, and R is the dimension reduction ratio.

10. The method for detecting commutator inner side image defects based on deep learning according to claim 9, characterized in that: In step S5, the loss function used to predict the defects of the expanded image on the inner side of the commutator includes three parts: the bounding box coordinate error, the bounding box confidence error and the classification error. The loss function is: Among them, the first term is the loss function of the center coordinate of the bounding box, the second term is the loss function of the height and width of the bounding box, the third term is the confidence loss function of the bounding box with objects, the fourth term is the confidence loss function of the bounding box without objects, the fifth term is the classification error of the unit grid with objects, S is the unit grid division coefficient of the image, B is the number of bounding boxes predicted for each grid, C is the total number of classifications, p is the category probability, It means that there is an object in the i-th unit grid, and the j-th bounding box in the cell predicts the target, λ coord and λ noobj are the weight coefficients of different loss functions.

Citation Information

Patent Citations

  • License plate detection model based on improved YOLOv3 network and construction method

    CN111209921A

  • Sea surface target detection and identification method and system based on deep learning

    CN114140680A

  • Remote sensing image multi-scale target detection and identification method based on lightweight network

    CN114170526A

  • Multi-scale feature fusion bridge detection method based on depth separable convolution

    CN115223017A

  • Method for detecting doubling defect of motor rotor by using deep learning

    CN115564769A

Cited By

  • Winter fish classification and identification method based on MG-ShuffleNet network structure

    CN118942123A

  • A winter fishing classification and recognition method based on MG-ShuffleNet network structure

    CN118942123B

  • Visual detection system for rubber pipe joint buckling and pressing and detection method thereof

    CN119048505A

  • Power transmission line insulator defect detection method of adaptive enhancement module

    CN119379640A

  • A transmission line insulator defect detection method based on adaptive enhanced module

    CN119379640B