An intelligent monitoring system and method for the opening and closing degree of gas meter valves based on the Internet of Things

Through the Internet of Things image sensor and deep learning model, the opening and closing degree of the gas valve is accurately monitored, which solves the problem of inaccurate valve opening and closing detection in traditional technology and achieves efficient and safe gas management.

CN118602171BActive Publication Date: 2024-10-15GUANGZHOU JINRAN INTELLIGENT SYST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411084870.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-10-15
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

Traditional gas valve monitoring technology cannot accurately monitor the opening and closing of the valve, resulting in inaccurate gas flow and pressure control, affecting efficiency and safety.

Method used

Using image sensors and deep learning models based on the Internet of Things, the first neural network and attention mechanism are used to extract and segment features of the valve detection image, identify the valve opening and closing, and generate alarm information when the threshold is exceeded.

Benefits of technology

The accuracy of valve identification is improved, the error rate is reduced to less than 1%, real-time and fast gas management is achieved, maintenance costs are reduced, and production efficiency and safety are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118602171B_ABST
    Figure CN118602171B_ABST
Patent Text Reader

Abstract

The present 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. A high-precision sensor is installed at a suitable position on the gas meter valve. The high-precision sensor can accurately capture the opening and closing action and switch status of the valve. An Internet of Things communication module is configured to ensure that data can be transmitted to a cloud server stably and quickly. Data processing and analysis algorithms are deployed on the cloud server to monitor the valve status in real time and respond to abnormal situations in a timely manner. The deep learning model is used to automatically extract the key features in the valve image, and the attention mechanism is combined to focus on the core area that affects the opening and closing degree, so that the network can learn the relationship and spatial information between the features more flexibly, improve the accuracy of valve recognition, and then improve the accuracy of valve opening and closing detection, and the error rate is reduced to less than 1%. That is, the accuracy of valve opening and closing recognition is improved, thereby improving the safety and conversion efficiency of gas use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of gas detection technology, and in particular to an intelligent monitoring system and method for the opening and closing degree of a gas meter valve based on the Internet of Things. Background Art

[0002] In the infrastructure of modern cities, the gas supply system plays a vital role. With the advancement of science and technology, the monitoring technology of gas valves is also constantly developing to ensure the safety, stability and efficiency of gas supply. However, the traditional gas meter valve monitoring technology mainly focuses on detecting the switch status of the valve, that is, whether the valve is fully open or closed, and whether there is any abnormal operation. Although this monitoring method guarantees the basic safety of gas use to a certain extent, it has obvious technical bottlenecks.

[0003] However, monitoring only the switch status of the valve cannot provide detailed information about the valve opening degree. The valve opening degree directly affects the gas flow and pressure, which in turn affects the user's gas experience and the economy of the gas. For example, if the valve opening is too large, it may cause gas leakage and increase safety risks; while if the valve opening is too small, it may cause insufficient gas supply and affect the normal use of the user. Or it is detected that the valve is in a closed or open state, but in fact it is impossible to accurately monitor the valve opening degree and determine whether the valve is in the optimal working position. This may lead to inaccurate control of gas flow in practical applications, affecting the efficiency and safety of gas use.

[0004] In the prior art, some people have proposed that setting up a pressure sensor or a laser sensor to detect the position of the valve is a detection method to determine the opening and closing degree of the valve. The pressure sensor detects the valve position mainly through the contact between the valve and the pressure sensor, so that the pressure sensor detects the pressure applied by the valve, and detects the opening and closing degree of the valve by detecting the size of the pressure: the greater the pressure, the smaller the opening and closing degree; the maximum pressure determines that the valve is completely closed. However, this method requires friction between the valve and the pressure sensor, which is easy to cause the loss of the pressure sensor during the friction process and reduce the detection accuracy.

[0005] Some people also proposed to install a laser sensor to detect the opening and closing degree of the valve. However, the laser sensor is installed at a fixed position, and the valve opening and closing process will cause vibration, which affects the detection accuracy of the laser sensor. In addition, the relative position between the laser sensor and the valve will change as the valve is used for a long time, making it impossible for the laser to accurately detect the opening and closing degree of the valve.

[0006] In summary, the market urgently needs a technology that can accurately monitor the opening and closing degree of valves to achieve more refined gas management. Summary of the invention

[0007] The purpose of the present invention is to provide a system and method for intelligently monitoring the opening and closing degree of a gas meter valve based on the Internet of Things, so as to solve the above-mentioned problems existing in the prior art.

