Subway water leakage identification method based on infrared image

By optimizing the YOLOv8 model, the adaptive small target penalty term and multi-dimensional collaborative optimization are adopted to solve the problem of small target detection in YOLOv8 when detecting water leakage in subway, significantly improving the recognition accuracy of fine cracks and water stain edges, ensuring the accuracy and efficiency of water leakage detection in subway.

CN120163972BActive Publication Date: 2025-08-22ZHEJIANG HONGPU TECH CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510643861.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-08-22
Estimated Expiration
2045-05-19

AI Technical Summary

Technical Problem

When YOLOv8 detects water leakage in subways, the detection accuracy of small targets is insufficient, especially the difficulty in identifying fine cracks and water stain edges, which is limited by the low pixel proportion, high positioning sensitivity and imbalance in gradient contribution.

Method used

By collecting infrared images of subway leaks, data set construction, preprocessing and labeling, the YOLOv8 model is optimized, adaptive small-objective penalty terms and multi-dimensional collaborative optimization are used to improve the model training process, use Mosaic data augmentation, median filtering and histogram equalization, and combine Adam optimizer and Soft NMS to improve the detection accuracy of small-objectives.

Benefits of technology

It significantly improves the accuracy of small target detection, especially the identification ability of fine cracks and water stain edges, ensures the accuracy and efficiency of subway leakage detection, reduces missed inspections and missed inspections, and provides key information for subway operation and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120163972B_ABST
    Figure CN120163972B_ABST
Patent Text Reader

Abstract

The present invention relates to infrared imaging technology, and specifically provides a subway water leakage identification method based on infrared images, including model optimization, which includes the following steps: (A1) collecting infrared images of subway water leakage to construct a data set; (A2) preprocessing the data set: removing noise and enhancing the leaking part; (A3) annotating the preprocessed image to mark the edge of the leaking area, converting the annotated result into a data set in YOLO format, and dividing it into a training set, a validation set, and a test set; (A4) in the target detection task, converting the positioning loss L of small targets into a training set, a validation set, and a test set; (A5) loc Corrected to Lˊ loc , obtaining an optimized YOLOv8 model; (A5) using the training set to train the optimized model, and using the validation set to validate the trained model; (A6) using the test set to test the finalized model. The present invention has advantages such as accurate recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of infrared imaging, and in particular to a subway water leakage identification method based on infrared images. Background Art

[0002] With the rapid development of urban rail transit, water leakage in subways has become increasingly prominent, posing a number of serious hazards. Leakage can corrode the concrete structure within subways, leading to corrosion of steel reinforcement, reducing the strength and durability of the structure, shortening the service life of subway facilities, and increasing the cost of large-scale repairs and reconstruction. Long-term leakage can also cause safety hazards such as short circuits and malfunctions in electrical equipment.

[0003] The YOLO series of algorithms, as a typical representative of one-stage algorithms, holds a key position in the field of object detection. Its uniqueness lies in converting object detection into a regression problem, which greatly improves detection efficiency. The latest YOLOv8 inherits the advantages of its predecessors and further optimizes the model architecture and training strategy, making significant improvements. It can achieve faster detection speeds while maintaining high detection accuracy. For subway water leakage detection scenarios, its efficient detection capabilities can quickly and accurately identify leaking areas, providing critical information to subway operations and maintenance in a timely manner, reducing potential risks and losses caused by water leakage, and meeting the needs of real-time, accurate detection in complex subway environments. However, there are also some shortcomings, such as:

[0004] When detecting small objects (such as minute cracks in subway water leaks and the edges of water stains), performance is limited due to the following reasons: a. The pixel ratio is low, and small objects have very few effective features in the image, which are easily submerged by background noise; b. Positioning sensitivity is high, and slight position deviations (such as a few pixels offset) will cause a significant drop in the Intersection over Union (IoU); c. Gradient contributions are unbalanced, with the gradients of large objects dominating the training process, and the positioning errors of small objects are ignored. Summary of the Invention

[0005] In order to solve the deficiencies in the above-mentioned prior art solutions, the present invention provides a subway water leakage identification method based on infrared images.

[0006] The purpose of the present invention is achieved through the following technical solutions:

[0007] A method for identifying subway water leaks based on infrared images includes model optimization; the model optimization includes the following steps:

[0008] (A1) Collect infrared images of subway water leakage to build a dataset;

[0009] (A2) Preprocess the dataset: remove noise and enhance the leaking part;

[0010] (A3) Annotate the preprocessed image, mark the edges of the leaking area, convert the annotation results into a YOLO format dataset, and divide it into training set, validation set, and test set;

[0011] (A4) In the target detection task, the positioning loss L of small targets is loc Corrected to Lˊ loc , obtain the optimized YOLOv8 model;

