Infrared leakage detection method, device and equipment for hydraulic structure and medium

By adopting the target detection model of fast network and feature enhancement network in infrared leakage detection of hydraulic buildings, combining the complete cross-border loss function and efficient multi-scale attention module, the problem of poor real-time leakage detection in the existing technology is solved, and efficient and accurate leakage detection is achieved.

CN119888203AInactive Publication Date: 2025-04-25SICHUAN ENERGY INTERNET RES INST TSINGHUA UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510353000.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-04-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The current leakage detection methods for hydraulic buildings have poor real-time performance, making it difficult to achieve efficient leakage detection.

Method used

The infrared leakage detection method is adopted to train the object detection model by obtaining preset object detection models, including fast networks and feature enhancement networks, combined with the complete cross-border loss function and efficient multi-scale attention module, and used to identify the target leakage area in the infrared leakage image.

Benefits of technology

It improves the real-time and accuracy of infrared leakage detection in hydraulic buildings, and can identify leakage areas more quickly and accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888203A_ABST
    Figure CN119888203A_ABST
Patent Text Reader

Abstract

The invention discloses an infrared leakage detection method, device and equipment for a hydraulic structure and a medium, and relates to a concrete water seepage detection technology. The method comprises the following steps: acquiring a preset target detection model, wherein the preset target detection model comprises a fast network; obtaining an initial data set, wherein the initial data set comprises a plurality of infrared leakage images; preprocessing each infrared leakage image to obtain a plurality of target images; determining a target data set according to each target image; according to a preset proportion, dividing the target data set into a training set, a test set and a verification set, and training a preset target detection model based on the training set, the test set and the verification set to obtain a target detection model; and inputting the to-be-identified image into the target detection model to obtain a target leakage area. According to the invention, the real-time performance and accuracy of infrared leakage detection of the hydraulic structure are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to concrete leakage detection technology, and in particular to a method, device, equipment and medium for infrared leakage detection of hydraulic structures. Background Art

[0002] Leakage detection is a key task to ensure the safe and stable operation of hydraulic structures. The existing detection methods mainly include: manual inspection method, machine vision method and target detection method. The existing technology has the following defects: poor real-time performance. Summary of the invention

[0003] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and provide a target detection method, device, equipment and medium. The present invention provides the following technical solutions: In a first aspect, the present invention provides a method for infrared leakage detection of hydraulic structures, the method comprising: obtaining a preset target detection model, the preset target detection model comprising a fast network; obtaining an initial data set, the initial data set comprising a plurality of infrared leakage images; preprocessing each of the infrared leakage images respectively to obtain a plurality of target images; determining a target data set based on each of the target images; dividing the target data set into a training set, a test set and a validation set according to a preset ratio, and training the preset target detection model based on the training set, the test set and the validation set to obtain a target detection model; inputting the image to be identified into the target detection model to obtain a target leakage area.

[0004] In one embodiment, obtaining the preset target detection model includes: taking the fast network and determining the fast network as the backbone network; obtaining a path aggregation network and adding an efficient multi-scale attention module to the path aggregation network to obtain a feature enhancement network; determining the preset target detection model based on the backbone network and the feature enhancement network.

[0005] In one embodiment, the preset target detection model is trained based on the training set, the test set and the validation set, and before obtaining the target detection model, it also includes: obtaining an SGD optimizer, and the SGD optimizer uses a complete intersection-over-union loss function to optimize the model parameters of the preset target detection model during the training process.

[0006] In one embodiment, the calculation formula of the complete intersection-over-union loss function is: , in, represents the complete intersection loss, represents the complete intersection and union ratio; The complete intersection ratio The calculation formula is: , in, represents the intersection-and-union ratio, Represents the center point distance between the actual predicted box and the true box, represents the diagonal length of the minimum bounding rectangle between the actual prediction box and the real box, represents the weight parameter, Represents a metric parameter used to measure aspect ratio consistency; The intersection ratio The calculation formula is: , in, represents the actual prediction box, represents the real frame; The weight parameter The calculation formula is:

