CN117333776A - VOCs gas leakage detection method, device and storage medium - Google Patents

VOCs gas leakage detection method, device and storage medium Download PDF

Info

Publication number
CN117333776A
CN117333776A CN202311451214.6A CN202311451214A CN117333776A CN 117333776 A CN117333776 A CN 117333776A CN 202311451214 A CN202311451214 A CN 202311451214A CN 117333776 A CN117333776 A CN 117333776A
Authority
CN
China
Prior art keywords
frame
vocs gas
image
leakage
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311451214.6A
Other languages
Chinese (zh)
Inventor
陈骥
钟建波
罗永芳
杨伟声
王元康
于闻
谭英
贾钰超
朱俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yunnan North Optical Technology Co ltd
Original Assignee
Yunnan North Optical Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yunnan North Optical Technology Co ltd filed Critical Yunnan North Optical Technology Co ltd
Priority to CN202311451214.6A priority Critical patent/CN117333776A/en
Publication of CN117333776A publication Critical patent/CN117333776A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)

Abstract

The embodiment of the application discloses a VOCs gas leakage detection method, a device and a storage medium, wherein the VOCs gas leakage detection method comprises the following steps: obtaining a trained VOCs gas detection model based on a YOLOv8 network structure; acquiring an image to be detected, inputting a VOCs gas detection model, obtaining a probability sequence corresponding to each frame of output image, and recording corresponding image frames and detection frame line values thereof when the probability sequence is greater than a preset threshold value; taking an infrared image in a detection frame line of a recorded image frame as a current background image, extracting a moving target area containing shadow features of continuous N frames of infrared images in the detection frame line from the recorded image frame by using a Gaussian mixture model, and acquiring the area change rate of a leakage area meeting the gas leakage detection condition in the moving target area; and counting image frames corresponding to the leakage areas with the area change rate meeting the preset conditions, and judging that VOCs gas leakage occurs when the counted frame number is larger than a preset threshold value.

Description