[0008] The embodiment of the present invention provides a method for intelligently monitoring the opening and closing degree of a gas meter valve based on the Internet of Things, the method comprising:

[0009] Obtaining a valve detection image, wherein the valve detection image is obtained by an image sensor;

[0010] Extracting features from the valve detection image through a first neural network to obtain a first feature map;

[0011] The first feature map is input into the attention mechanism module, and the attention weight of each pixel in the first feature map is calculated by the attention mechanism;

[0012] The weight of each spatial position is multiplied by the pixel value of the pixel point corresponding to the spatial position in the valve detection image to obtain an enhanced image;

[0013] Extracting features from the enhanced image using a second neural network to obtain a second feature map;

[0014] Performing pixel-level segmentation on the second feature map based on the first feature map to obtain a first segmented image;

[0015] Using a pre-trained valve opening and closing detection model, the valve opening and closing degree is identified based on the first segmented image;

[0016] If the valve opening degree is greater than the threshold, an alarm message is generated.

[0017] Optionally, the method further includes:

[0018] Send alarm information to the management system.

[0019] Optionally, performing pixel-level segmentation on the second feature map based on the first feature map to obtain a first segmented image includes:

[0020] Obtaining a pixel-level segmentation weight for each pixel based on the first feature map and the second feature map;

[0021] Adjust the second feature map based on the pixel-level segmentation weight to obtain a third feature map;

[0022] Performing feature extraction and similarity prediction on the third feature map based on the third neural network to obtain a similarity matrix between pixels;

[0023] The similarity matrix is ​​used as an input of a graph cut algorithm, and image segmentation is performed on the third feature map based on the graph cut algorithm; a first segmented image is obtained, and the first segmented image contains a valve.

[0024] Optionally, performing feature extraction and similarity prediction on the third feature map based on the third neural network to obtain a similarity matrix between pixels includes:

[0025] Obtain a feature vector of a pixel point in the third feature map; the feature vector includes the total pixel value of surrounding pixels, the difference between the pixel value of the pixel point and the average value of the pixel values ​​of surrounding pixels, the number of pixel values ​​of surrounding pixels and the pixel value of the pixel point whose difference is greater than a set value, and the pixel value of the pixel point;

[0026] Get the cosine value between the feature vectors of the pixel points;

[0027] A weighted adjacency matrix between pixel points is constructed, the cosine value is used as the weight of the weighted adjacency matrix, and the assigned weighted adjacency matrix is ​​used as the similarity matrix.

[0028] Optionally, obtaining a pixel-level segmentation weight for each pixel based on the first feature map and the second feature map includes:

[0029] Taking the first feature map as a background, performing a background difference operation on the second feature map to obtain a first difference image;

[0030] Using the valve detection image as a background, performing a background difference operation on the second feature image to obtain a second difference image;

[0031] A cross entropy image of a first difference image and a second difference image is obtained; the value of each pixel in the cross entropy image is equal to the cross entropy of the pixel value between the first pixel and the second pixel, the first pixel is a pixel in the first difference image, and the second pixel is a pixel in the second difference image; the coordinates of the first pixel and the second pixel are equal; the value of each pixel in the cross entropy image is a pixel-level segmentation weight.

[0032] Optionally, adjusting the second feature map based on the pixel-level segmentation weight to obtain a third feature map includes:

[0033] Get the transposed matrix of the cross entropy image;

[0034] The third feature map is obtained by multiplying the second feature map with the transposed matrix of the cross entropy image.

[0035] The embodiment of the present invention further provides an intelligent monitoring system for the opening and closing degree of a gas meter valve based on the Internet of Things, the system comprising:

[0036] An acquisition module, used for acquiring a valve detection image, wherein the valve detection image is acquired by an image sensor;

[0037] An extraction module, used for performing feature extraction on the valve detection image through a first neural network to obtain a first feature map;

[0038] The prediction module is used to input the first feature map into the attention mechanism module, calculate the attention weight of each pixel in the first feature map through the attention mechanism; multiply the weight of each spatial position by the pixel value of the pixel corresponding to the spatial position in the valve detection image to obtain an enhanced image; extract features of the enhanced image through the second neural network to obtain a second feature map; perform pixel-level segmentation on the second feature map based on the first feature map to obtain a first segmented image; and identify the valve opening degree based on the first segmented image through a pre-trained valve opening degree detection model;

[0039] The alarm module is used to generate an alarm message if the valve opening degree is greater than a threshold value.

[0040] Optionally, the alarm module is further configured to include:

[0041] Send alarm information to the management system.