[0012] , ;

[0013] S is the target area, A img is the area of ​​the image, α and γ are coefficients, β is the decay rate, epoch is the current round, T0 is the initial stage threshold, and T is the adaptive threshold;

[0014] (A5) Use the training set to train the optimized model and use the validation set to validate the trained model;

[0015] (A6) Test the final model using the test set.

[0016] Compared with the prior art, the present invention has the following beneficial effects:

[0017] This paper solves the problem of small target detection when YOLOv8 is applied to seepage water identification, proposes an adaptive small target penalty term, and significantly improves the detection accuracy of small targets through multi-dimensional collaborative optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The disclosure of the present invention will become more easily understood with reference to the accompanying drawings. Those skilled in the art will readily appreciate that these drawings are merely used to illustrate the technical solutions of the present invention and are not intended to limit the scope of protection of the present invention.

[0019] Figure 1 1 is a flow chart of a method for identifying subway water leakage based on infrared images according to the present invention;

[0020] Figure 2 The subway water leakage identification result using the method of the present invention is Figure 1 ;

[0021] Figure 3 The subway water leakage identification result using the method of the present invention is Figure 2 ;

[0022] Figure 4 The subway water leakage identification result using the method of the present invention is Figure 3 ;

[0023] Figure 5The subway water leakage identification result using the method of the present invention is Figure 4 ;

[0024] Figure 6 The subway water leakage identification result using the method of the present invention is Figure 5 . DETAILED DESCRIPTION

[0025] Figures 1-6 The following description describes optional embodiments of the present invention to teach those skilled in the art how to implement and reproduce the present invention. In order to explain the technical solution of the present invention, some conventional aspects have been simplified or omitted. Those skilled in the art will understand that variations or substitutions derived from these embodiments will be within the scope of the present invention. Those skilled in the art will understand that the following features can be combined in various ways to form multiple variations of the present invention. Therefore, the present invention is not limited to the following optional embodiments, but is only limited by the claims and their equivalents.

[0026] Example 1.

[0027] The method for identifying subway water leakage based on infrared images according to an embodiment of the present invention includes model optimization, such as Figure 1 As shown, model optimization includes the following steps:

[0028] (A1) Collect infrared images of subway water leakage to build a dataset;

[0029] (A2) Preprocess the dataset: remove noise and enhance the leaking part;

[0030] (A3) Annotate the preprocessed image, mark the edges of the leaking area, convert the annotation results into a YOLO format dataset, and divide it into training set, validation set, and test set;

[0031] (A4) In the target detection task, the positioning loss L of small targets is loc Corrected to Lˊ loc , obtain the optimized YOLOv8 model;

[0032] , ;

[0033] S is the target area, A img is the area of ​​the image, α and γ are coefficients, β is the decay rate, epoch is the current round, T0 is the initial stage threshold, and T is the adaptive threshold;

[0034] (A5) Use the training set to train the optimized model and use the validation set to validate the trained model;

[0035] (A6) Test the final model using the test set.

[0036] In order to improve the recognition accuracy, in step (A1), the Mosaic data enhancement method is used to expand the subway water leakage dataset.

[0037] In order to improve the recognition accuracy, further, in step (A2), median filtering is used to remove noise, and histogram equalization is used to enhance the leaking part, so that the distinction between the leaking part and the background is increased.

[0038] In order to improve the recognition accuracy, in step (A3), labelme is used for labeling, and the ratio of the training set, validation set and test set is 7:2:1.

[0039] In order to improve the recognition accuracy, further, in the model training of step (A5), during the training process, according to the set parameters, the Adam optimizer in the back-propagation algorithm is combined with momentum and adaptive learning rate to continuously adjust the weights and biases of the model so that the loss function value of the model is reduced and the model continues to converge. The parameters include learning rate and number of iterations.

[0040] In order to improve the recognition accuracy, further, in the model verification of step (A5), the performance of the model is evaluated. If the performance does not meet expectations, the parameters of the model are adjusted, including the batch size, and the learning rate is dynamically adjusted using cosine annealing until the performance meets expectations.

[0041] Example 2.

[0042] An application example of the method for identifying subway water leakage based on infrared images according to embodiment 1 of the present invention.

[0043] In this application example, Figure 1 As shown, model optimization includes the following steps:

[0044] (A1) Infrared images of water leakage are collected using infrared instruments to construct a dataset, and the Mosaic data enhancement method is used to expand the subway water leakage dataset.

[0045] Mosaic data augmentation greatly enriches the data diversity and enhances the generalization ability of the model by randomly cropping, scaling, and splicing four different images.

[0046] (A2) Preprocess the data set. First, use the median filter to denoise the infrared image. The median filter selects a square area with a side length of k and the current pixel (i, j) as the center (used to determine the reference point of the filter window):