VOCs gas leakage detection method, device and storage medium
Technical Field
The application relates to the technical field of image processing, in particular to a VOCs gas leakage detection method, a VOCs gas leakage detection device and a storage medium.
Background
The infrared gas leakage detector is a kind of commonly used gas detection equipment, widely used in petrochemical industry and other industrial fields, the equipment converts invisible object thermal radiation distribution image into video image by detecting infrared radiation of object, and performs means such as photoelectric conversion and electric signal processing, and the equipment monitors the whole window and can realize large-area monitoring by matching with infrared lenses with different focal lengths and cloud platforms. The equipment can realize the positioning of a leakage source, and can clearly display the gas diffusion direction, so that the equipment becomes an important technical means for detecting and tracing the gas leakage.
However, the gas leakage detector device commonly used at present mainly performs gas leakage alarm through human eye observation, and most of integrated intelligent gas leakage alarm algorithms have the following problems: 1. the method is only suitable for static background, and has low practicability for dynamic scene; 2. the detection algorithm is too dependent on training scenes, so that universality for unfamiliar use scenes is low; 3. the detection accuracy is not high, and false alarms are easy to occur.
Disclosure of Invention
The purpose of the application is to provide a VOCs gas leakage detection method, a device and a storage medium, which are used for solving the problems of the intelligent gas leakage alarm algorithm in the prior art: 1. the method is only suitable for static background, and has low practicability for dynamic scene; 2. the detection algorithm is too dependent on training scenes, so that universality for unfamiliar use scenes is low; 3. the detection precision is not high, and false alarm and missing report are easy to occur.
In order to achieve the above object, an embodiment of the present application provides a method for detecting VOCs gas leakage, including the following steps: step 1), obtaining a trained VOCs gas detection model based on a YOLOv8 network structure;
step 2) obtaining an image to be detected, inputting the VOCs gas detection model, obtaining a probability sequence corresponding to each frame of output image, and recording corresponding image frames and detection frame line values thereof when the probability sequence is larger than a preset threshold value;
step 3) taking an infrared image in a detection frame line of a recorded image frame as a current background image, extracting a moving target area containing shadow features of continuous N frames of infrared images in the detection frame line from the recorded image frame by using a Gaussian mixture model, and acquiring the area change rate of a leakage area meeting the gas leakage detection condition in the moving target area;
and 4) counting image frames corresponding to the leakage areas with the area change rate meeting the preset conditions, and judging that VOCs gas leakage occurs when the counted frame number is larger than a preset threshold value.
Optionally, the step 1) specifically includes:
acquiring infrared video images of VOCs gas leakage, carrying out frame size normalization, extracting images containing the VOCs gas leakage as key frames, and carrying out data preprocessing on the key frames;
screening repeated scene images in the key frames, extracting frame data in the key frames in equal proportion aiming at different scenes to serve as training samples, and dividing the training samples according to scenes;
and using the Yolov8 as a pre-training model, and performing model training by using the training sample to obtain the VOCs gas detection model.
Optionally, using YOLOv8 as a pre-training model, performing model training by using the training sample to obtain the VOCs gas detection model, including:
model training is carried out by utilizing a training set of the training sample, a prediction result output by the pre-training model is obtained, the prediction result is compared with a corresponding actual label, a loss value is calculated by utilizing cross entropy loss, and the weight and bias of the pre-training model are updated by utilizing a back propagation algorithm according to the loss value;
inputting the test set of the training sample into the pre-training model for forward reasoning, and comparing the test set with the actual label of the test set to obtain an evaluation index;
and performing iterative training until the preset requirement is met, and obtaining the VOCs gas detection model.
Optionally, the step 2) specifically includes:
acquiring a video stream of an image to be detected, inputting the video stream into the VOCs gas detection model by taking a frame as a unit, and obtaining a probability sequence and a target frame sequence output by the model for each frame of image;
traversing the probability sequence, and recording corresponding image frames and detection frame line values thereof when the probability sequence is larger than a first threshold value.
Optionally, the step 3) specifically includes:
using the Gaussian mixture model to count the change of brightness, saturation and hue parameters of each pixel point of the continuous N frames of infrared images in an HVS space from the recorded image frame;
the brightness, saturation and color of each pixel point are reduced, and the pixels lower than a second threshold value are used as shadow pixels, so that the moving target area containing shadow features is extracted;
extracting a shadow area from the moving target area by using an adaptive threshold segmentation method, and taking the shadow area as a leakage area of a potential VOCs gas target in a single frame image;
and acquiring the shape irregularity of the leakage area, and acquiring the area change rate of the leakage area corresponding to the image frame when the shape irregularity is between a third threshold value and a fourth threshold value.
Optionally, the acquiring the shape irregularity of the leakage area includes:
using the formula:and acquiring the shape irregularity alpha, wherein C is the perimeter of the edge of the possible leakage area, and A is the area of the possible leakage area.
Optionally, the acquiring the area change rate of the leakage area corresponding to the image frame includes:
using the formula:and acquiring the area change rate delta A, wherein an+1 and An are areas of possible leakage areas of An infrared image of An n+1st frame and An infrared image of An n frame respectively, the n+1st frame is a current image frame, and the n frame is a frame before the current image frame.
Optionally, the step 4) specifically includes:
when the area change rate is between the fifth threshold value and the sixth threshold value, judging that the leakage area in the image of the current image frame contains a VOCs gas leakage target, and adding one to the counted frame number;
when the number of frames of the counted images including the VOCs gas leakage target in the leakage area is greater than a seventh threshold value in the continuous N frame images from the recorded image frames, it is determined that the VOCs gas leakage has occurred.
To achieve the above object, the present application further provides a VOCs gas leakage detection device, including: a memory; and
a processor coupled to the memory, the processor configured to perform the steps of the method as described above.
To achieve the above object, the present application also provides a computer storage medium having stored thereon a computer program which, when executed by a machine, implements the steps of the method as described above.
The embodiment of the application has the following advantages:
the embodiment of the application provides a VOCs gas leakage detection method, which comprises the following steps: step 1), obtaining a trained VOCs gas detection model based on a YOLOv8 network structure; step 2) obtaining an image to be detected, inputting the VOCs gas detection model, obtaining a probability sequence corresponding to each frame of output image, and recording corresponding image frames and detection frame line values thereof when the probability sequence is larger than a preset threshold value; step 3) taking an infrared image in a detection frame line of a recorded image frame as a current background image, extracting a moving target area containing shadow features of continuous N frames of infrared images in the detection frame line from the recorded image frame by using a Gaussian mixture model, and acquiring the area change rate of a leakage area meeting the gas leakage detection condition in the moving target area; and 4) counting image frames corresponding to the leakage areas with the area change rate meeting the preset conditions, and judging that VOCs gas leakage occurs when the counted frame number is larger than a preset threshold value.
By the method, the VOCs gas leakage detection method based on the YOLOv8 and Gaussian mixture model framework is provided, the method not only utilizes strong scene adaptability and reasoning instantaneity of the YOLOv8 framework to ensure that the method can play a positive role in both static scenes and dynamic scenes, but also combines the analysis and detection capability of a GMM framework on a pixel-level moving target in the static scenes to ensure the detection precision of the VOCs gas leakage target. The method reduces the dependence of the model on training scenes, improves the detection precision of static scenes and dynamic scenes, and can make up for part of the shortages of the current common intelligent gas leakage alarm algorithm. Thereby solving the problems of the intelligent alarm algorithm for gas leakage in the prior art: 1. the method is only suitable for static background, and has low practicability for dynamic scene; 2. the detection algorithm is too dependent on training scenes, so that universality for unfamiliar use scenes is low; 3. the detection precision is not high, and false alarm and missing report are easy to occur.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It will be apparent to those skilled in the art from this disclosure that the drawings described below are merely exemplary and that other embodiments may be derived from the drawings provided without undue effort.
Fig. 1 is a flowchart of a method for detecting VOCs gas leakage according to an embodiment of the present application;
FIG. 2 is a logic block diagram of a method for detecting leakage of VOCs gas according to an embodiment of the present application;
fig. 3 is a video image of a weak gas leakage target and a graph of detecting effect of VOCs gas leakage, which are input by the method for detecting VOCs gas leakage according to the embodiment of the present application;
fig. 4 is a video image containing a non-weak gas leakage target and a VOCs gas leakage detection effect diagram, which are input by the VOCs gas leakage detection method according to the embodiment of the present application;
fig. 5 is a block diagram of a VOCs gas leakage detection apparatus according to an embodiment of the present application.
Detailed Description
Other advantages and advantages of the present application will become apparent to those skilled in the art from the following description of specific embodiments, which is to be read in light of the present disclosure, wherein the present embodiments are described in some, but not all, of the several embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In addition, the technical features described below in the different embodiments of the present application may be combined with each other as long as they do not collide with each other.
An embodiment of the present application provides a method for detecting gas leakage of VOCs, referring to fig. 1 and 2, fig. 1 is a flowchart of a method for detecting gas leakage of VOCs provided in an embodiment of the present application, and fig. 2 is a logic block diagram of a method for detecting gas leakage of VOCs provided in an embodiment of the present application, where it should be understood that the method may further include additional blocks not shown and/or blocks not shown may be omitted, and the scope of the present application is not limited in this respect.
At step 1), a trained volov 8 network structure-based VOCs gas detection model is obtained.
In some embodiments, specifically including:
1.1, acquiring infrared video images of target VOCs gas leakage, normalizing frame sizes, extracting images containing the gas leakage as key frame data, and preprocessing the same data of the key frames. Such as image enhancement processing, image rotation, overturning, brightness contrast adjustment and the like, so that the diversity of training samples is enhanced, and the robustness and accuracy of the model are improved;
1.2, screening repeated scene images in the key frames, and extracting frame data according to the proportions of ambient temperature, humidity, gas concentration, leakage gas category and the like for different scenes respectively to serve as training samples;
1.3, acquiring an actual label of a training sample, for example, marking a real labeling frame (hereinafter referred to as a "group labeling box") of a gas target in the training sample by using labeling software, wherein each of the basic labeling boxes comprises (x, y, w, h) values, wherein (x, y) represents a center point coordinate of the real labeling frame, w represents a width of the labeling frame, and h represents a height of the labeling frame;
1.4 dividing training sample data sets according to scenes, in some embodiments, dividing training sets, verification sets and test sets according to the ratio of 7:1:2 in each scene, merging the training sets, the verification sets and the test sets of each scene respectively, renumbering, and converting into data sets in a YOLO format;
1.5 Using Yolov8 (e.g., YOLOv8m. Pt) as a pre-training model, in some embodiments, batch size is set to 128, maximum number of iterations is set to 500, each iteration round extracts 128 annotated images of VOCs-containing gas leakage targets from the training set, sends the images to the Yolov8 framework for forward propagation, and extracts features through multi-layer convolution and pooling operations, generating a prediction box and a class probability score;
1.6 comparing the predictions of the model with the actual labels and calculating the loss value using cross entropy loss. Updating the weight and bias of the model by using a back propagation algorithm according to the loss value;
and 1.7, inputting the images of the test set into a trained model for forward reasoning, and comparing the images with the actual labels of the test set to obtain evaluation indexes such as accuracy, recall rate, precision rate and the like. If the performance of the model on the test set is not improved or the maximum iteration number is reached, the end of training can be judged, and the VOCs gas leakage target detection model is obtained. In some embodiments, the accuracy, recall, and precision of the model of the successive two iterations are compared across the test set. When the improvement of the 3 indexes is less than or equal to 0.1% or the maximum iteration number is reached, the model is considered to reach the ending condition. If the training does not reach the end condition, the next iteration is performed until the end condition is met.
And 2) acquiring an image to be detected, inputting the VOCs gas detection model to obtain a probability sequence corresponding to each output frame image, and recording corresponding image frames and detection frame line values thereof when the probability sequence is larger than a preset threshold value.
In some embodiments, specifically including:
2.1, pushing a video stream acquired by a gas leak detector into a system in real time by using RTSP or RTMP protocol, and inputting the video stream into a VOCs gas leakage target detection model (namely a VOCs gas detection model) by taking a frame as a unit; for each frame of image, the VOCs gas detection model outputs a probability sequence P and a target frame sequence B, wherein the probability sequence P and the target frame sequence B are in one-to-one correspondence and are arranged in descending order of values in the probability sequence P; the i (i=0, 1,2, …, 99) th value P in the sequence i (P i ∈[0,1]) Corresponding target frame B i =(x l-t ,y l-t ,x r-b ,y r-b ) Wherein (x) l-t ,y l-t ) Respectively representing the x coordinate and the y coordinate of the upper left corner of the target frame, (x) r-b ,y r-b ) The representative target frames represent the x coordinate and the y coordinate of the right lower corner of the target frame respectively;
2.2 for each frame of detection output result, traversing probability sequence P, according to preset safety threshold (first threshold), for example 0.5, if for all P i When the gas leakage is smaller than the first threshold value, the gas leakage of VOCs does not occur; and when P occurs i When the first threshold value is larger than the first threshold value, the occurrence of the VOCs gas leakage is indicated, so that the input video frame number and the suspected VOCs gas leakage detection frame line value are recorded. In some embodiments, the safety threshold is set to be 0.5, so as to detect as many VOCs gas leakage targets as possible, and improve the detection rate.
And 3) taking the infrared image in the detection frame line of the recorded image frame as a current background image, extracting a moving target area containing shadow features of continuous N frames of infrared images in the detection frame line from the recorded image frame by using a Gaussian mixture model, and acquiring the area change rate of a leakage area meeting the gas leakage detection condition in the moving target area.
In some embodiments, specifically including:
3.1, acquiring a frame of infrared image of the detection frame line area, and taking the frame of infrared image as a background image if the frame of infrared image is the recorded infrared image of the corresponding frame;
3.2 extracting a moving target region containing shadow features by using a GMM Gaussian mixture model. The GMM automatically selects the number of components according to different input scenes, selects a proper number of Gaussian distributions for each pixel, has good adaptability to scene changes caused by brightness and other changes, can separate the backgrounds better, and extracts a moving target area containing shadow features.
The GMM gaussian mixture model counts the changes of parameters of brightness (V component), saturation (S component) and hue (H component) of each pixel in the HVS space, and takes the pixel with the brightness, saturation and hue of each pixel reduced and below a threshold Th2 (second threshold) as a shadow pixel. In some embodiments, the modeling sample of the GMM background model is set to 1, so that the real-time performance of target detection can be greatly improved. In some embodiments, the second threshold Th2 is set to 0.5, which will directly determine the size of the shadow area of the pixels near the moving target, and when set to 0.5, the water vapor and target shadow feature disturbance can be greatly reduced;
and 3.3, extracting a shadow area from the moving target area by using an adaptive threshold segmentation method, and taking the shadow area as a leakage area of a potential VOCs gas target in a single frame image. In some embodiments, the obtained image has only two gray levels, the gray value 127 represents a shadow region, and the gray value 255 represents a moving target region, so that the shadow region can be conveniently extracted by using the adaptive threshold segmentation method to be used as a leakage region of a potential VOCs gas target;
3.4 calculating the shape irregularity alpha of the potential VOCs gas leakage area, and if the shape irregularity is between the third threshold Th3 and the fourth threshold Th4, calculating the area change rate.
In some embodiments, the shape irregularity α is:
wherein C is the edge circumference of the possible leakage area; a is the area of the possible leakage area.
Taking into account the diffusion motion characteristics of the VOCs gas after target leakage. The shape irregularity thresholds Th3 and Th4 in some embodiments are 0.1 and 0.4, respectively.
3.5 calculating the area change rate Δa of the leak region of potential VOCs gas, in some embodiments the area change rate Δa is:
where an+1 and An are areas of areas where the n+1st frame (current frame) infrared image and the n frame (previous frame to the current frame) infrared image may leak, respectively. Considering that VOCs gas target leakage is a continuous process of gas cloud from small to large and from large to small, the area change rate thresholds Th5 and Th6 in some embodiments are 0.2 and 5, respectively.
And 4) counting image frames corresponding to the leakage areas with the area change rate meeting the preset condition, and judging that VOCs gas leakage occurs when the counted number of frames is greater than a preset threshold value.
In some embodiments, specifically including:
if the calculated area change rate of the leakage area of the potential VOCs gas in the current frame is between the fifth threshold Th5 and the sixth threshold Th6, the leakage area of the potential VOCs gas target in the image of the current frame is considered to contain the VOCs gas leakage target, and the number of frames meeting the condition count is increased by 1. If the number of frames threshold which is detected to be in accordance with the condition count in the continuous N frames of infrared images is larger than the seventh threshold Th7, the occurrence of the VOCs gas leakage event is considered. Referring to fig. 3 and 4, the relevant video part at this time is subjected to pseudo color processing and transmitted to a system administrator so that a maintenance person checks the leakage condition against the reference.
In some embodiments, N is set to a total number of frames of infrared images acquired by the gas leak detector within 1 second, approximately 40 frames. And sets the value threshold Th7 of the eligible count to 0.6 of the total frame number. It will be appreciated that when a VOCs gas leak target is detected in the 24 frames of images of the 40 frames, a gas leak event is considered to have occurred. By the mechanism, the detection precision of the VOCs gas leakage event can be greatly improved, and the false alarm probability is reduced.
The technical scheme has the following advantages:
1. the method and the device utilize strong scene adaptability and reasoning instantaneity of the YOLOv8 frame to eliminate target interference of most non-VOCs gas leakage, and simultaneously detect target areas higher than a preset safety threshold as much as possible to realize preliminary screening of suspected VOCs gas leakage targets;
2. the application exerts the pixel-level moving object of the GMM Gaussian mixture model in a static scene
The detection capability is analyzed, statistics of pixel brightness, saturation and hue change of a specific pixel point in an HVS space based on a time sequence can be realized, a moving target area containing shadow features is extracted by combining a background model, and whether the point belongs to potential VOCs gas leakage points is judged;
3. based on the statistics of pixel brightness, saturation and hue change of a time sequence in an HVS space, the interference of water vapor and target shadow characteristics is eliminated, and the detection precision of whether a pixel point belongs to a VOCs gas leakage point is improved;
4. according to the method, dynamic identification, intelligent detection and active tracing of the VOCs gas leakage target can be realized by utilizing the YOLOv8 and GMM model to analyze the gas cloud dynamic characteristics, the gray level distribution characteristics and the gas cloud diffusion characteristics in video frames continuously containing suspected VOCs gas clouds, the data processing instantaneity is high, the detection precision is high, the problem of high false alarm rate can be effectively solved, and the method can be widely applied to the field of volatile organic compound leakage detection.
Fig. 5 is a block diagram of a VOCs gas leakage detection apparatus according to an embodiment of the present application.
The device comprises:
a memory 101; and a processor 102 connected to the memory 101, the processor 102 configured to: step 1), obtaining a trained VOCs gas detection model based on a YOLOv8 network structure;
step 2) obtaining an image to be detected, inputting the VOCs gas detection model, obtaining a probability sequence corresponding to each frame of output image, and recording corresponding image frames and detection frame line values thereof when the probability sequence is larger than a preset threshold value;
step 3) taking an infrared image in a detection frame line of a recorded image frame as a current background image, extracting a moving target area containing shadow features of continuous N frames of infrared images in the detection frame line from the recorded image frame by using a Gaussian mixture model, and acquiring the area change rate of a leakage area meeting the gas leakage detection condition in the moving target area;
and 4) counting image frames corresponding to the leakage areas with the area change rate meeting the preset conditions, and judging that VOCs gas leakage occurs when the counted frame number is larger than a preset threshold value.
In some embodiments, the processor 102 is further configured to: the step 1) specifically comprises the following steps:
acquiring infrared video images of VOCs gas leakage, carrying out frame size normalization, extracting images containing the VOCs gas leakage as key frames, and carrying out data preprocessing on the key frames;
screening repeated scene images in the key frames, extracting frame data in the key frames in equal proportion aiming at different scenes to serve as training samples, and dividing the training samples according to scenes;
and using the Yolov8 as a pre-training model, and performing model training by using the training sample to obtain the VOCs gas detection model.
In some embodiments, the processor 102 is further configured to: the use of YOLOv8 as a pre-training model, the use of the training sample for model training, the acquisition of the VOCs gas detection model, comprises:
model training is carried out by utilizing a training set of the training sample, a prediction result output by the pre-training model is obtained, the prediction result is compared with a corresponding actual label, a loss value is calculated by utilizing cross entropy loss, and the weight and bias of the pre-training model are updated by utilizing a back propagation algorithm according to the loss value;
inputting the test set of the training sample into the pre-training model for forward reasoning, and comparing the test set with the actual label of the test set to obtain an evaluation index;
and performing iterative training until the preset requirement is met, and obtaining the VOCs gas detection model.
In some embodiments, the processor 102 is further configured to: the step 2) specifically comprises the following steps:
acquiring a video stream of an image to be detected, inputting the video stream into the VOCs gas detection model by taking a frame as a unit, and obtaining a probability sequence and a target frame sequence output by the model for each frame of image;
traversing the probability sequence, and recording corresponding image frames and detection frame line values thereof when the probability sequence is larger than a first threshold value.
In some embodiments, the processor 102 is further configured to: the step 3) specifically comprises the following steps:
using the Gaussian mixture model to count the change of brightness, saturation and hue parameters of each pixel point of the continuous N frames of infrared images in an HVS space from the recorded image frame;
the brightness, saturation and color of each pixel point are reduced, and the pixels lower than a second threshold value are used as shadow pixels, so that the moving target area containing shadow features is extracted;
extracting a shadow area from the moving target area by using an adaptive threshold segmentation method, and taking the shadow area as a leakage area of a potential VOCs gas target in a single frame image;
and acquiring the shape irregularity of the leakage area, and acquiring the area change rate of the leakage area corresponding to the image frame when the shape irregularity is between a third threshold value and a fourth threshold value.
In some embodiments, the processor 102 is further configured to: the acquiring the shape irregularity of the leakage area includes:
using the formula:and acquiring the shape irregularity alpha, wherein C is the perimeter of the edge of the possible leakage area, and A is the area of the possible leakage area.
In some embodiments, the processor 102 is further configured to: the acquiring the area change rate of the leakage area corresponding to the image frame includes:
using the formula:acquiring the areaThe change rate delta A, wherein an+1 and An are areas of possible leakage areas of An n+1st frame of infrared image and An n frame of infrared image respectively, the n+1st frame is a current image frame, and the n frame is a frame before the current image frame.
In some embodiments, the processor 102 is further configured to: the step 4) specifically comprises the following steps:
when the area change rate is between the fifth threshold value and the sixth threshold value, judging that the leakage area in the image of the current image frame contains a VOCs gas leakage target, and adding one to the counted frame number;
when the number of frames of the counted images including the VOCs gas leakage target in the leakage area is greater than a seventh threshold value in the continuous N frame images from the recorded image frames, it is determined that the VOCs gas leakage has occurred.
Reference is made to the foregoing method embodiments for specific implementation methods, and details are not repeated here.
The present application may be a method, apparatus, system, and/or computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for performing the various aspects of the present application.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for performing the operations of the present application may be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present application are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information for computer readable program instructions, which may execute the computer readable program instructions.
Various aspects of the present application are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Note that all features disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise. Thus, unless expressly stated otherwise, each feature disclosed is one example only of a generic set of equivalent or similar features. Where used, further, preferably, still further and preferably, the brief description of the other embodiment is provided on the basis of the foregoing embodiment, and further, preferably, further or more preferably, the combination of the contents of the rear band with the foregoing embodiment is provided as a complete construct of the other embodiment. A further embodiment is composed of several further, preferably, still further or preferably arrangements of the strips after the same embodiment, which may be combined arbitrarily.
While the application has been described in detail with respect to the general description and specific embodiments thereof, it will be apparent to those skilled in the art that certain modifications and improvements may be made thereto based upon the application. Accordingly, such modifications or improvements may be made without departing from the spirit of the application and are intended to be within the scope of the invention as claimed.

