CN111080651B - Automatic monitoring method for petroleum drilling polluted gas based on water flow segmentation - Google Patents

Automatic monitoring method for petroleum drilling polluted gas based on water flow segmentation Download PDF

Info

Publication number
CN111080651B
CN111080651B CN201911290836.9A CN201911290836A CN111080651B CN 111080651 B CN111080651 B CN 111080651B CN 201911290836 A CN201911290836 A CN 201911290836A CN 111080651 B CN111080651 B CN 111080651B
Authority
CN
China
Prior art keywords
water flow
data
image
segmentation
perimeter
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.)
Active
Application number
CN201911290836.9A
Other languages
Chinese (zh)
Other versions
CN111080651A (en
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.)
Southwest University of Science and Technology
Original Assignee
Southwest University of Science and Technology
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 Southwest University of Science and Technology filed Critical Southwest University of Science and Technology
Priority to CN201911290836.9A priority Critical patent/CN111080651B/en
Publication of CN111080651A publication Critical patent/CN111080651A/en
Application granted granted Critical
Publication of CN111080651B publication Critical patent/CN111080651B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • 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/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A20/00Water conservation; Efficient water supply; Efficient water use
    • Y02A20/20Controlling water pollution; Waste water treatment

Abstract

The invention belongs to the technical field of automatic monitoring of petroleum drilling polluted gas, and discloses a water flow segmentation-based automatic monitoring method of petroleum drilling polluted gas. The water flow segmentation algorithm is used for segmenting water flow to obtain form information of the water flow, and the anomaly monitoring algorithm is realized through multiple gaussians and is used for identifying an abnormal data frame. Through the automatic monitoring algorithm of the petroleum drilling polluted gas based on water flow segmentation, the water flow of the petroleum drilling drainage pipeline is segmented, whether the polluted gas meets the emission standard or not is detected according to the segmentation result, real-time early warning can be realized when the polluted gas does not meet the emission standard, meanwhile, the problems that manual observation cannot be realized, and the water flow change form cannot be obtained by a water flow sensor in real time are solved, the labor cost can be effectively saved, and the environment is protected.

Description