[0042] Optionally, in the intelligent monitoring system for the opening and closing degree of the gas meter valve based on the Internet of Things, pixel-level segmentation of the second feature map based on the first feature map to obtain a first segmented image includes:

[0043] Obtaining a pixel-level segmentation weight for each pixel based on the first feature map and the second feature map;

[0044] Adjust the second feature map based on the pixel-level segmentation weight to obtain a third feature map;

[0045] Performing feature extraction and similarity prediction on the third feature map based on the third neural network to obtain a similarity matrix between pixels;

[0046] The similarity matrix is ​​used as an input of a graph cut algorithm, and image segmentation is performed on the third feature map based on the graph cut algorithm; a first segmented image is obtained, and the first segmented image contains a valve.

[0047] Optionally, in the gas meter valve opening and closing degree intelligent monitoring system based on the Internet of Things, feature extraction and similarity prediction are performed on the third feature map based on the third neural network to obtain a similarity matrix between pixels, including:

[0048] Obtain a feature vector of a pixel point in the third feature map; the feature vector includes the total pixel value of surrounding pixels, the difference between the pixel value of the pixel point and the average value of the pixel values ​​of surrounding pixels, the number of pixel values ​​of surrounding pixels and the pixel value of the pixel point whose difference is greater than a set value, and the pixel value of the pixel point;

[0049] Get the cosine value between the feature vectors of the pixel points;

[0050] A weighted adjacency matrix between pixel points is constructed, the cosine value is used as the weight of the weighted adjacency matrix, and the assigned weighted adjacency matrix is ​​used as the similarity matrix.

[0051] Optionally, in the gas meter valve opening and closing degree intelligent monitoring system based on the Internet of Things, the pixel-level segmentation weight of each pixel is obtained based on the first feature map and the second feature map, including:

[0052] Taking the first feature map as a background, performing a background difference operation on the second feature map to obtain a first difference image;

[0053] Using the valve detection image as a background, performing a background difference operation on the second feature image to obtain a second difference image;

[0054] A cross entropy image of a first difference image and a second difference image is obtained; the value of each pixel in the cross entropy image is equal to the cross entropy of the pixel value between the first pixel and the second pixel, the first pixel is a pixel in the first difference image, and the second pixel is a pixel in the second difference image; the coordinates of the first pixel and the second pixel are equal; the value of each pixel in the cross entropy image is a pixel-level segmentation weight.

[0055] Optionally, in the intelligent monitoring system for the opening and closing degree of the gas meter valve based on the Internet of Things, the second feature map is adjusted based on the pixel-level segmentation weight to obtain the third feature map, including:

[0056] Get the transposed matrix of the cross entropy image;

[0057] The third feature map is obtained by multiplying the second feature map with the transposed matrix of the cross entropy image.

[0058] Compared with the prior art, the embodiments of the present invention achieve the following beneficial effects:

[0059] The embodiment of the present invention provides an intelligent monitoring system and method for the valve opening degree of a gas meter based on the Internet of Things. The system extracts features from a valve detection image through a first neural network to obtain a first feature map; the first feature map is input into an attention mechanism module, and the attention weight of each pixel in the first feature map is calculated through the attention mechanism; the weight of each spatial position is multiplied by the pixel value of the pixel corresponding to the spatial position in the valve detection image to obtain an enhanced image; the enhanced image is extracted features through a second neural network to obtain a second feature map; the second feature map is pixel-level segmented based on the first feature map to obtain a first segmented image; the valve opening degree is identified based on the first segmented image through a pre-trained valve opening degree detection model; if the valve opening degree is greater than a threshold, an alarm message is generated. The key features in the valve image are automatically extracted using a deep learning model, and the core area that affects the opening degree is focused on in combination with the attention mechanism, so that the network can learn the relationship between features and spatial information more flexibly, thereby improving the accuracy of valve recognition, thereby improving the accuracy of valve opening degree detection, and reducing the error rate to less than 1%. On this basis, the system can process the image data captured by the camera in real time and output the evaluation result of the valve opening degree within milliseconds, meeting the demand for rapid response in industrial production. This method does not rely on a specific type of valve or installation conditions. It can be adapted to valve monitoring in different environments through training and has good generalization capabilities. By continuously monitoring the opening and closing of valves, the system can detect abnormal behavior in a timely manner and issue early warnings to operators, helping to prevent potential production accidents. Compared with traditional manual inspections or mechanical sensors, the present invention reduces maintenance and calibration costs while improving production efficiency, with significant economic benefits. The system continuously collects and analyzes valve data, continuously optimizes model performance, achieves self-learning and improvement, and maintains long-term stable high performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 The present invention provides a flow chart of a method for intelligently monitoring the opening and closing degree of a gas meter valve based on the Internet of Things.

