Contactor fault lossless automatic detection method based on deep learning model
By introducing the CA attention mechanism into the YOLOv5 model, the CA-YOLOv5 model is built to realize automatic detection of the internal structure images of the contactor and fault type identification, which solves the problems of inefficient and costly existing contactor fault detection methods, improves detection efficiency and accuracy, and reduces detection costs.
Patent Information
- Application Number
- CN202411948047.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-25
AI Technical Summary
The existing contactor fault detection methods are inefficient, expensive, and insufficiently accurate in diagnosis results. They rely on manual operations, making it difficult to meet the needs of intelligent development of rail transit.
The contactor failure non-destructive automatic detection method based on deep learning model is adopted, and the network structure of the YOLOv5 model is introduced through the CA attention mechanism to build the CA-YOLOv5 model to realize automatic detection of the internal structure images of the contactor and fault type identification.
It greatly improves the efficiency and accuracy of contactor fault detection, reduces inspection costs, reduces maintenance costs, improves inspection quality, ensures track driving safety, and promotes economic and social benefits.
Smart Images

Figure CN119887673A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of contactor fault detection methods, and in particular to introducing a non-destructive automatic detection method for contactor faults based on a deep learning model. Background Art
[0002] In the industrial field, contactors play a vital role in rail vehicles. As the core component of the electrical control system, their stability and reliability are extremely critical to the normal operation of the entire system. Once a contactor fails or is damaged, it may cause the EMU to slow down or stop, or even cause a fire, seriously affecting driving safety and possibly causing an accident.
[0003] Therefore, the Predictive Health Management (PHM) technology based on fault detection has received extensive attention. In PHM technology, fault assessment of contactors is one of the core contents, and accurate and efficient fault detection of the internal mechanical structure of contactors is a key step to ensure driving safety.
[0004] At present, the research on contactors mainly relies on electrical indicators to evaluate whether they are damaged, and life prediction and simulation research are carried out based on this. However, the fault detection of the internal mechanical structure of the contactor is mostly done manually, which is not only inefficient and costly, but also a heavy burden for enterprises in terms of maintenance and repair costs. Moreover, it is more dependent on the work experience of maintenance personnel, and the diagnosis of contactor faults is not accurate enough, and manual operation is prone to errors. With the surge in the number of contactors to be tested in recent years, according to the current detection efficiency, related testing companies will face increasing pressure, which will hinder the intelligent development of enterprises and rail transit.
[0005] To this end, a nondestructive automatic detection method for contactor faults based on deep learning model is proposed to solve the above problems. Summary of the invention
[0006] The present invention provides a non-destructive automatic detection method for contactor faults based on a deep learning model, aiming to improve the problems of low efficiency, high cost, inaccurate diagnostic results and large errors in manual detection of internal mechanical structure faults of contactors.
[0007] A non-destructive automatic detection method for contactor faults based on a deep learning model comprises the following steps:
[0008] Step 1: Collect several images of the internal structure of the contactor, preprocess and clean the images, enhance the images after removing incomplete or unclear images, establish a contactor image dataset, and obtain a labeled contactor image dataset by marking the contactor images of different fault types;
[0009] Step 2: Divide the labeled contactor image dataset into a training set and a test set using a cross-validation method;
[0010] Step 3: By introducing the CA attention mechanism into the network structure of the YOLOv5 model, a CA-YOLOv5 model is constructed;
[0011] Step 4: Input the training set into the parameters required for the CA-YOLOv5 model training to perform training, and obtain a trained CA-YOLOv5 model;
[0012] Step 5: Input the contactor images of the test set into the trained CA-YOLOv5 model. Each contactor image to be detected is marked with a fault type prediction box in the trained CA-YOLOv5 model and then output. The fault type, confidence level and location information of each contactor image in the test set are then displayed through different prediction boxes, thereby completing the detection of contactor faults.
[0013] As a further description of the above technical solution: in the step 1, the image of the internal structure of the contactor is an image taken using an X-ray device.
[0014] As a further description of the above technical solution: in the step 1, the image enhancement includes but is not limited to image rotation, image flipping, image scaling, cropping, pixel change and clarity adjustment.
[0015] As a further description of the above technical solution: in the step 1, the contactor images of different fault types in the contactor image data set are labeled using the LabelImg tool.
[0016] As a further description of the above technical solution: in the step 1, the fault types include: foreign matter, tilted contact, normally open contact (NO contact), normally closed contact (NC contact), and crooked spring.
[0017] As a further description of the above technical solution: in the step three, the YOLOv5 model network structure consists of four parts: Input input end, Backbone backbone network, Neck network, and Head prediction end.
[0018] As a further description of the above technical solution: The Input input end: preprocesses the data of the input image, including data enhancement, image size processing and adaptive anchor box calculation. The input image size is 640×640×3. In order to reduce information redundancy and improve inference speed, normalization processing is performed to improve detection performance. In addition, the original image is adaptively scaled and filled with minimal black edges to achieve better results. The adaptive anchor box calculation reversely updates the set initial anchor box, and obtains the appropriate anchor box value through continuous iterative parameters;
[0019] The Backbone network is responsible for extracting target features from the input image, including CBS module, C3 module and SPPF module. The CBS module encapsulates three parts including convolution (Conv2d), batch normalization and activation operations, and the filling effect is achieved using the automatic loading method, where Conv is the basic convolution unit of YOLOv5s. The CSP module consists of several bottleneck residual structural modules. The SPPF module uses the cascade of multiple small pool kernels and is an advanced version of SPP, which further improves the operation speed;
[0020] The Neck network: The feature map processed by Backbone will be passed to Neck. The Neck network is based on the residual structure of ResNet. The main task of this part is to further fuse the feature maps of different levels in order to capture richer spatial and semantic information. YOLOv5 uses FPN and PAN structures in this part. The top-down structural characteristics of FPN avoid that low-dimensional mapping information cannot affect high-dimensional mapping information, while PAN is just the opposite, which determines that the information is mapped from lower features to higher features, and transmits stronger localized features. These two together enhance the feature fusion capability of the neck network.
[0021] Head prediction end: The head part will process the feature map output by the neck network, output the category probability, confidence and coordinate information of each bounding box, and perform 1×1 convolution on the output feature map to expand the number of channels and reduce the number of features. The detection network consists of three detection layers with feature maps of different sizes for detecting target objects of different sizes.
[0022] As a further description of the above technical solution: in the step three, adding the CA attention mechanism after the SPPF layer in the Backbone network in the YOLOv5 model can better capture key data information and global features, thereby enhancing the model's ability to recognize details.
[0023] As a further description of the above technical solution: in the step three, a CA attention mechanism is added after the C3 convolution in the Neck network in the YOLOv5 model to more accurately locate and identify the target. When detecting the image output, this model helps to improve the detection accuracy, thereby more accurately determining the fault type of the internal mechanical structure of the contactor.
[0024] As a further description of the above technical solution: In the step 3, the CA attention mechanism process is as follows: First, the tensor size of the input feature map is C×H×W, and the CA attention mechanism applies pooling kernels of H×1 and 1×W in the height H and width W directions respectively, obtaining feature maps of size C×H×1 and C×1×W, and then these two feature maps are merged into the same dimension. Next, the features in the height and width directions are stacked and fused through a 1×1 convolution layer. After that, through convolution and normalization, the features are separated into two spatial directions again, and the tensors become C / r×H and C / r×W respectively. Finally, the attention weight is obtained through the Sigmoid function and multiplied with the original feature map to achieve the final feature map. Since the output range of the Sigmoid function is between 0 and 1, this feature enables the Sigmoid function to effectively binarize the features in the attention mechanism, thereby highlighting important features and suppressing unimportant features. At the same time, compared with other more complex activation functions, the calculation of the Sigmoid function is relatively simple, maintaining the computational efficiency and performance of the model.
[0025] An X-ray detection device that implements the non-destructive automatic detection method for contactor faults based on a deep learning model.
[0026] The present invention has the following beneficial effects:
[0027] The method for nondestructive automatic detection of contactor faults based on a deep learning model described in the present invention can effectively identify the fault type of the internal structure of the contactor, greatly improve the efficiency and accuracy of contactor fault detection, save computing resources, promote energy conservation and emission reduction, and thus reduce the economic cost of detection; the method for nondestructive automatic detection of contactor faults based on a deep learning model described in the present invention is of great significance for reducing contactor maintenance costs, improving detection quality, ensuring passenger and rail vehicle safety, and improving economic and social benefits. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a training test flow chart of the present invention;
[0029] Figure 2 It is a flow chart of the YOLOv5 model structure described in the present invention;
[0030] Figure 3This is a flowchart of the CA attention mechanism described in the present invention;
[0031] Figure 4 It is a flow chart of the CA-YOLOv5 model structure described in the present invention;
[0032] Figure 5 A schematic diagram showing the comparison between the input and output of an image with a foreign body fault;
[0033] Figure 6 A schematic diagram showing the comparison between the input and output of an image with a contact tilt fault;
[0034] Figure 7 The diagram is a comparison diagram of the input and output of the fault images of normally open contact, normally closed contact, and spring distortion. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. The present invention is further illustrated and described by specific implementation methods below, but is not limited to this:
[0036] Step 1: Use X-ray equipment to capture several images of the internal structure of the contactor, preprocess and clean the images, and perform image enhancement on the remaining images after removing incomplete or unclear images. The image enhancement includes but is not limited to image rotation, image flipping, image scaling, cropping, pixel change and clarity adjustment. Establish a contactor image dataset, use the LabelImg tool to label the contactor images of different fault types in the contactor image dataset, and obtain a labeled contactor image dataset. The fault types include: foreign matter, tilted contact, normally open contact (NO contact), normally closed contact (NC contact), and crooked spring;
[0037] Step 2: Divide the labeled contactor image dataset into a training set and a test set using a cross-validation method;
[0038] Step 3: By introducing the CA attention mechanism into the network structure of the YOLOv5 model, a CA-YOLOv5 model is constructed;
[0039] The YOLOv5 model network structure consists of four parts: Input, Backbone, Neck, and Head.
[0040] The Input input terminal: preprocesses the data of the input contactor X-ray image, including data enhancement, image size processing and adaptive anchor box calculation. The input image size is 640×640×3. In order to reduce information redundancy and improve reasoning speed, normalization processing is performed to improve detection performance. In addition, the original image is adaptively scaled and filled with minimal black edges to achieve better results. The adaptive anchor box calculation reversely updates the set initial anchor box, and obtains the appropriate anchor box value through continuous iterative parameters;
[0041] The Backbone network is responsible for extracting target features from contactor X-ray images, including CBS module, C3 module and SPPF module. The CBS module encapsulates three parts including convolution (Conv2d), batch normalization and activation operations, while the filling effect is implemented using an automatic loading method, where Conv is the basic convolution unit of YOLOv5s. The CSP module consists of several bottleneck residual structural modules. The SPPF module uses a cascade of multiple small pool kernels and is an advanced version of SPP, which further improves the operation speed;
[0042] The Neck network: The contactor X-ray image feature map processed by Backbone will be passed to Neck. The Neck network is based on the residual structure of ResNet. The main task of this part is to further fuse the feature maps of different levels in order to capture richer spatial and semantic information. YOLOv5 uses FPN and PAN structures in this part. The top-down structural characteristics of FPN avoid that low-dimensional mapping information cannot affect high-dimensional mapping information, while PAN is just the opposite, which determines that the information is mapped from lower features to higher features, and transmits stronger localized features. These two together enhance the feature fusion capability of the neck network.
[0043] Head prediction end: The Head part will process the contactor X-ray image feature map output by the Neck network, output the category probability, confidence and coordinate information of each bounding box, and perform 1×1 convolution on the output feature map to expand the number of channels and reduce the number of features. The detection network consists of three detection layers with feature maps of different sizes for detecting target objects of different sizes;
[0044] Adding the CA attention mechanism after the SPPF layer in the Backbone network in the YOLOv5 model can better capture key data information and global features, thereby enhancing the model's ability to recognize details;
[0045] A CA attention mechanism is added after the C3 convolution in the Neck network in the YOLOv5 model to more accurately locate and identify the target. When detecting the X-ray image output of the contactor, this model helps to improve the detection accuracy, thereby more accurately determining the fault type of the internal mechanical structure of the contactor;
[0046] The CA attention mechanism process is as follows: First, the tensor size of the input feature map is C×H×W. The CA attention mechanism applies pooling kernels of size H×1 and 1×W in the height H and width W directions respectively, and obtains feature maps of size C×H×1 and C×1×W, and then these two feature maps are merged into the same dimension. Next, the features in the height and width directions are stacked and fused through a 1×1 convolution layer. After that, through convolution and normalization, the features are separated into two spatial directions again, and the tensors become C / r×H and C / r×W respectively. Finally, the attention weight is obtained through the Sigmoid function and multiplied with the original feature map to achieve the final feature map. Since the output range of the Sigmoid function is between 0 and 1, this feature enables the Sigmoid function to effectively binarize the features in the attention mechanism, thereby highlighting important features and suppressing unimportant features. At the same time, compared with other more complex activation functions, the calculation of the Sigmoid function is relatively simple, maintaining the computational efficiency and performance of the model;
[0047] Step 4: Input the training set into the parameters required for the CA-YOLOv5 model training to perform training, and obtain a trained CA-YOLOv5 model;
[0048] Step 5: Input the contactor images in the test set into the trained CA-YOLOv5 model. Each contactor image to be detected is marked with a fault type prediction box in the trained CA-YOLOv5 model and then output. Then, the fault type, confidence level, and location information of each contactor image in the test set are displayed through different prediction boxes, thereby completing the detection of contactor faults. Figure 5 As shown in the figure, the comparison between the input and output of the image with contact tilt fault is as follows: Figure 6 As shown in the figure, there are normally open contacts, normally closed contacts, and spring distortion fault images with input and output comparisons. Figure 7 shown.
[0049] The described nondestructive automatic detection method for contactor faults based on a deep learning model can effectively identify the fault type of the internal structure of the contactor, greatly improve the efficiency and accuracy of contactor fault detection, save computing resources, promote energy conservation and emission reduction, and thus reduce the economic cost of detection; the described nondestructive automatic detection method for contactor faults based on a deep learning model is of great significance for reducing contactor maintenance costs, improving detection quality, ensuring passenger and rail traffic safety, and enhancing economic and social benefits.
[0050] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A non-destructive automatic detection method for contactor faults based on a deep learning model, characterized in that: The steps include: Step 1: Collect several images of the internal structure of the contactor, preprocess and clean the images, enhance the images after removing incomplete or unclear images, establish a contactor image dataset, and obtain a labeled contactor image dataset by marking the contactor images of different fault types; Step 2: Divide the labeled contactor image dataset into a training set and a test set using a cross-validation method; Step 3: By introducing the CA attention mechanism into the network structure of the YOLOv5 model, a CA-YOLOv5 model is constructed; Step 4: Input the training set into the parameters required for the CA-YOLOv5 model training to perform training, and obtain a trained CA-YOLOv5 model; Step 5: Input the contactor images of the test set into the trained CA-YOLOv5 model. Each contactor image to be detected is marked with a fault type prediction box in the trained CA-YOLOv5 model and then output. The fault type, confidence level and location information of each contactor image in the test set are then displayed through different prediction boxes, thereby completing the detection of contactor faults.
2. According to claim 1, a non-destructive automatic detection method for contactor faults based on a deep learning model is characterized in that: In the step 1, the image of the internal structure of the contactor is an image taken using an X-ray device.
3. The method for non-destructive automatic detection of contactor faults based on a deep learning model according to claim 2 is characterized in that: In the step 1, the image enhancement includes but is not limited to image rotation, image flipping, image scaling, cropping, pixel change and clarity adjustment.
4. The method for non-destructive automatic detection of contactor faults based on a deep learning model according to claim 3 is characterized in that: In the step 1, the LabelImg tool is used to label images of different fault types in the contactor image data set.
5. The method for non-destructive automatic detection of contactor faults based on a deep learning model according to claim 4 is characterized in that: In the step 1, the fault types include: foreign matter, contact tilt, normally open contact, normally closed contact, and spring distortion.
6. The method for non-destructive automatic detection of contactor faults based on a deep learning model according to claim 1 is characterized in that: In the step 3, the YOLOv5 model network structure consists of four parts: Input input end, Backbone backbone network, Neck network, and Head prediction end; The Input input end: pre-processes the data of the input image, including data enhancement, image size processing and adaptive anchor box calculation; The Backbone network is responsible for extracting target features from the input image, including the CBS module, the C3 module and the SPPF module; The Neck network: further fuses feature maps at different levels to capture richer spatial and semantic information; Head prediction end: The feature map output by the Neck network is processed, the category probability, confidence, and coordinate information of each bounding box are output, and a 1×1 convolution is performed on the output feature map.
7. The method for non-destructive automatic detection of contactor faults based on a deep learning model according to claim 6 is characterized in that: A CA attention mechanism is added after the SPPF layer in the Backbone network in the YOLOv5 model, and a CA attention mechanism is also added after the C3 convolution in the Neck network in the YOLOv5 model.
8. An X-ray detection device that implements the non-destructive automatic detection method for contactor faults based on a deep learning model as described in any one of claims 1 to 7.