Commutator inner side image defect detection method based on fusible feature pyramid
By adopting a structure based on the fusion feature pyramid in the detection of image defects on the inside of the commutator, the problem of limited detection accuracy and speed in the existing technology is solved, and more efficient feature information extraction is achieved by fusing multi-level and multi-scale features. and detection effects.
Patent Information
- Application Number
- PCT/CN2024/084862
- 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
The existing feature pyramid cannot effectively integrate multi-level features and multi-scale features in the detection of image defects on the inside of the commutator, resulting in limited detection accuracy and speed.
Using a fusion-based feature pyramid structure, multi-level features are extracted through the feature extraction network and input into the feature splicing module of the multi-scale feature pyramid network to generate multi-scale features, and the multi-level features and multi-scale features are fused through the feature aggregation module to form Fusionable feature pyramids are trained with convolutional neural networks to improve detection accuracy and speed.
It achieves richer and more effective multi-level feature information extraction, breaks through the limitations of single-level feature representation after feature pyramid convolution, and improves the accuracy and speed of image defect detection inside the commutator.
Smart Images

Figure CN2024084862_10102024_PF_FP_ABST
Abstract
Description
Commutator inner side image defect detection method based on fusible feature pyramid Technical Field
[0001] The present invention relates to the field of target detection, and in particular to a method for detecting defects in commutator inner side images based on a fusible feature pyramid. Background Art
[0002] In recent years, feature pyramids with different structures have been proposed and their functions have been continuously improved. However, the feature pyramids currently used only construct feature pyramid modules based on their feature extraction networks with multi-scale pyramid structures. The multi-scale of these feature pyramids is mainly designed for classification tasks. They are not very suitable for detecting defective images in the field of commutator inner side image defect detection, and have limitations for detection tasks. It is impossible to fuse multi-level features and multi-scale features to obtain richer feature information and improve the accuracy and speed of commutator inner side image defect detection.
[0003] Chinese patent ZL201910242976.2 discloses a feature-enhanced target detection method based on a feature pyramid network. Its technical feature is to add a top-down module TDM, a bottom-up module BUM, and a fusion extension module FEM to the backbone network model used before sending it to the target detector, thereby forming a new enhanced feature pyramid network eFPN. However, it only takes into account the features output by the backbone network, and the feature information obtained is less and less accurate.
[0004] Summary of the Invention
[0005] To this end, the present invention provides a method for detecting defects in the inner side image of a commutator based on a fusible feature pyramid, which can solve the technical problem of being unable to fuse multi-level features and multi-scale features to solve the limitations of the feature pyramid in detecting defects in the inner side image of the commutator.
[0006] To achieve the above objectives, the present invention provides a method for detecting defects in commutator inner side images based on a fusible feature pyramid, comprising:
[0007] Step S1: The feature extraction network extracts multi-level features of the inner image of the commutator to be inspected, and inputs the extracted multi-level features into the feature splicing module of the multi-scale feature pyramid network;
[0008] Step S2: the feature splicing module splices the input multi-level features and inputs the spliced multi-level features into the encoding and decoding module in the multi-scale feature pyramid network;
[0009] Step S3, the encoding and decoding module generates features with multiple scales based on the features input by the feature splicing module;
[0010] In step S4, the feature aggregation module of the multi-scale feature pyramid network aggregates the multi-level features in step S1 and the multi-scale features in step S3 into a fusible feature pyramid. The detection network obtains a convolutional neural network by adding several convolution layers after the fusible feature pyramid. The aggregation process of the multi-level features and the multi-scale features by the feature aggregation module includes:
[0011] Step S41, feature-connecting the multi-scale features and the multi-level features along the channel dimension of equal proportions to form a feature block;
[0012] Step S42, compressing the global spatial information into a channel description and performing global average pooling on the feature blocks;
[0013] Step S43, comprehensively capturing channel dependencies to utilize information gathered in the compression operation;
[0014] Step S44, re-weighting the feature blocks and outputting them;
[0015] In step S5, the convolutional neural network is trained, and a set of images of the inner side of the commutator to be detected is sequentially input into the trained convolutional neural network to obtain a set of prediction frames, and the coordinate values of the prediction frames are marked on the images to obtain the detection results.
[0016] Furthermore, in the step S42, the feature aggregation module compresses the global spatial information into a channel description through the Squeeze operation and performs global average pooling on the feature blocks. Formally, the statistics z∈R C It is generated by shrinking U in the spatial dimension W×H, where the cth element of z is,
[0017] Among them, u c (i, j) represents the statistical information of the cth element at the (i, j)th position in the spatial dimension W×H.
[0018] Furthermore, in step S43, the feature aggregation module fully captures channel dependencies through the Excitation operation, that is, aggregates features, s=F ex (z, W) = σ(W2δ(W1z))
[0019] Among them, σ represents the ReLU function, δ represents the sigmoid function, R represents the reduction ratio, and the bottleneck of two fully connected (FC) layers is used to parameterize the gate mechanism, that is, the dimension reduction layer parameter is W1, the dimension reduction ratio is r, and W2 is the dimension increase layer to reweight the output X of U.
[0020] Furthermore, in step S44, the feature aggregation module re-weights and outputs the feature blocks, wherein:
[0021] Among them, X represents the final output of the SE block, Representative fusion pyramid features With s c The product of .
[0022] Furthermore, in step S1, the feature extraction network is constructed by stacking a Darknet-53 network using a shuttle residual structure, and a downsampling operation is performed using a Mobilenet structure with a step size of 2, wherein the shuttle residual structure is formed by connecting the Darknet structure and the residual structure in YOLOv3.
[0023] Furthermore, in step S2, the feature concatenation module performs an upsampling operation on the input multi-level features and scales the deep features to the same scale before performing the concatenation operation.
[0024] Furthermore, in step S3, the encoding and decoding module includes an encoder and a decoder, and uses continuous 3×3 convolutional layers to perform convolution downsampling operations on the features input by the feature splicing module, wherein the feature output of each layer of the encoder is used as a reference feature set, and the decoder is a series of 3×3 convolutional layers with a step size of 1, and the decoder branch includes an upsampling layer and a pixel-by-pixel summation operation.
[0025] Furthermore, in step S5, the training of the convolutional neural network includes:
[0026] Step S51: The detection network obtains a number of three-dimensional tensor-encoded prediction boxes, objects, and class predictions, and performs bounding box regression and class regression in combination with a loss function;
[0027] In step S52 , the Soft-NMS method is used to filter the highly overlapping prediction boxes to obtain the final prediction bounding box.
[0028] Furthermore, in step S51, the detection network normalizes the parameters x, y, w and h of the prediction box, wherein:
[0029] The detection network divides the commutator image to be detected into a grid of s×s, where S=s, (x0, y0) is the predicted coordinate of the center point of the bounding box, the grid coordinate of the center point is (row, col), and width imgis the width of the commutator image to be detected, height img The height of the commutator image to be detected, width box is the width and height of the predicted bounding box box The predicted bounding box contains four parameters: x, y, w, and h. x and y refer to the X and Y coordinates of the center point of the predicted box, w and h refer to the width and height of the predicted box. The point (x0, y0) is the center point of the bounding box, and its grid coordinates are (row, col). Width img and height img Represents the width and height of the entire image, width box and height box Represents the width and height of the bounding box.
[0030] Furthermore, in step S52, the Soft-NMS algorithm is:
[0031] Among them, B represents the initial list; S represents the detection score, and the function f(IOU(M,b i ))for:
[0032] Among them, M represents the detection box with the highest score, b i Represents the processed box, N t represents the threshold and a represents the parameter.
[0033] Compared with the prior art, the beneficial effect of the present invention is that the present invention provides a multi-scale feature pyramid network, which can process the multi-level features extracted by the feature extraction network to generate multi-scale features, and fuse the multi-scale features with the multi-level features to form a fusible feature pyramid. The fusible feature pyramid structure not only takes into account the features output by the backbone network, but also adopts a new feature pyramid structure based on a U-shaped codec. In addition, the present invention updates and transforms the traditional residual block and proposes a new shuttle-shaped residual block to add depth-separable convolution and maintain the feature expression ability of the residual block while reducing the amount of calculation. It is more suitable for the detection of image defects on the inner side of the commutator and improves the detection accuracy and speed.
[0034] In particular, the feature aggregation module forms a fusible feature pyramid by fusing multi-level features and multi-scale features. The feature extraction of the fusible feature pyramid is more standardized, and richer and more effective multi-level feature information can be further obtained. It breaks through the limitation that the feature map after the convolution of the feature pyramid is mainly composed of the feature representation of a single level, and is more suitable for the detection of image defects on the inner side of the commutator.
[0035] In particular, the shuttle residual structure is a fusion of the traditional convolution module in MobileNet, which is designed as a deep convolution structure and a point convolution structure. The feature extraction network is built by stacking the Darknet-53 network using the shuttle residual structure, which makes feature extraction more comprehensive and can improve detection efficiency by reducing the amount of calculation while keeping the accuracy basically unchanged.
[0036] In particular, the purpose of adding upsampling layers and pixel-wise summation operations on the decoder branches is to keep the feature map size the same, enhance learning ability and maintain feature smoothness.
[0037] In particular, the detection network performs normalization processing on the prediction box parameters, which can reduce the impact of singular sample data and speed up the network learning speed.
[0038] In particular, the NMS algorithm directly sets the IOU of the largest box with a score greater than a certain threshold to zero. The algorithm is relatively rough. Therefore, the detection network uses the Soft-NMS algorithm. The detection network sets a threshold and eliminates the prediction boxes with category confidence lower than the threshold to obtain the final prediction box, thereby improving detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] FIG1 is a schematic diagram of the structure of a commutator inner side image defect detection system based on a fusible feature pyramid according to an embodiment of the present invention;
[0040] FIG2 is a flow chart of a method for detecting defects in commutator inner side images based on a fusible feature pyramid according to an embodiment of the present invention;
[0041] FIG3 is a schematic diagram of the specific structure of a feature aggregation module according to an embodiment of the present invention;
[0042] FIG4 is a schematic diagram of a shuttle residual structure according to an embodiment of the present invention;
[0043] FIG5 is a schematic diagram of the specific structure of the characteristic splicing module according to an embodiment of the present invention;
[0044] FIG6 is a schematic diagram showing the specific structure of the encoding and decoding module according to an embodiment of the present invention;
[0045] FIG7 shows the test results of the LSVM+DPM algorithm and the RCNN algorithm according to the embodiment of the invention in this paper;
[0046] FIG8 shows the test results of the FasterR-CNN algorithm and the FasterR-CNN_ResNet_101 algorithm according to the embodiment of the invention in this paper;
[0047] FIG9 shows the test results of the Multi-taskCNN algorithm and the YOLOv2 algorithm according to an embodiment of the invention in this paper;
[0048] FIG10 is a test result of the Aston-EAS algorithm and the F-ConvNet algorithm according to an embodiment of the invention in this paper;
[0049] FIG11 is a test result of the MonoGRNet algorithm and the LTN algorithm according to an embodiment of the invention in this paper;
[0050] FIG12 is a test result of the YOLOv3 algorithm of the embodiment of the invention and the algorithm of this paper in this paper. DETAILED DESCRIPTION
[0051] 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.
[0052] 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.
[0053] 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.
[0054] 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.
[0055] Please refer to FIG1 , which is a schematic diagram of the structure of a commutator inner side image defect detection system based on a fusible feature pyramid according to an embodiment of the present invention, including:
[0056] A feature extraction network is used to extract multi-level features of the inner image of the commutator to be inspected;
[0057] A multi-scale feature pyramid network, which is connected to the feature extraction network and includes a feature splicing module, an encoding and decoding module, and a feature aggregation module, wherein the feature splicing module is used to splice features from multiple different levels of the feature extraction network, the encoding and decoding module is used to generate multi-scale features based on the features input by the feature splicing module, and the feature aggregation module is used to fuse the multi-level features and multi-scale features into a fusible feature pyramid;
[0058] A detection network is connected to the multi-scale feature pyramid network and is used to obtain a prediction frame of the image defect on the inner side of the commutator to be detected.
[0059] Please refer to FIG2 , which is a flow chart of a method for detecting defects in an inner side image of a commutator based on a fusible feature pyramid according to an embodiment of the present invention, including:
[0060] Step S1: The feature extraction network extracts multi-level features of the inner image of the commutator to be inspected, and inputs the extracted multi-level features into the feature splicing module of the multi-scale feature pyramid network;
[0061] Step S2: the feature splicing module splices the input multi-level features and inputs the spliced multi-level features into the encoding and decoding module in the multi-scale feature pyramid network;
[0062] Step S3, the encoding and decoding module generates features with multiple scales based on the features input by the feature splicing module;
[0063] In step S4, the feature aggregation module of the multi-scale feature pyramid network aggregates the multi-level features in step S1 and the multi-scale features in step S3 into a fusible feature pyramid. The detection network obtains a convolutional neural network by adding several convolution layers after the fusible feature pyramid. The aggregation process of the multi-level features and the multi-scale features by the feature aggregation module includes:
[0064] Step S41, feature-connecting the multi-scale features and the multi-level features along the channel dimension of equal proportions to form a feature block;
[0065] Step S42, compressing the global spatial information into a channel description and performing global average pooling on the feature blocks;
[0066] Step S43, comprehensively capturing channel dependencies to utilize information gathered in the compression operation;
[0067] Step S44, re-weighting the feature blocks and outputting them;
[0068] In step S5, the convolutional neural network is trained, and a set of images of the inner side of the commutator to be detected is sequentially input into the trained convolutional neural network to obtain a set of prediction frames, and the coordinate values of the prediction frames are marked on the images to obtain the detection results.
[0069] In step S42, the feature aggregation module compresses the global spatial information into a channel description through the Squeeze operation and performs global average pooling on the feature blocks. Formally, the statistics z∈R C It is generated by shrinking U in the spatial dimension W×H, where the cth element of z is,
[0070] Among them, u c (i, j) represents the statistical information of the cth element at the (i, j)th position in the spatial dimension W×H.
[0071] In step S43, the feature aggregation module fully captures channel dependencies through the Excitation operation, that is, aggregates features, s = F ex (z, W) = σ(W2δ(W1z))
[0072] Among them, σ represents the ReLU function, δ represents the sigmoid function, Represents the reduction ratio, and uses the bottleneck of two fully connected (FC) layers to parameterize the gate mechanism, that is, the dimension reduction layer parameter is W1, the dimension reduction ratio is r, and W2 is the dimension increase layer parameter, thereby re-weighting U to output X:
[0073] In step S44, the feature aggregation module re-weights and outputs the feature blocks, wherein:
[0074] Among them, X represents the final output of the SE block, Representative fusion pyramid features With s c The product of .
[0075] Specifically, the feature aggregation module forms a fusible feature pyramid by fusing multi-level features and multi-scale features. The feature extraction of the fusible feature pyramid is more standardized, and richer and more effective multi-level feature information can be further obtained. It breaks through the limitation that the feature map after the convolution of the feature pyramid is mainly composed of the feature representation of a single level, and is more suitable for the detection of image defects on the inside of the commutator.
[0076] Specifically, the present invention does not make any specific restrictions on the structure of the feature aggregation module, as long as it can meet its functional requirements. The embodiment of the present invention provides a preferred feature aggregation module specific structure. Please refer to Figure 3, which is a schematic diagram of the specific structure of the feature aggregation module of the embodiment of the present invention.
[0077] In step S1, the feature extraction network is constructed by stacking a Darknet-53 network using a shuttle residual structure, and a downsampling operation is performed using a Mobilenet structure with a step size of 2, wherein the shuttle residual structure is formed by connecting the Darknet structure and the residual structure in YOLOv3.
[0078] Specifically, the shuttle residual structure is a fusion of the traditional convolution module in MobileNet, which is designed as a deep convolution structure and a point convolution structure. The feature extraction network is built by stacking the Darknet-53 network using the shuttle residual structure, which makes the feature extraction more comprehensive and can improve the detection efficiency by reducing the amount of calculation while keeping the accuracy basically unchanged.
[0079] Specifically, please refer to Figure 4, which is a schematic diagram of the shuttle residual structure of an embodiment of the present invention. The present invention does not limit the shuttle residual structure, as long as it can meet the feature extraction requirements. The embodiment of the present invention provides a preferred embodiment, including first setting the number of input channels to Ci, using a 1×1 convolution block to increase the dimension to t×Ci, then performing a filtering operation through a 3×3 filter, and finally reducing the dimension to Ci through a 1×1 convolution block.
[0080] In step S2, the feature concatenation module performs an upsampling operation on the input multi-level features and scales the deep features to the same scale before performing the concatenation operation.
[0081] Specifically, the present invention does not make any specific limitation on the structure of the feature splicing module, as long as it can splice features of different levels. The embodiment of the present invention provides a preferred feature splicing module specific structure. Please refer to Figure 5, which is a schematic diagram of the specific structure of the feature splicing module of the embodiment of the present invention, wherein F1, F2, and F3 are input features of the feature splicing module, 896, 1×1, and 256 mean that the input channel is 896, the convolution kernel size is 1×1, and the output channel is 256.
[0082] In step S3, the encoding and decoding module includes an encoder and a decoder, and uses continuous 3×3 convolutional layers to perform convolution downsampling operations on the features input by the feature splicing module, wherein the feature output of each layer of the encoder is used as a reference feature set, and the decoder is a series of 3×3 convolutional layers with a step size of 1, and the decoder branch includes an upsampling layer and a pixel-by-pixel summation operation.
[0083] Specifically, the purpose of adding upsampling layers and pixel-by-pixel summation operations on the decoder branches is to keep the feature map size the same, enhance learning ability and maintain feature smoothness.
[0084] Specifically, the present invention does not specifically limit the structure of the encoding and decoding module, as long as it can achieve its function. The embodiment of the present invention provides a preferred encoding and decoding module specific structure, as shown in Figure 6, which is a schematic diagram of the specific structure of the encoding and decoding module according to the embodiment of the present invention, wherein 256, 1, 256 means: the input channel is 256, the step size is 1, the output channel is 256, and the symbol It represents pixel-by-pixel addition.
[0085] In step S5, the training of the convolutional neural network includes:
[0086] Step S51: The detection network obtains a number of three-dimensional tensor-encoded prediction boxes, objects, and class predictions, and performs bounding box regression and class regression in combination with a loss function;
[0087] In step S52 , the Soft-NMS method is used to filter the highly overlapping prediction boxes to obtain the final prediction bounding box.
[0088] In step S51, the detection network normalizes the parameters x, y, w and h of the prediction box. The predicted bounding box contains four parameters x, y, w and h. x and y refer to the X and Y coordinates of the center point of the prediction box, and w and h refer to the width and height of the prediction box. We set S = 7 and divide the image into a 7×7 grid. The dotted area represents the position of the bounding box. The point (x0, y0) is the center point of the bounding box. The grid coordinates are (row, col), and width img and height img Represents the width and height of the entire image, width box and height box Represents the width and height of the bounding box. Therefore, the normalization process is:
[0089] The detection network divides the commutator image to be detected into a grid of s×s, where S=s, (x0, y0) is the predicted coordinate of the center point of the bounding box, the grid coordinate of the center point is (row, col), and width img is the width of the commutator image to be detected, height img The height of the commutator image to be detected, width box is the width and height of the predicted bounding box box is the width of the predicted bounding box.
[0090] Specifically, the detection network uses K-Means clustering to determine the prediction box prior.
[0091] Specifically, the detection network normalizes the prediction box parameters, which can reduce the impact of singular sample data and speed up network learning.
[0092] In step S52, the Soft-NMS algorithm is:
[0093] Among them, B represents the initial list; S represents the detection score, and the function f(IOU(M,b i ))for
[0094] Among them, M represents the detection box with the highest score, b i Represents the box being processed. N t Represents the threshold and a represents the parameter. If the overlap of bounding boxes is high, then a lower score is assigned, otherwise, the original detection score is kept.
[0095] Specifically, the NMS algorithm directly sets the IOU of the largest box with a score greater than a certain threshold to zero. The algorithm is relatively rough, so the detection network uses the Soft-NMS algorithm. The detection network sets a threshold and eliminates the prediction boxes with category confidence lower than the threshold to obtain the final prediction box, thereby improving the detection accuracy.
[0096] Specifically, the present invention does not impose any specific restrictions on the training process of the convolutional neural network, as long as the training can be completed. The embodiment of the present invention provides a preferred embodiment, including:
[0097] Step s1, capturing a set of image defect data of traffic diverter internal testing in real scenes, denoted as X: [X1, X2, X3...Xn];
[0098] Step s2: crop and scale the images to 416 pixels in length and 416 pixels in width. Label the image set X using the dataset annotation software Labelimg to obtain the commutator surface defect dataset, called SD_data.
[0099] Step s3: pre-train the feature extraction network on the Imagenet dataset to obtain a pre-trained feature extraction network, and train the overall model using SD_data combined with the loss function;
[0100] In step s4, the training image is passed through the feature extraction network to obtain a convolution feature map. Then, after a series of convolution and upsampling processes, an N×N (N is the length and width of the convolution feature map) three-dimensional tensor encoding of the bounding box, object and class prediction is obtained. Combined with the loss function, border regression and category regression are performed. Finally, the Soft-NMS method is used to filter highly overlapping areas.
[0101] Specifically, the present invention does not impose any specific restrictions on the implementation of the detection method, as long as the detection results meet the preset standards. The embodiment of the present invention provides a preferred implementation scheme, including:
[0102] Step S10: Obtain a picture set X.
[0103] In step S20, image X is fed into the trained convolutional neural network in sequence to obtain a set of prediction boxes. Soft-NMS is used to filter prediction boxes with high overlap, and the final result obtained by the neural network is output: the coordinates (x, y) of the upper left corner of the prediction box, and the width W and height H of the prediction box.
[0104] Step S30: Mark the coordinate values on the image to obtain the final predicted frame.
[0105] Specifically, the present invention provides test results and analysis, including comparative tests between the proposed algorithm and the YOLOv3 algorithm under different brightness conditions and under different road congestion conditions. In these tests, a defect in the labeled commutator image is considered detected only when the IOU between the detected defect area and the true labeled defect area is greater than 70%. The recall and precision rates are then calculated to obtain the F-value. Each experiment is repeated three times, and the average of the three F-values is used as the evaluation result.
[0106] Comparative Tests Under Different Light Intensities: In actual image detection, varying light intensities can affect detection results. Therefore, the comparative tests were conducted under three conditions: large-scale, medium-scale, and small-scale. The goal was to compare the detection performance of the two algorithms under different environments. The tests first randomly sampled several images from the original test set and classified them according to the three conditions. Random sampling was then repeated until there were 100 images in each of the three condition categories. In each comparative test, 50 images were randomly sampled from each comparison condition as the test set. The two algorithms were used to detect the images in the test set. The detection results are shown in Table 1.
[0107] Table 1 Image comparison test results between YOLOv3 and the proposed algorithm under different environmental conditions
[0108] The comprehensive results in Table 1 were calculated by summing the total number of commutator internal test image defects, the number of detected commutator internal test image defects, and the number of correctly detected commutator internal test image defects in each comparison test dataset. The overall recall, accuracy, and F-value were then calculated using the same method used for each test. The results in Table 1 show that compared to YOLOv3, this method improves detection performance under various lighting conditions. Specifically, large-scale detection accuracy improved by 5.64%, medium-scale defect detection improved by 5.17%, and small-scale detection improved by 7.09%. Compared to YOLOv3, this method can better adapt to changes in lighting.
[0109] The datasets used in this paper consist of images captured on commutators. The proposed method was trained and tested on this dataset. A comprehensive evaluation of this method was conducted, comparing it with classic object detection methods and recent methods for defect detection in commutator internal image testing, such as LSVM+DPM, RCNN, Faster R-CNN, Faster R-CNN (ResNet version), Multi-task CNN, Aston-EAS, F-ConverNet, MonoGRNet, LTN, YOLOv2, and YOLOv3. Figures 6-12 show the performance comparisons for these methods. Table 2 lists the performance comparisons for each algorithm at three different difficulty levels using this dataset.
[0110] Table 2 Average accuracy of three different difficulty levels in this dataset
[0111] This dataset consists of real-world images captured by on-board cameras on the road. Testing our commutator internal image defect detection algorithm on this dataset is highly relevant to real-world applications. As shown in the PR graphs for each algorithm and Table 2, our algorithm achieves APs of 95.29%, 92.42%, and 82.32% under the three different difficulty levels (Easy, Moderate, and Hard) on this dataset. Compared to the base YOLOv3 object detection model, our algorithm achieves AP improvements of 0.29%, 3.50%, and 4.63% at all difficulty levels. The reason for this accuracy improvement is closely related to the addition of the feature pyramid module. In the YOLOv3 object detection model, the bottom convolutional feature map is simply upsampled by a factor of 2 and then concatenated with the feature map from the previous stage to generate the current stage's feature map. In contrast, in our commutator internal image defect detection model, the three-scale feature maps generated by the backbone network are first fused to form a basic feature map, which is then fed into a U-shaped encoder-decoder to generate a higher-order multi-scale feature map. The multi-scale feature map generated by the U-shaped encoder-decoder is then fused with the three-scale feature map generated by the original backbone network, and a feature attention module is added to enhance feature representation. Compared to the FPN-like multi-scale detection method used in the YOLOv3 detection model, our model's feature pyramid has higher feature representation, enabling better detection of small objects in the image and generating more semantic information, further improving overall detection performance. This is also one of the reasons for the significant improvement at the Hard difficulty level.
[0112] Table 2 shows a comparison with the R-CNN series of algorithms. Compared to two-stage object detection algorithms such as R-CNN and Faster R-CNN, the proposed algorithm, based on the improved single-stage YOLOv3 object detection algorithm, treats the commutator internal image defect detection process as a regression problem. Unlike the RCNN series, it does not first use the Region Proposal Network (RPN) to generate a large number of candidate boxes before performing commutator internal image defect recognition. This results in significantly improved speed. As can be seen in the table, the runtime of the R-CNN series detection algorithms is over 1000ms, while the runtime (ms) of the proposed algorithm and the one-stage algorithms such as the YOLO series do not exceed two digits. The accuracy is also improved compared to the R-CNN series, mainly due to the full combination of shallow spatial information and deep semantic information (except for the YOLOv2 algorithm). The YOLOv2 algorithm is the fastest method for commutator internal image defect detection among the algorithms listed in the table, but it does not consider the multi-scale detection problem of images. Compared to currently popular commutator internal image defect detection algorithms, our proposed algorithm achieves significant improvements in accuracy over the Multi-taskCNN algorithm, Aston-AES algorithm, MonoGRNet algorithm, and LTN algorithm, while also outperforming them in speed. While our proposed algorithm is not as accurate as the F-ConverNet algorithm at the Easy difficulty level, it is several times faster. We believe our proposed algorithm is more effective for commutator internal image defect detection in real-world scenarios.
[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 commutator inner side image defect detection method based on a fusible feature pyramid, characterized in that: include: Step S1, the feature extraction network extracts multi-level features of the inner image of the commutator to be detected, and inputs the extracted multi-level features into the feature splicing module of the multi-scale feature pyramid network; Step S2, the feature splicing module splices the input multi-level features, and inputs the spliced multi-level features into the encoding and decoding module in the multi-scale feature pyramid network; Step S3, the encoding and decoding module generates features with multiple scales according to the features input by the feature splicing module; Step S4, the feature aggregation module of the multi-scale feature pyramid network aggregates the multi-level features in step S1 and the multi-scale features in step S3 into a fusible feature pyramid, and the detection network obtains a convolutional neural network by adding several convolution layers after the fusible feature pyramid, wherein the aggregation process of the multi-level features and the multi-scale features by the feature aggregation module includes: Step S41, feature-connecting the multi-scale features and the multi-level features along the channel dimensions of equal proportions to form a feature block; Step S42, compressing the global spatial information into a channel description, and performing global average pooling on the feature blocks; Step S43, comprehensively capturing channel dependencies to utilize information gathered in the compression operation; Step S44, re-weighting the feature blocks and outputting them; Step S5, training the convolutional neural network, and inputting the picture set of the inner side image of the commutator to be detected into the trained convolutional neural network in sequence to obtain a set of prediction boxes, marking the coordinate values of the prediction boxes on the pictures, and obtaining the detection results.
2. The method for detecting defects of the inner side image of a commutator based on a fusible feature pyramid according to claim 1, characterized in that: In step S42, the feature aggregation module compresses the global spatial information into a channel description through a Squeeze operation, and performs global average pooling on the feature blocks. Formally, the statistics z∈R C is generated by shrinking U in the spatial dimension W×H, where the cth element of z is, Among them, u c (i, j) represents the statistical information of the cth element at the (i, j)th position in the spatial dimension W×H.
3. The commutator inner side image defect detection method based on fusible feature pyramid according to claim 2, characterized in that: In step S43, the feature aggregation module captures channel dependencies comprehensively through the Excitation operation, that is, aggregates features, s = F ex (z, W) = σ(W2δ(W1z)) Among them, σ represents the ReLU function, δ represents the sigmoid function, R represents the reduction ratio, and the bottleneck of two fully connected (FC) layers is used to parameterize the gate mechanism, that is, the dimension reduction layer parameter is W1, the dimension reduction ratio is r, and W2 is the dimension increase layer parameter to re-weight the output X of U.
4. The method for detecting defects of the inner side image of a commutator based on a fusible feature pyramid according to claim 3, characterized in that: In step S44, the feature aggregation module re-weights and outputs the feature blocks, wherein: Among them, X represents the final output of the SE block, Representative fusion pyramid features With s c The product of .
5. The method for detecting defects of the inner side image of a commutator based on a fusible feature pyramid according to claim 4, characterized in that: In step S1, the feature extraction network is constructed by stacking a Darknet-53 network using a shuttle residual structure, and a downsampling operation is performed using a Mobilenet structure with a step size of 2, wherein the shuttle residual structure is formed by connecting the Darknet structure in YOLOv3 with the residual structure.
6. The method for detecting defects of the inner side image of a commutator based on a fusible feature pyramid according to claim 5, characterized in that: In step S2, the feature concatenation module performs an upsampling operation on the input multi-level features and scales the deep features to the same scale before performing the concatenation operation.
7. The method for detecting defects of the inner side image of a commutator based on a fusible feature pyramid according to claim 6, characterized in that: In step S3, the encoding and decoding module includes an encoder and a decoder, and uses continuous 3×3 convolutional layers to perform convolution downsampling operations on the features input by the feature splicing module, wherein the feature output of each layer of the encoder is used as a reference feature set, and the decoder is a series of 3×3 convolutional layers with a step size of 1, and the decoder branch includes an upsampling layer and a pixel-by-pixel summation operation.
8. The method for detecting defects of the inner side image of a commutator based on a fusible feature pyramid according to claim 7, characterized in that: In step S5, the training of the convolutional neural network includes: Step S51, the detection network obtains a number of three-dimensional tensor-encoded prediction boxes, objects, and class predictions, and performs box regression and class regression in combination with a loss function; In step S52, the Soft-NMS method is used to filter the highly overlapping prediction boxes to obtain the final prediction bounding box.
9. The method for detecting defects of the inner side image of a commutator based on a fusible feature pyramid according to claim 8, characterized in that: In step S51, the detection network normalizes the parameters x, y, w and h of the prediction box, where: The detection network divides the commutator image to be detected into a grid of s×s, where S=s, (x0, y0) is the predicted coordinate of the center point of the bounding box, the grid coordinates of the center point are (row, col), and width img is the width of the commutator image to be detected, height img The height of the commutator image to be detected, width box is the width of the predicted bounding box, height box is the width of the predicted bounding box, where the predicted bounding box contains four parameters: x, y, w, and h. x and y refer to the X and Y coordinates of the center point of the predicted box, w and h refer to the width and height of the predicted box. The point (x0, y0) is the center point of the bounding box, and its grid coordinates are (row, col). img and height img Represents the width and height of the entire image, width box and height box Represents the width and height of the bounding box.
10. The method for detecting defects of the inner side image of a commutator based on a fusible feature pyramid according to claim 9, characterized in that: In step S52, the Soft-NMS algorithm is: Among them, B represents the initial list; S represents the detection score, and the function f(IOU(M,b i ))for: Among them, M represents the detection box with the highest score, b i Represents the processed box, N t represents the threshold and a represents the parameter.
Citation Information
Patent Citations
Feature pyramid neural network architecture search method based on multi-information path aggregation
CN112699953A
Remote sensing image scene classification method based on multi-level feature fusion of feature pyramid
CN112784779A
Insulator defect detection method and system based on deep learning
CN113205502A
Commutator inner side image defect detection method based on fusible feature pyramid
CN116152226A
Gland segmentation with deeply-supervised multi-level deconvolution networks
US20190205758A1
Cited By
Sputum specimen bacterium detection method based on YOLOV8
CN119007200A
Multi-scale feature fusion 3D printing defect detection method based on improved YOLOv8
CN119048495A
Building change area detection method, system and device and medium
CN119131701A
Target detection system and method based on multi-scale feature calibration
CN119180995A
Image rain removal method and device, equipment and storage medium
CN119295344A