[0047] .

[0048] .

[0049] MedianFilter(I,k) represents the output value at position (I,k) after applying the median filter to image I. Indicates all Get the set of x values ​​with the minimum value. (x, y) represents the coordinates of any point within the window, which is used to traverse all pixels within the window. k is generally a positive integer, representing the side length of the filter window (an odd number), which controls the size of the filtering range. [k / 2] is the radius of the window, ensuring window symmetry. The median m is calculated by sorting the pixel values ​​within the window and taking the middle value as the new value for the current pixel, effectively removing interference such as salt and pepper noise.

[0050] Use histogram equalization to enhance the leaking part, histogram equalization, and map the original histogram to a uniform distribution U(0,1). Its probability density is transformed into:

[0051] .

[0052] Where W(z) represents the objective function or output variable, whose value is determined by the fractional product on the right. H(u) is the probability density function (PDF) or weight function, which describes the distribution or contribution strength of u. CDF(z) is the cumulative distribution function, P total is the normalization factor, , z and L are gray levels (i.e., the pixel intensity values ​​obtained from the image, such as L=256 for an 8-bit image). G(z) is the number (frequency) of pixels with gray level z in the histogram. , used to ensure that the results are within a reasonable range.

[0053] Redefine the contrast gain coefficient C after enhancement enh =var(T(I)) / var(I).

[0054] Where var(T(I)) is the variance of the enhanced image T(I), reflecting the degree of pixel value dispersion (contrast), and var(I) is the variance of the original image I, representing the initial contrast. By stretching the image histogram distribution, the water leakage and background can be more clearly distinguished.

[0055] (A3) Label the preprocessed image using LabelMe to accurately mark the edges of the leaking area for image segmentation. Finally, convert the labeled results into a dataset in YOLO format and divide it into training set, validation set, and test set with a division ratio of 7:2:1.

[0056] (A4) In target detection tasks, to better adapt to small target detection, this patent proposes a dynamic adaptive small-object penalty (DSOP), which significantly improves the detection accuracy of small targets through multi-dimensional collaborative optimization.

[0057] , .

[0058] S is the target area (pixel area), A img is the area of ​​the image, α and γ are coefficients, β is the decay rate, T0 is the initial stage threshold, and T is the adaptive threshold.

[0059] The global coefficient α of the small target penalty strength ranges from 0.1 to 1, which directly controls the additional loss weight for small targets. The value needs to balance the following contradictions:

[0060] α is too large: Over-amplifying the gradient of small targets may cause the model to insufficiently learn large / medium targets and lead to unstable training.

[0061] α is too small: The optimization efforts for small targets are insufficient, making it difficult to improve the missed detection problem.

[0062] For the dynamic weight mechanism:

[0063] Size sensitivity factor (1-S / T 2 ), when the target area S is smaller than the threshold T, a positive penalty term is generated , and the smaller the target, the greater the penalty weight.

[0064] Image scale normalization The influence of images with different resolutions can be eliminated, ensuring that the penalty term is independent of the input size.

[0065] The adaptive threshold T dynamically adjusts the threshold according to the training stage:

[0066] Initially, the threshold T0 is high (relaxed detection, determining the degree of leniency in the early stages of training). As training progresses, it exponentially decays, gradually focusing on smaller targets. The adjustment coefficient γ ranges from [0, 1] to control the magnitude of the decay. Experimental results show that larger values ​​result in more drastic threshold changes. β is the decay rate (empirical values ​​range from 0.01 to 0.5), which determines how quickly the threshold decreases. Larger values ​​result in faster decay (faster focus on smaller targets). Epoch is the current round.

[0067] Table 1. Table of different target parameters.

[0068] .

[0069] In Table 1, the smaller the target, the greater the correction amount. The larger the value, the higher the gradient weight during backpropagation, forcing the model to focus more on locating small targets. This modification solves the problem of small target gradients being overwhelmed by large targets during target detection. It is particularly suitable for enhancing the positioning accuracy of fine cracks and water stain edges in subway water leakage detection.

[0070] Table 2. Comparison of the processing results of the present invention and the existing model.

[0071] .

[0072] As shown in Table 2, in this way, the model pays more attention to the positioning accuracy of small targets during training, thereby improving the accuracy of small target detection.

[0073] (A5) Use the training set to train the optimized YOLOv8 model. During the training process, according to the set learning rate, number of iterations and other parameters, the Adam optimizer in the backpropagation algorithm is combined with momentum and adaptive learning rate:

[0074] .

[0075] .

[0076] Among them, m t Represents the momentum at the current moment (gradient weighted average). g t is the gradient at the current moment (calculated by back propagation). t is the weighted average of the squared gradient of the previous moment (used to adjust the learning rate). is the corrected momentum, which solves the deviation caused by m0=0 at the initial moment (t is small). is the corrected squared gradient average, and similarly eliminates the initial deviation, w t are the updated model parameters.

