Pressure gauge base liquid leakage detection method based on generative adversarial network

By adopting a generative adversarial network-based method in the pressure gauge base liquid leakage detection, combined with the YOLOv4 architecture and the weighted two-way feature fusion network, the existing detection methods are solved, and efficient, accurate and automated leakage detection is achieved.

CN119919918APending Publication Date: 2025-05-02HUANENG GUANYUN CLEAN ENERGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411688220.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

The existing pressure gauge base liquid leakage detection methods have problems such as low detection efficiency, influenced by environmental factors, blind spots in detection, limited data sets, and how to achieve efficient, accurate and automated pressure gauge base liquid leakage detection.

Method used

Using a method based on a generative adversarial network, combined with the YOLOv4 architecture, a liquid leakage detection model at the pressure gauge base is constructed, and feature extraction capabilities are enhanced through the weighted two-way feature fusion network to generate high-quality synthetic data, and improve the generalization ability and detection accuracy of the model.

Benefits of technology

The efficiency and accuracy of liquid leakage detection at the base of the pressure gauge is significantly improved, and the generation of adversarial network generates high-quality synthetic data, solving the problem of limited data sets. The weighted two-way feature fusion network enhances the expression of target features, improves the accuracy of detection and training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119919918A_ABST
    Figure CN119919918A_ABST
Patent Text Reader

Abstract

The invention discloses a pressure gauge base liquid leakage detection method based on a generative adversarial network, and relates to the technical field of computer vision image processing, and the method comprises the steps: collecting an image, carrying out the manual marking, enhancing data, and carrying out the image preprocessing, and obtaining a true value picture; a YOLOv4 framework is combined with a generative adversarial network, and a pressure gauge base liquid leakage detection model is constructed; and inputting a to-be-detected pressure gauge base picture into the trained pressure gauge base liquid leakage detection model to obtain a detection result. According to the method, the YOLOv4 is combined with the generative adversarial network, the weighted bidirectional feature fusion network is adopted, the efficiency and precision of power plant pressure gauge base liquid leakage detection can be effectively improved, the generative adversarial network can generate high-quality synthetic data, the problem that a data set is limited is solved, and the detection accuracy of the power plant pressure gauge base liquid leakage is improved. The weighted bidirectional feature fusion network enhances the expression of the target features, so that the model can identify the leakage target more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision image processing, and in particular to a method for detecting liquid leakage of a pressure gauge base based on a generative adversarial network. Background Art

[0002] The traditional method of detecting oil leakage at the base of a pressure gauge mainly relies on manual inspections and regular maintenance. This method is not only inefficient, time-consuming and labor-intensive, but also limited by human subjective judgment and accessibility. There may be blind spots and inaccuracies in detection, especially when the pressure gauge is located in a high-risk or difficult-to-reach area. Manual inspections face huge safety hazards.

[0003] Traditional deep learning methods are often highly dependent on large-scale annotated data sets for model training. However, in the specific scenario of leak detection, it is not only time-consuming but also costly to collect high-quality annotated data covering various possible situations. Although deep learning technology has demonstrated excellent performance in many fields due to its powerful automatic feature extraction capabilities, traditional methods may still be unable to cope with complex oil leak detection tasks and find it difficult to effectively capture those subtle and complex abnormal oil leak patterns. These subtle anomalies are often hidden in a large amount of normal data, and traditional methods may miss the opportunity to discover them due to lack of sufficient sensitivity and accuracy.

[0004] In contrast, the use of intelligent detection technology based on generative adversarial networks (GAN) can greatly improve detection efficiency and accuracy through automated and intelligent image recognition and analysis. This technology can accurately identify signs of oil leaks by deep learning of a large amount of real data. Even when the pressure gauge is in an extreme or dangerous position, it can also achieve remote, contactless safety detection, effectively avoiding the risks of manual inspections, ensuring the stable operation and safety of power plant equipment, and timely discovering and handling oil leaks to prevent potential safety hazards and equipment damage.