[0007] The metric parameters The calculation formula is: , in, and Respectively represent the width and height of the real frame, and Respectively represent the width and height of the actual prediction box.

[0008] In one embodiment, the preset target detection model is trained based on the training set, the test set and the validation set to obtain the target detection model, including: training the preset target detection model based on the training set, and adjusting the model parameters of the preset target detection model based on the validation set during the training process to obtain an initial target detection model; determining the generalization ability of the initial target detection model based on the test set; if the generalization ability of the initial target detection model meets the preset generalization condition, determining the initial target detection model as the target detection model.

[0009] In one embodiment, the preprocessing of each of the infrared leakage images is performed separately to obtain multiple target images, including: performing data augmentation processing on each of the infrared leakage images to obtain multiple initial images; determining the initial image that meets the preset resolution condition among the initial images as the target initial image; and cropping each of the target initial images to a preset size to obtain multiple target images.

[0010] In one implementation, determining the target data set according to each of the target images includes: adding a label to each of the target images, and determining each of the target images and the corresponding label as the target data set.

[0011] In a second aspect, the present invention provides an infrared leakage detection device for hydraulic structures, comprising: A model acquisition module, used to acquire a preset target detection model, wherein the preset target detection model includes a fast network; A data set acquisition module, used to acquire an initial data set, wherein the initial data set includes a plurality of infrared leakage images; A preprocessing module, used for preprocessing each of the infrared leakage images to obtain multiple target images; A determination module, used to determine a target data set according to each of the target images; A model training module is used to divide the target data set into a training set, a test set and a validation set according to a preset ratio, and train the preset target detection model based on the training set, the test set and the validation set to obtain a target detection model; The detection module is used to input the image to be identified into the target detection model to obtain the target leakage area.

[0012] In a third aspect, the present invention provides a computer device, comprising a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the infrared leakage detection method for hydraulic structures described in the first aspect.

[0013] In a fourth aspect, the present invention provides a computer storage medium storing a computer program, wherein when the computer program is executed on a processor, the method for infrared leakage detection of hydraulic structures described in the first aspect is implemented.

[0014] The infrared leakage detection method, device, equipment and medium for hydraulic structures provided by the present invention obtain a preset target detection model, which includes a fast network; obtain an initial data set, which includes multiple infrared leakage images; pre-process each of the infrared leakage images to obtain multiple target images; determine a target data set based on each of the target images; divide the target data set into a training set, a test set and a verification set according to a preset ratio, and train the preset target detection model based on the training set, the test set and the verification set to obtain a target detection model; input the image to be identified into the target detection model to obtain a target leakage area, thereby improving the real-time and accuracy of infrared leakage detection of hydraulic structures.

[0015] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. For ordinary technicians in this field, other related drawings can also be obtained based on these drawings without creative work.

[0017] Figure 1 A schematic diagram of a process of an infrared leakage detection method for hydraulic structures provided in an embodiment of the present application is shown; Figure 2 Another schematic diagram of the process of the infrared leakage detection method for hydraulic structures provided in the embodiment of the present application is shown; Figure 3 A schematic diagram of the structure of a preset target detection model provided in an embodiment of the present application is shown; Figure 4 The internal structure diagram of FasterNet Block provided in the embodiment of the present application is shown; Figure 5 A schematic diagram comparing partial convolution and traditional convolution is shown; Figure 6 A schematic diagram of the structure of an efficient multi-scale attention module provided in an embodiment of the present application is shown; Figure 7 A schematic diagram of calculating the complete intersection-union ratio provided in an embodiment of the present application is shown; Figure 8 A schematic diagram of the structure of an infrared leakage detection device for hydraulic structures provided in an embodiment of the present application is shown; Fig. 9 A structural schematic diagram of an electronic device provided in an embodiment of the present application is shown.

[0018] Description of main components symbols: 800 - infrared leakage detection device for hydraulic structures; 810 - model acquisition module; 820 - data set acquisition module; 830 - preprocessing module; 840 - determination module; 850 - model training module; 860 - detection module; 900 - electronic device; 901 - transceiver; 902 - processor; 903 - memory. DETAILED DESCRIPTION