Automatic monitoring method for petroleum drilling polluted gas based on water flow segmentation
Technical Field
The invention belongs to the technical field of automatic monitoring of polluted gas, and particularly relates to an automatic monitoring method of petroleum drilling polluted gas based on water flow segmentation.
Background
Currently, the closest prior art: the discharge treatment of pollutants, which is related to the environment and the civilian life, is an essential link in industrial production. In addition to underground utilities, there are contaminants, such as H, that are carried along during industrial exploration and excavation2S, the polluted gas can flow to the ground along with the industrial drainage pipeline. H2The S gas is a toxic and harmful acid gas, is directly discharged into the air, and affects the surrounding environment. Emissions need to be treated when the level of pollutant gases is above the emission standard. H2S gas is not only poisonous and harmful, but also colorless and tasteless gas, and can be contained in water. H2HSO generated by dissolving S gas in water4Is also colorlessTherefore, detection of the contaminant gas by observing the color change of the water stream is not possible. In the actual production process, a large amount of chemical reagents are consumed for detection by directly using the chemical reagents. Meanwhile, real-time monitoring is difficult. On the other hand, the water capacity of the polluted gas is limited, so that the pressure in the whole environment is increased when the quantity of the polluted gas is large, and the phenomenon of water jet occurs at the opening of the drainage pipeline. The spraying phenomenon is more obvious when the water flow is larger, which shows that the air pressure in the drainage pipeline is larger, and the content of the polluted gas is larger.
At present, video data are collected through a camera, and then polluted gas is monitored in a mode of manually monitoring the water flow change condition of a drainage pipeline in real time at the background. On the other hand, in the industrial production process, a plurality of working points often work simultaneously, so that a plurality of monitoring points are needed, a large amount of human resources are consumed, and the waste of the human resources is caused. Meanwhile, the problems of visual fatigue and non-concentration of energy caused by the fact that people watch monitoring videos for a long time can bring about the problem of not-in-place supervision. At present, whether the emission of the polluted gas meets the standard or not is judged according to the change condition of the water flow at the outlet of the drainage pipeline. At present, in the aspect of monitoring and statistics of water flow, a water flow sensor is mainly used. The water flow sensor may obtain statistics of water flow over a period of time. The main principle is that the sensor converts the induction of water flow into an electric signal, the electric signal is transmitted to a background, and the background analyzes the electric signal according to the transmitted signal to analyze water flow data. The main functions of the device are water flow display and flow accumulation calculation. However, water flow sensors are commonly used in electric water heaters, solar thermal water heaters, and household water flow meters. When the water flow change condition of the drainage pipeline is monitored, the water flow has the condition of sudden spraying, the data obtained by the water flow sensor can be inaccurate, and the installation of the sensor is also a problem due to the impact of the water flow. The water flow sensor is therefore unable to determine whether the pollutant gas emissions meet the standards.
In summary, the problems of the prior art are as follows: in the polluted gas monitoring, there are manpower resource waste, with high costs, visual fatigue through artificial mode to and current rivers sensor can not satisfy actual demand's problem.
Most of the conventional video-based abnormal data detection methods are directed to abnormal behaviors of human bodies or people, and most of the conventional video-based abnormal data detection methods represent changes of motions through human body postures, skeletons, optical flow information and the like. In practice, water flow differs from a human body in that the form of water flow is not fixed, and therefore it is difficult to capture a change in the form of water flow from a change in information such as optical flow. Meanwhile, the background of the image is complex, and different illumination intensities and changes of background objects are involved, so that the background is difficult to cut through the traditional image algorithm. The invention can acquire the interested image area by a deep learning method to cut off the background.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides an automatic monitoring method for petroleum drilling polluted gas based on water flow segmentation.
The invention is realized in such a way, and the automatic monitoring method for the petroleum drilling polluted gas based on water flow segmentation comprises the following steps:
performing AND operation on a mask and an original image, mapping the image to an HSV color expression space, and manually adjusting a threshold to obtain batch marking data;
secondly, preprocessing the marked data, adjusting the length and width of the image to be multiples of 32, converting the image into a tensor format, normalizing the data, and normalizing the pixel value from 0 to 255 to 0 to 1;
thirdly, training data through a neural network, wherein the neural network adopts a structure of a coder-decoder to fully discover potential information of the image, and the neural network inputs the original image and outputs the original image and the segmented image;
fourthly, extracting the contour of the segmented image, and calculating the perimeter and the area of the contour;
fifthly, establishing a multivariate Gaussian model by utilizing two quantities of perimeter and area extracted from the frame part which does not contain abnormal data in the annotation data;
and sixthly, inputting the perimeter and the area of the acquired segmentation image into a multivariate Gaussian model, and judging whether the data frame is abnormal or not.
Furthermore, the water flow data labeling of the automatic monitoring method for the petroleum drilling polluted gas based on water flow segmentation is modeled by making a mask image and HSV color space analysis, and 100-1000 pieces of data in the same scene are labeled at the same time; HSV is used for dividing water flow through a threshold value of a color space, and mask is used for eliminating noise points of the threshold value of the color space and the water flow in the same range, observing and analyzing sample data of the water flow to obtain that the illumination condition and the background in an image are basically unchanged when a camera does not move in a certain time range in a fixed scene;
the HSV model maps the RGB color space to a cone space, and the change of the color from black to white is represented by 0 to 255; marking and processing the pictures classified into one class by a code in a mode of combining mask and HSV in the process of manufacturing the data set label; mask is an image modeled according to a background picture, a corresponding Mask is arranged under each category and scene, and most of the background can be removed by directly performing an AND operation on the Mask and the original image; and the HSV further processes the result after the mask processing through threshold adjustment of a color space so as to obtain accurate depiction of the water flow form.
Further, a water flow segmentation algorithm of the automatic monitoring method for the petroleum drilling polluted gas based on water flow segmentation adopts a Unet network structure, and the Unet network realizes pixel-level segmentation to obtain accurate depiction of water flow change conditions; the U-net network consists of a contraction path and an expansion path;
the systolic path follows a typical convolutional network structure, consisting of two repeated 3x3 convolutional kernels, and both using a modified linear cell activation function and a 2x2 max pooling operation with step size 2 for the downsampling, and the number of feature channels is doubled in each downsampling step;
in the dilation path, each step involves upsampling a feature map; performing convolution operation by using 22 convolution kernels, wherein the convolution operation is used for reducing half of the number of characteristic channels; then, corresponding cut characteristic graphs in the cascade contraction path are obtained; performing convolution operation by using two 33 convolution kernels, wherein both convolution kernels use a ReLU activation function; in the last layer, convolution operation is carried out by using convolution kernels of 1 x 1, and each feature vector of 64 dimensions is mapped to an output layer of the network.
Further, the method for automatically monitoring the petroleum drilling polluted gas based on water flow segmentation calculates the mean value and the variance of all training data during pretreatment, and the mean value is subtracted from each picture and is compared with the variance; normalizing the data to 0 to 1 so that a plurality of pixel points become zero;
the loss function of the neural network is defined as follows:
Pre=∑i,jPr(i,j) (1)
Pte=∑i,jPt(i,j) (2)
Figure GDA0003594539360000041
in the formula, Pre, an image output by the neural network in the training process, Pte represents a corresponding label, and loss represents loss; i, j represents the coordinate position of the pixel point; in the formula (3), i is 0, n represents the number of images participating in calculation, const represents a non-0 constant, and the denominator is not 0 when the label is completely black; it is seen from equation (3) that the loss is smaller as the label and the actual predicted value are closer.
Further, the anomaly monitoring method of the automatic monitoring method for the petroleum drilling polluted gas based on water flow segmentation adopts a multivariate Gaussian modeling mode, and when a frame is an abnormal data frame, the area and the perimeter of the frame are changed more and more; a gaussian model obtained through normal data deviates from the gaussian model when abnormal data is tested; the Gaussian model is obtained by calculation according to the perimeter and the area of the water flow obtained by normal segmentation; judging one frame of data of the water flow monitoring video to be abnormal, and directly determining the data according to the form and the change condition of the water flow; the perimeter and the area are two most intuitive quantities for the morphological representation of the object, and in practice, a multivariate Gaussian model is established by the two quantities, namely the perimeter and the area, so as to find the relation between the two quantities, wherein the computational formula of the multivariate Gaussian is as follows:
Figure GDA0003594539360000042
wherein, Σ: represents the covariance matrix calculated from perimeter and area, u: represents the mean, x represents the input, ∈: a threshold value representing a decision; the formula is used to determine whether the input x belongs to the established multivariate gaussian distribution, and is determined not to belong to the probability distribution when the output probability value is lower than e, which is determined according to the statistics for normal data and abnormal data.
Another object of the present invention is to provide an automatic monitoring system for petroleum drilling polluted gas based on water flow segmentation, which implements the automatic monitoring method for petroleum drilling polluted gas based on water flow segmentation, and the automatic monitoring system for petroleum drilling polluted gas based on water flow segmentation comprises the following steps:
the annotation data acquisition module is used for performing AND operation on the mask and the original image, mapping the image to an HSV color expression space, and manually adjusting a threshold value to obtain batch annotation data;
the data preprocessing module is used for preprocessing the marked data, adjusting the length and width of the image to be multiples of 32, converting the image into a tensor format and normalizing the data;
the segmented image acquisition module is used for training data through a neural network, the neural network adopts a structure of a coder-decoder to fully discover potential information of an image, and the neural network inputs an original image and outputs a segmented image;
the contour calculation module is used for extracting the contour of the segmented image and calculating the perimeter and the area of the contour;
the model establishing module is used for establishing a multi-element Gaussian model by utilizing two quantities of perimeter and area extracted from the frame part which does not contain the abnormal data in the annotation data;
and the data frame judging module is used for inputting the perimeter and the area of the acquired segmentation image into the multivariate Gaussian model and judging whether the data frame is abnormal or not.
The invention also aims to provide an information data processing terminal for realizing the automatic monitoring method of the petroleum drilling polluted gas based on water flow segmentation.
Another object of the present invention is to provide a computer-readable storage medium, comprising instructions which, when run on a computer, cause the computer to execute the automatic monitoring method for oil drilling polluted gas based on water flow segmentation.
The invention also aims to provide an application of the automatic petroleum drilling polluted gas monitoring method based on water flow segmentation in automatic polluted gas monitoring.
The invention also aims to provide an application of the automatic monitoring method for the petroleum drilling polluted gas based on water flow segmentation in pollutant discharge treatment.
In summary, the advantages and positive effects of the invention are: the water flow data labeling method provided by the invention mainly comprises the steps of making a mask image and performing HSV color space analysis modeling, and can simultaneously label 100-1000 data in the same scene, so that a large amount of manpower resources are saved. The water flow segmentation algorithm mainly adopts a Unet network structure, can realize pixel-level segmentation and obtain accurate depiction of water flow change conditions. The anomaly monitoring method adopts a multivariate Gaussian modeling mode and has the main principle that when the frame is an abnormal data frame, the area and the perimeter of the frame are changed more and more; a gaussian model derived from normal data may deviate from the gaussian model when testing for abnormal data.
The invention replaces the manual real-time monitoring of the water flow condition of the drainage pipeline by a machine vision mode. The invention obtains the jet state information of the water flow by dividing the water flow image, and obtains whether the current pollutant gas emission meets the standard or not by combining the actual pollutant gas emission standard and the jet state through mathematical statistics and analysis after the division.
The invention aims to solve the technical problems of human resource waste, high cost, visual fatigue and incapability of acquiring the water flow change condition in real time by using an existing water flow sensor in a manual mode, and aims to acquire the water flow spraying state information by using a water flow image segmentation mode, and obtain whether the current pollutant gas emission meets the emission standard or not by combining the actual pollutant gas emission standard and the spraying state through mathematical statistics and analysis after segmentation.
According to the invention, through the automatic monitoring algorithm of the petroleum drilling polluted gas based on water flow segmentation, the water flow of the petroleum drilling drainage pipeline is segmented, and whether the polluted gas meets the emission standard is detected according to the segmentation result, real-time early warning can be realized when the polluted gas does not meet the emission standard, meanwhile, the problems that manual observation cannot be realized and a water flow sensor cannot obtain the water flow change form in real time are solved, the labor cost can be effectively saved (one detection machine can replace 5-6 personal workloads), and the environment is protected.
Drawings
FIG. 1 is a flow chart of an automatic monitoring method for petroleum drilling polluted gas based on water flow segmentation according to an embodiment of the invention.
Fig. 2 is a diagram of a structure of a split network according to an embodiment of the present invention.
Fig. 3 is a diagram of training accuracy provided by an embodiment of the present invention.
Fig. 4 is a graph of training loss provided by an embodiment of the present invention.
FIG. 5 is a graph of segmentation results provided by an embodiment of the present invention;
in the figure: (a) original drawing; (b) dividing a result; (c) original drawing; (d) and (6) dividing the result.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail with reference to the following embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
Aiming at the problems in the prior art, the invention provides an automatic monitoring method for petroleum drilling polluted gas based on water flow segmentation, and the invention is described in detail below by combining the attached drawings.
As shown in fig. 1, the automatic monitoring method for petroleum drilling polluted gas based on water flow segmentation provided by the embodiment of the invention comprises the following steps:
s101: performing AND operation on the mask and the original image, mapping the image to an HSV color expression space, and finally manually adjusting a threshold value to obtain batch of annotation data;
s102: preprocessing the marked data, firstly adjusting the length and width of the image to be multiples of 32, then converting the image into a tensor format, finally performing data normalization, normalizing the pixel value from 0 to 255 to 0 to 1, and adjusting the length and width of the image so as to meet the requirement of neural network training;
s103: the neural network adopts a structure of a coder-decoder to fully discover the potential information of the image through the neural network training data, and the neural network inputs the original image and outputs the original image and the segmented image;
s104: extracting the contour of the segmented image, calculating the perimeter and the area of the contour, and judging abnormal conditions in practice by manually observing the change of the water flow form, wherein the most basic representation of the form characteristics is the perimeter and the area of an object;
s105: establishing a multivariate Gaussian model by utilizing two quantities of perimeter and area extracted from a frame part without abnormal data in the annotation data, wherein the multivariate Gaussian model can fully explore the relationship between the perimeter and the area of the image and judge whether the image is abnormal according to the output probability;
s106: and inputting the perimeter and the area of the acquired segmentation image into a multivariate Gaussian model, and judging whether the data frame is abnormal or not.
The technical solution of the present invention is further described below with reference to the accompanying drawings.
The invention relates to an automatic monitoring algorithm of petroleum drilling polluted gas based on water flow segmentation, which comprises three parts: a water flow data labeling method, a water flow segmentation algorithm and an anomaly monitoring algorithm suitable for water flow. The water flow data form is not fixed, and the blowout phenomenon can be greatly changed, so that the Labelme labeling method is not applicable, and the data is labeled in a mode of combining mask and HSV. The water flow segmentation algorithm is used for segmenting water flow at the opening of the drainage pipeline to obtain accurate depiction of water flow form, and the abnormity monitoring algorithm detects whether the polluted gas at the current moment meets the emission standard according to the segmented result and the corresponding relation of the polluted gas.
The automatic monitoring algorithm for the petroleum drilling polluted gas based on water flow segmentation mainly comprises the following processes: (1) firstly, performing AND operation on a mask and an original image, then mapping the image to an HSV color expression space, and finally manually adjusting a threshold value to obtain batch of labeled data; (2) preprocessing the marked data, firstly adjusting the length and width of the image to be multiples of 32, then converting the image into a tensor format, finally performing data normalization, normalizing the pixel value from 0 to 255 to 0 to 1, and adjusting the length and width of the image so as to meet the requirement of neural network training; (3) the neural network adopts a structure of a coder-decoder to fully discover the potential information of the image through the neural network training data, and the neural network inputs the original image and outputs the original image and the segmented image; (4) extracting the contour of the segmented image, calculating the perimeter and the area of the contour, and judging abnormal conditions in practice by manually observing the change of the water flow form, wherein the most basic representation of the form characteristics is the perimeter and the area of an object; (5) and establishing a multivariate Gaussian model by using two quantities of the perimeter and the area extracted from the frame part without abnormal data in the annotation data, wherein the multivariate Gaussian model can fully explore the relationship between the perimeter and the area of the image and judge whether the image is abnormal according to the output probability. (6) And inputting the perimeter and the area of the acquired segmentation image into a multi-element Gaussian model, and judging whether the data frame is abnormal or not.
In the stage of labeling the water flow data set, the existing tool Labelme is directly used for labeling, the labeled object is shown as a segmented network structure chart in FIG. 2, and the left side is the result of labeling Labelme on the right side of the original image. As can be seen from fig. 2, using the tool for marking, only information about the general profile of the water flow is obtained, while information about other parts such as the side fine water jets and water drops that have left the central area due to the spray is lost. The workload of marking data is huge, so that a plurality of persons are required to cooperate with one another, each person has deviation in understanding the water flow form, and when fog exists, the boundary of the water flow is not obvious, and the marking data is difficult.
The water flow data labeling method mainly comprises the steps of making a mask image and performing HSV color space analysis modeling, and can simultaneously label 100 to 1000 pieces of data in the same scene, so that a large amount of manpower resources are saved. HSV is used to segment water flow through a threshold in color space, while mask is used to eliminate noise points where the color space threshold is in the same range as water flow. Through observation and analysis of water flow sample data, the light condition and the background in the image are basically unchanged when the camera does not move in a certain time range in a fixed scene. Meanwhile, referring to a related paper of flame segmentation, HSV (hue, saturation and value) is known to be a better color representation space, and a good effect is achieved in the field of flame segmentation. Based on the above conditions, the water flow is divided as the basis of the data label in a fixed scene. The HSV model maps the RGB color space into a conical space, from 0 to 255 representing the change in color from black to white. And marking and processing the pictures which are divided into one class in a mode of combining mask and HSV in the process of manufacturing the data set label. The classification standard is that the camera position is unchanged, the background is unchanged, and the light condition is not changed greatly, so that the classification can be classified into a class. Mask refers to an image modeled according to a background picture, a corresponding Mask exists under each category and scene, and most of the background can be removed by directly performing an AND operation on the Mask and an original image. The sample image of the mask is trained to the precision as shown in FIG. 3. HSV is to further process the result after mask processing through threshold adjustment of color space so as to obtain accurate depiction of water flow form.
The water flow segmentation algorithm mainly adopts a Unet network structure, and the neural network structure is shown in figure 4 after training loss. The Unet network can realize pixel-level segmentation and obtain accurate depiction of water flow change conditions. The U-net network consists of one contracted path (left) and one expanded path (right). Wherein the systolic path follows a typical convolutional network structure, which consists of two repeated 3x3 convolution kernels (no padding convolution), and both use a modified linear unit (ReLU) activation function and a 2x2 max pooling operation with step size 2 for downsampling, and the number of eigen-channels is doubled in each downsampling step. In the dilation path, each step involves upsampling a feature map; then performing convolution operation (up-convolution) with 22 convolution kernels for reducing the number of feature channels by half; then, corresponding cut characteristic graphs in the cascade contraction path are obtained; the convolution operation is again performed with two convolution kernels of 33 and both use the ReLU activation function. Since there is a missing problem with the boundary pixels in each convolution operation, it is necessary to crop the feature map. In the last layer, convolution operation is carried out by using convolution kernels of 1 x 1, and each feature vector of 64 dimensions is mapped to an output layer of the network.
The data preprocessing is mainly used for reducing the data amount of operation and normalizing the data. The method is also a common method adopted in preprocessing, the mean and the variance of all training data are calculated firstly, then the mean is subtracted from each picture, and finally the mean is compared with the variance. Through the processing, the data can be normalized to be between 0 and 1, and meanwhile, a plurality of pixel points can be changed into zero, so that the data size of the operation is reduced. The loss function of the neural network is defined as follows:
Pre=∑i,jPr(i,j) (1)
Pte=∑i,jPt(i,j) (2)
Figure GDA0003594539360000101
in the formula, Pre, an image of the output of the neural network in the training process, Pte represents a corresponding label, and loss represents loss. i, j represent the coordinate position of the pixel point. In the formula (3), i is 0, n represents the number of images participating in the calculation, const represents a non-0 constant, and the denominator is not 0 when the label is completely black. It can be seen from equation (3) that the loss is smaller as the label and the actual predicted value are closer.
In the aspect of neural network optimization, an Adam optimization algorithm is adopted, wherein Adam is a first-order optimization algorithm capable of replacing the traditional random gradient descent process, and can be used for updating the weights of the neural network iteratively based on training data. The Adam algorithm differs from the traditional random gradient descent. The stochastic gradient descent keeps a single learning rate (i.e., alpha) updating all weights, and the learning rate does not change during the training process. Adam designs independent adaptive learning rates for different parameters by computing first and second order moment estimates of the gradient. The proponents of Adam's algorithm describe its set of advantages as two random gradient descent expansions, namely: adaptive gradient algorithms preserve a learning rate for each parameter to improve performance on sparse gradients (i.e., natural language and computer vision problems). Root mean square propagation adaptively preserves the learning rate for each parameter based on the mean of the nearest magnitudes of the weight gradients. This means that the algorithm has excellent performance on non-steady state and on-line problems. Adam is a very popular algorithm in the field of deep learning because it can achieve good results quickly. Empirical results prove that the Adam algorithm has excellent performance in practice and has great advantages compared with other kinds of random optimization algorithms. Good results were obtained in the actual training process, and the accuracy map and the loss map of the training were as shown in fig. 3 and 4 below.
As can be seen from fig. 3-4, the accuracy of 95% can be achieved by only 20 times of training, and the higher the accuracy, the better the water flow segmentation effect. In fig. 3-4, the solid line represents the training precision, and the dots represent the verification precision, so that it can be seen that the training precision and the verification precision are almost simultaneously increased, i.e. there is no overfitting condition in the data. The solid line represents the training loss, the dotted line represents the verification loss, and the simultaneous decrease of the training loss and the verification loss also verifies that the model does not have the data overfitting condition. 3-4, it can be seen that the neural network model converges quickly, and only 20 times of training are needed to achieve higher accuracy.
After the training of fig. 3-4, the segmentation result is shown in fig. 5; in fig. 5: (a) original drawing; (b) dividing a result; (c) original drawing; (d) and (5) dividing the result.
Data from five scenarios have been collected from the field and trained to produce partial results. There are currently approximately seventy thousand data samples. The experimental equipment was titan v and the framework was keras. It takes only 20 hours to run 150 runs on Titan v. Because five upsampling and pooling of (2, 2) is done in the network structure, the input image size needs to be a multiple of 32. The input image size during training is (320, 448). In the testing stage, the processing time of the single-frame image is averagely 4ms, and the requirement of real-time property can be met.
The anomaly monitoring method adopts a multivariate Gaussian modeling mode and has the main principle that when the frame is an abnormal data frame, the area and the perimeter of the frame are changed more and more; a gaussian model derived from normal data deviates from the gaussian model when abnormal data is tested. The Gaussian model is obtained by calculation according to the perimeter and the area of the water flow obtained by normal segmentation. One frame of data of the water flow monitoring video is judged to be abnormal, and the data can be directly determined according to the form and the change condition of the water flow. Perimeter and area are the two most intuitive quantities for the morphological representation of an object. In practice, a multivariate gaussian model is built by using two quantities, namely perimeter and area, to find the connection between the two quantities. The formula for multivariate gaussians is as follows:
Figure GDA0003594539360000111
wherein, Σ: represents a covariance matrix calculated from the perimeter and area, u: represents the mean, x represents the input, ∈: representing the threshold of the decision. The formula is used for judging whether the input x belongs to the established multivariate Gaussian distribution or not, and judging that the input x does not belong to the probability distribution when the output probability value is lower than epsilon. E is determined from the statistics for normal data and abnormal data.
A Gaussian model is established through the perimeter and the area, experiments and comparison are carried out on the method for establishing the multivariate Gaussian model by singly using the perimeter and the area and combining the perimeter and the area to judge the abnormal data frame, and the comparison result is shown in Table 1. The data used contained 3000 images in total, with an abnormal data frame number of 200. The detection precision reaches 96% when the perimeter and the area are combined to establish a multi-element Gaussian model.
Table 1 water flow abnormal data frame detection result
Limitation of conditions Accuracy of measurement False detection rate Rate of missed examination
Area of 90% 15% 10%
Circumference 93% 12% 7%
Perimeter + area 96% 12% 4%
The invention provides a method for automatically monitoring petroleum drilling polluted gas based on water flow segmentation, which comprises the following three parts: the method is suitable for a water flow data labeling method, a water flow segmentation algorithm and an anomaly monitoring algorithm of water flow. The water flow data labeling method is used for labeling water flow data with the form changing at any time, hundreds of frames of data to one thousand of frames of data can be labeled at the same time, and a large amount of time can be saved. The water flow segmentation algorithm is used for segmenting water flow to obtain form information of the water flow, and the anomaly monitoring algorithm is realized through multiple gaussians and is used for identifying an abnormal data frame. Through the automatic monitoring algorithm of the petroleum drilling polluted gas based on water flow segmentation, the water flow of the petroleum drilling drainage pipeline is segmented, whether the polluted gas meets the emission standard or not is detected according to the segmentation result, real-time early warning can be realized when the polluted gas does not meet the emission standard, meanwhile, the problems that manual observation cannot be realized, and the water flow change form cannot be obtained by a water flow sensor in real time are solved, the labor cost can be effectively saved, and the environment is protected.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (5)

