CN118602171B - Intelligent monitoring system and method for opening and closing degree of gas meter valve based on Internet of things - Google Patents
Intelligent monitoring system and method for opening and closing degree of gas meter valve based on Internet of things Download PDFInfo
- Publication number
- CN118602171B CN118602171B CN202411084870.1A CN202411084870A CN118602171B CN 118602171 B CN118602171 B CN 118602171B CN 202411084870 A CN202411084870 A CN 202411084870A CN 118602171 B CN118602171 B CN 118602171B
- Authority
- CN
- China
- Prior art keywords
- pixel
- feature map
- valve
- image
- opening
- 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
Links
- 238000012544 monitoring process Methods 0.000 title claims abstract description 48
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000001514 detection method Methods 0.000 claims abstract description 55
- 230000007246 mechanism Effects 0.000 claims abstract description 21
- 238000004891 communication Methods 0.000 claims abstract description 3
- 230000011218 segmentation Effects 0.000 claims description 53
- 239000011159 matrix material Substances 0.000 claims description 45
- 239000013598 vector Substances 0.000 claims description 29
- 238000013528 artificial neural network Methods 0.000 claims description 27
- 238000000605 extraction Methods 0.000 claims description 15
- 238000005520 cutting process Methods 0.000 claims description 12
- 238000010586 diagram Methods 0.000 claims description 7
- 238000003709 image segmentation Methods 0.000 claims description 7
- 230000006855 networking Effects 0.000 claims description 2
- 230000009471 action Effects 0.000 abstract description 4
- 238000013136 deep learning model Methods 0.000 abstract description 4
- 238000012545 processing Methods 0.000 abstract description 4
- 230000002159 abnormal effect Effects 0.000 abstract description 3
- 238000006243 chemical reaction Methods 0.000 abstract 1
- 239000007789 gas Substances 0.000 description 38
- 230000006870 function Effects 0.000 description 8
- 238000009826 distribution Methods 0.000 description 7
- 238000013527 convolutional neural network Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 238000011176 pooling Methods 0.000 description 5
- 238000012549 training Methods 0.000 description 5
- 238000004519 manufacturing process Methods 0.000 description 4
- 239000002737 fuel gas Substances 0.000 description 3
- 230000006872 improvement Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000012512 characterization method Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 238000009776 industrial production Methods 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 238000009434 installation Methods 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000010606 normalization Methods 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000003860 storage Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Landscapes
- Alarm Systems (AREA)
Abstract
The invention discloses an intelligent monitoring system and method for the opening and closing degree of a gas meter valve based on the Internet of things, and a high-precision sensor is arranged at a proper position on the gas meter valve, and the high-precision sensor can accurately capture the opening and closing actions and the opening and closing states of the valve. And the communication module of the Internet of things is configured to ensure that data can be stably and rapidly transmitted to the cloud server. And deploying a data processing and analyzing algorithm on the cloud server, monitoring the valve state in real time, and responding to the abnormal condition in time. The key features in the valve image are automatically extracted by using the deep learning model, and the key features are focused on a core area affecting the opening and closing degree by combining an attention mechanism, so that the network can learn the relation and the space information among the features more flexibly, the accuracy of valve identification is improved, the accuracy of valve opening and closing degree detection is further improved, and the error rate is reduced to below 1%. The accuracy of identifying the opening and closing degree of the valve is improved, so that the safety and conversion efficiency of gas use are improved.
Description
Technical Field
The invention relates to the technical field of gas detection, in particular to an intelligent monitoring system and method for opening and closing degree of a gas meter valve based on the Internet of things.
Background
In the infrastructure of modern cities, the gas supply system plays a vital role. With the advancement of technology, the monitoring technology of the gas valve is also continuously developed to ensure the safety, stability and high efficiency of gas supply. However, the conventional gas meter valve monitoring technology mainly focuses on detecting the open/close state of the valve, i.e., whether the valve is fully opened or closed, and whether there is abnormal operation. Although the monitoring mode ensures the basic use safety of the fuel gas to a certain extent, obvious technical bottlenecks exist.
However, merely monitoring the open and closed states of the valve does not provide detailed information about the degree of opening and closing of the valve. The opening and closing degree of the valve directly influences the flow and pressure of the fuel gas, and further relates to the gas utilization experience of a user and the economy of the fuel gas. For example, excessive valve opening may cause gas leakage, increasing safety risks; and too small opening degree may cause insufficient gas supply, which affects normal use of users. Or the valve is detected to be in a closed state or an open state, but actually, the opening and closing degree of the valve cannot be accurately monitored, and whether the valve is in an optimal working position cannot be judged. This may lead to inaccurate control of gas flow in practical applications, affecting the efficiency and safety of gas use.
In the prior art, a mode of arranging a pressure sensor and a laser sensor to detect the position of a valve so as to determine the opening and closing degree of the valve is proposed as a detection means. The pressure sensor detects the valve position, mainly contacts with the pressure sensor through the valve for the pressure sensor detects the pressure that the valve applyed, through the size of detecting pressure in order to detect the degree of opening and shutting of valve: the larger the pressure is, the smaller the opening and closing degree is; the maximum pressure is the determination that the valve is fully closed. However, this method requires the valve to rub against the pressure sensor, which tends to reduce the accuracy of detection due to loss of the pressure sensor during the rubbing process.
It has also been proposed to detect the opening and closing degree of the valve by providing a laser sensor. However, the position of the laser sensor is fixed, and the valve is opened and closed, so that the detection accuracy of the laser sensor is affected, and in addition, the relative position between the laser sensor and the valve is changed after the valve is used for a long time, so that the opening and closing degree of the valve cannot be accurately detected by laser.
In summary, there is a strong market demand for a technology capable of accurately monitoring the opening and closing degree of a valve to achieve more refined gas management.
Disclosure of Invention
The invention aims to provide an intelligent monitoring system and method for opening and closing degree of a gas meter valve based on the Internet of things, which are used for solving the problems in the prior art.
The embodiment of the invention provides an intelligent monitoring method for the opening and closing degree of a gas meter valve based on the Internet of things, which comprises the following steps:
Obtaining a valve detection image, wherein the valve detection image is obtained through an image sensor;
Extracting features of the valve detection image through a first neural network to obtain a first feature map;
inputting the first feature map into an attention mechanism module, and calculating the attention weight of each pixel point in the first feature map through an attention mechanism;
multiplying the weight of each spatial position by the pixel value of the corresponding pixel point of the spatial position in the valve detection image to obtain an enhanced image;
extracting features of the enhanced image through a second neural network to obtain a second feature map;
performing pixel level segmentation on the second feature map based on the first feature map to obtain a first segmented image;
identifying the valve opening and closing degree based on the first segmentation image through a pre-trained valve opening and closing degree detection model;
and if the valve opening and closing degree is larger than the threshold value, generating alarm information.
Optionally, the method further comprises:
the alert information is sent to the management system.
Optionally, performing pixel-level segmentation on the second feature map based on the first feature map to obtain a first segmented image, including:
Obtaining a pixel level segmentation weight of each pixel point based on the first feature map and the second feature map;
adjusting the second feature map based on the pixel level segmentation weight to obtain a third feature map;
Performing feature extraction and similarity prediction on a third feature map based on a third neural network to obtain a similarity matrix between pixels;
Taking the similarity matrix as input of a graph cutting algorithm, and carrying out image segmentation on the third feature graph based on the graph cutting algorithm; a first segmented image is obtained, the first segmented image comprising a valve.
Optionally, feature extraction and similarity prediction are performed on the third feature map based on the third neural network, so as to obtain a similarity matrix between pixels, including:
Obtaining feature vectors of pixel points in the third feature map; the feature vector comprises the total pixel value of surrounding pixel points, the difference value of the pixel points and the average value of the pixel values of the surrounding pixel points, the number of the difference value of the pixel value in the surrounding pixel points and the pixel value of the pixel points which is larger than a set value, and the pixel value of the pixel points;
obtaining cosine values among the feature vectors of the pixel points;
And constructing weighted adjacent matrixes among the pixel points, taking the cosine value as the weight value of the weighted adjacent matrix, and taking the assigned weighted adjacent matrix as a similarity matrix.
Optionally, obtaining the pixel level segmentation weight of each pixel point based on the first feature map and the second feature map includes:
Taking the first feature map as a background, performing background difference operation on the second feature map, and obtaining a first difference image;
Taking the valve detection image as a background, performing background difference operation on the second feature image, and obtaining a second difference image;
Obtaining a cross entropy image of the first difference image and the second difference image; the value of each pixel point in the cross entropy image is equal to the cross entropy of the pixel value between a first pixel point and a second pixel point, wherein the first pixel point is the pixel point in the first difference image, and the second pixel point is the pixel point in the second difference image; the coordinates of the first pixel point and the second pixel point are equal; the value of each pixel point in the cross entropy image is a pixel level segmentation weight.
Optionally, adjusting the second feature map based on the pixel-level segmentation weight to obtain a third feature map, including:
Obtaining a transposed matrix of the cross entropy image;
and multiplying the second feature map by the transposed matrix of the cross entropy image to obtain a third feature map.
The embodiment of the invention also provides an intelligent monitoring system for the opening and closing degree of the gas meter valve based on the Internet of things, which comprises the following steps:
The acquisition module is used for acquiring a valve detection image, wherein the valve detection image is acquired by an image sensor;
The extraction module is used for extracting the characteristics of the valve detection image through a first neural network to obtain a first characteristic diagram;
The prediction module is used for inputting the first feature map into the attention mechanism module, and calculating the attention weight of each pixel point in the first feature map through an attention mechanism; multiplying the weight of each spatial position by the pixel value of the corresponding pixel point of the spatial position in the valve detection image to obtain an enhanced image; extracting features of the enhanced image through a second neural network to obtain a second feature map; performing pixel level segmentation on the second feature map based on the first feature map to obtain a first segmented image; identifying the valve opening and closing degree based on the first segmentation image through a pre-trained valve opening and closing degree detection model;
and the alarm module is used for generating alarm information if the opening and closing degree of the valve is larger than a threshold value.
Optionally, the alarm module is further configured to include:
the alert information is sent to the management system.
Optionally, in the intelligent monitoring system for opening and closing degree of a gas meter valve based on the internet of things, pixel-level segmentation is performed on the second feature map based on the first feature map, and a first segmentation image is obtained, including:
Obtaining a pixel level segmentation weight of each pixel point based on the first feature map and the second feature map;
adjusting the second feature map based on the pixel level segmentation weight to obtain a third feature map;
Performing feature extraction and similarity prediction on a third feature map based on a third neural network to obtain a similarity matrix between pixels;
Taking the similarity matrix as input of a graph cutting algorithm, and carrying out image segmentation on the third feature graph based on the graph cutting algorithm; a first segmented image is obtained, the first segmented image comprising a valve.
Optionally, in the intelligent monitoring system for opening and closing degree of a gas meter based on the internet of things, feature extraction and similarity prediction are performed on a third feature map based on a third neural network, so as to obtain a similarity matrix between pixels, including:
Obtaining feature vectors of pixel points in the third feature map; the feature vector comprises the total pixel value of surrounding pixel points, the difference value of the pixel points and the average value of the pixel values of the surrounding pixel points, the number of the difference value of the pixel value in the surrounding pixel points and the pixel value of the pixel points which is larger than a set value, and the pixel value of the pixel points;
obtaining cosine values among the feature vectors of the pixel points;
And constructing weighted adjacent matrixes among the pixel points, taking the cosine value as the weight value of the weighted adjacent matrix, and taking the assigned weighted adjacent matrix as a similarity matrix.
Optionally, in the intelligent monitoring system for opening and closing degree of a gas meter based on the internet of things, a pixel level segmentation weight of each pixel point is obtained based on the first feature map and the second feature map, including:
Taking the first feature map as a background, performing background difference operation on the second feature map, and obtaining a first difference image;
Taking the valve detection image as a background, performing background difference operation on the second feature image, and obtaining a second difference image;
Obtaining a cross entropy image of the first difference image and the second difference image; the value of each pixel point in the cross entropy image is equal to the cross entropy of the pixel value between a first pixel point and a second pixel point, wherein the first pixel point is the pixel point in the first difference image, and the second pixel point is the pixel point in the second difference image; the coordinates of the first pixel point and the second pixel point are equal; the value of each pixel point in the cross entropy image is a pixel level segmentation weight.
Optionally, in the intelligent monitoring system for opening and closing degree of a gas meter valve based on the internet of things, the second feature map is adjusted based on the pixel level segmentation weight to obtain a third feature map, which comprises:
Obtaining a transposed matrix of the cross entropy image;
and multiplying the second feature map by the transposed matrix of the cross entropy image to obtain a third feature map.
Compared with the prior art, the embodiment of the invention achieves the following beneficial effects:
The embodiment of the invention provides an intelligent monitoring system and method for valve opening and closing degree of a gas meter based on the Internet of things, wherein a first neural network is used for extracting characteristics of a valve detection image to obtain a first characteristic diagram; inputting the first feature map into an attention mechanism module, and calculating the attention weight of each pixel point in the first feature map through an attention mechanism; multiplying the weight of each spatial position by the pixel value of the corresponding pixel point of the spatial position in the valve detection image to obtain an enhanced image; extracting features of the enhanced image through a second neural network to obtain a second feature map; performing pixel level segmentation on the second feature map based on the first feature map to obtain a first segmented image; identifying the valve opening and closing degree based on the first segmentation image through a pre-trained valve opening and closing degree detection model; and if the valve opening and closing degree is larger than the threshold value, generating alarm information. The key features in the valve image are automatically extracted by using the deep learning model, and the key features are focused on a core area affecting the opening and closing degree by combining an attention mechanism, so that the network can learn the relation and the space information among the features more flexibly, the accuracy of valve identification is improved, the accuracy of valve opening and closing degree detection is further improved, and the error rate is reduced to below 1%. On the basis, the system can process the image data captured by the camera in real time and output the evaluation result of the valve opening and closing degree in millisecond time, thereby meeting the requirement of industrial production on quick response. The method is independent of specific types of valves or installation conditions, can adapt to valve monitoring in different environments through training, and has good generalization capability. Through the continuous monitoring to the valve degree of opening and shutting, the system can in time discover unusual action to send the early warning to operating personnel, help preventing potential production accident. Compared with the traditional manual inspection or mechanical sensor, the invention reduces the maintenance and calibration cost, improves the production efficiency and has obvious economic benefit. The system continuously optimizes the model performance by continuously collecting and analyzing the valve data, realizes self-learning and improvement, and keeps stable high-performance for a long time.
Drawings
Fig. 1 is a flowchart of an intelligent monitoring method for opening and closing degree of a gas meter valve based on the internet of things, which is provided by the embodiment of the invention.
Fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
The marks in the figure: 500-buses; 501-a receiver; 502-a processor; 503-a transmitter; 504-memory; 505-bus interface.
Detailed Description
The present invention will be described in detail with reference to the accompanying drawings.
Examples
The accuracy of detecting the opening and closing degree of the valve by the existing sensor technology is low. Therefore, the present application proposes a method of detecting the opening and closing degree of a valve by providing an image sensor (camera). Because the detection field of view of the camera is far larger than that of the pressure sensor and the laser sensor, the accuracy of the opening and closing degree of the detection valve of the camera is high, and the service life is long: because the camera shoots the image of the opening and closing positions of the valve, even if the relative positions of the camera and the valve are changed, the opening and closing degree state information of the valve can be detected by the camera with wide field of view, namely the detection precision is high. The camera is not contacted with the valve, even if the valve is frequently opened and closed, the damage to the camera is avoided, and the detection precision of the camera is not affected.
Through the improvement, the invention not only can monitor the opening and closing states of the valve, but also can accurately control and monitor the opening and closing degree of the valve, and ensure that the valve is always in the optimal working position, thereby improving the safety and efficiency of gas use.
Specifically, the intelligent monitoring of the opening and closing degree of the gas meter valve with high precision is realized by the following method:
The high-precision sensor is arranged at a proper position on the valve of the gas meter, and the camera is adopted in the embodiment of the invention, so that the camera can accurately capture the opening and closing actions and the opening and closing states of the valve. And the communication module of the Internet of things is configured to ensure that data can be stably and rapidly transmitted to the cloud server. And deploying a data processing and analyzing algorithm on the cloud server, monitoring the valve state in real time, and responding to the abnormal condition in time. And developing an application program of the mobile terminal, and realizing the pushing of early warning information and the inquiring function of historical data.
For the core technical scheme of the present application, please refer to fig. 1, namely, the embodiment of the present application provides an intelligent monitoring method for opening and closing degree of a gas meter based on internet of things, which comprises:
S101: a valve detection image is obtained.
Wherein the valve detection image is obtained by an image sensor (camera).
S102: and extracting the characteristics of the valve detection image through a first neural network to obtain a first characteristic diagram.
Wherein the first neural network is a convolutional neural network (Convolutional Neural Networks, CNN).
S103: and inputting the first feature map into an attention mechanism module, and calculating the attention weight of each pixel point in the first feature map through an attention mechanism.
Wherein S103 specifically is: global features of the first feature map are obtained through global pooling (e.g., global average pooling) operations, the global features representing information of the entire first feature map.
The global features are passed through a full connection layer and then through an activation function (e.g., reLU) to obtain the attention distribution vector. The dimension of the attention distribution vector is the same as the number of channels of the first feature map, and each value of the attention distribution vector represents the attention weight of the corresponding channel.
Multiplying each channel in the first feature map by the attention distribution vector to obtain a weighted feature map. In the embodiment of the present invention, the channels of the first feature map are pixels of the first feature map, and multiplying each channel in the first feature map by the attention distribution vector specifically includes: the pixel value of each pixel point in the first feature map is multiplied by the attention distribution vector.
The weighted feature maps are normalized to ensure that the attention weights range between 0, 1 and the sum of the attention weights is 1. The value of the pixel point of the feature image after normalization processing is the attention weight of the pixel point
In the embodiment of the invention, the normalization method is a Softmax function, and the attention weight of each pixel point is mapped to a probability distribution.
S104: and multiplying the weight of each spatial position by the pixel value of the corresponding pixel point of the spatial position in the valve detection image to obtain an enhanced image.
S105: and extracting the characteristics of the enhanced image through a second neural network to obtain a second characteristic diagram. Wherein the second neural network is a convolutional neural network (Convolutional Neural Networks, CNN).
S106: and performing pixel level segmentation on the second feature map based on the first feature map to obtain a first segmented image.
Each pixel in the first segmented image is labeled as to whether it belongs to a valve.
In an embodiment of the present invention, performing pixel-level segmentation on a second feature map based on a first feature map to obtain a first segmented image, including:
And obtaining a pixel level segmentation weight value of each pixel point based on the first feature map and the second feature map. Specifically, the first feature map is used as a background, and the second feature map is subjected to background difference operation, so that a first difference image is obtained. And taking the valve detection image as a background, and performing background difference operation on the second feature image to obtain a second difference image. And obtaining a cross entropy image of the first difference image and the second difference image, wherein the value of each pixel point in the cross entropy image is equal to the cross entropy of the pixel value between the first pixel point and the second pixel point, the first pixel point is the pixel point in the first difference image, the second pixel point is the pixel point in the second difference image, and the coordinates of the first pixel point and the second pixel point are equal. The value of each pixel point in the cross entropy image is a pixel level segmentation weight.
And adjusting the second characteristic map based on the pixel level segmentation weight to obtain a third characteristic map. Specifically, a transposed matrix of the cross entropy image is obtained, and the second feature map is multiplied by the transposed matrix of the cross entropy image to obtain a third feature map.
Feature extraction and similarity prediction are carried out on the third feature map based on the third neural network, so that a similarity matrix among pixels is obtained, and the method is specific:
Obtaining feature vectors of pixel points in the third feature map; the feature vector comprises the total pixel value of surrounding pixel points, the difference value between the pixel value of the pixel points and the average value of the pixel values of the surrounding pixel points, the number of the difference value between the pixel value of the surrounding pixel points and the pixel value of the pixel points which is larger than a set value, and the pixel value of the pixel points. Wherein the set values can be 1,2 and 3.
And obtaining cosine values among the feature vectors of the pixel points.
And constructing weighted adjacent matrixes among the pixel points, taking the cosine value as the weight value of the weighted adjacent matrix, and taking the assigned weighted adjacent matrix as a similarity matrix.
And taking the similarity matrix as input of a graph cutting algorithm, and carrying out image segmentation on the third feature graph based on the graph cutting algorithm to obtain a first segmented image, wherein the first segmented image comprises a valve.
In the embodiment of the invention, the graph cut algorithm specifically comprises the following steps:
and carrying out feature extraction and similarity prediction on the image by using a deep neural network to obtain a similarity matrix between pixels.
And taking the similarity matrix as the input of a graph cut algorithm, and carrying out image segmentation by using a minimum cut algorithm or other optimization algorithms.
And continuously adjusting the similarity matrix and the segmentation result through iterative optimization until convergence, so as to obtain a first segmentation image.
By introducing a spatial attention mechanism, the full convolution network can dynamically adjust the feature weights of different spatial positions while learning features, so that important information of a valve area is better captured, and the precision and accuracy of pixel level segmentation are improved. The method can effectively enhance the characterization capability of the full convolution network in the valve pixel level segmentation task.
S107: the valve opening and closing degree is identified based on the first divided image.
In the embodiment of the present invention, S107 is specifically: and identifying the valve opening and closing degree based on the first segmentation image through a pre-trained valve opening and closing degree detection model, namely taking the first segmentation image as the input of the valve opening and closing degree detection model, and outputting the valve opening and closing degree by the valve opening and closing degree detection model. The valve opening and closing degree indicates the angle of the valve or the size of the valve gap. In the embodiment of the invention, the training method of the valve opening and closing degree detection model comprises the following steps:
And obtaining a valve image data set which comprises a plurality of valve characteristic images with different opening and closing states and correspondingly marks the opening and closing degree.
The features of the valve feature image are extracted by the multi-layer convolution and pooling layers. Optionally, attention mechanisms and residual connections are introduced during feature extraction to obtain feature maps, enabling the model to better focus on key parts of the valve, thereby improving predictive performance, and in combination with residual connections to help the model learn better the feature representation.
Global average pooling: and adding a global average pooling layer after the final convolution layer, and converting the feature map processed by the method into feature vectors with fixed lengths.
The loss function of the valve opening and closing degree detection model is a mean square error function, and the difference between the predicted value and the actual opening and closing degree value is measured through the loss function. If the loss function converges, determining that the valve opening and closing degree detection model training is completed. The feature vector output by the valve opening and closing degree detection model after training comprises the opening and closing degree.
Optionally, S107 may be:
Determining edge pixels of the valve contour in the first segmentation image based on a Canny edge detection algorithm to obtain a valve edge;
Detecting straight lines in the edges of the valve through Hough transformation, and identifying two sides of the valve based on the straight lines; and obtaining the included angles of the two sides of the valve, and taking the included angles of the two sides of the valve as the opening and closing degree of the valve. Or obtaining the Euclidean distance at two sides of the valve, and taking the Euclidean distance at two sides of the valve as the opening and closing degree of the valve. Wherein, based on the both sides of straight line discernment valve specifically is: obtaining a distance vector between every two straight lines, wherein the distance vector comprises Euclidean distances of a plurality of edge pixel point pairs; each edge pixel point pair comprises two edge pixel points, the two edge pixel points are respectively positioned in two different straight lines, and the Euclidean distance between the two edge pixel points is nearest. If the Euclidean distance in the distance vector is increased in advance or the Euclidean distances are equal, determining the two straight lines as two sides of the valve.
S108: and if the valve opening and closing degree is larger than the threshold value, generating alarm information. Wherein the threshold value is 1-15, such as 1, 2, 3, 15, etc.
Optionally, after generating the alarm information, the method further comprises:
S109: the alert information is sent to the management system.
By adopting the scheme, the key features in the valve image are automatically extracted by using the deep learning model, and the key features are focused on the core area affecting the opening and closing degree by combining the attention mechanism, so that the detection accuracy is improved, and the error rate is reduced to below 1%. The system can process the image data captured by the camera in real time and output the evaluation result of the valve opening and closing degree in millisecond time, thereby meeting the requirement of industrial production on quick response. The method is independent of specific types of valves or installation conditions, can adapt to valve monitoring in different environments through training, and has good generalization capability. Through the continuous monitoring to the valve degree of opening and shutting, the system can in time discover unusual action to send the early warning to operating personnel, help preventing potential production accident. Compared with the traditional manual inspection or mechanical sensor, the invention reduces the maintenance and calibration cost, improves the production efficiency and has obvious economic benefit. The system continuously optimizes the model performance by continuously collecting and analyzing the valve data, realizes self-learning and improvement, and keeps stable high-performance for a long time.
In summary, the method based on deep learning can judge the opening and closing degree of the valve by learning the characteristics of the opening and closing state of the valve, and has better generalization capability and accuracy compared with the traditional method. In addition, the self-attention mechanism and the spatial attention mechanism are introduced, so that the network can learn the relation and the spatial information among the features more flexibly, the characterization capability of the network is enhanced, and the performance and the generalization capability of the deep learning model in various tasks are improved. The accuracy of valve opening and closing degree identification is improved, so that the safety and efficiency of gas use are improved.
Based on the intelligent monitoring method for the opening and closing degree of the gas meter valve based on the Internet of things, the embodiment of the invention also provides an intelligent monitoring system for the opening and closing degree of the gas meter valve based on the Internet of things, which is used for executing the intelligent monitoring method for the opening and closing degree of the gas meter valve based on the Internet of things. Based on thing networking gas table valve degree intelligent monitoring system that opens and shuts includes:
The acquisition module is used for acquiring a valve detection image, wherein the valve detection image is acquired by an image sensor;
The extraction module is used for extracting the characteristics of the valve detection image through a first neural network to obtain a first characteristic diagram;
The prediction module is used for inputting the first feature map into the attention mechanism module, and calculating the attention weight of each pixel point in the first feature map through an attention mechanism; multiplying the weight of each spatial position by the pixel value of the corresponding pixel point of the spatial position in the valve detection image to obtain an enhanced image; extracting features of the enhanced image through a second neural network to obtain a second feature map; performing pixel level segmentation on the second feature map based on the first feature map to obtain a first segmented image; identifying the valve opening and closing degree based on the first segmentation image through a pre-trained valve opening and closing degree detection model;
and the alarm module is used for generating alarm information if the opening and closing degree of the valve is larger than a threshold value.
Optionally, the alarm module is further configured to include:
the alert information is sent to the management system.
Optionally, in the intelligent monitoring system for opening and closing degree of a gas meter valve based on the internet of things, pixel-level segmentation is performed on the second feature map based on the first feature map, and a first segmentation image is obtained, including:
Obtaining a pixel level segmentation weight of each pixel point based on the first feature map and the second feature map;
adjusting the second feature map based on the pixel level segmentation weight to obtain a third feature map;
Feature extraction and similarity prediction are carried out on the third feature map based on the third neural network, and a similarity matrix between pixels is obtained: specific:
Obtaining feature vectors of pixel points in the third feature map; the feature vector comprises the total pixel value of surrounding pixel points, the difference value of the pixel points and the average value of the pixel values of the surrounding pixel points, the number of the difference value of the pixel value in the surrounding pixel points and the pixel value of the pixel points which is larger than a set value, and the pixel value of the pixel points;
obtaining cosine values among the feature vectors of the pixel points;
constructing weighted adjacent matrixes among pixel points, taking the cosine value as the weight of the weighted adjacent matrixes, and taking the assigned weighted adjacent matrixes as a similarity matrix;
Taking the similarity matrix as input of a graph cutting algorithm, and carrying out image segmentation on the third feature graph based on the graph cutting algorithm; a first segmented image is obtained, the first segmented image comprising a valve.
Optionally, in the intelligent monitoring system for opening and closing degree of a gas meter based on the internet of things, a pixel level segmentation weight of each pixel point is obtained based on the first feature map and the second feature map, including:
Taking the first feature map as a background, performing background difference operation on the second feature map, and obtaining a first difference image;
Taking the valve detection image as a background, performing background difference operation on the second feature image, and obtaining a second difference image;
Obtaining a cross entropy image of the first difference image and the second difference image; the value of each pixel point in the cross entropy image is equal to the cross entropy of the pixel value between a first pixel point and a second pixel point, wherein the first pixel point is the pixel point in the first difference image, and the second pixel point is the pixel point in the second difference image; the coordinates of the first pixel point and the second pixel point are equal; the value of each pixel point in the cross entropy image is a pixel level segmentation weight.
Optionally, in the intelligent monitoring system for opening and closing degree of a gas meter valve based on the internet of things, the second feature map is adjusted based on the pixel level segmentation weight to obtain a third feature map, which comprises:
Obtaining a transposed matrix of the cross entropy image;
and multiplying the second feature map by the transposed matrix of the cross entropy image to obtain a third feature map.
The specific implementation manner of the functions of the modules of the system is described above based on the intelligent monitoring method of the opening and closing degree of the gas meter valve of the internet of things, and is not described herein again.
The embodiment of the invention also provides an electronic device for integrating the intelligent monitoring system for the opening and closing degree of the gas meter based on the Internet of things, as shown in fig. 2, the electronic device comprises a memory 504, a processor 502 and a computer program stored on the memory 504 and capable of running on the processor 502, and the steps of any one of the intelligent monitoring methods for the opening and closing degree of the gas meter based on the Internet of things are realized when the processor 502 executes the program.
Where in FIG. 2a bus architecture (represented by bus 500), bus 500 may include any number of interconnected buses and bridges, with bus 500 linking together various circuits, including one or more processors, represented by processor 502, and memory, represented by memory 504. Bus 500 may also link together various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., as are well known in the art and, therefore, will not be described further herein. Bus interface 505 provides an interface between bus 500 and receiver 501 and transmitter 503. The receiver 501 and the transmitter 503 may be the same element, i.e. a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 502 is responsible for managing the bus 500 and general processing, while the memory 504 may be used to store data used by the processor 502 in performing operations.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when being executed by a processor, realizes the steps of any one of the intelligent monitoring methods based on the opening and closing degree of the gas meter of the Internet of things.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with the teachings herein. The required structure for a construction of such a system is apparent from the description above. In addition, the present invention is not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Claims (10)
1. An intelligent monitoring method for opening and closing degree of a gas meter valve based on the Internet of things is characterized by comprising the following steps:
Obtaining a valve detection image, wherein the valve detection image is obtained through an image sensor;
Extracting features of the valve detection image through a first neural network to obtain a first feature map;
inputting the first feature map into an attention mechanism module, and calculating the attention weight of each pixel point in the first feature map through an attention mechanism;
multiplying the weight of each spatial position by the pixel value of the corresponding pixel point of the spatial position in the valve detection image to obtain an enhanced image;
extracting features of the enhanced image through a second neural network to obtain a second feature map;
performing pixel level segmentation on the second feature map based on the first feature map to obtain a first segmented image;
identifying the valve opening and closing degree based on the first segmentation image through a pre-trained valve opening and closing degree detection model;
and if the valve opening and closing degree is larger than the threshold value, generating alarm information.
2. The intelligent monitoring method for opening and closing degree of gas meter valve based on internet of things of claim 1, which is characterized by further comprising:
the alert information is sent to the management system.
3. The intelligent monitoring method for the opening and closing degree of the gas meter valve based on the internet of things according to claim 1, wherein the pixel-level segmentation is performed on the second feature map based on the first feature map to obtain a first segmented image, and the method comprises the following steps:
Obtaining a pixel level segmentation weight of each pixel point based on the first feature map and the second feature map;
adjusting the second feature map based on the pixel level segmentation weight to obtain a third feature map;
Performing feature extraction and similarity prediction on a third feature map based on a third neural network to obtain a similarity matrix between pixels;
taking the similarity matrix as input of a graph cutting algorithm, and carrying out image segmentation on the third feature graph based on the graph cutting algorithm; a first segmented image is obtained, the first segmented image including a valve.
4. The intelligent monitoring method for the opening and closing degree of the gas meter valve based on the internet of things according to claim 3, wherein the method for obtaining the similarity matrix between pixels based on the feature extraction and the similarity prediction of the third feature map by the third neural network comprises the following steps:
Obtaining feature vectors of pixel points in the third feature map; the feature vector comprises the total pixel value of surrounding pixel points, the difference value of the pixel points and the average value of the pixel values of the surrounding pixel points, the number of the difference value of the pixel value in the surrounding pixel points and the pixel value of the pixel points which is larger than a set value, and the pixel value of the pixel points;
obtaining cosine values among the feature vectors of the pixel points;
And constructing weighted adjacent matrixes among the pixel points, taking the cosine value as the weight value of the weighted adjacent matrix, and taking the assigned weighted adjacent matrix as a similarity matrix.
5. The intelligent monitoring method for the opening and closing degree of the gas meter valve based on the internet of things according to claim 3, wherein the pixel-level segmentation weight of each pixel point is obtained based on the first feature map and the second feature map, and the method comprises the following steps:
Taking the first feature map as a background, performing background difference operation on the second feature map, and obtaining a first difference image;
Taking the valve detection image as a background, performing background difference operation on the second feature image, and obtaining a second difference image;
Obtaining a cross entropy image of the first difference image and the second difference image; the value of each pixel point in the cross entropy image is equal to the cross entropy of the pixel value between a first pixel point and a second pixel point, wherein the first pixel point is the pixel point in the first difference image, and the second pixel point is the pixel point in the second difference image; the coordinates of the first pixel point and the second pixel point are equal; the value of each pixel point in the cross entropy image is a pixel level segmentation weight.
6. The intelligent monitoring method for the opening and closing degree of the gas meter valve based on the internet of things according to claim 5, wherein the adjusting the second feature map based on the pixel-level segmentation weight to obtain the third feature map comprises:
Obtaining a transposed matrix of the cross entropy image;
and multiplying the second feature map by the transposed matrix of the cross entropy image to obtain a third feature map.
7. Based on thing networking gas table valve degree intelligent monitoring system that opens and shuts, a serial communication port, the system includes:
The acquisition module is used for acquiring a valve detection image, wherein the valve detection image is acquired by an image sensor;
The extraction module is used for extracting the characteristics of the valve detection image through a first neural network to obtain a first characteristic diagram;
The prediction module is used for inputting the first feature map into the attention mechanism module, and calculating the attention weight of each pixel point in the first feature map through an attention mechanism; multiplying the weight of each spatial position by the pixel value of the corresponding pixel point of the spatial position in the valve detection image to obtain an enhanced image; extracting features of the enhanced image through a second neural network to obtain a second feature map; performing pixel level segmentation on the second feature map based on the first feature map to obtain a first segmented image; identifying the valve opening and closing degree based on the first segmentation image through a pre-trained valve opening and closing degree detection model;
and the alarm module is used for generating alarm information if the opening and closing degree of the valve is larger than a threshold value.
8. The intelligent monitoring system for opening and closing a gas meter valve based on the internet of things of claim 7, wherein the alarm module is further configured to include:
the alert information is sent to the management system.
9. The intelligent monitoring system for opening and closing degree of a gas meter valve based on the internet of things of claim 7, wherein the pixel-level segmentation is performed on the second feature map based on the first feature map to obtain a first segmented image, and the intelligent monitoring system comprises:
Obtaining a pixel level segmentation weight of each pixel point based on the first feature map and the second feature map;
adjusting the second feature map based on the pixel level segmentation weight to obtain a third feature map;
Performing feature extraction and similarity prediction on a third feature map based on a third neural network to obtain a similarity matrix between pixels;
taking the similarity matrix as input of a graph cutting algorithm, and carrying out image segmentation on the third feature graph based on the graph cutting algorithm; a first segmented image is obtained, the first segmented image including a valve.
10. The intelligent monitoring system for opening and closing degree of a gas meter valve based on the internet of things according to claim 9, wherein the method for obtaining the similarity matrix between pixels based on feature extraction and similarity prediction of a third feature map by a third neural network comprises the following steps:
Obtaining feature vectors of pixel points in the third feature map; the feature vector comprises the total pixel value of surrounding pixel points, the difference value of the pixel points and the average value of the pixel values of the surrounding pixel points, the number of the difference value of the pixel value in the surrounding pixel points and the pixel value of the pixel points which is larger than a set value, and the pixel value of the pixel points;
obtaining cosine values among the feature vectors of the pixel points;
And constructing weighted adjacent matrixes among the pixel points, taking the cosine value as the weight value of the weighted adjacent matrix, and taking the assigned weighted adjacent matrix as a similarity matrix.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411084870.1A CN118602171B (en) | 2024-08-08 | 2024-08-08 | Intelligent monitoring system and method for opening and closing degree of gas meter valve based on Internet of things |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411084870.1A CN118602171B (en) | 2024-08-08 | 2024-08-08 | Intelligent monitoring system and method for opening and closing degree of gas meter valve based on Internet of things |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118602171A CN118602171A (en) | 2024-09-06 |
CN118602171B true CN118602171B (en) | 2024-10-15 |
Family
ID=92550289
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202411084870.1A Active CN118602171B (en) | 2024-08-08 | 2024-08-08 | Intelligent monitoring system and method for opening and closing degree of gas meter valve based on Internet of things |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118602171B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104100753A (en) * | 2013-04-10 | 2014-10-15 | 宁波晨岚电气设备有限公司 | Intelligent flow regulating valve |
CN105673908A (en) * | 2016-03-10 | 2016-06-15 | 浙江大学 | Intelligent water-saving faucet based on neural network and single-chip microcomputer |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4413504B2 (en) * | 2003-02-13 | 2010-02-10 | 株式会社東芝 | Medical image processing apparatus, medical image processing method, and medical image processing program |
ITRE20050130A1 (en) * | 2005-11-16 | 2007-05-17 | Sacmi Scrl | METHOD FOR FORMING TILES OR REPRODUCING CERAMIC SHEETS THE CHARACTERISTICS OF NATURAL STONES AND ITS APPARATUS |
CN115711315A (en) * | 2021-08-23 | 2023-02-24 | 维谛技术有限公司 | Valve opening control method and device, nonvolatile storage medium and processor |
-
2024
- 2024-08-08 CN CN202411084870.1A patent/CN118602171B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104100753A (en) * | 2013-04-10 | 2014-10-15 | 宁波晨岚电气设备有限公司 | Intelligent flow regulating valve |
CN105673908A (en) * | 2016-03-10 | 2016-06-15 | 浙江大学 | Intelligent water-saving faucet based on neural network and single-chip microcomputer |
Also Published As
Publication number | Publication date |
---|---|
CN118602171A (en) | 2024-09-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102229594B1 (en) | Display screen quality detection method, device, electronic device and storage medium | |
CN117056864B (en) | Pipeline leakage early warning method and system | |
CN117368862A (en) | High-efficiency weather radar data quality evaluation system | |
CN113486950A (en) | Intelligent pipe network water leakage detection method and system | |
CN118602171B (en) | Intelligent monitoring system and method for opening and closing degree of gas meter valve based on Internet of things | |
CN114170138B (en) | Method for establishing unsupervised industrial image anomaly detection model, detection method and system | |
CN114611409B (en) | Method and device for establishing abnormal detection model of power distribution terminal | |
CN113012107B (en) | Power grid defect detection method and system | |
CN118466413A (en) | Control method and device for unmanned equipment of power plant based on fuzzy logic | |
CN115456168B (en) | Training method of reinforcement learning model, energy consumption determining method and device | |
Segovia et al. | Connected system for monitoring electrical power transformers using thermal imaging | |
CN117975120A (en) | Training method, classifying method, device and medium for wafer defect classifying model | |
CN113806172B (en) | Method and device for processing equipment state parameters, electronic equipment and storage medium | |
US20240095588A1 (en) | Methods, apparatus and machine-readable mediums relating to machine learning models | |
CN111797925B (en) | Visual image classification method and device for power system | |
CN117834540B (en) | Communication optimization method based on ultrasonic water meter, internet of things system and equipment | |
CN118429605B (en) | Equipment abnormality analysis method based on analysis model | |
Xing et al. | Design and Application of Transmission Line Intelligent Monitoring System | |
CN117978247B (en) | Data compression method and device based on high-flux satellite Internet of things | |
US20240201641A1 (en) | Methods for noise reduction at smart gas field stations, internet of things systems, and storage media thereof | |
CN117498351B (en) | Full-model simulation system based on real-time data of power grid and used for loop closing control | |
LU500121B1 (en) | A method, device and equipment for electric meter detecting | |
Cai et al. | Research on efficient detection method of low voltage power line based on edge intelligence | |
CN118887044A (en) | RPA service processing method and system based on artificial intelligence | |
Segovia Román et al. | Connected system for monitoring electrical power transformers using thermal imaging |
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 |