Claims (10)

1. The VOCs gas leakage detection method is characterized by comprising the following steps of:
step 1), obtaining a trained VOCs gas detection model based on a YOLOv8 network structure;
step 2) obtaining an image to be detected, inputting the VOCs gas detection model, obtaining a probability sequence corresponding to each frame of output image, and recording corresponding image frames and detection frame line values thereof when the probability sequence is larger than a preset threshold value;
step 3) taking an infrared image in a detection frame line of a recorded image frame as a current background image, extracting a moving target area containing shadow features of continuous N frames of infrared images in the detection frame line from the recorded image frame by using a Gaussian mixture model, and acquiring the area change rate of a leakage area meeting the gas leakage detection condition in the moving target area;
and 4) counting image frames corresponding to the leakage areas with the area change rate meeting the preset conditions, and judging that VOCs gas leakage occurs when the counted frame number is larger than a preset threshold value.
2. The method for detecting the leakage of VOCs gas according to claim 1, wherein said step 1) specifically comprises:
acquiring infrared video images of VOCs gas leakage, carrying out frame size normalization, extracting images containing the VOCs gas leakage as key frames, and carrying out data preprocessing on the key frames;
screening repeated scene images in the key frames, extracting frame data in the key frames in equal proportion aiming at different scenes to serve as training samples, and dividing the training samples according to scenes;
and using the Yolov8 as a pre-training model, and performing model training by using the training sample to obtain the VOCs gas detection model.
3. The method for detecting gas leakage of VOCs according to claim 2, wherein the model training using YOLOv8 as a pre-training model with the training sample to obtain the VOCs gas detection model comprises:
model training is carried out by utilizing a training set of the training sample, a prediction result output by the pre-training model is obtained, the prediction result is compared with a corresponding actual label, a loss value is calculated by utilizing cross entropy loss, and the weight and bias of the pre-training model are updated by utilizing a back propagation algorithm according to the loss value;
inputting the test set of the training sample into the pre-training model for forward reasoning, and comparing the test set with the actual label of the test set to obtain an evaluation index;
and performing iterative training until the preset requirement is met, and obtaining the VOCs gas detection model.
4. The method for detecting the leakage of VOCs gas according to claim 1, wherein said step 2) specifically comprises:
acquiring a video stream of an image to be detected, inputting the video stream into the VOCs gas detection model by taking a frame as a unit, and obtaining a probability sequence and a target frame sequence output by the model for each frame of image;
traversing the probability sequence, and recording corresponding image frames and detection frame line values thereof when the probability sequence is larger than a first threshold value.
5. The VOCs gas leakage detection method according to claim 1, wherein the step 3) specifically comprises:
using the Gaussian mixture model to count the change of brightness, saturation and hue parameters of each pixel point of the continuous N frames of infrared images in an HVS space from the recorded image frame;
the brightness, saturation and color of each pixel point are reduced, and the pixels lower than a second threshold value are used as shadow pixels, so that the moving target area containing shadow features is extracted;
extracting a shadow area from the moving target area by using an adaptive threshold segmentation method, and taking the shadow area as a leakage area of a potential VOCs gas target in a single frame image;
and acquiring the shape irregularity of the leakage area, and acquiring the area change rate of the leakage area corresponding to the image frame when the shape irregularity is between a third threshold value and a fourth threshold value.
6. The VOCs gas leakage detection method according to claim 5, wherein said obtaining the shape irregularities of the leakage area comprises:
using the formula:and acquiring the shape irregularity alpha, wherein C is the perimeter of the edge of the possible leakage area, and A is the area of the possible leakage area.
7. The VOCs gas leakage detection method according to claim 5, wherein the acquiring the area change rate of the leakage area of the corresponding image frame comprises:
using the formula:and acquiring the area change rate delta A, wherein an+1 and An are areas of possible leakage areas of An infrared image of An n+1st frame and An infrared image of An n frame respectively, the n+1st frame is a current image frame, and the n frame is a frame before the current image frame.
8. The VOCs gas leakage detection method according to claim 1, wherein the step 4) specifically comprises:
when the area change rate is between the fifth threshold value and the sixth threshold value, judging that the leakage area in the image of the current image frame contains a VOCs gas leakage target, and adding one to the counted frame number;
when the number of frames of the counted images including the VOCs gas leakage target in the leakage area is greater than a seventh threshold value in the continuous N frame images from the recorded image frames, it is determined that the VOCs gas leakage has occurred.
9. VOCs gas leakage detection device, characterized by, include:
a memory; and
a processor connected to the memory, the processor being configured to perform the steps of the method of any one of claims 1 to 8.
10. A computer storage medium having stored thereon a computer program, which when executed by a machine performs the steps of the method according to any of claims 1 to 8.
CN202311451214.6A 2023-11-02 2023-11-02 VOCs gas leakage detection method, device and storage medium Pending CN117333776A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311451214.6A CN117333776A (en) 2023-11-02 2023-11-02 VOCs gas leakage detection method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311451214.6A CN117333776A (en) 2023-11-02 2023-11-02 VOCs gas leakage detection method, device and storage medium