[0077] The momentum decay coefficients β1 and β2 are close to 0.9. β1 controls the decay rate of the first-order moment (momentum); a larger value results in a more persistent effect of the historical gradient. β2 controls the decay rate of the second-order moment (the squared gradient); a larger value results in smoother adaptive learning rate changes. η is the global learning rate, which determines the overall step size of parameter updates. It is a numerical stabilization term that prevents division by zero errors. Close to 10 -8, t is the number of training steps (iterations), which is used for bias correction. The model weights and biases are continuously adjusted to gradually reduce the model loss function value and continuously converge the model. The trained model is verified using the validation set, and the model performance is evaluated based on indicators such as loss value, accuracy, and recall rate on the validation set. If the model performance does not meet the expected requirements, the model hyperparameters are adjusted, such as the batch size, and the learning rate is dynamically adjusted using cosine annealing.

[0078] η(t)=η max ·cos(π·t / T decay ).

[0079] Where η(t) is the dynamic learning rate at training step t, η max Initial maximum learning rate (peak), T decay Annealing cycle (half cycle length). You can maintain a high learning rate in the early stages of training for rapid convergence, and slow it down later to avoid overfitting. Alternatively, you can further expand the dataset and then retrain and validate until the model performance meets the requirements.

[0080] In the post-processing stage of the model, Soft NMS is used instead of traditional NMS. Soft NMS does not directly delete the detection boxes with high overlap, but instead attenuates the detection box scores based on the overlap. The formula is:

[0081] .

[0082] Where Si is the i-th detection box b i The confidence score of M is the candidate detection box with the highest score at present, and b i is the i-th candidate detection box to be processed, and IoU is the intersection-over-union function. IoU(M,b i ) is used to measure the difference between the reference frame M and the candidate frame b i The overlap level is determined by the threshold T1, where T1 is the preset overlap threshold. This allows more possible small target detection results to be retained, and the final detection frame is then obtained through subsequent threshold screening. This improves the effectiveness of small target detection and reduces false detections and missed detections, providing a strong guarantee for accurate detection of subway water leaks.

[0083] (A6) The finalized model is tested using the test set to evaluate the model's detection performance in subway water leakage scenarios, ensuring that the model can accurately and efficiently detect subway water leakage and provide reliable technical support for the safe operation and maintenance of the subway.

[0084] The above optimized model is used to identify the collected infrared image. The recognition results are as follows: Figure 2-Figure 6As shown in the figure, the label represents the class name and confidence. The confidence represents the model's estimate of the probability that the target object water exists in the current detection frame, ranging from [0, 1], which is used to reflect the model's confidence in the detection result.

Claims

1. A method for identifying subway water leaks based on infrared images, including model optimization; characterized in that: The model optimization includes the following steps: A1. Collect infrared images of subway water leakage to build a dataset. A2. Preprocess the dataset: remove noise and enhance the leaking parts; A3. Annotate the preprocessed images, marking the edges of the leaking areas. Convert the annotations into a YOLO dataset and divide them into training, validation, and test sets. A4. In the target detection task, the positioning loss of small targets is L loc Corrected to Lˊ loc , obtain the optimized YOLOv8 model; , ; S is the target area, A img is the area of ​​the image, α and γ are coefficients, β is the decay rate, epoch is the current round, T0 is the initial stage threshold, T is the adaptive threshold, S <T; A5. Use the training set to train the optimized model and the validation set to validate the trained model. A6. Use the test set to test the finalized model.

2. The identification method according to claim 1, wherein: The Mosaic data enhancement method is used to expand the subway water leakage dataset.

3. The identification method according to claim 1, characterized in that Median filtering is used to remove noise, and histogram equalization is used to enhance the leaking part.

4. The identification method according to claim 1, characterized in that The training set, validation set, and test set were annotated with labelme, with a ratio of 7:2:

1.

5. The identification method according to claim 1, characterized in that In model training, during the training process, according to the set parameters, the Adam optimizer in the back-propagation algorithm is combined with momentum and adaptive learning rate to continuously adjust the weights and biases of the model so that the loss function value of the model decreases and the model continues to converge. The parameters include learning rate and number of iterations.

6. The identification method according to claim 1, characterized in that In model validation, the performance of the model is evaluated. If the performance does not meet expectations, the model parameters are adjusted, including the batch size, and the learning rate is dynamically adjusted using cosine annealing until the performance reaches the expected level.

Citation Information

Patent Citations

  • Infrared gas detection and gas contour automatic identification method

    CN116452529A

  • Small target detection method under view angle of unmanned aerial vehicle based on self-attention mechanism

    CN119992393A