[0005] Compared with traditional deep learning methods, the power plant pressure gauge base liquid leakage detection method based on generative adversarial networks can generate high-quality synthetic data, which is especially important when data is scarce or difficult to collect. By generating more diverse training samples, the generalization ability of the model can be improved, thereby improving the accuracy of oil leak detection. It can effectively learn the potential distribution and characteristics of the data. For complex oil leakage patterns, especially those features that are not easy to be explicitly extracted, the deep learning model can better capture this information when combined with GAN. Summary of the invention

[0006] In view of the above-mentioned problems, the present invention is proposed.

[0007] Therefore, the technical problem solved by the present invention is: the existing pressure gauge base liquid leakage detection method has low detection efficiency, is affected by environmental factors, has detection blind spots, and has a limited data set; and how to achieve efficient, accurate, and automated pressure gauge base liquid leakage detection.

[0008] To solve the above technical problems, the present invention provides the following technical solutions: a pressure gauge base liquid leakage detection method based on a generative adversarial network, comprising collecting images for manual annotation, enhancing data, and performing image preprocessing to obtain a true value image; combining the YOLOv4 architecture with the generative adversarial network to construct a pressure gauge base liquid leakage detection model; inputting the pressure gauge base image to be detected into the trained pressure gauge base liquid leakage detection model to obtain a detection result.

[0009] As a preferred solution of the pressure gauge base liquid leakage detection method based on the generative adversarial network described in the present invention, the image preprocessing includes grayscale correction, filtering and sharpening of the image to extract clear feature information;

[0010] Grayscale correction uses the Bottom-hat transformation technology to adjust the grayscale of the image to further optimize the data quality. The Bottom-hat transformation is expressed as:

[0011] Bottom-hat=(f·s)-f

[0012] Among them, f represents the original image dataset, and s represents the field of morphological operation;

[0013] Image filtering uses Gaussian filtering technology to assign weights to each pixel according to its spatial proximity to the center point. The weight assignment formula is expressed as:

[0014]

[0015] Among them, g(i,j) represents a point on the output image, f(k,l) represents the corresponding point on the input image, s(i,j) represents the neighborhood centered at (i,j), and w(i,j,l,k) represents the weight;

[0016] Sharpening is to use the Sobel operator edge enhancement tool to sharpen the image.

[0017] As a preferred solution of the pressure gauge base liquid leakage detection method based on generative adversarial network described in the present invention, the true value image includes marking the image after labeling, data enhancement and image preprocessing, and processing it into a 256×256 JPG format image to obtain a true value image.

[0018] As a preferred solution of the pressure gauge base liquid leakage detection method based on the generative adversarial network described in the present invention, wherein: the construction of the pressure gauge base liquid leakage detection model includes combining the YOLOv4 architecture with the generative adversarial network, constructing a generation module under the YOLOv4 framework, taking the true value image to be detected as the input of the generation network, and generating an image similar to the reference data through generator training;

[0019] The discriminator compares the images generated by the generator with the real images;

[0020] Generate adversarial network objective function, expressed as:

[0021]

[0022] Among them, L(D,G) represents the loss function of the whole system, G represents the parameters of the generator, D represents the parameters of the discriminator, and P data represents the distribution of real data, y B represents the sample sampled from the real data distribution, and x represents the sample output from the generator;

[0023] The two networks compete with each other through adversarial training. The discriminator's ability to distinguish differences between images continues to improve, and the generator further generates higher quality images. Through training, the objective function converges to Pada(x)=Pada(y).

[0024] As a preferred solution of the pressure gauge base liquid leakage detection method based on the generative adversarial network described in the present invention, wherein: the construction of the pressure gauge base liquid leakage detection model also includes using a weighted bidirectional feature fusion network to replace the traditional bottom-up to top-down feature pyramid structure in YOLOv4;

[0025] Based on YOLOv4, a 2x upsampling operation is performed on high-level features. New elements are inserted into the existing pixel matrix through interpolation, so that the width and height of the features are expanded to twice the original size to match the size of the adjacent feature layer.

[0026] For low-level features, a 1×1 convolution operation is applied to adjust the number of output channels, and secondary feature fusion is performed. The fused low-level features are downsampled by a 3×3 convolution with a step size of 2.

[0027] Based on the YOLOv4 architecture, an additional prediction scale is introduced to accurately capture and identify subtle leakage targets.

[0028] As a preferred solution of the pressure gauge base liquid leakage detection method based on the generative adversarial network of the present invention, wherein: the construction of the pressure gauge base liquid leakage detection model also includes evaluating the output using the discriminator, and feeding the evaluation result back to the generator for tuning;

[0029] Construct loss functions for the generator network and the discriminator network respectively, and calculate the overall loss function of the generator network, which will be used as the objective function for optimization;

[0030] The bounding box regression loss is expressed as:

[0031] L GIoU =1-GIoU

[0032]

[0033] in, B gt represents the labeled true sample, B pre Denotes the prediction box ρ 2 (B pre ,B gt ) represents the Euclidean square between the center points of the two boxes, w gt Indicates the height of the real sample, h gt Represents the width of the real sample, w pre Indicates the height of the predicted sample frame, h pre Represents the width of the predicted sample box, and v represents the parameter that measures the consistency of the aspect ratio between the predicted box and the true box;

[0034] Confidence prediction loss, expressed as:

[0035]

[0036] Among them, s 2 represents the predicted grid unit, B represents the number of predicted prior boxes, and the value is 4. represents the target contained in the i-th and j-th networks, represents the target that is not in the i-th and j-th networks, With C i Represent the confidence of the actual target and the predicted target, respectively, fo represents the hyperparameter, which is set to 0.5;

[0037] The classification loss is expressed as:

[0038]

[0039] Among them, p i (c) represents the probability value of the i-th network belonging to category c when it contains the target, p^ i(c) represents the probability value of belonging to category c when the i-th network has no target;

[0040] Adversarial loss, expressed as:

[0041] L voxel =Ε Iinput ~P data (I input )∥I TrainingSet -I output ∥

[0042] Among them, Iinput represents the average value of the input features, P data (I input ) represents the probability density function of the data;

[0043] The objective function is expressed as:

[0044] L=λ GIoU ·L GIoU +λ Confidence ·L Confidence +λ Class ·L Class +λ voxel ·L voxel

[0045] Among them, λ represents the weight coefficient;

[0046] The objective function for training the pressure gauge base liquid leakage detection model is expressed as:

[0047]

[0048] Set the number of iterations, input image training data in batches, update network parameters, and save the model after training is complete.

[0049] As a preferred solution of the pressure gauge base liquid leakage detection method based on the generative adversarial network described in the present invention, wherein: the obtaining of the detection result includes inputting the pressure gauge base image to be tested into the trained model, and outputting the detection result L;

[0050] When the detection result L≥threshold β, it is judged that there is liquid leakage at the base of the pressure gauge;

[0051] When the detection result L is less than the threshold value β, it is determined that there is no liquid leakage in the pressure gauge base.

[0052] Another object of the present invention is to provide a pressure gauge base liquid leakage detection system based on a generative adversarial network, which can replace the traditional bottom-up to top-down feature pyramid architecture in YOLOv4 by adopting a weighted bidirectional feature fusion network, thereby solving the problems of low efficiency and insufficient accuracy in feature fusion of the current YOLOv4 technology.

[0053] As a preferred solution of the pressure gauge base liquid leakage detection system based on the generative adversarial network described in the present invention, it includes: an image acquisition module, a model training module, and a detection module; the image acquisition module is used to collect images for manual annotation, enhance data, and perform image preprocessing to obtain true value images; the model training module is used to combine the YOLOv4 architecture with the generative adversarial network to construct a pressure gauge base liquid leakage detection model; the detection module is used to input the pressure gauge base image to be detected into the trained pressure gauge base liquid leakage detection model to obtain a detection result.

[0054] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement a step of a pressure gauge base liquid leakage detection method based on a generative adversarial network.

[0055] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a pressure gauge base liquid leakage detection method based on a generative adversarial network.

[0056] Beneficial effects of the present invention: The pressure gauge base liquid leakage detection method based on the generative adversarial network provided by the present invention can effectively improve the efficiency and accuracy of the pressure gauge base liquid leakage detection in the power plant by combining YOLOv4 with the generative adversarial network and adopting the weighted bidirectional feature fusion network. The generative adversarial network can generate high-quality synthetic data to solve the problem of limited data sets. The weighted bidirectional feature fusion network enhances the expression of target features, so that the model can more accurately identify the leakage target; the weighted bidirectional feature fusion network effectively combines shallow detail information with deep semantic information through the bidirectional fusion mechanism, thereby enhancing the feature expression of the target, so that the model can better capture the subtle features of the leakage target and improve the detection accuracy; the weighted bidirectional feature fusion network can significantly improve the training efficiency of the model, which enables the bidirectional fusion mechanism to more effectively utilize the feature information, thereby reducing the number of iterations and time required for training. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0058] Figure 1 An overall flow chart of a method for detecting liquid leakage of a pressure gauge base based on a generative adversarial network provided in the first embodiment of the present invention.

[0059] Figure 2 An overall flow chart of a pressure gauge base liquid leakage detection system based on a generative adversarial network provided in the third embodiment of the present invention. DETAILED DESCRIPTION

[0060] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0061] Example 1, reference Figure 1 , which is an embodiment of the present invention, provides a pressure gauge base liquid leakage detection method based on a generative adversarial network, comprising:

[0062] S1: Collect images for manual annotation, enhance data, and perform image preprocessing to obtain true value images.

[0063] Furthermore, data augmentation includes comprehensive enhancement of the dataset using a variety of techniques such as image rotation, histogram equalization, and vertical shift;

[0064] It should be noted that image preprocessing includes grayscale correction, filtering and sharpening of the image to extract clear feature information;

[0065] Grayscale correction uses Bottom-hat transformation technology to adjust the grayscale of the image to further optimize the data quality. The Bottom-hat transformation is expressed as:

[0066] Bottom-hat=(f·s)-f

[0067] Among them, f represents the original image dataset, and s represents the field of morphological operation;

[0068] Image filtering uses Gaussian filtering technology to assign weights to each pixel according to its spatial proximity to the center point. The weight assignment formula is expressed as:

[0069]

[0070] Among them, g(i,j) represents a point on the output image, f(k,l) represents the corresponding point on the input image, s(i,j) represents the neighborhood centered at (i,j), and w(i,j,l,k) represents the weight;

[0071] Sharpening is to use the Sobel operator edge enhancement tool to sharpen the image.

[0072] It should also be noted that the true value image includes the image that has been labeled, data enhanced and pre-processed, and processed into a 256×256 JPG format image to obtain the true value image.

[0073] It should also be noted that grayscale correction further optimizes data quality by using the Bottom-hat transformation technology. The basic operations of erosion and dilation in mathematical morphology are expressed as:

[0074]

[0075] Where D S represents the domain of the structural element s. From the above formula, we can get the opening and closing operations:

[0076]

[0077] It should also be noted that image filtering achieves a more delicate and accurate combing of images by using Gaussian filtering technology;

[0078] Among them, the spatial filter function is expressed as:

[0079]

[0080] Grayscale difference filter function, expressed as:

[0081]

[0082] w=r(i,j,l,k)·r(i,j,l,k)

[0083] Sharpening processing can highlight the edge information in the image by calculating the gradient of the image grayscale value through the Sobel operator, making the edge contour clearer.

[0084] S2: Combine the YOLOv4 architecture with the generative adversarial network to build a pressure gauge base liquid leakage detection model.

[0085] Furthermore, the construction of the pressure gauge base liquid leakage detection model includes combining the YOLOv4 architecture with the generative adversarial network, building a generation module under the YOLOv4 framework, taking the true value image to be detected as the input of the generation network, and generating images similar to the reference data through generator training;

[0086] The discriminator compares the images generated by the generator with the real images;

[0087] Generate adversarial network objective function, expressed as:

[0088]

[0089] Among them, L(D,G) represents the loss function of the whole system, G represents the parameters of the generator, D represents the parameters of the discriminator, and P data represents the distribution of real data, y B represents the sample sampled from the real data distribution, and x represents the sample output from the generator;

[0090] The two networks compete with each other through adversarial training. The discriminator's ability to distinguish differences between images continues to improve, and the generator further generates higher quality images. Through training, the objective function converges to Pada(x)=Pada(y).

[0091] It should be noted that building a pressure gauge base liquid leakage detection model also includes using a weighted bidirectional feature fusion network to replace the traditional bottom-up to top-down feature pyramid structure in YOLOv4;

[0092] Based on YOLOv4, a 2x upsampling operation is performed on high-level features. New elements are inserted into the existing pixel matrix through interpolation, so that the width and height of the features are expanded to twice the original size to match the size of the adjacent feature layer.

[0093] For low-level features, a 1×1 convolution operation is applied to adjust the number of output channels, and secondary feature fusion is performed. The fused low-level features are downsampled by a 3×3 convolution with a step size of 2.

[0094] Based on the YOLOv4 architecture, an additional prediction scale is introduced to accurately capture and identify subtle leakage targets.

[0095] It should also be noted that building the pressure gauge base liquid leakage detection model also includes evaluating the output using the discriminator and feeding the evaluation results back to the generator for tuning;

[0096] Construct loss functions for the generator network and the discriminator network respectively, and calculate the overall loss function of the generator network, which will be used as the objective function for optimization;

[0097] The bounding box regression loss is expressed as:

[0098] L GIoU =1-GIoU

[0099]

[0100] in, B gt represents the labeled true sample, B pre Denotes the prediction box ρ 2 (B pre ,B gt ) represents the Euclidean square between the center points of the two boxes, w gt Indicates the height of the real sample, h gt Represents the width of the real sample, w pre Indicates the height of the predicted sample frame, h pre Represents the width of the predicted sample box, and v represents the parameter that measures the consistency of the aspect ratio between the predicted box and the true box;

[0101] Confidence prediction loss, expressed as:

[0102]

[0103] Among them, s 2 represents the predicted grid unit, B represents the number of predicted prior boxes, and the value is 4. represents the target contained in the i-th and j-th networks, represents the target that is not in the i-th and j-th networks, With C i Represent the confidence of the actual target and the predicted target, respectively, fo represents the hyperparameter, which is set to 0.5;

[0104] The classification loss is expressed as:

[0105]

[0106] Among them, p i (c) represents the probability value of the i-th network belonging to category c when it contains the target, p^ i (c) represents the probability value of belonging to category c when the i-th network has no target;

[0107] Adversarial loss, expressed as:

[0108]

[0109] in, represents the average value of the input features, P data (I input ) represents the probability density function of the data;

[0110] The objective function is expressed as:

[0111] L=λ GIoU ·L GIoU +λ Confidence ·L Confidence +λ Class ·L Class +λ voxel ·L voxel

[0112] Among them, λ represents the weight coefficient;

[0113] The objective function for training the pressure gauge base liquid leakage detection model is expressed as:

[0114]

[0115] Set the number of iterations, input image training data in batches, update network parameters, and save the model after training is complete.

[0116] S3: Input the image of the pressure gauge base to be detected into the trained pressure gauge base liquid leakage detection model to obtain the detection result.

[0117] Furthermore, obtaining the test result includes inputting the image of the pressure gauge base to be tested into the trained model and outputting the test result L;

[0118] When the detection result L≥threshold β, it is judged that there is liquid leakage at the base of the pressure gauge;

[0119] When the detection result L is less than the threshold value β, it is determined that there is no liquid leakage in the pressure gauge base.

[0120] Example 2 is an embodiment of the present invention, which provides a pressure gauge base liquid leakage detection method based on a generative adversarial network. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.

[0121] First, 500 images of pressure gauge bases were collected from a power plant, covering different angles, lighting conditions, and whether there was liquid leakage. Experienced experts manually annotated the collected images, marked the location and scope of the liquid leakage, and performed data enhancement on the annotated images. Data enhancement included rotation, flipping, scaling, cropping, brightness adjustment and other operations. Finally, 5,000 enhanced images were obtained. All images were uniformly cropped to 256×256 pixels and converted into grayscale images to reduce computational complexity and shorten model training time.

[0122] Secondly, YOLOv4 is used as the basic framework, and it is improved by combining the generative adversarial network GAN. The generator network uses CSPDarknet53 as the backbone network, and the feature extraction capability is enhanced by the weighted bidirectional feature fusion network. The discriminator network uses the same structure as the generator to evaluate the quality of the generator output image. The generator loss function includes bounding box regression loss, confidence loss, classification loss, and adversarial loss. The discriminator loss function includes real sample loss and adversarial loss. The model is trained using the enhanced dataset, the number of iterations is set to 50,000, and the learning rate is set to 0.001. 100 pictures are randomly selected from the original dataset as the test set to evaluate the detection performance of the model. The data collected during the experiment are shown in Table 1 below.