[0061] Figure 2 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.

[0062] Markings in the figure: 500 - bus; 501 - receiver; 502 - processor; 503 - transmitter; 504 - memory; 505 - bus interface. DETAILED DESCRIPTION

[0063] The present invention will be described in detail below in conjunction with the accompanying drawings.

[0064] Example

[0065] The current sensor technology has low accuracy in detecting the opening and closing degree of valves. Therefore, the present application proposes a method for detecting the opening and closing degree of valves by setting an image sensor (camera). Since the detection field of view of the camera is much larger than that of the pressure sensor and the laser sensor, the camera has high accuracy and long service life in detecting the opening and closing degree of valves: since the camera captures the image of the opening and closing position of the valve, even if the relative position of the camera and the valve changes, the wide field of view of the camera can detect the opening and closing state information of the valve, that is, the detection accuracy is high. The camera does not contact the valve, and even if the valve is frequently opened and closed, it will not cause damage to the camera, nor will it affect the detection accuracy of the camera.

[0066] Through the above improvements, the present invention can not only monitor the switch state of the valve, but also accurately control and monitor the opening and closing degree of the valve, ensuring that the valve is always in the optimal working position, thereby improving the safety and efficiency of gas use.

[0067] Specifically, high-precision intelligent monitoring of the opening and closing degree of the gas meter valve is achieved through the following methods:

[0068] Select a suitable location on the gas meter valve to install a high-precision sensor. In the embodiment of the present invention, a camera is used to ensure that the camera can accurately capture the opening and closing action and switch status of the valve. Configure the Internet of Things communication module to ensure that data can be stably and quickly transmitted to the cloud server. Deploy data processing and analysis algorithms on the cloud server to monitor the valve status in real time and respond to abnormal situations in a timely manner. Develop mobile terminal applications to realize the push of early warning information and the query function of historical data.

[0069] For the core technical solution of this application, please refer to Figure 1 , that is, the embodiment of the present invention provides a method for intelligently monitoring the opening and closing degree of a gas meter valve based on the Internet of Things, comprising:

[0070] S101: Obtain a valve detection image.

[0071] Wherein, the valve detection image is obtained through an image sensor (camera).

[0072] S102: Extract features of the valve detection image through a first neural network to obtain a first feature map.

[0073] Among them, the first neural network is the Convolutional Neural Networks (CNN).

[0074] S103: Input the first feature map into the attention mechanism module, and calculate the attention weight of each pixel in the first feature map through the attention mechanism.

[0075] Among them, S103 specifically includes: obtaining the global features of the first feature map through a global pooling operation (such as global average pooling), and the global features represent the information of the entire first feature map.