Publications (1)

Publication Number Publication Date
CN117333776A true CN117333776A (en) 2024-01-02

Family

ID=89283041

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311451214.6A Pending CN117333776A (en) 2023-11-02 2023-11-02 VOCs gas leakage detection method, device and storage medium

Country Status (1)

Country Link
CN (1) CN117333776A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117670878A (en) * 2024-01-31 2024-03-08 天津市沛迪光电科技有限公司 VOCs gas detection method based on multi-mode data fusion
CN117876800A (en) * 2024-03-11 2024-04-12 成都千嘉科技股份有限公司 Method for identifying potential safety hazard of flue of gas water heater

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117670878A (en) * 2024-01-31 2024-03-08 天津市沛迪光电科技有限公司 VOCs gas detection method based on multi-mode data fusion
CN117670878B (en) * 2024-01-31 2024-04-26 天津市沛迪光电科技有限公司 VOCs gas detection method based on multi-mode data fusion
CN117876800A (en) * 2024-03-11 2024-04-12 成都千嘉科技股份有限公司 Method for identifying potential safety hazard of flue of gas water heater
CN117876800B (en) * 2024-03-11 2024-05-17 成都千嘉科技股份有限公司 Method for identifying potential safety hazard of flue of gas water heater

Similar Documents

Publication Publication Date Title
CN117333776A (en) VOCs gas leakage detection method, device and storage medium
CN112669344A (en) Method and device for positioning moving object, electronic equipment and storage medium
CN111368771A (en) Tunnel fire early warning method and device based on image processing, computer equipment and computer readable storage medium
CN111931719B (en) High-altitude parabolic detection method and device
CN114241511B (en) Weak supervision pedestrian detection method, system, medium, equipment and processing terminal
CN115953566B (en) Feature analysis method, system and medium for infrared thermal imager
Jiang et al. A self-attention network for smoke detection
CN114298948A (en) Ball machine monitoring abnormity detection method based on PSPNet-RCNN
Jiang et al. Adaptive shadow detection using global texture and sampling deduction
CN110958467A (en) Video quality prediction method and device and electronic equipment
Wang et al. Pointer meter recognition in UAV inspection of overhead transmission lines
TWI729587B (en) Object localization system and method thereof
CN115691034A (en) Intelligent household abnormal condition warning method, system and storage medium
CN110751667A (en) Method for detecting infrared dim small target under complex background based on human visual system
CN113076889B (en) Container lead seal identification method, device, electronic equipment and storage medium
Sahoo et al. A fast valley-based segmentation for detection of slowly moving objects
Zeng et al. Extended scale invariant local binary pattern for background subtraction
CN116524357A (en) High-voltage line bird nest detection method, model training method, device and equipment
CN115713620A (en) Infrared small target detection method and device, computing equipment and storage medium
CN115131340A (en) Power plant pulverized coal leakage identification method, device and equipment and scale storage medium
CN112348011B (en) Vehicle damage assessment method and device and storage medium
Mahdi et al. SINGLE IMAGE DE-HAZING THROUGH IMPROVED DARK CHANNEL PRIOR AND ATMOSPHERIC LIGHT ESTIMATION.
CN109886133B (en) Ship detection method and system based on optical remote sensing image
Salazar Colores et al. Statistical multidirectional line dark channel for single‐image dehazing
Ekanayake et al. Crowd estimation using key‐point matching with support vector regression

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination