Attention network analysis method, system and equipment for contact network fault classification and medium
By using channel packet attention network as the backbone network in contact network fault detection, the problems of complex calculation and feature distortion of ResNet residual network are solved, and the precise fault classification of contact network components is realized, reducing the risk of misjudgment and model training time.
Patent Information
- Application Number
- CN202411801910.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-29
AI Technical Summary
In the fault detection of contact network components in the prior art, the ResNet residual network is complex in calculation and feature distortion, with the risk of overfitting, and the number of model parameters is large, which increases the cost of deployment and storage.
The channel grouping attention network is used as the backbone network of the classification model. By grouping the input images by channel and applying attention mechanism on each channel, the depth semantic features of the image are extracted, and the model is fine-tuned using ImageNet pre-training weights.
Accurate fault classification of contact network components is realized, the risk of misjudgment is reduced, classification accuracy is improved, and model training time and deployment cost are reduced.
Smart Images

Figure CN119904667A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent recognition of engineering images, and in particular to an attention network analysis method, system, equipment and medium for classification of contact network faults. Background Art
[0002] Since the supporting and hanging devices of the contact network are in an open-air environment for a long time, affected by natural factors such as temperature, light, and strong wind, the main components of the contact network fail, which makes the contact network power supply system have hidden dangers, such as the suspension string is not stressed, the components fall off (nuts fall off, rivets fall off, bolts loosen, positioning pins come out), and components cracks. By analyzing the fault statistics of the contact network, it can be found that the main anomalies in the 2C system are abnormal suspension strings and foreign objects, and the main anomalies in the 4C system are various fastener failures of the contact network. However, whether it is a 2C system or a 4C system, the contact network components are very subtle relative to the entire image. For a certain type of component, it is very difficult to directly perform fault analysis and detection on the complete system image.
[0003] The current fault detection methods can be divided into two categories: traditional methods and deep learning-based methods. Based on the deep learning method, the features of the components are learned by training deep convolutional neural networks (Faster R-CNN, YOLO, GAN, etc.), and then the fault classification is completed. CN115731211A discloses a contact network fastener fault detection method using a four-level cascade architecture. The method uses the improved R-FCN algorithm backbone network as the residual network ResNet-101. From the feature map output by the residual network ResNet-101, the region candidate network generates a series of regions of interest ROIs according to the anchors. These regions of interest ROIs are input into the position-sensitive ROI pooling layer, and two global average pooling layers are used to generate the score map and bounding box prediction map of each class respectively.
[0004] The ResNet residual network can deepen the network to dozens or even hundreds of layers by stacking residual blocks, which greatly improves the network's feature expression ability and overcomes a series of problems such as overfitting and network degradation. However, due to the tiny components of the contact network, the calculation amount is large and complex, and there is a risk of overfitting. The direct addition operation in the residual block may sometimes cause feature distortion, and the number of model parameters is large, which increases the deployment and storage costs. Summary of the invention
[0005] In view of the problems of complex calculation and feature distortion of ResNet residual network in contact network component fault detection in the prior art, the present invention provides an attention network analysis method, system, device and medium for contact network fault classification.
[0006] The present invention is achieved through the following technical solutions: An attention network analysis method for catenary fault classification comprises the following steps: Step 1: Establish a fault classification model with the channel grouping attention network as the backbone network; Step 2: divide the existing image set into a training set and a test set. For the test set, use the fault classification model to learn the data distribution of components and their fault types, and obtain the optimal parameter model through training. Step 3: Taking the image to be tested as input, the optimal parameter model is used for processing to obtain the fault type of the image to be tested.
[0007] Preferably, in step 1, the channel grouping attention network divides the input image into channels groups, each group is denoted as Cardinal- , and then split each Cardinal into Each of them is recorded as Split- , each channel is assigned a different weight.
[0008] Preferably, in step 2, the existing image set consists of folders storing images by category, and the number of folders is consistent with the number of categories; each category corresponds to a type of normal component or the fault type of the component.
[0009] Preferably, the ratio of training set to test set is 2:1.
[0010] Preferably, in step 2, the steps for obtaining the optimal parameter model are: First, import the weight parameters trained by ImageNet as a pre-trained model; The training images of the training set are input into the ResNeSt50 network to extract image features and obtain semantic feature maps of normal parts and faulty parts; The semantic feature maps of normal components and faulty components are input into the fully connected layer for processing to obtain a multi-dimensional feature vector; The multi-dimensional feature vector uses the softmax function in the softmax layer to obtain the category probability and finally output the predicted category; Calculate the loss of the predicted category and the true label, and back-propagate to optimize the model parameters; After training, save the optimal parameter model.
[0011] Preferably, cross entropy is used to calculate the loss between the predicted category and the true label.
[0012] Preferably, in step 3, the test image of the test set is read into the network to extract image features and obtain a semantic feature map of the test image; the feature map is then input into the fully connected layer, and a multi-dimensional feature vector is obtained after processing, and the predicted category is output through the softmax layer.
[0013] An attention network analysis system for contact network fault classification includes a data acquisition module, a model building module, an optimization module and a test module; the data acquisition module is used to divide an existing image set into a training set and a test set; the model building module is used to establish a fault classification model with a channel grouping attention network as a main network; the optimization module is used to use the fault classification model to learn the data distribution of components and their fault types, and train to obtain an optimal parameter model; the test module is used to take an image to be tested as input, use the optimal parameter model for processing, and obtain the fault type of the image to be tested.
[0014] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the attention network analysis method for contact network fault classification when executing the computer program.
[0015] A storage medium stores a computer program, which, when executed by a processor, implements the steps of the attention network analysis method for contact network fault classification.
[0016] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides an attention network analysis method for contact network fault classification, which uses a channel grouping attention network as the backbone network of a classification model, extracts deep semantic features of images, learns the data distribution of components and their fault types through training with a large number of images, and realizes accurate fault classification of components in the test phase.
[0017] Furthermore, by using the ImageNet pre-trained weights as the initial parameters, the model training time is greatly shortened, and the model can be adapted to specific component fault classification tasks more quickly through fine-tuning.
[0018] Furthermore, the cross entropy loss function and gradient descent algorithm were used for model optimization, which ensured the stability and convergence of the model during training and further improved the classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flow chart of the attention network analysis method for catenary fault classification of the present invention; Figure 2 Schematic diagram of the channel grouping attention network in the present invention; Figure 3 It is a structural diagram of Split Attention in the present invention; Figure 4 is a normal image of the hanging string in the embodiment; Figure 5 is an abnormal image of the hanging string in the embodiment; Figure 6 is a normal image of the U-bolt in the embodiment; Figure 7 This is an abnormal image of the U-bolt in the embodiment. DETAILED DESCRIPTION
[0020] The present invention is further described in detail below in conjunction with specific embodiments, which are intended to explain the present invention rather than to limit it.
[0021] The present invention discloses an attention network analysis method for catenary fault classification, referring to Figure 1 , including the following steps: Step 1: Establish a fault classification model with the channel grouping attention network as the backbone network; where the channel grouping attention network (such as Figure 2 ) is an improvement on ResNet. The channel grouping attention network divides the input image into channels groups, each group is denoted as Cardinal- , and then split each Cardinal into Each of them is recorded as Split- , each channel is assigned different weights. In each Cardinal, Split Attention is based on the channel attention mechanism, assigning different weights to the channels to model the importance of the channels. The structure of Split Attention is as follows Figure 3 As shown in the figure. By grouping channels and further splitting them, the Split Attention mechanism is used to assign different weights to each group of channels. This fine-grained feature processing method helps the model to more accurately capture the key information in the image, especially the subtle differences related to faults. ResNeSt has shown great performance improvement in multiple visual tasks compared to ResNet.
[0022] Step 2: Divide the existing image set into a training set and a test set in a ratio of 2:1. For the test set, use the fault classification model to learn the data distribution of components and their fault types, and obtain the optimal parameter model after training.
[0023] Among them, the existing image set consists of folders that store images by category, and the number of folders is consistent with the number of categories; each category corresponds to a type of normal component or the fault type of the component.
[0024] The steps to obtain the optimal parameter model are: First, the weight parameters trained by ImageNet are imported as the pre-trained model; using the weights trained by ImageNet as the pre-trained model can greatly shorten the model training time, and through fine-tuning, the model can be adapted to the catenary fault classification task more quickly. This transfer learning strategy helps to improve the generalization ability of the model and reduce the dependence on the amount of training data required for new tasks.
[0025] The training images of the training set are input into the ResNeSt50 network to extract image features and obtain semantic feature maps of normal parts and faulty parts; The semantic feature maps of normal components and faulty components are input into the fully connected layer for processing to obtain a multi-dimensional feature vector; The multi-dimensional feature vector uses the softmax function in the softmax layer to obtain the category probability and finally output the predicted category; Use cross entropy to calculate the loss of predicted categories and true labels, and back propagate to optimize model parameters; After training, save the optimal parameter model.
[0026] Step 3: Take the image to be tested as input and process it using the optimal parameter model to obtain the fault type of the image to be tested. Specifically, read the test image of the test set into the network to extract image features and obtain the semantic feature map of the test image; then input the feature map into the fully connected layer, and after processing, obtain a multi-dimensional feature vector, and output the predicted category through the softmax layer.
[0027] The present invention adopts an attention network analysis method for contact network fault classification by adopting the ResNeSt50 network. The present invention combines the deep feature extraction capability of the residual network and the precise positioning capability of the attention mechanism, can more effectively extract key features from the image, improve the accuracy of fault classification, and reduce the risk of misjudgment, and has significant technical advantages and application value. After the training is completed, the model is verified using a test set. This step helps to evaluate the performance of the model and ensure its reliability in practical applications. Through the verification results of the test set, the model's classification ability for contact network faults can be intuitively understood, which is particularly suitable for the detection and classification of contact network faults. Through accurate fault classification, problems in the contact network can be discovered and handled in a timely manner to ensure the safe and stable operation of the railway system.
[0028] Taking the two types of components, suspension strings and U-bolts, and their fault types as examples, 300 images of faulty suspension strings and faulty U-bolts that meet the fault characteristics were selected. At the same time, 300 images of normal suspension strings and normal U-bolts were selected to match them. The training set and validation set were divided in a 2:1 ratio, with a total of 800 training images and 400 test images, which were divided into 4 categories. The example images of each class are as follows: Figure 4 , 5, 6, and 7.
[0029] The image input size is 128*128, the experiment is set for 20 epochs, the initial learning rate is 0.005, the weight decay rate is 1e-4, the optimizer is SGD, and the batch size is set to 32.
[0030] Computing environment: CPU is Xeon E5-2664 v4 Gold, main frequency is 3.2GHz, 16 cores; GPU is NVIDIA TeslaP100, 16GB video memory, 3584 cores. Deep learning open source framework Pytorch1.5.0 is used for deep network model training and testing.
[0031] The final classification results after the test are shown in the confusion matrix in Table 1, where the accuracy of the classification of suspension string faults is 97.5%, and the accuracy of the classification of U-bolts is 98.5%.
[0032] Table 1 Classification results of contact network components
[0033] The present invention also discloses an attention network analysis system for fault classification of contact network, including a data acquisition module, a model building module, an optimization module and a test module; the data acquisition module is used to divide the existing image set into a training set and a test set; the model building module is used to establish a fault classification model with a channel grouping attention network as the backbone network; the optimization module is used to use the fault classification model to learn the data distribution of parts and their fault types, and train to obtain the optimal parameter model; the test module is used to use the image to be tested as input, use the optimal parameter model for processing, and obtain the fault type of the image to be tested. The modular design makes the system more flexible, easy to maintain and expand.
[0034] The present invention also discloses an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the attention network analysis method for contact network fault classification when executing the computer program.
[0035] The present invention also discloses a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the attention network analysis method for contact network fault classification are implemented.
[0036] The above description is only a preferred embodiment of the present invention and is not intended to impose any limitation on the technical solution of the present invention. Those skilled in the art should understand that, without departing from the spirit and principles of the present invention, the technical solution can also be subjected to several simple modifications and substitutions, and these modifications and substitutions are also within the scope of protection covered by the claims.
Claims
1. An attention network analysis method for contact network fault classification, characterized in that: Includes the following: Step 1: Establish a fault classification model with the channel grouping attention network as the backbone network; Step 2: divide the existing image set into a training set and a test set. For the test set, use the fault classification model to learn the data distribution of components and their fault types, and obtain the optimal parameter model through training. Step 3: Taking the image to be tested as input, the optimal parameter model is used for processing to obtain the fault type of the image to be tested.
2. The attention network analysis method for contact network fault classification according to claim 1 is characterized in that: In step 1, the channel grouping attention network divides the input image into channels groups, each group is denoted as Cardinal- , and then split each Cardinal into Each of them is recorded as Split- , each channel is assigned a different weight.
3. The attention network analysis method for contact network fault classification according to claim 1 is characterized in that: In step 2, the existing image set consists of folders storing images by category, and the number of folders is consistent with the number of categories; each category corresponds to a type of normal component or the fault type of the component.
4. The attention network analysis method for contact network fault classification according to claim 1 is characterized in that: The ratio of training set to test set is 2:
1.
5. The attention network analysis method for contact network fault classification according to claim 1 is characterized in that: In step 2, the steps for obtaining the optimal parameter model are: First, import the weight parameters trained by ImageNet as a pre-trained model; The training images of the training set are input into the ResNeSt50 network to extract image features and obtain semantic feature maps of normal parts and faulty parts; The semantic feature maps of normal components and faulty components are input into the fully connected layer for processing to obtain a multi-dimensional feature vector; The multi-dimensional feature vector uses the softmax function in the softmax layer to obtain the category probability and finally output the predicted category; Calculate the loss of the predicted category and the true label, and back-propagate to optimize the model parameters; After training, save the optimal parameter model.
6. The attention network analysis method for contact network fault classification according to claim 5 is characterized in that: The loss is calculated using cross entropy between the predicted category and the true label.
7. The attention network analysis method for contact network fault classification according to claim 1 is characterized in that: In step 3, the test image of the test set is read into the network to extract image features and obtain the semantic feature map of the test image; then the feature map is input into the fully connected layer, and after processing, a multi-dimensional feature vector is obtained, and the predicted category is output through the softmax layer.
8. An attention network analysis system for contact network fault classification, characterized in that: It includes a data acquisition module, a model building module, an optimization module and a testing module; the data acquisition module is used to divide the existing image set into a training set and a test set; the model building module is used to establish a fault classification model with a channel grouping attention network as the backbone network; the optimization module is used to use the fault classification model to learn the data distribution of components and their fault types, and train to obtain the optimal parameter model; the testing module is used to take the image to be tested as input, use the optimal parameter model to process it, and obtain the fault type of the image to be tested.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the attention network analysis method for contact network fault classification according to any one of claims 1 to 7 are implemented.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the attention network analysis method for contact network fault classification according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Contact network fastener fault detection method adopting four-stage cascade architecture
CN115731211A