[0076] The global features are passed through a fully connected layer and then through an activation function (such as 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.

[0077] Each channel in the first feature map is multiplied by the attention distribution vector to obtain a weighted feature map. In an embodiment of the present invention, the channel of the first feature map is a pixel point of the first feature map, and multiplying each channel in the first feature map by the attention distribution vector is specifically: multiplying the pixel value of each pixel point in the first feature map by the attention distribution vector.

[0078] The weighted feature map is normalized to ensure that the range of attention weights is between [0, 1] and the sum of attention weights is 1. The pixel value of the normalized feature map is the attention weight of the pixel.

[0079] In an embodiment of the present invention, the normalization method is a Softmax function, which maps the attention weight of each pixel to a probability distribution.

[0080] S104: Multiply the weight of each spatial position by the pixel value of the pixel point corresponding to the spatial position in the valve detection image to obtain an enhanced image.

[0081] S105: extracting features from the enhanced image through a second neural network to obtain a second feature map, wherein the second neural network is a convolutional neural network (CNN).

[0082] S106: Perform pixel-level segmentation on the second feature map based on the first feature map to obtain a first segmented image.

[0083] Each pixel in the first segmented image is labeled whether it belongs to a valve.

[0084] In an embodiment of the present invention, performing pixel-level segmentation on the second feature map based on the first feature map to obtain a first segmented image includes:

[0085] The pixel-level segmentation weight of each pixel is obtained based on the first feature map and the second feature map. Specifically, the first feature map is used as the background, and the background difference operation is performed on the second feature map to obtain the first difference image. The valve detection image is used as the background, and the background difference operation is performed on the second feature map to obtain the second difference image. A cross entropy image of the first difference image and the second difference image is obtained, wherein the value of each pixel in the cross entropy image is equal to the cross entropy of the pixel value between the first pixel and the second pixel, the first pixel is a pixel in the first difference image, the second pixel is a pixel in the second difference image, and the coordinates of the first pixel and the second pixel are equal. The value of each pixel in the cross entropy image is the pixel-level segmentation weight.

[0086] The second feature map is adjusted based on the pixel-level segmentation weight to obtain a third feature 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 the third feature map.

[0087] Based on the third neural network, feature extraction and similarity prediction are performed on the third feature map to obtain a similarity matrix between pixels. Specifically:

[0088] Obtain a feature vector of a pixel in the third feature map; the feature vector includes the total pixel value of surrounding pixels, the difference between the pixel value of the pixel and the average pixel value of surrounding pixels, the number of pixel values ​​of surrounding pixels whose difference between the pixel value of the pixel and the pixel value of the pixel is greater than a set value, and the pixel value of the pixel itself. The set value can be 1, 2, or 3.

[0089] Get the cosine value between the feature vectors of the pixels.

[0090] A weighted adjacency matrix between pixel points is constructed, the cosine value is used as the weight of the weighted adjacency matrix, and the assigned weighted adjacency matrix is ​​used as the similarity matrix.

[0091] The similarity matrix is ​​used as an input of the graph cut algorithm, and the third feature map is segmented based on the graph cut algorithm to obtain a first segmented image, wherein the first segmented image contains the valve.

[0092] In the embodiment of the present invention, the graph cut algorithm is specifically:

[0093] A deep neural network is used to extract features and predict similarity of images to obtain a similarity matrix between pixels.

[0094] The similarity matrix is ​​used as the input of the graph cut algorithm, and the image is segmented using the minimum cut algorithm or other optimization algorithms.

[0095] Through iterative optimization, the similarity matrix and segmentation results are continuously adjusted until convergence, and the first segmentation image is obtained.

[0096] By introducing the spatial attention mechanism, the fully convolutional network can dynamically adjust the feature weights of different spatial positions while learning features, so as to better capture the important information of the valve area and improve the precision and accuracy of pixel-level segmentation. This method can effectively enhance the representation ability of the fully convolutional network in the valve pixel-level segmentation task.

[0097] S107: Identify the valve opening degree based on the first segmented image.

[0098] In an embodiment of the present invention, S107 specifically includes: using a pre-trained valve opening and closing detection model to identify the valve opening and closing based on the first segmented image, that is, using the first segmented image as the input of the valve opening and closing detection model, and the valve opening and closing detection model outputs the valve opening and closing. The valve opening and closing represents the angle of the valve or the size of the valve gap. In an embodiment of the present invention, the training method of the valve opening and closing detection model includes:

[0099] A valve image data set is obtained, wherein the valve image data set includes a plurality of valve feature images in different opening and closing degree states, and the opening and closing degrees are marked accordingly.

[0100] The features of the valve feature image are extracted through multiple layers of convolution and pooling layers. Optionally, the attention mechanism and residual connection are introduced during feature extraction to obtain the feature map, so that the model can better focus on the key parts of the valve, thereby improving the prediction performance, and combined with residual connection to help the model better learn feature representation.

[0101] Global average pooling: A global average pooling layer is added after the last convolutional layer to convert the feature map processed above into a feature vector of fixed length.

[0102] Among them, the loss function of the valve opening and closing degree detection model is the mean square error function, and the difference between the predicted value and the actual opening and closing value is measured by the loss function. If the loss function converges, it is determined that the valve opening and closing degree detection model training is completed. The feature vector output by the trained valve opening and closing degree detection model includes the size of the opening and closing degree.

[0103] Optionally, S107 may also be:

[0104] Based on the Canny edge detection algorithm, edge pixels of the valve contour are determined in the first segmented image to obtain the valve edge;

[0105] The straight line in the valve edge is detected by Hough transform, and the two sides of the valve are identified based on the straight line; the angle between the two sides of the valve is obtained, and the angle between the two sides of the valve is used as the valve opening degree. Or the Euclidean distance between the two sides of the valve is obtained, and the Euclidean distance between the two sides of the valve is used as the valve opening degree. Among them, the two sides of the valve are identified based on the straight line, specifically: the distance vector between each two straight lines is obtained, and the distance vector includes the Euclidean distance of multiple edge pixel pairs; each edge pixel pair includes two edge pixel points, and the two edge pixel points are respectively located in two different straight lines, and the Euclidean distance between the edge pixel points is the shortest. If the Euclidean distance in the distance vector increases first, or the Euclidean distance is equal, the two straight lines are determined to be the two sides of the valve.

[0106] S108: If the valve opening degree is greater than a threshold, an alarm message is generated, wherein the threshold value is between 1 and 15, such as 1, 2, 3, 15, etc.

[0107] Optionally, after generating the alarm information, the method further includes:

[0108] S109: Send the alarm information to the management system.

[0109] By adopting the above scheme, the key features in the valve image are automatically extracted using a deep learning model, and the core area that affects the opening and closing degree is focused on in combination with the attention mechanism, which improves the accuracy of detection and reduces the error rate to less than 1%. The system can process the image data captured by the camera in real time and output the evaluation results of the valve opening and closing degree in milliseconds, meeting the needs of industrial production for rapid response. This method does not depend on a specific type of valve or installation conditions. Through training, it can adapt to valve monitoring in different environments and has good generalization ability. Through continuous monitoring of the valve opening and closing degree, the system can detect abnormal behavior in time and issue early warnings to operators, which helps prevent potential production accidents. Compared with traditional manual inspections or mechanical sensors, the present invention reduces the cost of maintenance and calibration, while improving production efficiency, and has significant economic benefits. The system continuously collects and analyzes valve data, continuously optimizes model performance, achieves self-learning and improvement, and maintains long-term stable high performance.

[0110] In summary, the method of the present invention is based on deep learning and can judge the opening and closing degree of the valve by learning the characteristics of the valve opening and closing state, which has better generalization ability and accuracy than the traditional method. In addition, the introduction of self-attention mechanism and spatial attention mechanism can make the network learn the relationship between features and spatial information more flexibly, thereby enhancing the representation ability of the network and improving the performance and generalization ability of the deep learning model in various tasks. The accuracy of valve opening and closing degree recognition is improved, thereby improving the safety and efficiency of gas use.

[0111] Based on the above-mentioned method for intelligently monitoring the opening and closing degree of a gas meter valve based on the Internet of Things, an embodiment of the present invention further provides an intelligent monitoring system for the opening and closing degree of a gas meter valve based on the Internet of Things, which is used to execute the above-mentioned method for intelligently monitoring the opening and closing degree of a gas meter valve based on the Internet of Things. The intelligent monitoring system for the opening and closing degree of a gas meter valve based on the Internet of Things includes:

[0112] An acquisition module, used for acquiring a valve detection image, wherein the valve detection image is acquired by an image sensor;

[0113] An extraction module, used for performing feature extraction on the valve detection image through a first neural network to obtain a first feature map;

[0114] The prediction module is used to input the first feature map into the attention mechanism module, calculate the attention weight of each pixel in the first feature map through the attention mechanism; multiply the weight of each spatial position by the pixel value of the pixel corresponding to the spatial position in the valve detection image to obtain an enhanced image; extract features of the enhanced image through the second neural network to obtain a second feature map; perform pixel-level segmentation on the second feature map based on the first feature map to obtain a first segmented image; and identify the valve opening degree based on the first segmented image through a pre-trained valve opening degree detection model;

[0115] The alarm module is used to generate an alarm message if the valve opening degree is greater than a threshold value.

[0116] Optionally, the alarm module is further configured to include:

[0117] Send alarm information to the management system.

[0118] Optionally, in the intelligent monitoring system for the opening and closing degree of the 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 to obtain a first segmented image, including:

[0119] Obtaining a pixel-level segmentation weight for each pixel based on the first feature map and the second feature map;

[0120] Adjust the second feature map based on the pixel-level segmentation weight to obtain a third feature map;

[0121] Based on the third neural network, feature extraction and similarity prediction are performed on the third feature map to obtain a similarity matrix between pixels: Specifically:

[0122] Obtain a feature vector of a pixel point in the third feature map; the feature vector includes the total pixel value of surrounding pixels, the difference between the pixel value of the pixel point and the average value of the pixel values ​​of surrounding pixels, the number of pixel values ​​of surrounding pixels and the pixel value of the pixel point whose difference is greater than a set value, and the pixel value of the pixel point;

[0123] Get the cosine value between the feature vectors of the pixel points;

[0124] Constructing a weighted adjacency matrix between pixel points, using the cosine value as the weight of the weighted adjacency matrix, and using the assigned weighted adjacency matrix as a similarity matrix;

[0125] The similarity matrix is ​​used as an input of a graph cut algorithm, and image segmentation is performed on the third feature map based on the graph cut algorithm; a first segmented image is obtained, and the first segmented image contains a valve.

[0126] Optionally, in the gas meter valve opening and closing degree intelligent monitoring system based on the Internet of Things, the pixel-level segmentation weight of each pixel is obtained based on the first feature map and the second feature map, including:

[0127] Taking the first feature map as a background, performing a background difference operation on the second feature map to obtain a first difference image;

[0128] Using the valve detection image as a background, performing a background difference operation on the second feature image to obtain a second difference image;

[0129] A cross entropy image of a first difference image and a second difference image is obtained; the value of each pixel in the cross entropy image is equal to the cross entropy of the pixel value between the first pixel and the second pixel, the first pixel is a pixel in the first difference image, and the second pixel is a pixel in the second difference image; the coordinates of the first pixel and the second pixel are equal; the value of each pixel in the cross entropy image is a pixel-level segmentation weight.

[0130] Optionally, in the intelligent monitoring system for the opening and closing degree of the gas meter valve based on the Internet of Things, the second feature map is adjusted based on the pixel-level segmentation weight to obtain the third feature map, including:

[0131] Get the transposed matrix of the cross entropy image;

[0132] The third feature map is obtained by multiplying the second feature map with the transposed matrix of the cross entropy image.

[0133] The specific implementation methods of the functions of each module of the above system are as described above based on the method for intelligent monitoring of valve opening and closing degree of gas meter based on the Internet of Things, and will not be repeated here.

[0134] The embodiment of the present invention also provides an electronic device for integrating the above-mentioned gas meter valve opening and closing degree intelligent monitoring system based on the Internet of Things, such as Figure 2 As shown, the electronic device includes a memory 504, a processor 502, and a computer program stored in the memory 504 and executable on the processor 502. When the processor 502 executes the program, the steps of any of the methods described above for intelligent monitoring of valve opening and closing degree of gas meters based on the Internet of Things are implemented.

[0135] Among them, Figure 2 In the embodiment of the present invention, a bus architecture (represented by bus 500) is shown, and bus 500 may include any number of interconnected buses and bridges, and bus 500 links various circuits including one or more processors represented by processor 502 and memory represented by memory 504. Bus 500 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 505 provides an interface between bus 500 and receiver 501 and transmitter 503. Receiver 501 and transmitter 503 may be the same element, i.e., a transceiver, providing a unit for communicating with various other devices on a transmission medium. Processor 502 is responsible for managing bus 500 and general processing, while memory 504 may be used to store data used by processor 502 when performing operations.

[0136] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of any method of the intelligent monitoring method for the opening and closing degree of the valve of the gas meter based on the Internet of Things are implemented as described above.

[0137] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific languages ​​is for disclosing the best mode of the present invention.

[0138] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

Claims

1. An intelligent monitoring method for the opening and closing degree of a gas meter valve based on the Internet of Things, characterized in that: The method comprises: Obtaining a valve detection image, wherein the valve detection image is obtained by an image sensor; Extracting features from the valve detection image through a first neural network to obtain a first feature map; The first feature map is input into the attention mechanism module, and the attention weight of each pixel in the first feature map is calculated by the attention mechanism; The weight of each spatial position is multiplied by the pixel value of the pixel point corresponding to the spatial position in the valve detection image to obtain an enhanced image; Extracting features from the enhanced image using 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; Using a pre-trained valve opening and closing detection model, the valve opening and closing degree is identified based on the first segmented image; If the valve opening degree is greater than the threshold, an alarm message is generated.

2. The method for intelligently monitoring the opening and closing degree of a gas meter valve based on the Internet of Things according to claim 1 is characterized in that: The method further comprises: Send alarm information to the management system.

3. The method for intelligently monitoring the opening and closing degree of a gas meter valve based on the Internet of Things according to claim 1 is characterized in that: Performing pixel-level segmentation on the second feature map based on the first feature map to obtain a first segmented image includes: Obtaining a pixel-level segmentation weight for each pixel based on the first feature map and the second feature map; Adjust the second feature map based on the pixel-level segmentation weight to obtain a third feature map; Performing feature extraction and similarity prediction on the third feature map based on the third neural network to obtain a similarity matrix between pixels; The similarity matrix is ​​used as an input of a graph cut algorithm, and image segmentation is performed on the third feature map based on the graph cut algorithm; a first segmented image is obtained, and the first segmented image contains a valve.

4. According to the method for intelligent monitoring of the opening and closing degree of a gas meter valve based on the Internet of Things in claim 3, the third feature map is subjected to feature extraction and similarity prediction based on a third neural network to obtain a similarity matrix between pixels, including: Get the feature vector of the pixel in the third feature map; feature The vector includes the total pixel value of the surrounding pixels, the difference between the pixel value of the pixel and the average value of the pixel values ​​of the surrounding pixels, the number of pixel values ​​of the surrounding pixels whose difference between the pixel value of the pixel and the pixel value of the pixel is greater than a set value, and the pixel value of the pixel; Get the cosine value between the feature vectors of the pixel points; A weighted adjacency matrix between pixel points is constructed, the cosine value is used as the weight of the weighted adjacency matrix, and the assigned weighted adjacency matrix is ​​used as the similarity matrix.

5. According to the method for intelligent monitoring of the opening and closing degree of the gas meter valve based on the Internet of Things in claim 3, the pixel-level segmentation weight of each pixel is obtained based on the first feature map and the second feature map, comprising: Taking the first feature map as a background, performing a background difference operation on the second feature map to obtain a first difference image; Using the valve detection image as a background, performing a background difference operation on the second feature image to obtain a second difference image; Obtaining a cross entropy image of the first difference image and the second difference image; The value of each pixel in the cross entropy image is equal to the cross entropy of the pixel values ​​between the first pixel and the second pixel, the first pixel is the pixel in the first difference image, and the second pixel is the pixel in the second difference image; the coordinates of the first pixel and the second pixel are equal; the value of each pixel in the cross entropy image is the pixel-level segmentation weight.

6. The method for intelligently monitoring the opening and closing degree of a gas meter valve based on the Internet of Things according to claim 5 is characterized in that: The second feature map is adjusted based on the pixel-level segmentation weight to obtain a third feature map, including: Get the transposed matrix of the cross entropy image; Multiply the second feature map by the transposed matrix of the cross entropy image to obtain the third feature map.

7. An intelligent monitoring system for the opening and closing degree of gas meter valves based on the Internet of Things, characterized in that: The system comprises: An acquisition module, used for acquiring a valve detection image, wherein the valve detection image is acquired by an image sensor; An extraction module, used for extracting features from the valve detection image through a first neural network to obtain a first feature map; The prediction module is used to input the first feature map into the attention mechanism module, calculate the attention weight of each pixel in the first feature map through the attention mechanism; multiply the weight of each spatial position by the pixel value of the pixel corresponding to the spatial position in the valve detection image to obtain an enhanced image; extract features of the enhanced image through the second neural network to obtain a second feature map; perform pixel-level segmentation on the second feature map based on the first feature map to obtain a first segmented image; and identify the valve opening degree based on the first segmented image through a pre-trained valve opening degree detection model; The alarm module is used to generate an alarm message if the valve opening degree is greater than a threshold value.

8. The intelligent monitoring system for the opening and closing degree of gas meter valves based on the Internet of Things according to claim 7 is characterized in that: The alarm module is further configured to include: Send alarm information to the management system.

9. The intelligent monitoring system for the opening and closing degree of gas meter valves based on the Internet of Things according to claim 7 is characterized in that: Performing pixel-level segmentation on the second feature map based on the first feature map to obtain a first segmented image includes: Obtaining a pixel-level segmentation weight for each pixel based on the first feature map and the second feature map; Adjust the second feature map based on the pixel-level segmentation weight to obtain a third feature map; Performing feature extraction and similarity prediction on the third feature map based on the third neural network to obtain a similarity matrix between pixels; The similarity matrix is ​​used as an input of a graph cut algorithm, and image segmentation is performed on the third feature map based on the graph cut algorithm; a first segmented image is obtained, and the first segmented image contains a valve.

10. According to the intelligent monitoring system for the opening and closing degree of gas meter valves based on the Internet of Things according to claim 9, the third feature map is subjected to feature extraction and similarity prediction based on the third neural network to obtain a similarity matrix between pixels, including: Get the feature vector of the pixel in the third feature map; feature The vector includes the total pixel value of the surrounding pixels, the difference between the pixel value of the pixel and the average value of the pixel values ​​of the surrounding pixels, the number of pixel values ​​of the surrounding pixels whose difference between the pixel value of the pixel and the pixel value of the pixel is greater than a set value, and the pixel value of the pixel; Get the cosine value between the feature vectors of the pixel points; A weighted adjacency matrix between pixel points is constructed, the cosine value is used as the weight of the weighted adjacency matrix, and the assigned weighted adjacency matrix is ​​used as the similarity matrix.