Liquid leakage intelligent detection method and system based on vision
By using a vision-based liquid leak detection method, which utilizes high-definition cameras and deep learning models to identify liquid areas, the technical shortcomings of traditional contact detection methods are overcome, enabling high-precision, low-maintenance, all-weather automated monitoring.
Patent Information
- Application Number
- CN202511329293.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2026-02-10
AI Technical Summary
Traditional contact-based liquid leak detection methods are complex to install and maintain, susceptible to mechanical vibration and electromagnetic interference, and have high false alarm and false alarm rates, especially under adverse weather conditions. They cannot meet the requirements of high precision, low maintenance cost and automation for industrial safety monitoring.
Using a high-definition camera combined with the UNet++ semantic segmentation model, liquid regions are identified through CIE-Lab color space and 8-neighborhood connectivity analysis. The liquid regions are converted into convex polygons using Andrew's MonotoneChain algorithm, and then expanded outwards using a radial expansion algorithm. The color difference value is calculated to determine leakage and trigger an alarm.
It achieves non-contact, interference-resistant liquid leak detection, reduces system complexity and maintenance costs, improves environmental adaptability and accuracy of detection, and realizes all-weather, high-precision automated monitoring.
Smart Images

Figure CN121504801A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of industrial equipment safety monitoring, and particularly relates to a liquid leakage intelligent detection method and system based on vision. BACKGROUND
[0002] In the industrial fields of petrochemical industry, water conservancy engineering, etc., the leakage detection of liquid storage containers and conveying pipelines has always been a key technical problem related to production safety and environmental protection. Traditional leakage detection methods mainly rely on contact-type detection equipment such as pressure sensors, flow meters, etc. for monitoring. These traditional methods monitor the changes in internal pressure or flow anomalies of the pipeline to determine whether there is a leakage phenomenon. Under normal working conditions, they can to some extent find the leakage problem. However, contact-type detection equipment needs to be directly installed on the pipeline or container, which not only increases the complexity of the system, but also may become a new fault point.
[0003] Traditional detection technologies have exposed many technical defects and limitations in practical application. The installation and maintenance process of contact-type detection equipment is complex, which requires professional technicians to calibrate and maintain regularly, increasing the operating cost. More seriously, these devices are easily affected by external factors such as mechanical vibration, electromagnetic interference, etc., leading to frequent false positives or false negatives. Especially in outdoor complex environments, temperature changes, humidity effects, and adverse weather conditions such as rain and snow will significantly reduce the reliability and accuracy of the detection system. In addition, the high dependence on manual inspection of existing technologies not only has low efficiency, but also has safety hazards, which cannot meet the urgent needs of modern industry for automated and intelligent monitoring.
[0004] In view of the above technical bottlenecks, the industry urgently needs a non-contact, high-precision, strong anti-interference liquid leakage detection technology. The detection method based on computer vision and deep learning provides a new idea to solve this technical problem. By deploying high-definition camera equipment combined with advanced image processing algorithms, remote monitoring and intelligent identification of leakage phenomena can be realized, effectively avoiding the technical defects of traditional methods. This non-contact detection method not only can reduce the installation and maintenance cost, but also can maintain stable detection performance under complex environmental conditions, providing a more reliable and efficient technical solution for industrial safety monitoring. SUMMARY
[0005] The technical problem to be solved by the present application is the key defects existing in the leakage detection technology of existing liquid storage containers and conveying pipelines. The traditional contact detection method relies on pressure sensors, flow meters and other equipment, which has the technical bottlenecks of complex installation and maintenance, equipment vulnerable to mechanical vibration and electromagnetic interference, and significant reduction of detection reliability in complex outdoor environments. Especially in bad weather conditions such as rain and snow, the false positive rate and false negative rate of the traditional detection method increase sharply, which cannot meet the technical requirements of high precision, strong anti-interference and low maintenance cost for industrial safety monitoring. The high dependence on manual inspection in the prior art not only has low efficiency, but also has safety hazards, and it is difficult to realize continuous and uninterrupted automatic monitoring.
[0006] To solve the above technical problems, the present application provides a visual-based liquid leakage intelligent detection method, which collects the monitoring image of the liquid storage container or conveying pipeline through a high-definition camera, processes the image using a pre-trained UNet++ semantic segmentation model to generate a segmentation mask, converts the original image to a CIE-Lab color space, and then uses 8-neighbor connectivity analysis to identify independent liquid regions. The method converts the irregular contour to a convex polygon using the Andrew's Monotone Chain algorithm, performs outer expansion processing on the contour using the radial expansion algorithm, extracts the Lab values of the pixels in the convex hull region and the background pixels in the expanded ring region, calculates the color difference value using the CIE76 standard color difference formula, and determines that there is a real liquid leakage and triggers an alarm when the color difference value is greater than a preset threshold. The present application also provides a corresponding detection system, including a high-definition camera, a hard disk recorder, an edge analysis device and an audible alarm, forming a complete intelligent monitoring solution.
[0007] A visual-based liquid leakage intelligent detection method, comprising the following steps: Collecting the monitoring image of the liquid storage container or conveying pipeline through a high-definition camera, with an image resolution not less than 1920x1080; Processing the collected image using a pre-trained UNet++ semantic segmentation model to generate a single-channel segmentation mask image, with 255 representing the predicted liquid region and 0 representing the background in the mask; Converting the original image to a CIE-Lab color space; Using 8-neighbor connectivity analysis to identify independent liquid regions in the segmentation mask, and removing connected regions with less than 100 pixels; Converting the irregular contour of each connected region to a convex polygon using the Andrew's Monotone Chain algorithm, arranging the contour points in ascending order of x coordinate, and using the cross product judgment formula to judge the concave-convex property; Performing outer expansion processing on the convex polygon contour using the radial expansion algorithm, calculating the arithmetic mean center of the contour points as the centroid, and controlling the verification region width through the expansion coefficient; The Lab values of pixels in the convex hull region and the Lab values of background pixels in the expanded ring region are extracted, and the color difference value is calculated using the CIE76 standard color difference formula; When the color difference value is greater than the preset threshold, it is determined that there is real liquid leakage and an alarm is triggered.
[0008] Further, the cross product judgment formula is: for an ordered point set , , , the cross product When , the point is retained.
[0009] Further, the calculation formula of the radial expansion algorithm is: , wherein is the original contour point, c is the region centroid, is the number of expanded pixels.
[0010] Further, the CIE76 standard color difference formula is: , wherein , is the Lab value of the liquid region, , , is the Lab value of the background region.
[0011] Further, the UNet++ semantic segmentation model is obtained by training through the following steps: water splashing simulation is performed within a range of 2 meters near the positions prone to leakage of the liquid storage container and the conveying pipeline, image data under the conditions of morning, noon, evening, night and rainy and snowy weather is collected; the liquid in the image is polygonally labeled using CVAT software; the labeled data set is divided into a training set, a validation set and a test set for model training.
[0012] A visual-based liquid leakage intelligent detection system, comprising: a high-definition camera installed at a position not less than 3 meters from the ground, facing the positions prone to leakage of the liquid storage container and the conveying pipeline; a hard disk video recorder connected with the high-definition camera, used for storing the collected video data; an edge analysis device with an AI chip, reading the video stream from the hard disk video recorder and executing the above-described detection method; an audible alarm connected with the edge analysis device, playing an alarm voice when real liquid leakage is detected.
[0013] Further, the edge analysis device is any one of an inference server, an edge analysis device or an industrial computer.
[0014] Further, the high-definition camera has a resolution of no less than 1920*1080, and multiple cameras are arranged on the same device to cover different angle positions of the liquid storage container and the conveying pipeline.
[0015] Further, the system further comprises an application display platform connected with the edge analysis device, used for receiving and displaying the liquid leakage detection result.
[0016] The present application has the following beneficial effects: 1. The present application realizes non-contact intelligent monitoring of liquid leakage of the liquid storage container and the conveying pipeline by using a visual detection technology based on deep learning and contour extension, effectively overcoming technical defects such as complex installation and maintenance, and easy damage of equipment of the traditional contact detection method. The system does not need to directly install a sensor device on the pipeline or container, avoiding detection failure caused by equipment failure, and significantly reducing the installation cost and later maintenance cost of the system. The non-contact detection method also eliminates the physical connection between the equipment and the monitored object, improving the reliability and service life of the whole monitoring system.
[0017] 2. The present application has excellent environmental adaptability and anti-interference ability, and can maintain stable detection performance in various complex outdoor industrial environments. By combining the contour extension technology and the color difference analysis of the CIE-Lab color space, the system can effectively distinguish the real liquid leakage from environmental interference factors such as rain and snow, and significantly reduce the false alarm rate. Multi-period data acquisition training and all-weather monitoring capability ensure that the system can maintain high-precision detection effect in the morning, noon, evening, night and severe weather conditions, solving the technical bottleneck of significantly reduced detection reliability of the traditional method in complex environments.
[0018] 3. The present application realizes high automation and intelligence of liquid leakage detection, greatly improving the detection efficiency and accuracy. The system uses real-time video stream analysis technology to continuously and uninterruptedly monitor the monitoring area, and triggers the alarm mechanism as soon as leakage is found, with a response speed far exceeding the traditional manual inspection method. Through accurate leakage area positioning and automatic alarm function, the system not only reduces the dependence on manual inspection, but also provides accurate location information at the first time of leakage, providing strong support for subsequent emergency handling and repair work, thereby effectively preventing safety accidents and minimizing economic losses. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only illustrate the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0020] Figure 1 A liquid leakage detection process schematic diagram of an embodiment of the present application; Figure 2 A UNet++ model segmentation result schematic diagram of an embodiment of the present application; Figure 3 A convex polygon construction and contour expansion schematic diagram of an embodiment of the present application. DETAILED DESCRIPTION
[0021] The present application will be described in detail below with reference to the drawings and specific embodiments. It should be noted that in order to make the embodiments more detailed, the following embodiments are the best, preferred embodiments, and other alternative ways can also be implemented by those skilled in the art for some known technologies; and the drawings are only used to more specifically describe the embodiments, and are not intended to specifically limit the present application.
[0022] It should be noted that in the specification, "one embodiment", "embodiment", "exemplary embodiment", "some embodiments" and the like indicate that the described embodiments can include a specific feature, structure or property, but not necessarily every embodiment includes the specific feature, structure or property. In addition, when a specific feature, structure or property is described in combination with an embodiment, it should be within the knowledge of those skilled in the related art to implement such a feature, structure or property in combination with other embodiments (whether or not explicitly described).
[0023] Generally, the terms can be understood at least in part from the context of their use. For example, depending on the context, the term "one or more" as used herein can be used to describe any feature, structure, or characteristic in the singular or can be used to describe combinations of features, structures, or characteristics in the plural. In addition, the term "based on" can be understood as not necessarily intended to convey a set of exclusive factors, but can instead, depending on the context, allow for the existence of other factors not necessarily explicitly described.
[0024] Embodiment one: liquid leakage detection system based on deep learning and contour expansion As Figure 1As shown, the liquid leakage detection system provided by the embodiment adopts a visual detection method combining deep learning and contour expansion, and realizes intelligent leakage monitoring of the liquid storage container and the conveying pipeline. The system first simulates and collects liquid leakage data of the liquid storage container and the conveying pipeline in advance through a high-definition camera, labels the leaked liquid in the video to construct an image training dataset, trains an AI semantic segmentation model using the training dataset, and deploys the AI semantic segmentation model to an intelligent analysis device for real-time AI on-site analysis. When the UNet++ network detects a leakage area, the system converts the original image to a CIE-Lab color space, identifies the connected regions in the segmentation mask, removes the connected regions with a pixel number less than 100 in the connected regions, and finally performs convex polygon conversion and contour expansion on each connected region. The color difference between the expanded region and the original segmentation region is calculated, and when the color difference is greater than a set threshold, it is determined as a real leakage and a field sound and light alarm is triggered to play an alarm voice of liquid leakage.
[0025] Camera installation and configuration: The high-definition camera is installed facing the liquid storage container and the conveying pipeline at a position where leakage is likely to occur, and the installation height is not less than 3 meters from the ground. For the same device, multiple cameras need to be installed for monitoring to ensure that different angle positions of the liquid storage container and the conveying pipeline are covered, the imaging of the camera is clear without obstruction, and abnormal shaking does not occur. The camera uses a high-definition camera with a resolution of not less than 1920x1080 to ensure that the image quality meets the accuracy requirements of subsequent AI analysis.
[0026] Data collection and annotation processing: The embodiment needs to simulate liquid leakage data. Water simulation is performed within a range of 2 meters around each position where leakage is likely to occur, and the water color is as close as possible to the leakage liquid itself. The simulation time covers different environmental conditions such as morning, noon, evening, night, and rainy and snowy weather. When constructing the liquid leakage semantic segmentation dataset, use the deep learning image label annotation software CVAT for annotation, use polygon box for annotation type, and use liquid for annotation category to ensure that the positive and negative sample data are as balanced as possible to improve the model training effect.
[0027] Semantic segmentation model selection and training: The embodiment uses the UNet++ algorithm model as the basic model, which not only has significant detection performance, but also supports pruning and quantization to adapt to the deployment requirements of edge devices. Based on the constructed liquid leakage semantic segmentation dataset, the dataset is divided into training set, validation set and test set three parts, the training set and the validation set are used to train the liquid leakage detection AI model, the accuracy and recall rate of the model are evaluated through the validation set samples, and the model can accurately detect the liquid leakage position.
[0028] Post-processing verification algorithm: For the leakage area detected by UNet++, the system implements further authenticity verification processing. First, UNet++ generates a single-channel segmentation mask image for each frame image, where 255 represents the predicted water area, and 0 represents the background, as shown in the red area in FIG. 6B. Second, the original video frame image is converted to the CIE-Lab color space, and the 8-neighbor connectivity analysis is used to identify independent water area. A parallel labeling algorithm based on scan lines is used, and for a binary mask M, the labeling result L satisfies the formula: Figure 2 where L represents the labeling matrix, i and j are pixel coordinate indices, and k is the connected region number.
[0029] Contour processing and expansion algorithm: The system calculates the number of pixels for each connected region, removes noise regions with an area less than 100 pixels, and then converts the irregular water area contour to a convex polygon to retain the main geometric features and provide a stable boundary for contour expansion and color difference verification. The Andrew's Monotone Chain algorithm is selected, the point set is sorted in ascending order of x coordinates (if x is the same, it is sorted by y), and the sorted points are traversed. The cross product is used to determine the concave-convex property, and the predecessor points that cause concavity are removed. The cross product judgment formula is: for an ordered point set , , : when is retained.
[0030] Subsequently, a radial expansion algorithm is used to ensure the smoothness of the expanded contour. The arithmetic mean center of all contour points is calculated, and the vector from each point to the centroid is unitized. By adjusting the expansion coefficient , the width of the verification area is controlled, and the expansion formula is: where is the original contour point, c is the region centroid, is the number of expanded pixels. As shown in FIG. 6C, the green line is the convex polygon area, and the blue line is the contour expansion result. Figure 3
[0031] Color difference calculation and determination: The system extracts the Lab values of all pixels within the convex hull region, uniformly samples the background pixels within the expanded ring-shaped region, uses the median instead of the mean to enhance noise resistance, and uses the CIE76 standard color difference formula for calculation: where This represents the CIE76 standard color difference value. , The Lab value for the water area. , , The Lab value represents the background area. When the calculated color difference value exceeds a preset threshold, the system determines it as a real liquid leak and triggers an alarm mechanism.
[0032] System Hardware Configuration and Integration: The hardware devices involved in this embodiment include a high-definition camera, a hard disk recorder, an edge analysis device, and an audible and visual alarm. The edge analysis device can be an inference server with an AI chip, an edge analysis device, or an industrial control computer, etc. During system integration, the camera is connected to the hard disk recorder, and the edge analysis device reads the video stream from the hard disk recorder for real-time analysis, returns the analysis results, and provides the liquid leak detection results. The detection results are sent to the application system for display and management. When a real liquid leak is detected, the system automatically triggers the on-site audible and visual alarm to play a liquid leak alarm message, and simultaneously pushes the alarm information to the monitoring center for rapid response and handling.
[0033] By implementing the above technical solutions, the present invention can achieve all-weather, high-precision, non-contact liquid leakage detection of liquid storage containers and conveying pipelines, effectively solving the technical defects of traditional contact detection methods, and significantly improving the intelligence level and detection reliability of industrial equipment safety monitoring.
[0034] This invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of this invention. To provide the public with a thorough understanding of this invention, specific details are described in detail in the following preferred embodiments; however, those skilled in the art will fully understand the invention even without these details. Furthermore, to avoid unnecessary misunderstanding of the essence of this invention, well-known methods, processes, procedures, components, and circuits are not described in detail.
[0035] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A vision-based intelligent detection method for liquid leaks, characterized in that: Includes the following steps: High-definition cameras are used to capture monitoring images of liquid storage containers or delivery pipelines, with an image resolution of no less than 1920×1080. The acquired images are processed using a pre-trained UNet++ semantic segmentation model to generate a single-channel segmentation mask image. In the mask, 255 represents the predicted liquid region and 0 represents the background. Convert the original image to the CIE-Lab color space; 8-neighborhood connectivity analysis is used to identify independent liquid regions in the segmentation mask, and connected regions with fewer than 100 pixels are removed; Andrew's Monotone Chain algorithm is used to convert the irregular contour of each connected region into a convex polygon. The contour points are arranged in ascending order of x-coordinate, and the cross product judgment formula is used to determine the concavity and convexity. A radial expansion algorithm is used to expand the convex polygon contour. The arithmetic mean center of the contour points is calculated as the centroid, and the width of the verification region is controlled by the expansion coefficient. Extract the Lab values of pixels within the convex hull region and the Lab values of background pixels within the outer annular region, and calculate the color difference value using the CIE76 standard color difference formula; When the color difference value exceeds the preset threshold, it is determined to be a real liquid leak and an alarm is triggered.
2. The method according to claim 1, characterized in that, The cross product criterion is as follows: For an ordered set of points... , , cross product when The point should be retained at that time.
3. The method according to claim 1, characterized in that, The calculation formula for the radial expansion algorithm is as follows: ,in Let c be the original contour point and c be the centroid of the region. This represents the number of pixels in the outermost region.
4. The method according to claim 1, characterized in that, The CIE76 standard color difference formula is: , in , The Lab value for the liquid region. , , This represents the Lab value for the background area.
5. The method according to claim 1, characterized in that, The UNet++ semantic segmentation model was trained through the following steps: a water splashing simulation was conducted within 2 meters of the location where the liquid storage container and delivery pipeline were prone to leakage, and image data was collected under morning, noon, evening, night and rainy / snowy weather conditions; CVAT software was used to annotate the liquid in the images with polygonal boxes; The labeled dataset is divided into training, validation, and test sets for model training.
6. A vision-based intelligent liquid leak detection system, characterized in that, include: High-definition cameras are installed at a height of no less than 3 meters above the ground, directly facing the liquid storage containers and delivery pipelines where leaks are likely to occur. A hard disk video recorder, connected to a high-definition camera, is used to store the captured video data; An edge analysis device, having an AI chip, reads a video stream from a hard disk recorder and executes the detection method according to any one of claims 1 to 5; An audible and visual alarm, connected to an edge analytics device, plays an alarm voice when a real liquid leak is detected.
7. The system according to claim 6, characterized in that, The edge analysis device can be any one of an inference server, an edge analysis device, or an industrial control computer.
8. The system according to claim 6, characterized in that, The resolution of the high-definition camera is no less than 1920×1080, and multiple cameras are configured on the same device to cover different angles and positions of the liquid storage container and the delivery pipeline.
9. The system according to claim 6, characterized in that, It also includes an application demonstration platform that connects to edge analytics devices to receive and display liquid leak detection results.