[0019] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0020] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0021] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.

[0022] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.

[0023] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.

[0024] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0025] Example 1 As a key component of water conservancy and hydropower hubs, hydropower stations play a vital role in my country's national economic construction and development. As an important hub of the underground part of a hydropower station, hydraulic structures are prone to leakage due to their complex terrain and long-term environmental characteristics under the riverbed, which in turn leads to unpredictable serious consequences. Scientific and standardized real-time detection and maintenance of hydraulic structures are crucial to the safe and stable operation of hydropower stations. The leakage detection methods in the existing technology mainly include: manual inspection method, machine vision method and target detection method. The existing detection methods have poor real-time detection and low detection accuracy. For this, please refer to Figure 1 The embodiment of the present application provides a method for infrared leakage detection of hydraulic structures, the method comprising: steps S110 to S160.

[0026] Step S110, obtaining a preset target detection model, wherein the preset target detection model includes a fast network.

[0027] It should be noted that as a lightweight convolutional neural network, the fast network only performs convolution on the valid part of the input feature map, thereby reducing the amount of calculation and memory access, increasing the network's running speed, and thus improving the real-time performance of model detection.

[0028] In this embodiment, the preset target detection model adopts a fast network based on partial convolution as the backbone network, which can effectively reduce unnecessary calculations and memory accesses. The fast network only processes the effective part of the input channel, and can achieve high-speed operation on a variety of devices, which not only improves the real-time performance of the model, but also maintains a high degree of accuracy.

[0029] In one embodiment, see Figure 2 , the obtaining of the preset target detection model includes: steps S111~S113.

[0030] It can be understood that the preset target detection model includes: backbone network, feature enhancement network and head network. For details, please refer to Figure 3 , Figure 3 A structural schematic diagram of a preset target detection model provided in an embodiment of the present application is shown, wherein Bcakbone represents a backbone network, Neck represents a feature enhancement network, and Head represents a head network.

[0031] S111, acquiring the fast network, and determining the fast network as a backbone network.

[0032] In this embodiment, the fast network includes the following structures: Input, used to receive the image to be identified; Embedding, used for preliminary feature extraction; FasterNet Block, used to extract features at different levels; Merging, used to merge features; SPPF (Spatial Pyramid Pooling-Fast), used to extract multi-scale features and enhance the detection capability of objects of different sizes. The internal structure of FasterNet Block is as follows: Figure 4 As shown, it includes some convolutional layers and two point convolutional layers. Figure 4 In the above figure, P Conv 3×3 indicates a partial convolution layer with a convolution kernel size of 3×3, Conv 1×1 indicates a point-wise convolution layer with a convolution kernel size of 1×1, BN indicates batch normalization, and ReLU indicates an activation function. It can be understood that in order to maintain feature diversity, normalization and activation layers are added only after the intermediate layers, so that the fast network can significantly improve operating efficiency while maintaining high performance.

[0033] It should be noted that partial convolution is an operation used in convolutional neural networks that is designed to improve computational efficiency. Unlike traditional convolution operations that are fully applied to the entire input feature map, partial convolution only performs convolution operations on specific parts of the input feature map. This approach significantly reduces computational requirements by ignoring parts of the input that are considered redundant, reducing unnecessary computation and memory access. This efficient computing strategy is very suitable for running deep learning models on resource-constrained devices because it can significantly reduce the computational burden while ensuring performance. For details, please refer to Figure 5 , Figure 5 A schematic diagram comparing partial convolution and traditional convolution is shown.

[0034] S112, obtaining a path aggregation network (PANet), and adding an efficient multi-scale attention module (EMA) to the path aggregation network to obtain a feature enhancement network.

[0035] It should be noted that the path aggregation network is a network structure for target detection, which aims to solve the problem of low-level feature information that may be lost when the feature pyramid network (FPN) is fused. The path aggregation network enhances the fluidity of features by introducing bottom-up paths and top-down paths, thereby improving the network's ability to detect targets of different scales.

[0036] Please see again Figure 3, the embodiment of the present application introduces an efficient multi-scale attention module in the path aggregation network, which effectively enhances the fluidity of features through the fusion of upper and lower levels, improves the network's ability to identify leakage at different scales, and effectively improves the model's feature processing capabilities; it uses cross-dimensional interactions to capture pixel-level relationships and global information in parallel branch encoding, effectively enhancing feature representation capabilities and improving model detection performance as a whole. In addition, the present application also introduces an enhanced convolution module (C2f) in the path aggregation network, adds more gradient flow branches for parallel processing, and further optimizes the network structure to obtain richer gradient information.

[0037] It is necessary to add that Figure 3 In the figure, Backbone represents the backbone network; Input represents image input; Embedding represents embedding layer; Merging represents merging operation; FasterNet Block represents fast network module; SPPF represents fast spatial pyramid pooling; Neck represents feature enhancement network, C2f represents enhanced convolution module; Concat represents cascade; Upsample represents upsampling; EMA represents efficient multi-scale attention module; Conv represents convolution operation; Head represents head network, Detect represents detection operation; Conv2d represents two-dimensional convolution with default size of 3×3; BatchNorm2d represents batch normalization; SiLU represents activation function; SPPF represents pyramid pooling operation; MaxPool2d represents two-dimensional maximum pooling operation; Spilt represents feature map splitting function; Bottleneck represents bottleneck layer.

[0038] For further information, see Figure 6 , Figure 6 A structural schematic diagram of an efficient multi-scale attention module provided by an embodiment of the present application is shown, wherein "g" represents the number of groups into which the input channel is divided. "X Avg Pool" and "Y Avg Pool" represent one-dimensional horizontal and vertical global average pooling operations, respectively. In the efficient multi-scale attention module, the input features are first divided into multiple groups and then processed by different branches: one branch performs one-dimensional global pooling, and the other performs feature extraction through 3x3 convolution. The output features of the two branches are then modulated by a sigmoid function and a normalization operation, and finally merged through a cross-dimensional interaction module to capture pixel-level paired relationships. After the final sigmoid adjustment, the output feature map is used to enhance or weaken the original input features to obtain the final output.

[0039] It should be noted that Figure 6In the figure, Input represents image input; h represents height; w represents width; c represents the number of channels; X represents one of multiple images; c / / g represents splitting the number of channels into g parts, g represents the number of parts; batch size: represents the input image size for each training; Avg Pool represents the global average pooling operation; X Avg Pool represents the one-dimensional horizontal global average pooling operation; Y Avg Pool represents the vertical global average pooling operation; Softmax represents the activation function, Sigmoid represents the activation function; Group Norm represents group normalization; Matmul represents multi-dimensional matrix multiplication; Output represents image output.

[0040] S113, determining the preset target detection model according to the backbone network and the feature enhancement network.

[0041] It can be understood that the preset target detection model also includes a head network, and the backbone network, the feature enhancement network and the head network together constitute the preset target detection model. Among them, the backbone network is used to extract features from the input image data, and the feature enhancement network is used to further process and optimize the features extracted by the backbone network.

[0042] In one embodiment, the preset target detection model is trained based on the training set, the test set and the validation set, and before obtaining the target detection model, it also includes: obtaining an SGD optimizer, and the SGD optimizer uses a complete intersection over union (CIoU) loss function during training to optimize the model parameters of the preset target detection model.

[0043] It should be noted that the stochastic gradient descent optimizer (SGD) is used to calculate the gradient of the loss function relative to the model parameters during the model training process, and update the model parameters according to the calculated gradient and the predefined learning rate.

[0044] It can be understood that the loss function in the prior art consists of two parts: classification loss and regression loss. In the regression loss part, the prior art mainly uses the intersection over union (IoU) loss. This application introduces the full intersection over union loss, further considering the aspect ratio of the boundary on the basis of the traditional intersection over union loss, and improves the convergence speed and detection accuracy of the model to a certain extent.