1. The automatic monitoring method for the petroleum drilling polluted gas based on water flow segmentation is characterized by comprising the following steps of:
firstly, performing AND operation on a mask and an original image, mapping the image to an HSV color expression space, and manually adjusting a threshold to obtain batch marking data;
secondly, preprocessing the marked data, adjusting the length and width of the image to be multiples of 32, converting the image into a tensor format, normalizing the data, and normalizing the pixel value from 0 to 255 to 0 to 1;
thirdly, training data through a neural network, wherein the neural network adopts a coder-decoder structure, and the input of the neural network is an original image and the output of the neural network is a segmented image;
fourthly, extracting the contour of the segmented image, and calculating the perimeter and the area of the contour;
fifthly, establishing a multivariate Gaussian model by utilizing two quantities of perimeter and area extracted from the frame part which does not contain abnormal data in the annotation data;
sixthly, inputting the perimeter and the area of the obtained segmentation image into a multivariate Gaussian model, and judging whether the data frame is abnormal or not; the water flow data annotation of the automatic monitoring method for the petroleum drilling polluted gas based on water flow segmentation is modeled by making a mask image and HSV color space analysis, and simultaneously annotates 100 to 1000 pieces of data in the same scene; HSV is used for dividing water flow through a threshold value of a color space, and mask is used for eliminating noise points of the threshold value of the color space and the water flow in the same range, and observing and analyzing water flow sample data to obtain that the illumination condition and the background in an image are unchanged when a camera does not move in a certain time range under a fixed scene;
the HSV model maps the RGB color space to a cone space, and the change of the color from black to white is represented by 0 to 255; marking and processing the pictures classified into one class by a code in a mode of combining mask and HSV in the process of manufacturing the data set label; the mask is an image obtained by modeling according to a background picture, a corresponding mask is arranged under each category and scene, and the mask and the original image are directly subjected to AND operation; HSV processes the result after mask processing through threshold adjustment of color space so as to obtain accurate depiction of water flow form;
the anomaly monitoring method of the automatic petroleum drilling polluted gas monitoring method based on water flow segmentation adopts a multi-element Gaussian modeling mode, and when a frame is an abnormal data frame, the area and the perimeter of the frame can be changed; a Gaussian model obtained through normal data deviates from the Gaussian model when abnormal data are tested; the Gaussian model is obtained by calculation according to the perimeter and the area of the water flow obtained by normal segmentation; judging one frame of data of the water flow monitoring video to be abnormal, and directly determining the data according to the form and the change condition of the water flow; the perimeter and the area are two most intuitive quantities for the morphological representation of the object, and in practice, a multivariate Gaussian model is established by the two quantities, namely the perimeter and the area, so as to find the relation between the two quantities, wherein the computational formula of the multivariate Gaussian is as follows:
Figure FDA0003646276700000021
wherein, sigma: represents the covariance matrix calculated from perimeter and area, u: represents the mean, x represents the input, ∈: a threshold value representing a decision; the formula is used for judging whether the input x belongs to the established multivariate Gaussian distribution, and when the output probability value is lower than the epsilon, the output probability value is judged not to belong to the multivariate Gaussian distribution, and the epsilon is determined according to the statistical values of normal data and abnormal data;
the water flow segmentation algorithm of the automatic monitoring method for the petroleum drilling polluted gas based on water flow segmentation adopts a U-net network structure, and the U-net network realizes pixel-level segmentation to obtain accurate depiction of water flow change conditions; the U-net network consists of a contraction path and an expansion path;
the systolic path follows a typical convolutional network structure, consisting of two repeated 3x3 convolutional kernels, and both using a modified linear cell activation function and a 2x2 max pooling operation with step size 2 for the downsampling, and the number of feature channels is doubled in each downsampling step;
in the dilation path, each step involves upsampling a feature map; performing convolution operation by using a convolution kernel of 2x2 to reduce the number of characteristic channels by half; then, corresponding cut characteristic graphs in the cascade contraction path are obtained; performing convolution operation by using two convolution kernels of 3x3, wherein both convolution kernels use a ReLU activation function; in the last layer, convolution operation is carried out by using convolution kernels of 1 x 1, and each feature vector of 64 dimensions is mapped to an output layer of the network.
2. The automatic petroleum drilling polluted gas monitoring method based on water flow segmentation as claimed in claim 1, wherein the automatic petroleum drilling polluted gas monitoring method based on water flow segmentation calculates the mean value and the variance of all training data during preprocessing, and each picture is compared with the variance after the mean value is subtracted; normalizing the data to 0 to 1 so that the pixel points become zero;
the loss function of the neural network is defined as follows:
Pre=∑i,jPr(i,j) (1)
Pte=∑i,jPt(i,j) (2)
Figure FDA0003646276700000031
in the formula, Pre, an image output by the neural network in the training process, Pte represents a corresponding label, and loss represents loss; i, j represents the coordinate position of the pixel point; in the formula (3), i is 0, n represents the number of images participating in calculation, const represents a non-0 constant, and the denominator is not 0 when the label is completely black; it is seen from equation (3) that the loss is smaller as the label and the actual predicted value are closer.
3. The automatic monitoring system for the petroleum drilling polluted gas based on water flow segmentation, which implements the automatic monitoring method for the petroleum drilling polluted gas based on water flow segmentation of any one of claims 1-2, is characterized by comprising the following steps:
the annotation data acquisition module is used for performing AND operation on the mask and the original image, mapping the image to an HSV color expression space, and manually adjusting a threshold value to obtain batch annotation data;
the data preprocessing module is used for preprocessing the marked data, adjusting the length and width of the image to be multiples of 32, converting the image into a tensor format and normalizing the data;
the segmented image acquisition module is used for training data through a neural network, the neural network adopts a coder-decoder structure, the input of the neural network is an original image, and the output of the neural network is a segmented image;
the contour calculation module is used for extracting the contour of the segmented image and calculating the perimeter and the area of the contour;
the model establishing module is used for establishing a multivariate Gaussian model by utilizing two quantities of perimeter and area extracted from the frame part which does not contain abnormal data in the marked data;
the data frame judging module is used for inputting the perimeter and the area of the acquired segmentation image into the multivariate Gaussian model and judging whether the data frame is abnormal or not;
the water flow data annotation of the automatic monitoring method for the petroleum drilling polluted gas based on water flow segmentation is modeled by making a mask image and HSV color space analysis, and simultaneously annotates 100 to 1000 pieces of data in the same scene; HSV is used for dividing water flow through a threshold value of a color space, and mask is used for eliminating noise points of the threshold value of the color space and the water flow in the same range, observing and analyzing water flow sample data to obtain that the illumination condition and the background in an image are unchanged when a camera does not move in a certain time range in a fixed scene;
the HSV model maps the RGB color space to a cone space, and the change of the color from black to white is represented by 0 to 255; marking and processing the pictures classified into one class by a code in a mode of combining mask and HSV in the process of manufacturing the data set label; the mask is an image obtained by modeling according to a background picture, a corresponding mask is arranged under each category and scene, and the mask and the original image are directly subjected to AND operation; the HSV processes the result after mask processing through threshold adjustment of a color space so as to obtain accurate depiction of the water flow form;
the anomaly monitoring method of the automatic petroleum drilling polluted gas monitoring method based on water flow segmentation adopts a multi-element Gaussian modeling mode, and when a frame is an abnormal data frame, the area and the perimeter of the frame can be changed; a Gaussian model obtained through normal data deviates from the Gaussian model when abnormal data are tested; the Gaussian model is obtained by calculation according to the perimeter and the area of the water flow obtained by normal segmentation; judging one frame of data of the water flow monitoring video to be abnormal, and directly determining the data according to the form and the change condition of the water flow; the perimeter and the area are two most intuitive quantities for the morphological representation of the object, and in practice, a multivariate Gaussian model is established by the two quantities, namely the perimeter and the area, so as to find the relation between the two quantities, wherein the computational formula of the multivariate Gaussian is as follows:
Figure FDA0003646276700000041
wherein, Σ: represents the covariance matrix calculated from perimeter and area, u: represents the mean, x represents the input, ∈: a threshold value representing a decision; the formula is used for judging whether the input x belongs to the established multivariate Gaussian distribution, and when the output probability value is lower than the epsilon, the output probability value is judged not to belong to the multivariate Gaussian distribution, and the epsilon is determined according to the statistical values of normal data and abnormal data;
the water flow segmentation algorithm of the automatic monitoring method for the petroleum drilling polluted gas based on water flow segmentation adopts a U-net network structure, and the U-net network realizes pixel-level segmentation to obtain accurate depiction of water flow change conditions; the U-net network consists of a contraction path and an expansion path;
the systolic path follows a typical convolutional network structure, consisting of two repeated 3x3 convolutional kernels, and both using a modified linear cell activation function and a 2x2 max pooling operation with step size 2 for the downsampling, and the number of feature channels is doubled in each downsampling step;
in the dilation path, each step involves upsampling a feature map; performing convolution operation by using a convolution kernel of 2x2 to reduce the number of characteristic channels by half; then, corresponding cut characteristic graphs in the cascade contraction path are obtained; performing convolution operation by using two convolution kernels of 3x3, wherein both convolution kernels use a ReLU activation function; in the last layer, convolution operation is carried out by using convolution kernels of 1 x 1, and each feature vector of 64 dimensions is mapped to an output layer of the network.
4. An information data processing terminal for realizing the automatic monitoring method of the petroleum drilling polluted gas based on water flow segmentation as claimed in any one of claims 1-2.
5. A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the method for automatic monitoring of oil drilling contaminated gas based on water flow splitting according to any of claims 1-2.
CN201911290836.9A 2019-12-12 2019-12-12 Automatic monitoring method for petroleum drilling polluted gas based on water flow segmentation Active CN111080651B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911290836.9A CN111080651B (en) 2019-12-12 2019-12-12 Automatic monitoring method for petroleum drilling polluted gas based on water flow segmentation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911290836.9A CN111080651B (en) 2019-12-12 2019-12-12 Automatic monitoring method for petroleum drilling polluted gas based on water flow segmentation