[0123] Table 1 Data indicators of different models

[0124] Experimental subjects Detection accuracy Recall F1 score Training time Basic YOLOv4 0.85 0.82 0.83 24h GAN-YOLOv4 0.90 0.88 0.89 30h GAN-YOLOv4 (weighted bidirectional feature fusion) 0.92 0.90 0.91 28h

[0125] By comparing the experimental data, it can be seen that the model of the present invention performs well in detection accuracy, recall rate and F1 score. After introducing the generative adversarial network, the detection accuracy, recall rate and F1 score of the present invention are significantly improved, indicating that the generative adversarial network effectively enhances the feature expression ability of the model; on the basis of GAN-YOLOv4, the weighted bidirectional feature fusion network is used to further improve the detection performance of the model and shorten the training time, indicating that the improvement of the present invention effectively improves the efficiency and accuracy of the model.

[0126] Therefore, the present invention combines YOLOv4 with a generative adversarial network, effectively solves the problem of limited data sets, and improves the generalization ability and detection accuracy of the model; by adopting a weighted bidirectional feature fusion network instead of the traditional feature pyramid architecture, the training efficiency and detection accuracy of the model are significantly improved; the present invention adds a new prediction scale to YOLOv4, which is specifically used to identify small leakage targets, effectively reduces the missed recognition rate and improves the detection accuracy.

[0127] Example 3, reference Figure 2 , as an embodiment of the present invention, provides a pressure gauge base liquid leakage detection system based on a generative adversarial network, including an image acquisition module, a model training module, and a detection module.

[0128] The image acquisition module is used to collect images for manual annotation, enhance data, and perform image preprocessing to obtain true value images; the model training module is used to combine the YOLOv4 architecture with the generative adversarial network to construct a pressure gauge base liquid leakage detection model; the detection module is used to input the pressure gauge base image to be detected into the trained pressure gauge base liquid leakage detection model to obtain the detection result.

[0129] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0130] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0131] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.

[0132] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc. It should be noted that the above embodiments are only used to illustrate the technical solution of the present invention and are not limited. Although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.

[0133] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A pressure gauge base liquid leakage detection method based on a generative adversarial network, characterized in that: include: Collect images for manual annotation, enhance data, and perform image preprocessing to obtain true value images; Combine the YOLOv4 architecture with the generative adversarial network to build a pressure gauge base liquid leakage detection model; The image of the pressure gauge base to be tested is input into the trained pressure gauge base liquid leakage detection model to obtain the test result.

2. The pressure gauge base liquid leakage detection method based on generative adversarial network according to claim 1, characterized in that: The image preprocessing includes grayscale correction, filtering and sharpening of the image to extract clear feature information; Grayscale correction uses Bottom-hat transformation technology to adjust the grayscale of the image to further optimize the data quality. The Bottom-hat transformation is expressed as: Bottom-hat=(f·s)-f Among them, f represents the original image dataset, and s represents the field of morphological operation; Image filtering uses Gaussian filtering technology to assign weights to each pixel according to its spatial proximity to the center point. The weight assignment formula is expressed as: Among them, g(i,j) represents a point on the output image, f(k,l) represents the corresponding point on the input image, s(i,j) represents the neighborhood centered at (i,j), and w(i,j,l,k) represents the weight; Sharpening is to use the Sobel operator edge enhancement tool to sharpen the image.

3. The pressure gauge base liquid leakage detection method based on generative adversarial network according to claim 2 is characterized in that: The true value image includes marking an image that has been subjected to marking processing, data enhancement, and image preprocessing, and processing the image into a 256×256 JPG format image to obtain a true value image.

4. The pressure gauge base liquid leakage detection method based on generative adversarial network according to claim 3 is characterized in that: The construction of the pressure gauge base liquid leakage detection model includes combining the YOLOv4 architecture with the generative adversarial network, constructing a generation module under the YOLOv4 framework, taking the true value image to be detected as the input of the generation network, and generating an image similar to the reference data through generator training; The discriminator compares the images generated by the generator with the real images; Generate adversarial network objective function, expressed as: Among them, L(D,G) represents the loss function of the whole system, G represents the parameters of the generator, D represents the parameters of the discriminator, and P data represents the distribution of real data, y B represents the sample sampled from the real data distribution, and x represents the sample output from the generator; The two networks compete with each other through adversarial training. The discriminator's ability to distinguish differences between images continues to improve, and the generator further generates higher quality images. Through training, the objective function converges to Pada(x)=Pada(y).