[0045] In one embodiment, the calculation formula of the complete intersection-over-union loss function is: , in, represents the complete intersection loss, represents the complete intersection and union ratio; The complete intersection ratio The calculation formula is: , in, represents the intersection-and-union ratio, Represents the center point distance between the actual predicted box and the true box, represents the diagonal length of the minimum bounding rectangle between the actual prediction box and the real box, represents the weight parameter, Represents a metric parameter used to measure the consistency between the aspect ratio of the actual predicted box and the true box; The intersection ratio The calculation formula is: , in, represents the actual prediction box, represents the real frame; The weight parameter The calculation formula is:

[0046] The metric parameters The calculation formula is: , in, and Respectively represent the width and height of the real frame, and Respectively represent the width and height of the actual prediction box.

[0047] In this example, see Figure 7 , Figure 7 A calculation diagram of the complete intersection-over-union ratio provided in an embodiment of the present application is shown. It can be understood that the actual prediction box is the leakage area determined according to the input target image during the model training process, and the real box represents the actual leakage area of ​​the corresponding target image, that is, the label of the target image. By introducing the complete intersection-over-union ratio, the aspect ratio of the regression bounding box is further considered, which greatly improves the detection accuracy of the model.

[0048] Step S120, obtaining an initial data set, wherein the initial data set includes a plurality of infrared leakage images.

[0049] In this embodiment, an infrared camera is mounted on an intelligent device such as a track robot to take fixed-point photos of the leakage plane of a hydraulic structure to obtain multiple infrared leakage images, each of which constitutes an initial data set.

[0050] Step S130 , pre-processing each of the infrared leakage images to obtain a plurality of target images.

[0051] It can be understood that since the infrared penetration images that can be collected are very rare, this application is based on each infrared leakage image, uses preprocessing technology to augment the original data, and selects qualified target images from the multiple initial images obtained by augmentation.

[0052] In one embodiment, see Figure 7 , step S130 includes: steps S131~S133.

[0053] Step S131 : performing data augmentation processing on each of the infrared leakage images to obtain a plurality of initial images.

[0054] In this embodiment, the augmentation processing includes but is not limited to: rotation, scaling, cropping, color adjustment, noise addition and / or mosaic data enhancement.

[0055] Step S132: determining the initial image that meets the preset resolution condition among the initial images as the target initial image.

[0056] In order to avoid the adverse effect of too low resolution on model training, an image with a resolution that meets a preset resolution condition is selected from the initial images and determined as a target initial image. For example, an initial image with a resolution of 640×512 is determined as the target initial image.

[0057] Step S133 , cropping each of the target initial images into a preset size to obtain a plurality of the target images.

[0058] For example, each target initial image is uniformly cropped to a size of 640×640.

[0059] Step S140: determining a target data set according to each of the target images.

[0060] In this embodiment, a label is added to each target image, and each target image and its corresponding label are determined as a target data set.

[0061] In one implementation, determining the target data set according to each of the target images includes: adding a label to each of the target images, and determining each of the target images and the corresponding label as the target data set.

[0062] In this embodiment, the open source software LabelImg is used to add labels to each target image, specifically, it includes determining the preset feature area of ​​each target image and adding corresponding attribute information to each preset feature area. For example, the leakage area in the target image is identified and labels are added to these areas. For example, the leakage area can be marked as "leakage".

[0063] Step S150, dividing the target data set into a training set, a test set and a validation set according to a preset ratio, and training the preset target detection model based on the training set, the test set and the validation set to obtain a target detection model.

[0064] In this embodiment, a preset target detection model is trained based on a target data set, and the trained model is determined as a target detection model, and the target detection model is used to perform infrared leakage target detection.

[0065] In one embodiment, the preset target detection model is trained based on the training set, the test set, and the validation set to obtain the target detection model, including: training the preset target detection model based on the training set, and adjusting the model parameters of the preset target detection model based on the validation set during the training process to obtain an initial target detection model; determining the generalization ability of the initial target detection model based on the test set; if the generalization ability of the initial target detection model meets the preset generalization condition, determining the initial target detection model as the target detection model.