Publications (2)

Publication Number Publication Date
CN111080651A CN111080651A (en) 2020-04-28
CN111080651B true CN111080651B (en) 2022-07-12

Family

ID=70314654

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911290836.9A Active CN111080651B (en) 2019-12-12 2019-12-12 Automatic monitoring method for petroleum drilling polluted gas based on water flow segmentation

Country Status (1)

Country Link
CN (1) CN111080651B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112229952B (en) * 2020-09-30 2022-11-15 重庆科技学院 Method for monitoring toxic and harmful gases in chemical industrial park
CN114980514A (en) * 2022-05-19 2022-08-30 深圳崇达多层线路板有限公司 Method for improving board edge pressing cavity of circuit board, circuit board and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109190640A (en) * 2018-08-20 2019-01-11 贵州省生物研究所 A kind of the intercept type acquisition method and acquisition system of the planktonic organism based on big data
CN109614576A (en) * 2018-12-11 2019-04-12 福建工程学院 Transformer exception detection method based on Multi-dimensional Gaussian distribution and trend segmentation
CN109961425A (en) * 2019-02-28 2019-07-02 浙江大学 A kind of water quality recognition methods of Dynamic Water

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6609051B2 (en) * 2001-09-10 2003-08-19 Daimlerchrysler Ag Method and system for condition monitoring of vehicles
US8009193B2 (en) * 2006-06-05 2011-08-30 Fuji Xerox Co., Ltd. Unusual event detection via collaborative video mining
CN109600345A (en) * 2017-09-30 2019-04-09 北京国双科技有限公司 Abnormal data flow rate testing methods and device
CN108334907B (en) * 2018-02-09 2019-05-17 哈尔滨工业大学(威海) A kind of complex equipment point method for detecting abnormality and system based on deep learning
CN109325403B (en) * 2018-08-07 2020-12-11 广州粤建三和软件股份有限公司 Water area pollution identification treatment method and system based on image identification
CN109523510B (en) * 2018-10-11 2021-05-04 浙江大学 Method for detecting abnormal region of river channel water quality space based on multispectral remote sensing image
CN110245691A (en) * 2019-05-27 2019-09-17 上海眼控科技股份有限公司 A kind of intelligent identification Method of vehicle appearance color discoloration repacking
CN110490196B (en) * 2019-08-09 2022-11-15 Oppo广东移动通信有限公司 Subject detection method and apparatus, electronic device, and computer-readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109190640A (en) * 2018-08-20 2019-01-11 贵州省生物研究所 A kind of the intercept type acquisition method and acquisition system of the planktonic organism based on big data
CN109614576A (en) * 2018-12-11 2019-04-12 福建工程学院 Transformer exception detection method based on Multi-dimensional Gaussian distribution and trend segmentation
CN109961425A (en) * 2019-02-28 2019-07-02 浙江大学 A kind of water quality recognition methods of Dynamic Water

