A high-speed rail pendant insulator integrity identification method and system based on improved YOLOv9
By improving the detection model built on the YOLOv9 framework, the problems of identification accuracy and speed in the high-speed rail dropper insulator detection system were solved, achieving high-precision, low-false-detection-rate identification of dropper insulator integrity, which is suitable for intelligent detection in high-speed rail operation and maintenance.
Patent Information
- Application Number
- CN202510643002.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-05-19
AI Technical Summary
The existing high-speed rail dropper insulator integrity detection system has low identification accuracy and is easily affected by the subjective judgment of the operator, resulting in frequent false detections and missed detections, which cannot meet the high precision requirements of industrial production.
An improved YOLOv9 framework was used to build a detection model. The model was optimized by reparameterizing the RepNCSPELAN4 module, embedding a spatial channel collaborative attention mechanism between the backbone network and the neck network, introducing dilated convolution and EffectiveSE attention mechanism, and combining high-speed integrated inspection train image data with data augmentation to generate a high-quality labeled dataset. The model was then iteratively trained and deployed to edge computing devices.
It significantly improves the accuracy and speed of dropper insulator detection, reduces the missed detection rate and false alarm rate, and achieves high precision and real-time performance in identifying the integrity of dropper insulators in high-speed railways.
Smart Images

Figure CN120279382B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of target detection, and particularly relates to a high-speed rail pendant insulator integrity recognition method and system based on an improved YOLOv9. BACKGROUND
[0002] In the current high-speed rail pendant insulator integrity detection field, the recognition accuracy is not ideal, and the detection result is easily affected by the subjective judgment of the operator, which leads to low accuracy in the recognition process and frequent false detection and missed detection. Traditional detection methods, such as fine-tuning of the target detection model or adding additional detection levels, cannot fully meet the high-precision requirements of industrial production for pendant insulator integrity detection. Therefore, if the high-speed rail pendant insulator detection system has a serious recognition error, it is not suitable for deployment and use in actual industrial production environment.
[0003] Therefore, improvement is needed. SUMMARY
[0004] To solve the problems of low recognition accuracy and slow recognition speed of high-speed rail pendant insulator integrity, the application provides a high-speed rail pendant insulator integrity recognition method and system based on an improved YOLOv9.
[0005] The application aims to achieve the following technical solutions:
[0006] A high-speed rail pendant insulator integrity recognition method based on an improved YOLOv9, comprising the following steps:
[0007] Collecting pendant insulator image data with a preset clarity by a high-speed comprehensive detection train, labeling the insulators of the pendant insulator image data as "normal" or "missing" categories based on a labeling platform, and generating a dual-category labeled data set;
[0008] Performing negative sample screening on the dual-category labeled data set, dividing the training set, validation set and test set based on a preset ratio of 8:1:1, and implementing data enhancement of geometric transformation and color space adjustment on the training set and validation set;
[0009] Building an improved detection model based on the YOLOv9 framework, which includes reparameterization improvement of the RepNCSPELAN4 module, embedding a spatial channel cooperative attention mechanism between the backbone network and the neck network, and introducing a hollow convolution and an EffectiveSE attention mechanism optimization to the SPPCSPC module;
[0010] inputting the training set and the verification set into the improved detection model in sequence, performing iterative training based on the training set, monitoring convergence based on the verification set, and outputting a trained improved detection model;
[0011] inputting the test set into the trained improved detection model, calculating the precision, recall, average precision mean and intersection over union based on the test set, determining whether the performance meets the standard, and outputting a trained improved detection model;
[0012] deploying the trained improved detection model to an edge computing device, inputting a to-be-detected image in real time and outputting a detection result, wherein the detection result includes an insulator bounding box coordinate, an integrity state classification result and a classification confidence score;
[0013] Based on the detection result, a defect alarm signal and a visual report are generated and transmitted to a monitoring center through wireless communication.
[0014] In a preferred embodiment, the improved detection model is constructed based on the YOLOv9 framework, and the improved detection model includes the steps of reparameterization improvement of the RepNCSPELAN4 module, embedding a spatial channel collaborative attention mechanism between the backbone network and the neck network, and introducing a hollow convolution and an EffectiveSE attention mechanism optimization to the SPPCSPC module, which includes:
[0015] The step of reparameterization improvement of the RepNCSPELAN4 module includes:
[0016] In the training phase, a multi-branch structure containing a 3x3 convolution layer, a 1x1 convolution layer and an identity mapping branch is constructed.
[0017] In the inference phase, the multi-branch is merged into a single-path structure through a parameter fusion technology, wherein the fusion formula is:
[0018] wherein W i and b i are the convolution kernel weights and bias of each branch, and a i is a fusion coefficient.
[0019] In a preferred embodiment, the improved detection model is constructed based on the YOLOv9 framework, and the improved detection model includes the steps of reparameterization improvement of the RepNCSPELAN4 module, embedding a spatial channel collaborative attention mechanism between the backbone network and the neck network, and introducing a hollow convolution and an EffectiveSE attention mechanism optimization to the SPPCSPC module, which further includes:
[0020] The step of embedding a spatial channel collaborative attention mechanism between the backbone network and the neck network includes:
[0021] The multi-scale spatial features are extracted by the shareable multi-semantic spatial attention module, and the calculation formula is: s = σ (Σ k∈{3,5,7} Conv1D k (F));
[0022] Wherein, F is an input feature map, Conv1D k is a 1D convolution with kernel size k, and σ is a Sigmoid function.
[0023] The channel weight matrix is generated by the progressive channel self-attention module, and the calculation formula is:
[0024]
[0025] Wherein, GAP and GMP are global average pooling and maximum pooling, is a concatenation operation.
[0026] The spatial and channel weights are fused and the feature is re-calibrated:
[0027] Wherein, is an element-wise multiplication, and · is a channel dimension broadcast multiplication.
[0028] In a preferred embodiment, the improved detection model is constructed based on the YOLOv9 framework, which includes the steps of re-parameterization improvement of the RepNCSPELAN4 module, embedding of the spatial channel collaborative attention mechanism between the backbone network and the neck network, and introduction of the EffectiveSE attention mechanism optimization of the SPPCSPC module, and further includes:
[0029] The step of introducing the EffectiveSE attention mechanism optimization of the SPPCSPC module includes:
[0030] A three-level dilated convolution layer is constructed, and the expansion coefficients are 2, 4 and 6 respectively.
[0031] The EffectiveSE attention module is connected in parallel, and the channel compression ratio is set to 16:1, wherein the calibration formula is: F calibrated = F·δ(W2·ReLU(W1·GAP(F)));
[0032] Wherein, and are the parameters of the fully connected layer, and δ is the Sigmoid function.
[0033] In a preferred embodiment, the step of inputting the training set and the validation set into the improved detection model in sequence, performing iterative training based on the training set, and monitoring convergence based on the validation set to output the trained improved detection model comprises:
[0034] The cosine annealing strategy is adopted to dynamically adjust the learning rate, the initial learning rate η0=0.01 is set, the total training period T=100 is set, and the learning rate updating formula is:
[0035]
[0036] wherein t is the current training iteration number;
[0037] At the end of each training period, the average precision mean (mAP) and the loss value of the validation set are calculated
[0038] If the relative decline amplitude of the loss value of the validation set in the last 10 training periods is less than the threshold value ∈=1×10 -4 , the early stop mechanism is triggered;
[0039] The model parameters corresponding to the peak value of the average precision mean of the validation set are selected from the training history and loaded into the improved detection model through the parameter writing back technology.
[0040] In a preferred embodiment, the step of inputting the test set into the trained improved detection model, calculating the precision, recall, average precision mean, and intersection over union based on the test set, determining whether the performance meets the standard, and outputting the trained improved detection model comprises:
[0041] The calculation formula of the precision is:
[0042] wherein TP is the number of correctly detected insulators, and FP is the number of misdetected non-insulator targets;
[0043] The calculation formula of the recall is:
[0044] wherein FN is the number of missed real insulators;
[0045] The calculation formula of the average precision mean is:
[0046] wherein N=2 is the number of categories, p c (r) is the recall-precision interpolation curve of category c;
[0047] The calculation formula of the intersection over union is:
[0048] wherein B predTo predict the bounding box region, B gt is the true bounding box region;
[0049] When Precision≥95% and Recall≥93%, it is determined that the classification performance meets the requirements;
[0050] When the proportion of detection boxes with IoU≥0.8 in the test set is ≥95%, it is determined that the positioning accuracy is qualified;
[0051] When the single-frame inference time is ≤35ms and the false detection rate is ≤3%, it is determined that the real-time requirement is met.
[0052] In a preferred embodiment, the step of deploying the improved detection model trained to the edge computing device, inputting the image to be detected in real time and outputting the detection result, the detection result including the insulator bounding box coordinates, the integrity state classification result and the classification confidence score, comprises:
[0053] Performing normalization processing on the image to be detected, the normalization processing including size normalization and pixel value normalization, and outputting normalized image data;
[0054] Inputting the normalized image data into the improved detection model trained, and generating an original detection tensor containing bounding box coordinates, classification confidence and class score through forward propagation;
[0055] Performing the following processing on the original detection tensor, and outputting the detection result:
[0056] Converting the relative coordinates into absolute coordinates based on the anchor box mechanism, and the calculation formula is: x abs =(2σ(x pred )-0.5+c x )·s w y abs =(2σ(y pred )-0.5+c y )·s h ;
[0057] Wherein, (c x ,c y ) is the grid center coordinate, s w ,s h is the feature map step, and σ is the Sigmoid function;
[0058] Applying the Softmax function to the class score, and retaining the result with confidence≥0.9;
[0059] Sorting according to the confidence, and eliminating the overlapping boxes with IoU≥0.5.
[0060] The second object of the application is achieved by the following technical solutions:
[0061] The first module: collect image data of the suspension insulator with preset definition through high-speed comprehensive detection of the train, label the suspension insulator in the image data as "normal" or "missing" categories based on a labeling platform, and generate a double-category labeled data set;
[0062] The second module: perform negative sample screening on the double-category labeled data set, divide the training set, the validation set and the test set based on a preset ratio of 8:1:1, and perform data enhancement of geometric transformation and color space adjustment on the training set and the validation set;
[0063] The third module: build an improved detection model based on the YOLOv9 framework, which includes reparameterization improvement of the RepNCSPELAN4 module, embedding of the spatial channel cooperative attention mechanism between the backbone network and the neck network, and introduction of the hole convolution and the EffectiveSE attention mechanism optimization to the SPPCSPC module;
[0064] The fourth module: input the training set and the validation set into the improved detection model in turn, perform iterative training based on the training set, monitor the convergence based on the validation set, and output the trained improved detection model;
[0065] The fifth module: input the test set into the trained improved detection model, calculate the precision, recall, average precision mean and intersection over union based on the test set, determine whether the performance meets the standard, and output the trained improved detection model;
[0066] The sixth module: deploy the trained improved detection model to an edge computing device, input the image to be detected in real time and output the detection result, the detection result including the insulator bounding box coordinates, the integrity state classification result and the classification confidence score;
[0067] The seventh module: generate a defect alarm signal and a visual report based on the detection result, and transmit them to the monitoring center through wireless communication.
[0068] The third object of the application is achieved through the following technical solutions:
[0069] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps of the high-speed rail suspension insulator integrity identification method based on the improved YOLOv9.
[0070] The fourth object of the application is achieved through the following technical solutions:
[0071] A computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the high-speed rail pendant insulator integrity identification method based on improved YOLOv9.
[0072] In summary, the present application includes at least one of the following beneficial technical effects:
[0073] The RepNCSPELAN4 module of yolov9 is improved using the way of reparameterization, and a spatial channel cooperative convolution attention mechanism is introduced and inserted into the transmission between the backbone network and the neck network of yolov9. The SPPCSPC is optimized in the way of using the hole convolution and the EffectiveSE attention mechanism. Through the above improvements, the high-speed rail pendant insulator integrity identification can be more accurate, faster and higher speed. BRIEF DESCRIPTION OF DRAWINGS
[0074] Figure 1 is an implementation flowchart of an embodiment of the high-speed rail pendant insulator integrity identification method based on improved YOLOv9 of the present application;
[0075] Figure 2 is a network structure diagram of step S30 in an embodiment of the high-speed rail pendant insulator integrity identification method based on improved YOLOv9 of the present application;
[0076] Figure 3 is another network structure diagram of step S30 in an embodiment of the high-speed rail pendant insulator integrity identification method based on improved YOLOv9 of the present application;
[0077] Figure 4 is a network model diagram of step S30 in an embodiment of the high-speed rail pendant insulator integrity identification method based on improved YOLOv9 of the present application;
[0078] Figure 5 is a principle block diagram of a computer device of the present application. DETAILED DESCRIPTION
[0079] The following will be described in detail in combination with the accompanying Figures 1-5 The present application will be further described in detail.
[0080] In an embodiment, as shown in Figure 1 The present application discloses a high-speed rail pendant insulator integrity identification method based on improved YOLOv9, which specifically includes the following steps:
[0081] S10: Collecting pendant insulator image data with a preset clarity through high-speed comprehensive detection trains, labeling the insulators of the pendant insulator image data as "normal" or "missing" categories based on a labeling platform, and generating a dual-category labeled data set;
[0082] S20: performing negative sample screening on the dual-class labeling dataset, dividing a training set, a validation set and a test set based on a preset ratio 8:1:1, and performing data enhancement of geometric transformation and color space adjustment on the training set and the validation set;
[0083] S30: constructing an improved detection model based on a YOLOv9 framework, the improved detection model including reparameterization improvement of a RepNCSPELAN4 module, embedding a spatial channel cooperative attention mechanism between a backbone network and a neck network, and introducing a hollow convolution and an EffectiveSE attention mechanism optimization to an SPPCSPC module;
[0084] S40: sequentially inputting the training set and the validation set into the improved detection model, performing iterative training based on the training set, monitoring convergence based on the validation set, and outputting a trained improved detection model;
[0085] S50: inputting the test set into the trained improved detection model, calculating a precision rate, a recall rate, an average precision mean value and an intersection over union based on the test set, determining whether a performance meets a standard, and outputting a trained improved detection model;
[0086] S60: deploying the trained improved detection model to an edge computing device, inputting a to-be-detected image in real time and outputting a detection result, the detection result including an insulator bounding box coordinate, a completeness state classification result and a classification confidence score;
[0087] S70: generating a defect alarm signal and a visual report based on the detection result, and transmitting the defect alarm signal and the visual report to a monitoring center through wireless communication.
[0088] In the embodiment, high-definition images are collected by a high-speed comprehensive detection train (S10), and a dual-class labeling dataset is generated by combining a professional labeling platform to provide a high-quality supervision signal for model training. The dataset is divided in a ratio of 8:1:1 (S20), data distribution consistency is maintained, data enhancement is implemented through geometric transformation and color space adjustment, the model has stronger robustness to scenes such as light changes and perspective shifts, and the risk of overfitting is effectively reduced. An improved detection model is constructed based on a YOLOv9 framework (S30), and performance breakthroughs are achieved through three core improvements: reparameterization improvement of a RepNCSPELAN4 module to improve inference efficiency; embedding a spatial channel cooperative attention mechanism between a backbone network and a neck network to enhance feature representation capability; and introducing a hollow convolution and an EffectiveSE attention mechanism optimization to an SPPCSPC module to expand a receptive field and strengthen channel dimension feature extraction. These improvements achieve a better balance between detection accuracy and speed.
[0089] The training set is used for iterative training, and the convergence is monitored in real time through the validation set (S40). The learning rate and other hyperparameters are dynamically adjusted based on the change of the loss function to ensure that the model converges stably to the optimal state during the training process. Finally, the precision, recall, mAP and IoU and other indicators are calculated through the test set (S50) to establish a quantitative performance evaluation system and ensure that the model meets the engineering application standard. The trained model is deployed to the edge computing device (S60), and the model quantization and optimization technology is used to realize lightweight deployment, which meets the real-time requirement of single-frame inference time on the premise of ensuring detection accuracy. The structured detection results containing the bounding box coordinates, classification results and confidence scores are output to provide complete information chain for defect positioning and identification. Based on the detection results, the defect alarm signal and visual report are automatically generated (S70), which are transmitted to the monitoring center in real time through the wireless communication module to form a complete business closed loop of "detection-identification-alarm-disposal". The system reduces the missed detection rate of insulator defect detection, controls the false alarm rate within the acceptable range of engineering, and significantly improves the intelligent level of the overhead line system operation and maintenance.
[0090] Figure 2 The S30 step includes:
[0091] S301: the step of reparameterization improvement of the RepNCSPELAN4 module includes:
[0092] In the training phase, a multi-branch structure including a 3x3 convolution layer, a 1x1 convolution layer and an identity mapping branch is constructed.
[0093] S302: in the inference phase, the multi-branch is merged into a single-path structure through parameter fusion technology, and the fusion formula is:
[0094] S303: wherein, W i and b i are the convolution kernel weights and bias of each branch, and a i is a fusion coefficient.
[0095] In this embodiment, the reparameterization improvement of the RepNCSPELAN4 module uses RepConv, which is an advanced model reparameterization method. It significantly improves the efficiency and performance of the model by merging multiple computing units into one unit in the inference phase. The basic idea of RepConv is to use multi-path convolution layers during training, and then use reparameterization techniques to merge the parameters of these path layers into the main path during inference. This method not only greatly reduces the computational demand, but also significantly reduces the memory usage.
[0096] Figure 3 The S30 step further includes:
[0097] S304: The step of embedding a spatial channel synergy attention mechanism between the backbone network and the neck network comprises:
[0098] A multi-scale spatial feature is extracted through a shareable multi-semantic spatial attention module, and a calculation formula is s = σ(∑ k∈{3,5,7} Conv1D k (F));
[0099] S305: Wherein F is an input feature map, Conv1D k is a 1D convolution with a kernel size k, and σ is a Sigmoid function.
[0100] S306: A channel weight matrix is generated through a progressive channel self-attention module, and a calculation formula is:
[0101]
[0102] S307: Wherein GAP and GMP are global average pooling and maximum pooling, is a concatenation operation.
[0103] S308: The spatial and channel weights are fused and the features are re-calibrated:
[0104] S309: Wherein is an element-wise multiplication, and · is a channel dimension broadcast multiplication.
[0105] In this embodiment, on the images taken by the China Railway High-speed Comprehensive Detection Train, the spatial and channel synergy attention mechanism can extract the attention area of the feature map, helping YOLOv9 to distinguish the information of complex hanging string insulators, so that the network can focus on the target to be detected. The Spatial and Channel Synergy Attention (SCSA) algorithm is an attention mechanism used in deep learning models, especially in image processing tasks such as object detection, image classification, and semantic segmentation. The principle of this algorithm is to enhance the model's attention to important features by considering both the spatial and channel dimensions of the feature map, thereby improving the performance of the model.
[0106] Specifically, the basic principles of the SCSA algorithm are as follows: Shareable Multi-Semantic Spatial Attention (SMSA), principle: SMSA captures multi-semantic spatial information of each feature channel through multi-scale and depth-shared 1D convolution, effectively integrating global contextual dependence and multi-semantic spatial prior; Progressive Channel Self-Attention (PCSA), principle: PCSA uses self-attention mechanism to adjust the mutual relationship between channels, by calculating the feature map in the channel dimension, A is the channel attention weight, FC is the full connection layer, Concat is the splicing operation, GAP and GMP are global average pooling and global maximum pooling respectively; Spatial and Channel Collaborative Attention (SCSA), principle: SCSA combines SMSA and PCSA, considering both spatial and channel information. Through these three steps, the SCSA algorithm can effectively highlight the key spatial regions in the image, and enhance the model's attention to specific features through channel dimension adjustment, thereby achieving better performance in visual tasks.
[0107] Figure 4 , S30 step, also includes:
[0108] SA1: The step of introducing a hollow convolution and an EffectiveSE attention mechanism optimization in the SPPCSPC module includes:
[0109] A three-level hollow convolution layer is constructed, and the expansion coefficients are 2, 4 and 6 respectively;
[0110] SA2: Parallel EffectiveSE attention module, with a channel compression ratio of 16:1, wherein the calibration formula is: F calibrated = F·δ(W2·ReLU(W1·GAP(F)));
[0111] SA3: wherein, and are the parameters of the full connection layer, and δ is the Sigmoid function.
[0112] In this embodiment, dilated convolution is a technique used in the field of deep learning to expand the receptive field of convolutional neural networks, particularly in tasks such as image processing. This technique achieves this by inserting "holes" or "gaps" between the elements of the convolution kernel, which can increase the field of view of the convolution operation without increasing the number of parameters or computational cost. EffectiveSE (Effective Squeeze-and-Excitation) attention mechanism is an improved Squeeze-and-Excitation (SE) module used to enhance feature representation in deep learning models. The SE module improves the representation ability of the network by explicitly modeling the dependence between channels. EffectiveSE optimizes this to improve efficiency and performance.
[0113] S40 step, comprising:
[0114] S401: Adopting cosine annealing strategy to dynamically adjust learning rate, setting initial learning rate η0=0.01, training total period T=100, and learning rate updating formula is:
[0115]
[0116] S402: Wherein t is the current training iteration number;
[0117] S403: At the end of each training period, the average precision mean (mAP) and loss value of the validation set are calculated
[0118] S404: If the relative decline amplitude of the validation set loss value in the last 10 training periods is less than the threshold value ∈=1×10 -4 , the early stopping mechanism is triggered;
[0119] S405: Select the model parameters corresponding to the peak value of the average precision mean of the validation set from the training history, and load them to the improved detection model through the parameter writing back technology.
[0120] In this embodiment, in the model training stage (S401-S405), the cosine annealing learning rate strategy is used to dynamically optimize the training process, the initial learning rate η0=0.01 and the training period T=100 are set, and the learning rate is periodically decayed according to the formula (t is the current iteration number), which avoids local optimal trap and accelerates model convergence; at the same time, combined with the intelligent early stopping mechanism, the average precision mean and loss value of the validation set are calculated at the end of each training period If the loss decline amplitude in the last 10 periods is less than the threshold value ∈=1×10 -4If so, the training is automatically terminated and the parameter backwriting technique is triggered to load the model parameters corresponding to the peak value of the average precision of the validation set from the training history to the improved detection model.
[0121] S50, comprising:
[0122] S501: the calculation formula of the precision is:
[0123] S502: wherein TP is the number of correctly detected insulators, and FP is the number of misdetected non-insulator targets;
[0124] S503: the calculation formula of the recall is:
[0125] S504: wherein FN is the number of missed real insulators;
[0126] S505: the calculation formula of the average precision mean is:
[0127] S506: wherein N = 2 is the number of categories, p c (r) is the recall-precision interpolation curve of the category c;
[0128] S507: the calculation formula of the IoU is:
[0129] S508: wherein B pred is the predicted frame region, and B gt is the real labeled frame region;
[0130] S509: when Precision ≥ 95% and Recall ≥ 93%, it is determined that the classification performance meets the requirements;
[0131] S510: when the proportion of detection frames with IoU ≥ 0.8 is ≥ 95%, it is determined that the positioning accuracy is qualified;
[0132] S511: when the single-frame inference time is ≤ 35 ms and the misdetection rate is ≤ 3%, it is determined that the real-time requirement is met.
[0133] In the embodiment, the binary evaluation system of precision (S501-S502) and recall (S503-S504) is used to quantify the recognition accuracy (TP / (TP+FP)) and coverage completeness (TP / (TP+FN)) of the positive samples of the model, respectively, to form the basic performance scale of the detection task. The average precision mean (mAP, S505-S506) further integrates the multi-class detection results, draws the PR curve by interpolation method and calculates the area under the curve to realize the standardized comparison of cross-class performance. The intersection over union (IoU, S507-S508) as the core index of geometric matching degree, through the intersection / union ratio (A∩B / A∪B) of the predicted box and the real box, converts the spatial positioning accuracy into a calculable continuous value, and provides an objective evaluation basis for the boundary box regression quality. The double threshold (S509-S511) is set, when the precision is greater than or equal to 95% and the recall is greater than or equal to 93%, the classification reliability is ensured; the proportion of the detection box with IoU greater than or equal to 0.8 is more than 95% to guarantee the positioning accuracy; finally, through the real-time constraint of single frame inference time less than or equal to 35 ms and false detection rate less than or equal to 3%, the whole chain evaluation standard from detection accuracy to calculation efficiency is constructed.
[0134] S60 step, comprising:
[0135] S601: performing normalization processing on the to-be-detected image, the normalization processing including size normalization and pixel value normalization, and outputting normalized image data;
[0136] S602: inputting the normalized image data into the improved detection model trained, and generating an original detection tensor containing boundary box coordinates, classification confidence and class score through forward propagation;
[0137] S603: performing the following processing on the original detection tensor, and outputting a detection result:
[0138] S604: converting relative coordinates into absolute coordinates based on an anchor box mechanism, and the calculation formula is: x abs =(2σ(x pred )-0.5+c x )·s w y abs =(2σ(y pred )-0.5+c y )·s h ;
[0139] S605: wherein (c x ,c y ) is the grid center coordinate, s w ,s h is the feature map step, and σ is the Sigmoid function;
[0140] S606: Apply Softmax function to the class score, and retain the results with a confidence level of ≥0.9;
[0141] S607: Sort by confidence level, and eliminate overlapping boxes with an IoU of ≥0.5.
[0142] In this embodiment, the input image resolution is unified by size normalization (S601), eliminating feature extraction bias caused by image scale differences; pixel value normalization maps pixel values to a standard interval, accelerating model training convergence and enhancing generalization ability, providing a standardized input base for subsequent detection. Feature extraction and decoding mechanism: the improved detection model (S602) generates original tensors containing bounding box coordinates, classification confidence, and class scores through forward propagation. Its model optimization may involve a feature pyramid network (FPN) or multi-scale feature fusion, enhancing the feature expression ability for small target insulators. In the coordinate decoding stage (S604-S605), the anchor box mechanism is used, and the relative coordinates are converted to absolute coordinates through linear mapping of the grid center coordinates and the feature map step size, combined with the Sigmoid function, to achieve precise spatial positioning of the detection box. The class score is normalized by the Softmax function (S606), generating a probability distribution vector and filtering low-confidence predictions, effectively suppressing background noise interference; non-maximum suppression (NMS, S607) filters out redundant detection boxes with an overlap exceeding the threshold value by sorting by confidence level and IoU threshold, reducing the false detection rate to an acceptable range for engineering while ensuring recall rate.
[0143] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0144] In an embodiment, a high-speed comprehensive detection train is provided to collect insulator image data with a preset clarity, and an insulator in the insulator image data is labeled as "normal" or "missing" based on a labeling platform to generate a dual-class labeled data set.
[0145] The first module: collect insulator image data with a preset clarity by a high-speed comprehensive detection train, and label the insulator in the insulator image data as "normal" or "missing" based on a labeling platform to generate a dual-class labeled data set.
[0146] The second module: perform negative sample screening on the dual-class labeled data set, divide the training set, validation set, and test set based on a preset ratio of 8:1:1, and perform data enhancement of geometric transformation and color space adjustment on the training set and validation set.
[0147] The third module: based on the YOLOv9 framework, an improved detection model is constructed, which includes the reparameterization improvement of the RepNCSPELAN4 module, the embedding of the spatial channel cooperative attention mechanism between the backbone network and the neck network, the introduction of the hole convolution and the EffectiveSE attention mechanism optimization to the SPPCSPC module;
[0148] The fourth module: the training set and the verification set are input into the improved detection model in turn, based on the training set, iterative training is performed, and based on the verification set, convergence is monitored, and a trained improved detection model is output;
[0149] The fifth module: the test set is input into the trained improved detection model, based on the test set, the precision, recall, average precision mean and intersection over union are calculated, whether the performance meets the standard is determined, and the trained improved detection model is output;
[0150] The sixth module: the trained improved detection model is deployed to the edge computing device, real-time input of the image to be detected and output of the detection result, the detection result including the insulator bounding box coordinates, the integrity state classification result and the classification confidence score;
[0151] The seventh module: based on the detection result, a defect alarm signal and a visual report are generated, and transmitted to the monitoring center through wireless communication.
[0152] Optionally, it further comprises:
[0153] The first including module: the step of reparameterization improvement of the RepNCSPELAN4 module, comprising:
[0154] In the training phase, a multi-branch structure containing 3*3 convolution layer, 1*1 convolution layer and identity mapping branch is constructed;
[0155] The first formula module: in the inference phase, the multi-branch is merged into a single path structure through parameter fusion technology, and the fusion formula is:
[0156] The first wherein module: wherein, W i and b i are the convolution kernel weights and bias of each branch, and a i is the fusion coefficient.
[0157] Optionally, it further comprises:
[0158] The second including module: the step of embedding the spatial channel cooperative attention mechanism between the backbone network and the neck network, comprising:
[0159] The multi-scale spatial features are extracted by the shareable multi-semantic spatial attention module, and the calculation formula is: S = σ (∑ k∈{3,5,7} Conv1D k (F));
[0160] The second module: wherein F is an input feature map, Conv1D k is a 1D convolution with a kernel size k, and σ is a Sigmoid function.
[0161] The second formula module: a channel weight matrix is generated by the progressive channel self-attention module, and the calculation formula is:
[0162]
[0163] The third module: wherein GAP and GMP are global average pooling and maximum pooling, is a concatenation operation.
[0164] The first fusion module: the spatial and channel weights are fused and the feature is recalibrated:
[0165] The fourth module: wherein is an element-wise multiplication, and · is a channel dimension broadcast multiplication.
[0166] Optionally, it further includes:
[0167] The third module: the steps of introducing a cavity convolution and an EffectiveSE attention mechanism optimization in the SPPCSPC module, including:
[0168] A three-level cavity convolution layer is constructed, and the expansion coefficients are 2, 4 and 6 respectively.
[0169] The fifth module: the EffectiveSE attention module is connected in parallel, and the channel compression ratio is set to 16:1, wherein the calibration formula is: F calibrated = F·δ(W2·ReLU(W1·GAP(F)));
[0170] The sixth module: wherein and are the parameters of a fully connected layer, and δ is a Sigmoid function.
[0171] Optionally, it further includes:
[0172] The third formula module: a cosine annealing strategy is adopted to dynamically adjust the learning rate, the initial learning rate η0 is set to 0.01, the total training period T is set to 100, and the learning rate updating formula is:
[0173]
[0174] Seventh wherein the module: wherein, t is the current training iteration number;
[0175] The first calculation module: at the end of each training cycle, the average precision mean (mAP) and loss value L of the validation set are calculated val ;
[0176] The first trigger module: if the relative decline amplitude of the validation set loss value in the last 10 training cycles is less than the threshold value ∈ = 1 x 10 -4 , the early stop mechanism is triggered;
[0177] The first selection module: the model parameters corresponding to the peak value of the average precision mean of the validation set are selected from the training history, and are loaded to the improved detection model through the parameter writing back technology.
[0178] Optionally, it further comprises:
[0179] The second calculation module: the calculation formula of the precision is:
[0180] The eighth wherein the module: wherein, TP is the number of correctly detected insulators, and FP is the number of misdetected non-insulator targets;
[0181] The third calculation module: the calculation formula of the recall rate is:
[0182] The ninth wherein the module: wherein, FN is the number of missed real insulators;
[0183] The calculation module: the calculation formula of the average precision mean is:
[0184] The module: wherein, N = 2 is the number of categories, p c (r) is the recall-precision interpolation curve of the category c;
[0185] The fifth calculation module: the calculation formula of the intersection over union is:
[0186] The fifth wherein the module: wherein, B pred is the predicted frame region, and B gt is the real labeled frame region;
[0187] The first determination module: when Precision≥95% and Recall≥93%, it is determined that the classification performance meets the standard;
[0188] The second determination module: when the proportion of detection frames with IoU≥0.8 is ≥95%, it is determined that the positioning accuracy is qualified;
[0189] The third determination module determines that the real-time requirement is met when the single-frame inference time is less than or equal to 35 ms and the false detection rate is less than or equal to 3%.
[0190] Optionally, the system further comprises:
[0191] The system comprises a module that performs normalization processing on the to-be-detected image, the normalization processing including size normalization and pixel value normalization, and outputs normalized image data.
[0192] The system comprises an input module that inputs the normalized image data into the trained improved detection model, and generates an original detection tensor containing bounding box coordinates, classification confidence and class score through forward propagation.
[0193] The system comprises an output module that performs the following processing on the original detection tensor, and outputs a detection result:
[0194] The sixth calculation module converts the relative coordinates into absolute coordinates based on an anchor box mechanism, and the calculation formula is: x abs =(2σ(x pred )-0.5+c x )·s w y abs =(2σ(y pred )-0.5+c y )·s h .
[0195] The sixth module comprises: wherein (c x ,c y ) is the grid center coordinate, s w ,s h is the feature map step length, and sigma is the Sigmoid function.
[0196] The system comprises a retention module that applies a Softmax function to the class score, and retains the result with a confidence of greater than or equal to 0.9.
[0197] The system comprises a rejection module that sorts according to the confidence, and rejects the overlapping box with an IoU greater than or equal to 0.5.
[0198] For specific limitations of the high-speed rail hanging string insulator integrity identification system based on the improved YOLOv9, refer to the limitations of the high-speed rail hanging string insulator integrity identification method based on the improved YOLOv9 in the foregoing, which will not be repeated here. Each module in the high-speed rail hanging string insulator integrity identification system based on the improved YOLOv9 can be realized by software, hardware, or a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0199] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores image data of dropper insulators. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements an improved YOLOv9-based method for identifying the integrity of high-speed railway dropper insulators.
[0200] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a method for identifying the integrity of high-speed railway dropper insulators based on an improved YOLOv9.
[0201] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, is a method for identifying the integrity of high-speed rail drop wire insulators based on an improved YOLOv9.
[0202] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, database or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0203] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of functional units and modules is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.
Claims
1. A high-speed rail pendant insulator integrity identification method based on improved YOLOv9, characterized in that, The method comprises the following steps: including the following steps: Collecting image data of the suspension insulator with a preset definition through high-speed comprehensive detection of a train, labeling the suspension insulator in the image data as a "normal" or "missing" category based on a labeling platform, and generating a double-category labeled data set; Performing negative sample screening on the double-category labeled data set, dividing the training set, the validation set and the test set based on a preset ratio of 8:1:1, and implementing data enhancement of geometric transformation and color space adjustment on the training set and the validation set; Based on the YOLOv9 framework, an improved detection model is constructed, which includes the steps of reparameterization improvement of the RepNCSPELAN4 module, embedding a spatial channel collaborative attention mechanism between the backbone network and the neck network, and introducing a hollow convolution and an EffectiveSE attention mechanism optimization to the SPPCSPC module. The reparameterization improvement of the RepNCSPELAN4 module comprises: In the training phase, a multi-branch structure including a 3×3 convolution layer, a 1×1 convolution layer and an identity mapping branch is constructed; wherein W i and b i are the convolution kernel weights and bias of each branch, and a i is the fusion coefficient; In the inference phase, the multi-branch is merged into a single path structure through parameter fusion technology, and the fusion formula is: The multi-scale spatial features are extracted through the shareable multi-semantic spatial attention module, and a calculation formula is as follows: s = σ(∑ k∈{3,5,7} Conv1D k (F)); wherein F is an input feature map, Conv1D k is a 1D convolution with kernel size k, and σ is a Sigmoid function. The step of embedding a spatial channel collaborative attention mechanism between the backbone network and the neck network comprises: A channel weight matrix is generated through a progressive channel self-attention module, and the calculation formula is: A=FC2(ReLU(FC1(GAP(F)⊕GMP(F))); Fusing the spatial and channel weights and performing feature re-scaling: wherein, is element-wise multiplication, and • is channel dimension broadcast multiplication. Where GAP and GMP are global average pooling and maximum pooling, and is a splicing operation; The training set and the validation set are input into the improved detection model in turn, the training set is used for iterative training, the validation set is used for monitoring convergence, and a trained improved detection model is output; The test set is input into the trained improved detection model, the precision, recall, average precision and intersection over union of the test set are calculated, whether the performance meets the standard is determined, and a trained improved detection model is output; The trained improved detection model is deployed to an edge computing device, real-time input of the image to be detected is performed, and a detection result is output, the detection result including the insulator bounding box coordinates, the integrity state classification result and the classification confidence score; 2. The method of claim 1, wherein, Based on the detection result, a defect alarm signal and a visual report are generated, and are transmitted to a monitoring center through wireless communication. The step of constructing an improved detection model based on the YOLOv9 framework, which includes the steps of reparameterization improvement of the RepNCSPELAN4 module, embedding a spatial channel collaborative attention mechanism between the backbone network and the neck network, and introducing a hollow convolution and an EffectiveSE attention mechanism optimization to the SPPCSPC module, further comprises: The step of introducing a hollow convolution and an EffectiveSE attention mechanism optimization to the SPPCSPC module comprises: A three-level hollow convolution layer is constructed, and the dilation coefficients are 2, 4 and 6, respectively; A parallel EffectiveSE attention module with a channel compression ratio set to 16:1, wherein the calibration formula is: F calibrated = F · δ(w2 · ReLU(W1 · GAP(F))); wherein, and are fully connected layer parameters, and δ is a sigmoid function.
3. The method of claim 1, wherein, The step of sequentially inputting the training set and the verification set into the improved detection model, based on the training set, performing iterative training, and based on the verification set, monitoring convergence, and outputting the trained improved detection model, comprises: The cosine annealing strategy is adopted to dynamically adjust the learning rate, the initial learning rate η0=0.01 is set, the total training period T=100, and the learning rate updating formula is: Wherein, t is the current training iteration number; At the end of each training cycle, the mean average precision (mAP) and loss value of the validation set are computed If the relative decline of the validation set loss value is less than a threshold value ∈ for 10 consecutive training cycles, trigger the early stopping mechanism, the threshold value ∈ = 1 x 10 -4 ; The model parameters corresponding to the average precision mean peak value of the validation set are selected from the training history, and are loaded into the improved detection model through parameter writing technology.
4. The method of claim 1, wherein, The step of inputting the test set into the trained improved detection model, based on the test set, calculating the precision, recall, average precision mean and intersection over union, determining whether the performance meets the standard, and outputting the trained improved detection model, comprises: The calculation formula of the precision rate is: Wherein, TP is the number of correctly detected insulators, and FP is the number of misdetected non-insulator targets; The calculation formula of the recall rate is: Wherein, FN is the number of missed real insulators; The formula for calculating the average precision mean is: where N = 2 is the number of classes, p c (r) is the recall-precision interpolation curve for class c; The formula for calculating the FOM is: wherein B pred is a predicted bounding box region, B gt is a ground truth bounding box region; When Precision≥95% and Recall≥93%, the classification performance is determined to meet the standard; When the proportion of detection boxes with IoU≥0.8 in the test set is ≥95%, the positioning accuracy is determined to be qualified; When the single-frame inference time is ≤35ms and the misdetection rate is ≤3%, the real-time requirement is met.
5. The method of claim 1, wherein, The step of deploying the trained improved detection model to the edge computing device, inputting the image to be detected in real time and outputting the detection result, the detection result including the insulator bounding box coordinates, the integrity state classification result and the classification confidence score, comprises: Perform normalization processing on the image to be detected, which includes size normalization and pixel value normalization, and output normalized image data; Input the normalized image data into the trained improved detection model to generate an original detection tensor containing bounding box coordinates, classification confidence and class score through forward propagation; The following processing is performed on the original detection tensor to output the detection result: The relative coordinates are converted into absolute coordinates based on an anchor frame mechanism, and the calculation formula is: x abs =(2σ(x pred )-0.5+c x )·s w , y abs =(2σ(y pred )-0.5+c y )·s h ; wherein (c x , c y ) is the grid center coordinate, s w ,s h is the feature map step size, and σ is a sigmoid function. Apply the Softmax function to the class score to retain the results with a confidence of ≥0.9; Sort by confidence and remove overlapping boxes with IoU≥0.
5.
6. An improved YOLOv9-based high-speed rail pendant insulator integrity identification system, characterized in that, The following steps are included: First module: Collecting the image data of the pendant insulator with a preset clarity through high-speed comprehensive detection of the train, and labeling the insulator of the image data as "normal" or "missing" category based on the labeling platform to generate a dual-category labeled data set; Second module: Negative sample screening is performed on the dual-category labeled data set, the training set, the validation set and the test set are divided based on a preset ratio of 8:1:1, and data enhancement of geometric transformation and color space adjustment is performed on the training set and the validation set; The third module constructs an improved detection model based on the YOLOv9 framework, which includes reparameterization improvement of the RepNCSPELAN4 module, embedding of a spatial channel cooperative attention mechanism between the backbone network and the neck network, and introduction of a hollow convolution and an EffectiveSE attention mechanism optimization to the SPPCSPC module; The first module includes the steps of reparameterization improvement of the RepNCSPELAN4 module, which comprises: The training stage constructs a multi-branch structure including a 3*3 convolution layer, a 1*1 convolution layer and an identity mapping branch; The first formula module: in the reasoning stage, the multi-branch is merged into a single path structure through parameter fusion technology, wherein the fusion formula is: The first module is: wherein, W i and b i are the convolution kernel weights and bias of each branch, and α i is a fusion coefficient; The second comprising module: the step of embedding a spatial channel collaborative attention mechanism between the backbone network and the neck network, comprising: The multi-scale spatial features are extracted through the shareable multi-semantic spatial attention module, and a calculation formula is as follows: S = σ(∑ k∈{3,5,7} Conv1D k (F)); The second module is: wherein F is an input feature map, Conv1D k is a 1D convolution with kernel size k, and σ is a Sigmoid function. The second formula module: generating a channel weight matrix through a progressive channel self-attention module, wherein the calculation formula is: A=FC2(ReLU(FC1(GAP(F)⊕GMP(F))); The third wherein module: wherein GAP and GMP are global average pooling and maximum pooling respectively, and is a splicing operation; The first fusion module fuses the space and channel weights and performs feature re-scaling: Fourth among the modules: where, is element-wise multiplication, and • is channel-dimension broadcast multiplication. The fourth module: inputting the training set and the verification set into the improved detection model in turn, based on the training set, performing iterative training, and based on the verification set, monitoring convergence, and outputting a trained improved detection model; The fifth module: inputting the test set into the trained improved detection model, based on the test set, calculating precision, recall, average precision mean and intersection over union, determining whether the performance meets the standard, and outputting a trained improved detection model; The sixth module: deploying the trained improved detection model to an edge computing device, inputting a to-be-detected image in real time and outputting a detection result, the detection result including insulator bounding box coordinates, integrity state classification results and classification confidence scores; The seventh module: based on the detection result, generating a defect alarm signal and a visual report, and transmitting them to a monitoring center through wireless communication. 7.A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the improved YOLOv9-based high-speed rail insulator integrity identification method according to any one of claims 1-5 when executing the computer program. 8.A computer readable storage medium, storing a computer program, wherein the computer program implements the steps of the improved YOLOv9-based high-speed rail insulator integrity identification method according to any one of claims 1-5 when executed by a processor.
Citation Information
Patent Citations
Glass bead defect detection method based on improved spatial pyramid pooling
CN118485631A
Improved YOLOv9 transformer substation insulator and defect detection method and system thereof
CN119515816A