[0066] In this embodiment, the precision, recall, F1 score, mAP50, and mAP50:95 of the model on the test set are 0.981, 0.838, 0.912, 0.947, and 0.629, respectively.

[0067] It should be noted that, in order to verify the improvement effect of the target detection model, this embodiment also conducts an ablation experiment, a data set division experiment and a network model comparison experiment. The following Table 1 shows the experimental results of the ablation experiment.

[0068] Table 1 Ablation experiment results

[0069] Among them, Experiment 1 is the experimental result of using the fast network as the benchmark network; Experiments 2 and 3 are the effects of adding CIoU loss and EMA attention mechanism on the model; Experiments 4-6 are the effects of inserting different attention mechanisms such as ECA, CBAM and EMA into the network results on the performance of the model. It can be seen from Experiment 2 that after adding the CIoU loss function, the model's accurate regression of the bounding box is effectively improved, and the model's F1 value and mAP are improved to a certain extent, and it will not affect the detection speed of the model. After adding the EMA attention mechanism in Experiment 3, the feature enhancement is performed through cross-dimensional interactive information, which effectively improves the model detection accuracy. The final model detection accuracy is improved by 7.3%, F1 value is improved by 4%, mAP50 is improved by 1.6%, and FPS reaches 134, which will not affect the real-time performance of the model; and according to the results of Experiments 4-6, it can be seen that different attention mechanisms can improve the network model's attention to the leakage area, suppress other interference factors, and bring a certain improvement in accuracy; and the collection effect with EMA attention is obviously the best, among which the model precision rate is improved by 12.3%, F1 value is improved by 7.1%, mAP50 is improved by 6.2%, mAP50:95 is improved by 0.8%, and the final model FPS is as high as 133, which will not affect the real-time performance of the model detection at all. This also shows that the strategy of reorganizing channel dimensions and cross-dimensional interaction can effectively improve the performance of the model. The experimental results finally prove that the model improvement strategy provided by the embodiment is effective and feasible, and can effectively improve the model detection accuracy.

[0070] This embodiment also compares the target detection model with excellent algorithms such as FasterNet, Faster-RCNN, SSD, YOLOv3 and YOLOv5n, and sets up 6 groups of comparative experiments, while keeping the experimental parameters and software and hardware environment consistent. The specific experimental results are shown in Table 2 below.

[0071] Table 2 Experimental results of Faster-ISD compared with other algorithms

[0072] Among them, Faster-ISD represents the target detection model. From the data analysis in the table, it can be seen that Faster-RCNN, as a two-stage detector, has a certain detection accuracy, but its reasoning speed is too slow and does not meet the real-time requirements. Although SSD can balance speed and accuracy, its overall accuracy is not high and its speed is not fast. FasterNet, as the backbone network described in this application, has good performance in detection accuracy and running speed. Compared with FasterNet, YOLOv3 has a slightly higher accuracy, but its detection speed is only about half of that, with an FPS of only 81; and YOLOv5n is slightly higher than FasterNet in both accuracy and speed. However, the target detection model described in this application achieves high-precision and high-real-time detection. Although the detection speed has dropped slightly, it maintains ultra-high detection accuracy and good real-time performance, which also shows that the detection performance improvement of the model after adding the EMA attention mechanism is effective. Finally, the target detection model described in this application achieved mAP of 0.947, mAP50:95 of 0.629, and F1 value of 0.912, which is the best method among all models and meets the real-time requirements of the model well.

[0073] Step S160: input the image to be identified into the target detection model to obtain the target leakage area.

[0074] It can be understood that the image to be identified is an infrared leakage image. By inputting the image to be identified into the target detection model, the corresponding detection result, that is, the target leakage area, can be obtained.