Also Published As

Publication number Publication date
CN111080651A (en) 2020-04-28

Similar Documents

Publication Publication Date Title
CN111126136B (en) Smoke concentration quantification method based on image recognition
Knoll et al. Improving efficiency of organic farming by using a deep learning classification approach
CN111091541B (en) Method for identifying fault of missing nut in cross beam assembly of railway wagon
CN113327071B (en) 5G-based environment management method and device, computer equipment and storage medium
CN104484890B (en) Video target tracking method based on compound sparse model
CN111080651B (en) Automatic monitoring method for petroleum drilling polluted gas based on water flow segmentation
CN111852792B (en) Fan blade defect self-diagnosis positioning method based on machine vision
CN106815576B (en) Target tracking method based on continuous space-time confidence map and semi-supervised extreme learning machine
CN111178177A (en) Cucumber disease identification method based on convolutional neural network
CN111091544A (en) Method for detecting breakage fault of side integrated framework of railway wagon bogie
CN110348342B (en) Pipeline disease image segmentation method based on full convolution network
Ji et al. In-field automatic detection of maize tassels using computer vision
CN111709397A (en) Unmanned aerial vehicle variable-size target detection method based on multi-head self-attention mechanism
CN110533100A (en) A method of CME detection and tracking is carried out based on machine learning
CN108734277A (en) A kind of targeted drug spray method based on convolutional neural networks
CN112749747A (en) Garbage classification quality evaluation method and system
CN111833347A (en) Transmission line damper defect detection method and related device
CN115731493A (en) Rainfall micro physical characteristic parameter extraction and analysis method based on video image recognition
CN115620178A (en) Real-time detection method for abnormal and dangerous behaviors of power grid of unmanned aerial vehicle
CN113469938B (en) Pipe gallery video analysis method and system based on embedded front-end processing server
CN113221667A (en) Face and mask attribute classification method and system based on deep learning
CN110349119B (en) Pavement disease detection method and device based on edge detection neural network
CN108460772B (en) Advertisement harassment fax image detection system and method based on convolutional neural network
CN114299020A (en) Scooter display screen defect detection method and system based on machine vision
Liu et al. Working condition perception for froth flotation based on NSCT multiscale features

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
GR01 Patent grant
GR01 Patent grant