Self-supervision defect detection method and system for catenary parts based on ETROfficientAD
Through the ETR_EfficientAD self-supervised defect detection method, the teacher-student network comparison learning framework and data enhancement technology are used to solve the problems of low manual screening efficiency and poor generalization ability of traditional methods in contact network parts detection, efficient and accurate defect detection and automated maintenance are achieved, and high-speed rail operation safety and operation efficiency are improved.
Patent Information
- Application Number
- CN202510566221.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-08
AI Technical Summary
The existing contact network component defect detection relies on manual screening to be inefficient and prone to missed inspection. Traditional and supervised learning methods have poor generalization capabilities in complex environments, making it difficult to adapt to problems such as lighting changes and occlusion.
The ETR_EfficientAD self-supervised defect detection method is adopted, and the teacher-student network comparison learning framework is combined with data enhancement and feature loss functions to construct a ternary network architecture to realize the detection of implicit and explicit feature anomaly scores.
It significantly improves the detection accuracy and robustness in complex environments, realizes the automation of contact network detection, reduces the error detection rate, extends the service life of key components, and improves the operation safety and operational efficiency of high-speed rail.
Smart Images

Figure CN120451741A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of component defect detection, and in particular to a method and system for self-supervisory defect detection of contact network components based on ETR_EfficientAD. Background Art
[0002] High-speed trains generally use electric traction, drawing power from the catenary via pantographs. Therefore, the catenary is crucial for the normal operation of high-speed electric locomotives. Failures in the catenary can lead to serious accidents. Due to the dynamic impact of high-speed trains and the effects of inclement weather such as high temperatures and icing, catenary components are prone to defects such as loosening and deformation. These defects can directly impact the operational stability of the entire catenary. Therefore, research on catenary defect detection is of great practical significance for maintaining railway safety.
[0003] Currently, defect detection for catenary components primarily relies on manual image screening. The specific process involves using an inspection vehicle equipped with a high-speed industrial camera to capture multi-angle images of the catenary component status. Then, technicians in the power supply section visually inspect the images to identify anomalies. This method is labor-intensive, inefficient, and highly dependent on the inspector's experience, making it prone to missed detections. With the rapid development of machine learning and computer vision technologies, their application to catenary defect detection can significantly improve the speed and accuracy of component defect detection. These technologies support large-scale image analysis, helping to improve the efficiency of railway operations and maintenance. Therefore, intelligent defect detection and analysis of catenary components has become a current research hotspot.
[0004] Existing research on intelligent detection of contact network defects primarily utilizes traditional image processing and deep learning. Traditional image processing methods rely on predefined rules and hand-crafted features to detect component defects. For example, some studies have used the Histogram of Oriented Gradients (HOG) feature extraction algorithm combined with a Support Vector Machine (SVM) to detect pipe cap faults, while others have used the Scale-Invariant Feature Transform (SIFT) method to identify rotating binaural fracture faults. However, these methods perform poorly when handling complex defects, struggle to adapt to changes in lighting, angle, or occlusion, and exhibit poor generalization capabilities.
[0005] In recent years, deep learning-based contact network defect detection technology has garnered widespread attention, with research primarily focusing on supervised and unsupervised learning. Supervised learning methods rely on large amounts of labeled data to train neural networks, enabling them to identify different types of component defects. For example, one study used the SSD algorithm for defect location, combined with DeepLab v3+ for semantic segmentation to determine the defect status of the tightening bolts; another used the Faster R-CNN algorithm to locate the dropper wires, then used the FCOS network to identify their status; and another proposed a cascaded network based on YOLOv5 and ResNet50 to first locate pipe caps and insulators and then determine their working status. However, these methods still face challenges in component defect detection: insufficient training data can lead to model overfitting and reduced generalization ability; and the wide variety of defects and complex and varied morphologies make it difficult for supervised models to adapt to all variations, resulting in limited detection performance.
[0006] Chinese patent document CN114581388B discloses a method for detecting defects in contact network components. This method identifies defects based on similarity matching between a template image and the image to be detected. However, this method is prone to missed detections or false detections in complex backgrounds, and its detection performance is easily affected by lighting changes and other noise.
[0007] Chinese patent document CN118429317A proposes a method for detecting loose nuts in double-sleeve connectors for contact lines. This method generates enhanced defect sample images through a program. However, since most anomalies in real datasets are difficult to predict, relying solely on simple rotational transformations cannot fully simulate the complex defects of real components. This can lead to overfitting of the model, ultimately affecting detection effectiveness. Summary of the Invention
[0008] The purpose of the present invention is to propose a self-supervised defect detection method and system for contact network components based on ETR_EfficientAD. Through the teacher-student network comparative learning framework, it effectively distinguishes normal and abnormal features, significantly improves the discriminative ability of feature expression, and enables it to extract more representative deep feature information in complex environments.
[0009] According to a first aspect of an embodiment of the present disclosure, a method for self-supervised defect detection of contact network components based on ETR_EfficientAD is provided, comprising the following steps:
[0010] Extract component images from the contact network image and obtain the component image dataset CHSR through data enhancement technology;
[0011] Construct the ETR_EfficientAD contrastive learning model, which uses a student model-teacher model-autoencoder ternary network architecture and is trained based on the ImageNet dataset and the component image dataset CHSR.
[0012] The trained ETR_EfficientAD comparative learning model is used to detect component images to obtain implicit feature anomaly scores and explicit feature anomaly scores. The optimal threshold is obtained through the implicit feature anomaly scores and the explicit feature anomaly scores to detect whether the components are abnormal.
[0013] In one embodiment, the method for extracting component images from the contact network image is as follows: several images containing the sleeve double-ear component are selected from the contact network image, and then the sleeve double-ear component is identified and located using a target detection model. The sleeve double-ear component area is cropped on the contact network image according to the positioning information. After the sleeve double-ear image is obtained, secondary positioning is performed on it to obtain the specific nut and cotter pin components.
[0014] In one of the embodiments, during the training phase, the teacher model learns the feature information of the dataset ImageNet to obtain a pre-trained teacher model; knowledge distillation is performed on the pre-trained teacher model on normal sample images in the component image dataset CHSR to train the student model and the autoencoder.
[0015] In one embodiment, the model parameters are adjusted by optimizing the feature loss function so that the model learns a discriminative feature representation; the feature loss function uses the mean square error:
[0016]
[0017] L S,T =D' S,T +(D S,T >0.999)
[0018]
[0019] Where: I is the component image, I' is the ImageNet image, T is the pre-trained teacher model, S is the first half of the student model, A is the autoencoder, S' is the second half of the student model, n is the batch size, C is the number of channels, H is the image height, and W is the image width;
[0020] The total feature training loss of the model is:
[0021] L train =L STAE +L AE +L S,T
[0022] Where: L STAE is the loss of the second half of the student model, L AE is the loss of the autoencoder, L S,T is the loss of the first half of the student model.
[0023] In one embodiment, the ETR_EfficientAD contrast learning model first performs elastic deformation on the positive sample image, and then inputs the elastically deformed image and the positive sample image into the pre-trained teacher model and the student model to obtain the feature map T output by the pre-trained teacher model for the pseudo negative sample image. anomal , the feature map S output by the student model for the pseudo negative sample image anomal , the feature map T output by the pre-trained teacher model for the positive sample image nomeal , the feature map S output by the student model for the positive sample image nomal ; Therefore, the contrast loss function of the model is as follows:
[0024] P n =T noaml -S nomal
[0025] P a =T anoaml -S anomal
[0026]
[0027] Where B is the batch size, C is the number of channels, H is the image height, and W is the image width.
[0028] In one embodiment, the ETR_EfficientAD contrastive learning model performs implicit feature anomaly detection based on histogram projection:
[0029] Obtain the component feature vector output by the student model and then project the component feature vector onto a random direction. The implementation is as follows:
[0030] z=xP,P∈R d×k ,x∈R d
[0031] Where x is the component feature vector output by the student model, P is the random Gaussian matrix, d is the vector length of x, and k is the k directions of projection;
[0032] Construct a projection histogram from each projection component, and reduce the dimension by dividing the projection histogram into bins sub-regions.
[0033] h j =histogram(z j,bins=b,range=(-1,1))
[0034] Where z j is the projection component, b is the number of sub-regions of the projection histogram, and histogram(·) is the construction of the projection histogram;
[0035] Concatenate all projected histograms together to form a histogram vector:
[0036] h=[h1,h2,…,h k ]∈R k·b
[0037] For this histogram vector, the distance between it and the normal sample distribution is obtained by the Mahalanobis distance, that is, the implicit feature anomaly score:
[0038]
[0039] Where μ h is the mean of the normal sample distribution, is the inverse of the covariance matrix of the normal sample distribution.
[0040] In one of the embodiments, the contact network image is input into the trained ETR_EfficientAD comparative learning model and then divided into two branches. One branch is the teacher model and the first half of the student model, which are used to extract local features and output local difference maps; the other branch is the second half of the student model and the autoencoder, which are used to extract global features and output global difference maps. The local difference map is fused with the global difference map to generate a combined anomaly map, and its maximum value is extracted as the explicit feature anomaly score at the image level. The implicit feature anomaly score is added to the explicit feature anomaly score to obtain the optimal threshold.
[0041] According to a second aspect of an embodiment of the present disclosure, a self-supervisory defect detection system for contact network components based on ETR_EfficientAD is provided, comprising:
[0042] The dataset acquisition module extracts component images from the contact network image and obtains the component image dataset CHSR through data enhancement technology;
[0043] The training module builds the ETR_EfficientAD contrastive learning model, which uses a student model-teacher model-autoencoder ternary network architecture and is trained based on the ImageNet dataset and the component image dataset CHSR.
[0044] The detection module uses the trained ETR_EfficientAD comparative learning model to detect component images and obtain implicit feature anomaly scores and explicit feature anomaly scores. The optimal threshold is obtained through the implicit feature anomaly scores and the explicit feature anomaly scores to detect whether the component is abnormal.
[0045] According to the third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored and running on the memory, wherein when the processor executes the program, the method for self-supervisory defect detection of contact network components based on ETR_EfficientAD is implemented.
[0046] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for self-supervisory defect detection of contact network components based on ETR_EfficientAD is implemented.
[0047] Compared with the existing technology, the above technical solutions adopted by the present invention have the following advantages: (1) The present invention innovatively integrates the teacher-student model, comparative learning and reconstruction mechanism to build an efficient feature learning framework. In the anomaly detection stage, by introducing the Mahalanobis distance statistical method, three-dimensional accurate detection of texture anomalies, logical anomalies and potential feature anomalies is achieved. It can still reliably identify the abnormal state of components under insufficient sample conditions, significantly improving detection accuracy and robustness.
[0048] (2) The present invention realizes the full process automation of contact network detection. This technological breakthrough not only improves the detection efficiency by an order of magnitude, but also significantly reduces the false detection rate by eliminating human factors, thereby greatly optimizing the contact network maintenance cost.
[0049] (3) The present invention can accurately identify and locate defects in high-speed rail contact lines. This not only provides reliable protection for high-speed rail operation safety, but also extends the service life of key contact line components by more than 30% through early defect diagnosis and early warning, thereby improving the overall operational efficiency and life cycle of the high-speed rail system. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The drawings in the specification, which constitute a part of this application, are used to provide further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute improper limitations on this application.
[0051] Figure 1 This is a flow chart of the self-supervised defect detection method for contact network components based on ETR_EfficientAD;
[0052] Figure 2 The flowchart for obtaining binaural images of the sleeve is shown;
[0053] Figure 3 This is an example diagram of the double-ear state of the sleeve;
[0054] Figure 4 This is an example diagram of data enhancement;
[0055] Figure 5 Schematic diagram of the ETR_EfficientAD comparative learning model. DETAILED DESCRIPTION
[0056] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.
[0057] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present application belongs.
[0058] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0059] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the methods and systems according to the various embodiments of the present disclosure. It should be noted that each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code can include one or more executable instructions for implementing the logical functions specified in the various embodiments. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the flowchart and / or block diagram, and the combination of the boxes in the flowchart and / or block diagram, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0060] Example 1:
[0061] like Figure 1 As shown, this embodiment provides a self-supervisory defect detection method for contact network components based on ETR_EfficientAD, including the following steps:
[0062] S1. Extract component images from the contact network image and obtain the component image dataset CHSR through data enhancement technology;
[0063] Specifically, this embodiment takes a sleeve with two ears as an example to verify the effectiveness of the proposed method. Figure 2 As shown in the figure, 2069 images containing sleeve binaural components are first selected from the contact network images taken by the 4C inspection vehicle. Then, the target detection model is used to identify and locate the sleeve binaural components. Finally, the sleeve binaural region is cropped from the contact network image according to the positioning information to obtain the sleeve binaural image. Then, the image is subjected to secondary positioning to the specific nut and cotter pin components. 2262 images are selected from these images to create the self-supervised component image dataset (CHSR), covering multiple angles, various lighting environments, and noise scenarios.
[0064] This embodiment can detect three defect states of the sleeve ears: loose nuts, missing cotter pins, and insufficient cotter pin opening angles, as shown in Figure 3. Due to the small number of defect samples in actual engineering, only 52 defect images of the sleeve ears were collected. In order to improve the robustness of the detection model, this embodiment performs geometric enhancement, brightness transformation, and Mixup enhancement on the defect samples. The enhancement effect is shown in Figure 3. Figure 4 After data augmentation, a total of 1526 images were obtained as the test dataset, including 81 images of nut defects and 1255 images of cotter pin defects. The data categories and their quantity distribution are shown in Table 1.
[0065] Table 1 Data categories and their quantities
[0066]
[0067] S2. Build the ETR_EfficientAD contrastive learning model, which uses a student model-teacher model-autoencoder ternary network architecture and is trained on the ImageNet dataset and the component image dataset CHSR.
[0068] Specifically, the ETR_EfficientAD contrastive learning model is a highly efficient self-supervised visual anomaly detection model that achieves high-precision anomaly detection with millisecond-level latency. This model utilizes a ternary network architecture, combined with a lightweight feature extractor and knowledge distillation technology, to quickly and accurately complete anomaly detection tasks. It should be noted that the student model has twice as many output channels as the teacher model. The first half is used to regress the teacher model's output features, while the second half works together with the teacher model to complete the training of the autoencoder.
[0069] During the training phase, the teacher model first learns feature information from the large-scale ImageNet dataset to acquire rich semantic expression capabilities. Subsequently, the teacher model guides the student model to learn the features of normal sample images from the component image dataset (CHSR) and complete the training of the autoencoder. This guidance is achieved by regressing the features of the teacher model's normal samples onto the student model. During the training of the ETR_EfficientAD contrastive learning model, model parameters are adjusted by optimizing the feature loss function to enable it to learn discriminative feature representations.
[0070] An autoencoder is used to model the spatial structural characteristics of parts, including logical relationships such as position, size, and arrangement. As a data compression algorithm, the autoencoder encodes the input data into a low-dimensional latent space representation and decodes and reconstructs it. This allows for accurate reconstruction of normal samples, while significantly increasing reconstruction errors for abnormal samples. This reconstruction error-based detection mechanism enables the model to discern the logical spatial relationships of parts, effectively distinguishing normal from abnormal samples.
[0071] In order to give full play to the advantages of self-supervised anomaly detection and effectively solve the problems of small target detection in contact lines and anomaly identification in complex backgrounds, the ETR_EfficientAD contrastive learning model adopts a contrastive learning method of synthetic abnormal pixels, aiming to maximize the feature difference distance between positive and negative samples. This not only significantly improves the detection accuracy and performance, but also effectively prevents the over-generalization problem of the student model.
[0072] Abnormal pixels cannot be obtained during the training phase, so the comparative learning method is implemented as follows: for the positive sample image, elastic deformation is first performed, and then the elastically deformed image and the positive sample image are input to the pre-trained teacher model and the student model respectively, and the feature map T output by the pre-trained teacher model for the pseudo negative sample image is obtained. anomal , the feature map S output by the student model for the pseudo negative sample image anomal , the feature map T output by the pre-trained teacher model for the positive sample image nomal , the feature map S output by the student model for the positive sample image nomal The core optimization goal of contrastive learning is to achieve effective representation learning in feature space. This method guides model training by constructing positive and negative sample pairs: on the one hand, maximizing the similarity in feature space between positive sample pairs (different instances from the same sample), and on the other hand, minimizing the feature similarity between negative sample pairs (instances from different samples). This dual optimization mechanism forces the model to learn discriminative feature representations, clustering semantically similar instances in feature space while separating semantically different instances.
[0073] This paper proposes a method based on contrastive learning. By maximizing the output difference between the teacher model and the student model on abnormal images, the model can not only learn the feature distribution of normal samples, but also enhance the ability to recognize abnormal features, thereby effectively solving the problem of over-generalization of the model.
[0074] S3. Use the trained ETR_EfficientAD comparative learning model to detect component images and obtain implicit feature anomaly scores and explicit feature anomaly scores. The optimal threshold is obtained through the implicit feature anomaly scores and the explicit feature anomaly scores to detect whether the component is abnormal.
[0075] like Figure 5 As shown, the ETR_EfficientAD model effectively enhances its ability to learn the differences between normal and abnormal samples by introducing synthetic anomaly samples. This mechanism enables the model to demonstrate excellent generalization performance for unknown anomaly types. Specifically, the model achieves dual optimization through a contrastive learning framework: accurately capturing the characteristic distribution of normal samples while strengthening its ability to discriminate abnormal features using synthetic anomaly samples. This design not only improves the model's detection robustness but also significantly reduces the risk of overfitting.
[0076] The implicit feature anomaly score is derived based on a statistical method. Specifically, the component feature vector output by the student model is obtained, then projected onto random directions. A projection histogram is constructed from each projected component, and all projected histograms are concatenated to form a histogram vector. The Mahalanobis distance is used to determine the distance between this histogram vector and the normal sample distribution, thereby detecting potential anomalies and obtaining the implicit feature anomaly score. The present invention uses a projection histogram method to randomly project component image features, enabling the extraction and combination of features from multiple angles and directions. This processing method improves the model's robustness to factors such as imaging angle, background interference, and illumination changes, resulting in more stable detection of feature information for key components such as nuts.
[0077] The explicit feature anomaly score is obtained as follows: the contact network image is input into the trained ETR_EfficientAD comparative learning model and then divided into two branches. One branch is the teacher model and the first half of the student model, which are used to extract local features and output local difference maps; the other branch is the second half of the student model autoencoder, which is used to extract global features and output global difference maps. The local difference maps are fused with the global difference maps to generate a combined anomaly map, and its maximum value is extracted as the explicit feature anomaly score at the image level. The implicit feature anomaly score is added to the explicit feature anomaly score to obtain the optimal threshold.
[0078] This paper proposes a visual anomaly detection method based on projected direct images and ETR_EfficientAD. This method introduces a contrastive learning mechanism, effectively improving the ability to distinguish between normal and abnormal features and enhancing the model's discriminative power of feature expression. This improvement enables the method to extract more representative deep feature information of components even in complex environments, significantly improving the performance of intelligent defect detection tasks.
[0079] Example 2:
[0080] This embodiment provides a self-supervisory defect detection system for contact network components based on ETR_EfficientAD, including:
[0081] The dataset acquisition module extracts component images from the contact network image and obtains the component image dataset CHSR through data enhancement technology;
[0082] The training module builds the ETR_EfficientAD contrastive learning model, which uses a student model-teacher model-autoencoder ternary network architecture and is trained based on the ImageNet dataset and the component image dataset CHSR.
[0083] The detection module uses the trained ETR_EfficientAD comparative learning model to detect component images and obtain implicit feature anomaly scores and explicit feature anomaly scores. The optimal threshold is obtained through the implicit feature anomaly scores and the explicit feature anomaly scores to detect whether the component is abnormal.
[0084] Example 3:
[0085] An electronic device includes a memory, a processor, and a computer program stored and running on the memory, wherein when the processor executes the program, the method for self-supervisory defect detection of contact network components based on ETR_EfficientAD is implemented, including:
[0086] Extract component images from the contact network image and obtain the component image dataset CHSR through data enhancement technology;
[0087] Construct the ETR_EfficientAD contrastive learning model, which uses a student model-teacher model-autoencoder ternary network architecture and is trained based on the ImageNet dataset and the component image dataset CHSR.
[0088] The trained ETR_EfficientAD comparative learning model is used to detect component images to obtain implicit feature anomaly scores and explicit feature anomaly scores. The optimal threshold is obtained through the implicit feature anomaly scores and the explicit feature anomaly scores to detect whether the components are abnormal.
[0089] Example 4:
[0090] A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for self-supervisory defect detection of contact network components based on ETR_EfficientAD is implemented, comprising:
[0091] Extract component images from the contact network image and obtain the component image dataset CHSR through data enhancement technology;
[0092] Construct the ETR_EfficientAD contrastive learning model, which uses a student model-teacher model-autoencoder ternary network architecture and is trained based on the ImageNet dataset and the component image dataset CHSR.
[0093] The trained ETR_EfficientAD comparative learning model is used to detect component images to obtain implicit feature anomaly scores and explicit feature anomaly scores. The optimal threshold is obtained through the implicit feature anomaly scores and the explicit feature anomaly scores to detect whether the components are abnormal.
[0094] Those skilled in the art will appreciate that the modules or steps of the present disclosure described above can be implemented using a general-purpose computer device. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. The present disclosure is not limited to any specific combination of hardware and software.
[0095] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
[0096] Although the above describes the specific implementation methods of the present disclosure in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present disclosure. Those skilled in the art should understand that on the basis of the technical solution of the present disclosure, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present disclosure.
Claims
1. A self-supervised defect detection method for contact network components based on ETR_EfficientAD, characterized in that: The following steps are involved: Extract component images from the contact network image and obtain the component image dataset CHSR through data enhancement technology; Construct the ETR_EfficientAD contrastive learning model, which uses a student model-teacher model-autoencoder ternary network architecture and is trained based on the ImageNet dataset and the component image dataset CHSR. The trained ETR_EfficientAD comparative learning model is used to detect component images to obtain implicit feature anomaly scores and explicit feature anomaly scores. The optimal threshold is obtained through the implicit feature anomaly scores and the explicit feature anomaly scores to detect whether the components are abnormal.
2. The method for self-supervised defect detection of contact network components based on ETR_EfficientAD according to claim 1, characterized in that: The method for extracting component images from the contact network image is as follows: several images containing the sleeve double-ear components are selected from the contact network image, and then the target detection model is used to identify and locate the sleeve double-ear components. The sleeve double-ear component area is cropped on the contact network image based on the positioning information. After obtaining the sleeve double-ear image, secondary positioning is performed on it to obtain the specific nut and cotter pin components.
3. The method for self-supervised defect detection of contact network components based on ETR_EfficientAD according to claim 1, characterized in that: During the training phase, the teacher model learns the feature information of the ImageNet dataset to obtain a pre-trained teacher model; knowledge distillation is performed on the pre-trained teacher model on normal sample images in the component image dataset CHSR to train the student model and autoencoder.
4. The method for self-supervised defect detection of contact network components based on ETR_EfficientAD according to claim 1, characterized in that: Adjust the model parameters by optimizing the feature loss function so that the model can learn discriminative feature representations; Its characteristic loss function uses mean square error: L S,T =D’ S,T +(D S,T >0.999) Where: I is the component image, I' is the ImageNet image, T is the pre-trained teacher model, S is the first half of the student model, A is the autoencoder, S' is the second half of the student model, n is the batch size, C is the number of channels, H is the image height, and W is the image width; The total feature training loss of the model is: L train =L STAE +L AE +L S,T Where: L STAE is the loss of the second half of the student model, L AE is the loss of the autoencoder, L S,T is the loss of the first half of the student model.
5. The method for self-supervised defect detection of contact network components based on ETR_EfficientAD according to claim 1, characterized in that: The ETR_EfficientAD contrast learning model first performs elastic deformation on the positive sample image, and then inputs the elastically deformed image and the positive sample image into the pre-trained teacher model and the student model to obtain the feature map T output by the pre-trained teacher model for the pseudo negative sample image. anomal , the feature map S output by the student model for the pseudo negative sample image anomal , the feature map T output by the pre-trained teacher model for the positive sample image nomal , the feature map S output by the student model for the positive sample image nomal ; Therefore, the contrast loss function of the model is as follows: P n =T noaml -S nomal P a =T anoaml -S anomal Where B is the batch size, C is the number of channels, H is the image height, and W is the image width.
6. The method for self-supervised defect detection of contact network components based on ETR_EfficientAD according to claim 1, characterized in that: In the ETR_EfficientAD contrastive learning model, implicit feature anomaly detection is performed based on histogram projection: Obtain the component feature vector output by the student model and then project the component feature vector onto a random direction. The implementation is as follows: z=xP,P∈R d×k ,x∈R d Where x is the component feature vector output by the student model, P is the random Gaussian matrix, d is the vector length of x, and k is the k directions of projection; Construct a projection histogram from each projection component, and reduce the dimension by dividing the projection histogram into bins sub-regions. j =histogram(z j ,bins=b,range=(-1,1)) Where z j is the projection component, b is the number of sub-regions of the projection histogram, and histogram(·) is the construction of the projection histogram; Concatenate all projected histograms together to form a histogram vector: h=[h1,h2,…,h k ]∈R k·b For this histogram vector, the distance between it and the normal sample distribution is obtained by the Mahalanobis distance, that is, the implicit feature anomaly score: Where μ h is the mean of the normal sample distribution, is the inverse of the covariance matrix of the normal sample distribution.
7. The method for self-supervised defect detection of contact network components based on ETR_EfficientAD according to claim 1, characterized in that: After the contact network image is input into the trained ETR_EfficientAD comparative learning model, it is divided into two branches. One branch is the teacher model and the first half of the student model, which are used to extract local features and output local difference maps; the other branch is the second half of the student model and the autoencoder, which are used to extract global features and output global difference maps. The local difference map is fused with the global difference map to generate a combined anomaly map, and its maximum value is extracted as the explicit feature anomaly score at the image level. The implicit feature anomaly score is added to the explicit feature anomaly score to obtain the optimal threshold.
8. A self-supervisory defect detection system for contact network components based on ETR_EfficientAD, characterized by: include: The dataset acquisition module extracts component images from the contact network image and obtains the component image dataset CHSR through data enhancement technology; The training module builds the ETR_EfficientAD contrastive learning model, which uses a student model-teacher model-autoencoder ternary network architecture and is trained based on the ImageNet dataset and the component image dataset CHSR. The detection module uses the trained ETR_EfficientAD comparative learning model to detect component images and obtain implicit feature anomaly scores and explicit feature anomaly scores. The optimal threshold is obtained through the implicit feature anomaly scores and the explicit feature anomaly scores to detect whether the component is abnormal.
9. An electronic device comprising a memory, a processor, and a computer program stored and running on the memory, characterized in that: When the processor executes the program, it implements the self-supervisory defect detection method for contact network components based on ETR_EfficientAD as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the self-supervisory defect detection method for contact network components based on ETR_EfficientAD as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Contact network parts defect detection method and device
CN114581388B
Catenary double-sleeve connector nut loosening defect detection method
CN118429317A