[0075] The infrared leakage detection method for hydraulic structures provided in the embodiment of the present application obtains a preset target detection model, which includes a fast network; obtains an initial data set, which includes multiple infrared leakage images; preprocesses each of the infrared leakage images to obtain multiple target images; determines a target data set based on each of the target images; divides the target data set into a training set, a test set, and a validation set according to a preset ratio, and trains the preset target detection model based on the training set, the test set, and the validation set to obtain a target detection model; inputs the image to be identified into the target detection model to obtain a target leakage area, thereby improving the real-time and accuracy of infrared leakage detection of hydraulic structures.

[0076] Example 2 Also, see Figure 8 The embodiment of the present application further provides a hydraulic structure infrared leakage detection device 800, comprising: A model acquisition module 810 is used to acquire a preset target detection model, wherein the preset target detection model includes a fast network; A data set acquisition module 820 is used to acquire an initial data set, wherein the initial data set includes a plurality of infrared leakage images; A preprocessing module 830 is used to preprocess each of the infrared leakage images to obtain multiple target images; A determination module 840, configured to determine a target data set according to each of the target images; A model training module 850 is used to divide the target data set into a training set, a test set and a validation set according to a preset ratio, and train the preset target detection model based on the training set, the test set and the validation set to obtain a target detection model; The detection module 860 is used to input the image to be identified into the target detection model to obtain the target leakage area.

[0077] The infrared leakage detection device for hydraulic structures provided in the embodiment of the present application obtains a preset target detection model through a model acquisition module, and the preset target detection model includes a fast network; the data set acquisition module obtains an initial data set, and the initial data set includes multiple infrared leakage images; the preprocessing module preprocesses each of the infrared leakage images respectively to obtain multiple target images; the determination module determines the target data set according to each of the target images; the model training module divides the target data set into a training set, a test set and a verification set according to a preset ratio, and trains the preset target detection model based on the training set, the verification set and the test set to obtain a target detection model; the detection module inputs the image to be identified into the target detection model to obtain a target leakage area, thereby improving the real-time and accuracy of infrared leakage detection of hydraulic structures.

[0078] Example 3 In addition, an embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the infrared leakage detection method for hydraulic structures provided in Example 1 is executed.

[0079] For details, see Fig. 9 The electronic device 900 includes: a transceiver 901, a bus interface and a processor 902, wherein the processor 902 is used to obtain a preset target detection model, wherein the preset target detection model includes a fast network; obtain an initial data set, wherein the initial data set includes multiple infrared leakage images; pre-process each of the infrared leakage images respectively to obtain multiple target images; determine a target data set according to each of the target images; divide the target data set into a training set, a test set and a verification set according to a preset ratio, and train the preset target detection model based on the training set, the test set and the verification set to obtain a target detection model; input the image to be identified into the target detection model to obtain a target leakage area.

[0080] In the embodiment of the present invention, the electronic device 900 further includes a memory 903. Fig. 9 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 902 and memory represented by memory 903. The bus architecture may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 901 may be a plurality of components, i.e., including a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 902 is responsible for managing the bus architecture and general processing, and the memory 903 may store data used by the processor 902 when performing operations.

[0081] The electronic device 900 provided in the embodiment of the present invention can execute the infrared leakage detection method for hydraulic structures provided in the above method embodiment 1, which will not be described again to avoid repetition.

[0082] Example 4 In addition, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the infrared leakage detection method for hydraulic structures provided in Example 1 is implemented.

[0083] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0084] The computer-readable storage medium provided in this embodiment can implement the infrared leakage detection method for hydraulic structures provided in Example 1, and will not be described again here to avoid repetition.

[0085] In all examples shown and described herein, any specific values ​​should be interpreted as merely exemplary and not as limiting, and thus other examples of the exemplary embodiments may have different values.

[0086] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0087] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A method for infrared leakage detection of hydraulic structures, characterized in that: The method comprises: Acquire a preset target detection model, wherein the preset target detection model includes a fast network; Acquire an initial data set, wherein the initial data set includes a plurality of infrared leakage images; Preprocessing each of the infrared leakage images respectively to obtain a plurality of target images; Determine a target data set according to each of the target images; According to a preset ratio, the target data set is divided into a training set, a test set and a validation set, and the preset target detection model is trained based on the training set, the test set and the validation set to obtain a target detection model; The image to be identified is input into the target detection model to obtain the target leakage area.