5. The method for detecting liquid leakage of a pressure gauge base based on a generative adversarial network according to claim 4, characterized in that: The construction of the pressure gauge base liquid leakage detection model also includes using a weighted bidirectional feature fusion network to replace the traditional bottom-up to top-down feature pyramid structure in YOLOv4; Based on YOLOv4, a 2x upsampling operation is performed on high-level features. New elements are inserted into the existing pixel matrix through interpolation, so that the width and height of the features are expanded to twice the original size to match the size of the adjacent feature layer. For low-level features, a 1×1 convolution operation is applied to adjust the number of output channels, and secondary feature fusion is performed. The fused low-level features are downsampled by a 3×3 convolution with a step size of 2. Based on the YOLOv4 architecture, an additional prediction scale is introduced to accurately capture and identify subtle leakage targets.

6. The pressure gauge base liquid leakage detection method based on generative adversarial network according to claim 5, characterized in that: The constructing of the pressure gauge base liquid leakage detection model further includes evaluating the output using the discriminator and transmitting the evaluation result back to the generator for tuning; Construct loss functions for the generator network and the discriminator network respectively, and calculate the overall loss function of the generator network, which will be used as the objective function for optimization; The bounding box regression loss is expressed as: L GIoU =1-GIoU in, B gt represents the labeled true sample, B pre Denotes the prediction box ρ 2 (B pre ,B gt ) represents the Euclidean square between the center points of the two boxes, w gt Indicates the height of the real sample, h gt Represents the width of the real sample, w pre Indicates the height of the predicted sample frame, h pre Represents the width of the predicted sample box, and v represents the parameter that measures the consistency of the aspect ratio between the predicted box and the true box; Confidence prediction loss, expressed as: Among them, s 2 represents the predicted grid unit, B represents the number of predicted prior boxes, and the value is 4. represents the target contained in the i-th and j-th networks, represents the target that is not in the i-th and j-th networks, With C i Represent the confidence of the actual target and the predicted target, respectively, fo represents the hyperparameter, which is set to 0.5; The classification loss is expressed as: Among them, p i (c) represents the probability value of the i-th network belonging to category c when it contains the target, Represents the probability value of belonging to category c when the i-th network has no target; Adversarial loss, expressed as: in, represents the average value of the input features, P data (I input ) represents the probability density function of the data; The objective function is expressed as: L=λ GIoU ·L GIoU +λ Confidence ·L Confidence +λ Class ·L Class +λ voxel ·L voxel Among them, λ represents the weight coefficient; The objective function for training the pressure gauge base liquid leakage detection model is expressed as: Set the number of iterations, input image training data in batches, update network parameters, and save the model after training is complete.

7. The pressure gauge base liquid leakage detection method based on generative adversarial network according to claim 6, characterized in that: The obtaining of the test result comprises inputting the image of the pressure gauge base to be tested into the trained model and outputting the test result L; When the detection result L≥threshold β, it is judged that there is liquid leakage at the base of the pressure gauge; When the detection result L is less than the threshold value β, it is determined that there is no liquid leakage in the pressure gauge base.

8. A system using the pressure gauge base liquid leakage detection method based on a generative adversarial network as claimed in any one of claims 1 to 7, characterized in that: Including image acquisition module, model training module and detection module; The image acquisition module is used to collect images for manual annotation, enhance data, and perform image preprocessing to obtain true value images; The model training module is used to combine the YOLOv4 architecture with the generative adversarial network to build a pressure gauge base liquid leakage detection model; The detection module is used to input the pressure gauge base image to be detected into the trained pressure gauge base liquid leakage detection model to obtain the detection result.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the pressure gauge base liquid leakage detection method based on a generative adversarial network described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the pressure gauge base liquid leakage detection method based on a generative adversarial network described in any one of claims 1 to 7 are implemented.