2. The method for infrared leakage detection of hydraulic structures according to claim 1, characterized in that: The obtaining of a preset target detection model comprises: Acquire the fast network, and determine the fast network as a backbone network; Obtaining a path aggregation network, and adding an efficient multi-scale attention module to the path aggregation network to obtain a feature enhancement network; The preset target detection model is determined according to the backbone network and the feature enhancement network.

3. The method for infrared leakage detection of hydraulic structures according to claim 2, characterized in that: Before the preset target detection model is trained based on the training set, the test set and the validation set to obtain the target detection model, the method further includes: An SGD optimizer is obtained, wherein the SGD optimizer uses a complete intersection-over-union loss function to optimize model parameters of the preset target detection model during training.

4. The method for infrared leakage detection of hydraulic structures according to claim 3 is characterized in that: The calculation formula of the complete intersection-over-union loss function is: , in, represents the complete intersection loss, represents the complete intersection and union ratio; The complete intersection ratio The calculation formula is: , in, represents the intersection-and-union ratio, Represents the center point distance between the actual predicted box and the real box, represents the diagonal length of the minimum bounding rectangle between the actual prediction box and the real box, represents the weight parameter, Represents a measurement parameter; The intersection ratio The calculation formula is: , in, represents the actual prediction box, represents the real frame; The weight parameter The calculation formula is: The metric parameters The calculation formula is: , in, and Respectively represent the width and height of the real frame, and Respectively represent the width and height of the actual prediction box.

5. The method for infrared leakage detection of hydraulic structures according to claim 4, characterized in that: The step of training the preset target detection model based on the training set, the test set, and the validation set to obtain the target detection model includes: Training the preset target detection model based on the training set, and adjusting the model parameters of the preset target detection model based on the validation set during the training process to obtain an initial target detection model; Based on the test set, determining the generalization ability of the initial object detection model; If the generalization ability of the initial target detection model meets the preset generalization condition, the initial target detection model is determined as the target detection model.

6. The method for infrared leakage detection of hydraulic structures according to any one of claims 1 to 5, characterized in that: The preprocessing of each of the infrared leakage images is performed to obtain a plurality of target images, including: For each of the infrared leakage images, data augmentation processing is performed to obtain multiple initial images; Determining, among the initial images, the initial image that meets the preset resolution condition as the target initial image; Each of the target initial images is cropped to a preset size to obtain a plurality of the target images.

7. The method for infrared leakage detection of hydraulic structures according to claim 6, characterized in that: The step of determining a target data set according to each of the target images comprises: Labels are added to the target images respectively, and the target images and their corresponding labels are determined as target data sets.

8. An infrared leakage detection device for hydraulic structures, characterized in that: include: A model acquisition module, used to acquire a preset target detection model, wherein the preset target detection model includes a fast network; A data set acquisition module, used to acquire an initial data set, wherein the initial data set includes a plurality of infrared leakage images; A preprocessing module, used for preprocessing each of the infrared leakage images to obtain multiple target images; A determination module, used to determine a target data set according to each of the target images; A model training module is used to divide the target data set into a training set, a test set and a validation set according to a preset ratio, and train the preset target detection model based on the training set, the test set and the validation set to obtain a target detection model; The detection module is used to input the image to be identified into the target detection model to obtain the target leakage area.

9. A computer device, characterized in that: The computer device comprises a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the infrared leakage detection method for hydraulic structures according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that: The computer program is stored therein, and when the computer program is executed on a processor, the infrared leakage detection method for hydraulic structures according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Wheat field wheat scab state evaluation method and system and electronic equipment

    CN117392668A

  • Small target detection model training method, small target detection method and related equipment

    CN117746015A

  • Dam leakage infrared image target detection method based on deep learning

    CN118675072A

  • Video-based automated recognition of epileptic seizure from rodents in home cages

    US20240215924A1