Air quality monitoring and management method and system

By combining the feature extraction of temperature and humidity data and environmental images, the gradient boosting tree algorithm and the GRU network model are used to predict sewer air quality, which solves the problems of sewer air quality monitoring error and high cost in the existing technology, and achieves high accuracy and low cost. Cost of air quality management.

CN117975220BActive Publication Date: 2024-08-30TIANJIN FUZE SHENGSHI GREEN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410225414.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-29
Publication Date
2024-08-30
Estimated Expiration
2044-02-29

AI Technical Summary

Technical Problem

The existing technology has many errors and high costs in sewer air quality monitoring. The sensor can only detect one gas concentration, making it difficult to assess the overall air quality.

Method used

Temperature and humidity data are collected through sensors and environmental images are collected through cameras. PCA algorithm and gradient boosting tree algorithm are used for feature extraction and fitting. The GRU network model combined with the self-attention mechanism is used for air quality prediction, and compensation is performed through the error prediction model.

Benefits of technology

It achieves fast and accurate air quality prediction, reduces costs, improves accuracy and rationality of purification instructions, and ensures the safety of the sewer air environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117975220B
    Figure CN117975220B
Patent Text Reader

Abstract

The present invention discloses an air quality monitoring management method and system, the method comprising collecting temperature and humidity data in a sewer through a sensor, collecting an environmental image of the sewer through a camera; extracting features from the environmental image, reducing the extracted features using a PCA algorithm, fitting the reduced features using a gradient boosting tree algorithm, and selecting the feature quantity with the greatest correlation as a target feature; fusing the temperature and humidity data with the target feature and inputting them into a trained prediction model to obtain a prediction result of the sewer air quality; generating an air purification instruction, and using the air purification instruction to process the sewer. The present invention can quickly and accurately predict the air quality of the sewer, and has the advantages of low cost and high precision compared to sensors for multiple gas detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of air monitoring, and in particular to an air quality monitoring and management method and system. Background Art

[0002] Sewers are an important part of urban infrastructure, mainly used to collect and transport rainwater, domestic sewage and industrial wastewater. Due to the special internal environment of sewers, there are a large number of organic and inorganic substances. These substances will produce various gases such as hydrogen sulfide, ammonia, methane, etc. under the action of microorganisms. If these gases cannot be effectively controlled, they may not only cause harm to the human body, but also cause safety accidents such as fire and explosion. Therefore, it is very important to monitor the air quality of sewers.

[0003] At present, sewer monitoring usually only uses sensors to directly detect the gas concentration in the sewer. Once it exceeds the standard, an alarm is immediately activated. However, due to the complex gas environment in the sewer and the easy chemical reactions between gases, errors often occur in the detection method using sensors. Secondly, one type of sensor can usually only detect one gas concentration. If an overall air quality assessment is to be conducted in the sewer, multiple sensors need to be deployed, which is not only costly but also increases the difficulty of subsequent operation and maintenance. Summary of the invention

[0004] In order to solve at least one of the above-mentioned technical problems, the present invention provides an air quality monitoring and management method and system.

[0005] In a first aspect, the present invention provides an air quality monitoring and management method, the method comprising:

[0006] The temperature and humidity data in the sewer are collected through sensors, and the environmental images of the sewer are collected through cameras;

[0007] Extract features from the environment image, use the PCA algorithm to reduce the dimension of the extracted features, fit the reduced features according to the gradient boosting tree algorithm, and select the feature with the greatest correlation from the fitted features as the target feature;

[0008] The temperature and humidity data are integrated with the target features and input into the trained prediction model to obtain the sewer air quality prediction results;

[0009] An air purification instruction is generated according to the air quality prediction result, and the sewer is treated using the air purification instruction.

[0010] Preferably, the step of fitting the reduced-dimensional features according to the gradient boosting tree algorithm comprises:

[0011] Assuming that the feature dimensions are m and the number of categories is N, calculate the Gini coefficient of the node in the decision tree:

[0012]

[0013] In the formula, is the Gini coefficient of node v under the kth decision tree; is the proportion of category l under node v;

[0014] Calculate feature x z The change in the Gini coefficient before and after the branch at node v

[0015]

[0016] In the formula, and They are the Gini coefficients of the two new nodes after branching;

[0017] Define feature x z The node set that appears under decision tree k is Q, then x z The importance under the kth decision tree is:

[0018]

[0019] In the formula, z′ is a node in the node set Q;

[0020] Assuming that a total of T trees are generated during the training process, the feature x z The importance among all trees is:

[0021]

[0022] Where V z z ′ is a node in the node set Q; V z z ′ is the feature importance corresponding to each tree;

[0023] Perform normalization operation to obtain feature x z Final importance score of I GBz :

[0024]

[0025] Where V w is the importance of feature dimension w.

[0026] Preferably, the feature extraction of the environment image includes:

[0027] Establish multiple target detection frames, use each target detection frame to extract multi-channel color features from multiple environmental images of the sewer, and generate multiple feature sub-images;

[0028] Calculate the intersection-and-union ratio between any two target detection frames as the correlation between the any two target detection frames; splice multiple feature sub-maps according to the correlation to obtain a target feature map;

[0029] Extract color features, texture features, spectral features and spatial distribution features from the target feature map.

[0030] Preferably, the method further comprises training the prediction model, comprising:

[0031] Acquire some temperature and humidity data obtained from monitoring in historical scenarios and environmental images corresponding to the temperature and humidity as training samples;

[0032] Extract features from the environment images in the training samples, use the PCA algorithm to reduce the dimension of the extracted features, fit the reduced-dimensional features according to the gradient boosting tree algorithm, and select the feature with the greatest correlation from the fitted features;

[0033] The temperature and humidity data are fused with the most relevant feature quantity to train the GRU network model with self-attention mechanism;

[0034] The loss function is constructed using the root mean square error. If the value of the loss function is greater than the first threshold, the feature quantities with secondary correlation are screened out from the fitted features to reconstruct the fusion features and iteratively train the GRU network model until the value of the loss function is less than the first threshold, and a prediction model is generated.

[0035] Preferably, the expression of the self-attention mechanism is:

[0036]

[0037] In the formula, Q * ,K * ,V * are lookup, key, and value, respectively, Q * K *T To find the similarity with the key, d k The dimension of the key.

[0038] Preferably, the method further comprises:

[0039] The difference between the original input data and the predicted value of the GRU network output is used as the training set to train the model built based on the SVR algorithm to obtain the error prediction model;

[0040] The features after the temperature and humidity data are fused with the target features are input into the error prediction model, and the error prediction model is used to compensate the prediction results output by the prediction model to obtain the final air quality prediction results.

[0041] In a second aspect, the present invention further provides an air quality monitoring and management system, the system comprising:

[0042] A collection unit, used to collect temperature and humidity data in the sewer through sensors, and to collect environmental images of the sewer through cameras;

[0043] The feature extraction unit is used to extract features from the environment image, use the PCA algorithm to reduce the dimension of the extracted features, fit the reduced features according to the gradient boosting tree algorithm, and select the feature with the greatest correlation from the fitted features as the target feature;

[0044] The prediction unit is used to fuse the temperature and humidity data with the target features and input them into the trained prediction model to obtain the sewer air quality prediction results;

[0045] The purification control unit is used to generate an air purification instruction according to the air quality prediction result, and use the air purification instruction to treat the sewer.

[0046] Preferably, the feature extraction unit is further used for:

[0047] Establish multiple target detection frames, use each target detection frame to extract multi-channel color features from multiple environmental images of the sewer, and generate multiple feature sub-images;

[0048] Calculate the intersection-and-union ratio between any two target detection frames as the correlation between the any two target detection frames; splice multiple feature sub-maps according to the correlation to obtain a target feature map;

[0049] Extract color features, texture features, spectral features and spatial distribution features from the target feature map.

[0050] In a third aspect, the present invention further provides an electronic device comprising: a processor and a memory, wherein the memory is used to store computer program code, wherein the computer program code comprises computer instructions, and when the processor executes the computer instructions, the electronic device executes the method as described in the first aspect above and any possible implementation thereof.

[0051] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by a processor of an electronic device, the processor executes the method as described in the first aspect above and any possible implementation thereof.

[0052] Compared with the prior art, the present invention has the following beneficial effects:

[0053] 1) The present invention collects temperature and humidity data in the sewer through a sensor, and collects environmental images of the sewer through a camera; extracts features from the environmental images, uses the PCA algorithm to reduce the dimension of the extracted features, fits the reduced features according to the gradient boosting tree algorithm, and selects the feature quantity with the greatest correlation from the fitted features as the target feature; fuses the temperature and humidity data with the target feature, and inputs them into a trained prediction model to obtain the sewer air quality prediction result; by extracting features from the environmental images and combining them with the temperature and humidity environment of the sewer, the air quality can be quickly and accurately measured and predicted, and compared with sensors for detecting multiple gas concentrations, it has the advantages of low cost and high precision.

[0054] 2) When performing feature fitting according to the gradient boosting tree algorithm, the present invention mainly calculates the Gini coefficients of different nodes under the decision tree, determines the importance of the features by calculating the change in the Gini coefficient, and then extracts features with high correlation, making the prediction results more accurate.

[0055] 3) The present invention will generate air purification instructions based on the air quality prediction results to treat the sewer, and compensate the air prediction results initially generated through the error prediction model, so as to improve the accuracy of the air quality prediction results, and then improve the rationality of the purification instructions to ensure the safety of the sewer air environment.

[0056] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.

[0058] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.

[0059] Figure 1 A flow chart of an air quality monitoring and management method provided by an embodiment of the present invention;

[0060] Figure 2 The embodiment of the present invention provides Figure 1 A schematic flow chart of the sub-steps of step S20 in FIG.

[0061] Figure 3 A schematic diagram of the structure of an air quality monitoring and management system provided by an embodiment of the present invention;

[0062] Figure 4 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0063] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0064] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

[0065] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.

[0066] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0067] In addition, in order to better illustrate the present invention, numerous specific details are provided in the following specific embodiments. It should be understood by those skilled in the art that the present invention can be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present invention.

[0068] At present, the air quality monitoring of sewers is usually achieved by deploying various types of sensors for detecting the concentration of polluted gases, which is not only costly, but also cannot guarantee the accuracy and is difficult to operate and maintain in the later stage. To this end, the present invention provides an air quality monitoring and management method, which can quickly and accurately obtain air quality prediction results based on the temperature, humidity and environmental images in the environment, and has the advantages of low cost and high accuracy.

[0069] See also Figure 1 , Figure 1 The following is a flow chart of an air quality monitoring and management method provided by an embodiment of the present invention. Figure 1 As shown, an air quality monitoring and management method comprises the following steps:

[0070] S10, collecting temperature and humidity data in the sewer through sensors, and collecting environmental images of the sewer through cameras.

[0071] There are many types of temperature and humidity sensors, such as DHT11, DHT22, SHT11, etc. They all have their own advantages and applicable scenarios. The selection of a suitable sensor can be determined based on the actual situation of the sewer, such as the range of temperature and humidity, environmental conditions and other factors. When installing, it needs to be installed at a key position in the sewer to accurately capture temperature and humidity information.

[0072] Due to the special environment of the sewer, it is necessary to select a waterproof, dustproof and vibration-resistant camera. It also needs to be installed at a key position in the sewer so as to capture the environmental conditions of the sewer in all directions. When acquiring images, you can take pictures at different angles at preset intervals to obtain an environmental image that includes the sewage part and the air part of the sewer. You can also rotate the camera 360 degrees to shoot a video, and then extract the image by framing the video stream.

[0073] S20, extracting features from the environment image, reducing the dimension of the extracted features using the PCA algorithm, fitting the reduced-dimensional features according to the gradient boosting tree algorithm, and selecting the feature with the greatest correlation from the fitted features as the target feature.

[0074] See also Figure 2 In one embodiment, extracting features from an environment image includes the following sub-steps:

[0075] S201, establishing multiple target detection frames, using each target detection frame to perform feature extraction of multi-channel color features on multiple environmental images of the sewer, and generating multiple feature sub-images;

[0076] S202, calculating the intersection-over-union ratio between any two target detection frames as the correlation between any two target detection frames; splicing multiple feature sub-graphs according to the correlation to obtain a target feature graph;

[0077] S203, extracting color features, texture features, spectral features, and spatial distribution features from the target feature map.

[0078] The target detection frame refers to a rectangular frame used to mark the location of the detection object in a picture or video frame. When establishing the target detection frame, first obtain the initial rectangular detection frame and the corresponding polygonal outline; then calculate the first IOU value of the initial detection frame and the polygonal outline. When the first IOU value meets the requirement, calculate the second IOU value of the polygonal outline and the actual outline of the target. When the second IOU value meets the requirement, select the corresponding initial detection frame as the target detection frame.

[0079] It is understandable that when extracting features, if the overall features of a target are extracted, the overall extraction range is large and the granularity is not fine enough, which will easily interfere with the accuracy of the final recognition feature. To this end, this embodiment first uses each target detection frame to extract features from different target areas of the video image, obtains multiple feature sub-maps, and then splices them to obtain the feature extraction map of the target. In this way, compared with the overall extraction of the target, the feature granularity is finer and the feature recognition result will be more accurate.

[0080] When splicing feature sub-maps, it is necessary to first determine the correlation between the two target detection frames. When splicing, the features with high correlation are spliced ​​first, and then the features with the second highest correlation are spliced. Finally, the features without correlation can be discarded to prevent feature interference. Finally, the overall target feature map is obtained through splicing.

[0081] Finally, the color features, texture features, spectral features and spatial distribution features are extracted from the target feature map:

[0082] Color features: Color is one of the most intuitive features of an image. Different sewage may appear in different colors. For example, the degree of turbidity, the chemicals it contains, etc., all of which may affect the color performance.

[0083] Texture features: Texture features reflect the roughness, directionality, and regularity of an image. For example, sewage treatment images have texture features, and the texture features under different working conditions have the characteristics of local sequential repetition, non-random arrangement, and roughly uniform texture areas.

[0084] Spectral signature: Spectral signature refers to the intensity of reflection or emission of an image at different wavelengths. For example, certain chemicals may absorb light at specific wavelengths, which can be reflected by spectral signatures.

[0085] Spatial distribution characteristics: Spatial distribution characteristics describe the spatial position relationship of each pixel or area in the image. For example, some pollutants may gather in a specific spatial location, which can be reflected by spatial distribution characteristics.

[0086] Thus, through the partitioned feature extraction provided by this embodiment, more detailed image features can be extracted; by extracting color, texture, spectrum and spatial distribution features, the model can deeply learn the environmental image features, thereby combining temperature and humidity data to predict the air quality of the sewer. By considering the correlation between different target detection frames, invalid features can be effectively filtered out during feature splicing, reducing noise interference and improving the quality of extracted features.

[0087] Furthermore, since the feature dimension is too high, in one embodiment, the PCA algorithm is used to reduce the dimension of the extracted features, and the reduced features are fitted according to the gradient boosting tree algorithm, and the feature quantity with the greatest correlation is selected from the fitted features as the target feature.

[0088] The PCA algorithm, or principal component analysis, is a commonly used feature dimensionality reduction algorithm that maps the original data to a new low-dimensional space through linear transformation while maintaining the data information. By standardizing the data, calculating the covariance matrix, and then calculating the eigenvalues ​​and eigenvectors, and finally filtering out the principal components and projecting them, the reduced-dimensional data can be obtained.

[0089] In one embodiment, the reduced-dimensional features are fitted according to a gradient boosting tree algorithm, including:

[0090] Assuming that the feature dimensions are m and the number of categories is N, calculate the Gini coefficient of the node in the decision tree:

[0091]

[0092] In the formula, is the Gini coefficient of node v under the kth decision tree; is the proportion of category l under node v;

[0093] Calculate feature x z The change in the Gini coefficient before and after the branch at node v

[0094]

[0095] In the formula, and They are the Gini coefficients of the two new nodes after branching;

[0096] Define feature x z The node set that appears under decision tree k is Q, then x z The importance under the kth decision tree is:

[0097]

[0098] In the formula, z′ is a node in the node set Q;

[0099] Assuming that a total of T trees are generated during the training process, the feature x z The importance among all trees is:

[0100]

[0101] Where V z z ′ is a node in the node set Q; V z z ′ is the feature importance corresponding to each tree;

[0102] Perform normalization operation to obtain feature x z Final importance score of I GBz :

[0103]

[0104] Where V w is the importance of feature dimension w.

[0105] Therefore, the gradient boosting tree algorithm (GBDT) is used to fit the features after dimensionality reduction. The Gini coefficients of different nodes under the decision tree are calculated, and the change in the Gini coefficient is calculated to determine the importance of the features, and then the features with the greatest correlation are selected to make the prediction results more accurate.

[0106] S30: The temperature and humidity data are integrated with the target features and input into the trained prediction model to obtain the sewer air quality prediction result.

[0107] Since temperature and humidity data are meteorological factors that affect sewer air quality, and the extraction of environmental images is mainly to analyze the influencing factors of sewage and pollutants in the air, in this embodiment, the temperature and humidity data are combined with the extracted image features and input into the trained prediction model to quickly obtain the air quality results.

[0108] In one embodiment, preferably, the method further comprises training a prediction model, comprising:

[0109] 1) Obtain some temperature and humidity data obtained from monitoring in historical scenarios and environmental images corresponding to the temperature and humidity as training samples;

[0110] 2) Extract features from the environment images in the training samples, use the PCA algorithm to reduce the dimension of the extracted features, fit the reduced-dimensional features according to the gradient boosting tree algorithm, and select the feature with the greatest correlation from the fitted features;

[0111] 3) The temperature and humidity data are fused with the most relevant feature quantity to train the GRU network model with self-attention mechanism.

[0112] The GRU network extracts information features in a forward manner in chronological order. When an abnormal state occurs, the data will show a recovery trend. If this trend is used in reverse, the abnormal state will be captured more sensitively. The bidirectional gated recurrent unit network BiGRU is composed of a forward GRU and a backward GRU, which can simultaneously extract feature information of the forward and reverse time series. BiGRU has two independent hidden layers, in which the forward hidden layer learns historical information and the reverse hidden layer learns future information, and finally integrates historical and future information as the output result.

[0113] Among them, the expression of the self-attention mechanism is:

[0114]

[0115] In the formula, Q * ,K * ,V * are lookup, key, and value, respectively, Q * K *T To find the similarity with the key, d k The dimension of the key.

[0116] In this embodiment, the structure of self-attention is composed of query, key and value, and the three are equal. It can connect different information of the input sequence and is better at capturing important data. The mechanism is mainly divided into three steps. First, the similarity between each query and key is calculated to obtain the corresponding value; then the weight is normalized using the Softmax function to obtain the weight coefficient; finally, the weight coefficient and the corresponding value are weighted and summed to obtain the final attention value. By adding the self-attention mechanism, the model training can focus more on the important features that affect air quality.

[0117] 4) The loss function is constructed using the root mean square error. If the value of the loss function is greater than the first threshold, the feature quantities with secondary correlation are selected from the fitted features to reconstruct the fusion features and iteratively train the GRU network model until the value of the loss function is less than the first threshold, thereby generating a prediction model.

[0118] Considering that the selected features with greater correlation may have an impact on the prediction accuracy of the training process of the prediction model, in one embodiment, the loss function is first constructed using the root mean square error. It is assumed that the number of iterations has met the requirements, and the value of the loss function is still greater than the first threshold at this time, indicating that there may be a problem with the extracted feature quantity. Therefore, when it is found that the value of the loss function exceeds the first threshold, the feature quantity with secondary correlation can be selected from the fitted features to reconstruct the fusion feature iterative training of the GRU network model. Assuming that after the preset number of trainings, it still exceeds the first threshold, the feature quantity whose importance is ranked behind the secondary feature can continue to be selected according to the correlation, or the target feature can be selected and combined from the feature quantity with the greatest correlation, the secondary, and so on according to the order of importance. Finally, the combined target feature is fused with the temperature and humidity data to train the GRU network until the value of the loss function is less than the first threshold, and the final prediction model is generated.

[0119] In one embodiment, the method further comprises:

[0120] 1) The difference between the original input data and the predicted value of the GRU network output is used as the training set to train the model built based on the SVR algorithm to obtain the error prediction model;

[0121] 2) The features after fusion of temperature and humidity data and target features are input into the error prediction model, and the error prediction model is used to compensate the prediction results output by the prediction model to obtain the final air quality prediction results.

[0122] The SVR algorithm introduces kernel functions and loss functions based on support vector machine (SVM) classification. It maps input data to high-dimensional feature space through a nonlinear mapping function, namely the kernel function, and finds the optimal fitting hyperplane to minimize the total deviation of all training samples from the plane. The regression function expression is as follows:

[0123]

[0124] In the formula, ω is the weight coefficient, is a nonlinear mapping function, and b is an offset.

[0125] By introducing slack variables and minimizing the regularized split criterion, the original regression problem is transformed into an unconstrained quadratic programming problem for modeling.

[0126] In this embodiment, the error prediction model is obtained by training the SVR algorithm; then the features after the temperature and humidity data are fused with the target features are input into the error prediction model to obtain the predicted error value, and the error value is used to compensate for the prediction result of the prediction model based on GRU network training. The error correction can greatly improve the prediction accuracy of the prediction model, thereby assisting the generation of purification instructions and ensuring the air quality safety of the sewer.

[0127] S40: Generate an air purification instruction according to the air quality prediction result, and use the air purification instruction to treat the sewer.

[0128] In summary, the air quality monitoring and management method provided by the embodiment of the present invention can quickly and accurately measure and predict the air quality by extracting the features of the environmental image and combining it with the temperature and humidity environment of the sewer. Compared with the sensors for the detection of multiple gas concentrations, it has the advantages of low cost and high precision. In addition, by calculating the Gini coefficients of different nodes under the decision tree and calculating the change in the Gini coefficient to determine the importance of the features, the features with high correlation are extracted, so that the prediction results are more accurate. Finally, the embodiment of the present invention generates air purification instructions based on the air quality prediction results to process the sewer, and compensates the air prediction results generated at the beginning through the error prediction model, so as to improve the accuracy of the air quality prediction results, thereby improving the rationality of the purification instructions and ensuring the safety of the air environment in the sewer.

[0129] See also Figure 3 In one embodiment of the present invention, an air quality monitoring and management system is also provided, the system comprising:

[0130] The collecting unit 100 is used to collect temperature and humidity data in the sewer through a sensor and collect environmental images of the sewer through a camera;

[0131] The feature extraction unit 200 is used to extract features from the environment image, perform feature dimension reduction on the extracted features using the PCA algorithm, fit the reduced dimension features using the gradient boosting tree algorithm, and select the feature quantity with the greatest correlation from the fitted features as the target feature;

[0132] The prediction unit 300 is used to fuse the temperature and humidity data with the target features and input them into the trained prediction model to obtain the sewer air quality prediction result;

[0133] The purification control unit 400 is used to generate an air purification instruction according to the air quality prediction result, and use the air purification instruction to treat the sewer.

[0134] In a preferred embodiment, the feature extraction unit 200 is further used for:

[0135] Establish multiple target detection frames, use each target detection frame to extract multi-channel color features from multiple environmental images of the sewer, and generate multiple feature sub-images;

[0136] Calculate the intersection-and-union ratio between any two target detection frames as the correlation between the any two target detection frames; splice multiple feature sub-maps according to the correlation to obtain a target feature map;

[0137] Extract color features, texture features, spectral features and spatial distribution features from the target feature map.

[0138] In some embodiments, the functions or modules included in the system provided in this embodiment can be used to execute the method described in the above method embodiment. The specific implementation can refer to the description of the above method embodiment, and for the sake of brevity, it will not be repeated here.

[0139] The present invention also provides an electronic device, comprising: a processor, a sending device, an input device, an output device and a memory, wherein the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes a method as described in any possible implementation manner.

[0140] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a method as described in any possible implementation manner.

[0141] See also Figure 4 , Figure 4 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention.

[0142] The electronic device 2 includes a processor 21, a memory 22, an input device 23, and an output device 24. The processor 21, the memory 22, the input device 23, and the output device 24 are coupled via a connector, and the connector includes various interfaces, transmission lines, or buses, etc., which are not limited in the embodiments of the present invention. It should be understood that in various embodiments of the present invention, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, through various interfaces, transmission lines, buses, etc.

[0143] The processor 21 may be one or more graphics processing units (GPUs). When the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Optionally, the processor 21 may be a processor group consisting of multiple GPUs, and the multiple processors are coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in the embodiments of the present invention.

[0144] The memory 22 can be used to store computer program instructions and various computer program codes including program codes for executing the scheme of the present invention. Optionally, the memory includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or portable read only memory (CD-ROM), which is used for related instructions and data.

[0145] The input device 23 is used to input data and / or signals, and the output device 24 is used to output data and / or signals. The input device 23 and the output device 24 can be independent devices or an integrated device.

[0146] It is understandable that in the embodiment of the present invention, the memory 22 is not only used to store related instructions, and the embodiment of the present invention does not limit the specific data stored in the memory.

[0147] Understandably, Figure 4 Only a simplified design of an electronic device is shown. In practical applications, the electronic device may also include other necessary components, including but not limited to any number of input / output devices, processors, memories, etc., and all video analysis devices that can implement the embodiments of the present invention are within the protection scope of the present invention.

[0148] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0149] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of the various embodiments of the present invention have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, refer to the records of other embodiments.

[0150] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0151] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0152] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0153] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0154] A person skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

Claims

1. An air quality monitoring and management method, characterized in that: The method comprises: The temperature and humidity data in the sewer are collected through sensors, and the environmental images of the sewer are collected through cameras; Extract features from the environment image, use the PCA algorithm to reduce the dimension of the extracted features, fit the reduced features according to the gradient boosting tree algorithm, and select the feature quantity with the greatest correlation from the fitted features as the target feature; extracting features from the environment image includes: Establish multiple target detection frames, use each target detection frame to extract multi-channel color features from multiple environmental images of the sewer, and generate multiple feature sub-images; Calculate the intersection-and-union ratio between any two target detection frames as the correlation between the any two target detection frames; splice multiple feature sub-maps according to the correlation to obtain a target feature map; Extract color features, texture features, spectral features and spatial distribution features from the target feature map; The temperature and humidity data are integrated with the target features and input into the trained prediction model to obtain the sewer air quality prediction result; the prediction model is trained, including: Acquire some temperature and humidity data obtained from monitoring in historical scenarios and environmental images corresponding to the temperature and humidity as training samples; Extract features from the environment images in the training samples, use the PCA algorithm to reduce the dimension of the extracted features, fit the reduced-dimensional features according to the gradient boosting tree algorithm, and select the feature with the greatest correlation from the fitted features; The temperature and humidity data are fused with the most relevant feature quantity to train the GRU network model with self-attention mechanism; A loss function is constructed using the root mean square error. If the value of the loss function is greater than a first threshold, feature quantities with minor correlation are selected from the fitted features to reconstruct the fusion features and iteratively train the GRU network model until the value of the loss function is less than the first threshold, thereby generating a prediction model. An air purification instruction is generated according to the air quality prediction result, and the sewer is treated using the air purification instruction.

2. The air quality monitoring and management method according to claim 1, characterized in that: The step of fitting the reduced-dimensional features according to the gradient boosting tree algorithm includes: Assuming that the feature dimensions are m and the number of categories is N, calculate the Gini coefficient of the node in the decision tree: In the formula, is the Gini coefficient of node v under the kth decision tree; is the proportion of category l under node v; Calculate feature x z The change in the Gini coefficient before and after the branch at node v In the formula, and They are the Gini coefficients of the two new nodes after branching; Define feature x z The node set that appears under decision tree k is Q, then x z The importance under the kth decision tree is: In the formula, z′ is a node in the node set Q; Assuming that a total of T trees are generated during the training process, the feature x z Importance V among all trees z for: In the formula, is the feature importance corresponding to each tree; Perform normalization operation to obtain feature x z Final importance score of I GBz : Where V w is the importance of feature dimension w.

3. The air quality monitoring and management method according to claim 1, characterized in that: The expression of the self-attention mechanism is: In the formula, Q * ,K * ,V * are lookup, key, and value, respectively, Q * K *T To find the similarity with the key, d k The dimension of the key.

4. The air quality monitoring and management method according to claim 1, characterized in that: The method further comprises: The difference between the original input data and the predicted value of the GRU network output is used as the training set to train the model built based on the SVR algorithm to obtain the error prediction model; The features after the temperature and humidity data are fused with the target features are input into the error prediction model, and the error prediction model is used to compensate the prediction results output by the prediction model to obtain the final air quality prediction results.

5. An air quality monitoring and management system, characterized in that: The system comprises: A collection unit, used to collect temperature and humidity data in the sewer through sensors, and to collect environmental images of the sewer through cameras; The feature extraction unit is used to extract features from the environment image, perform feature dimension reduction on the extracted features using the PCA algorithm, fit the reduced-dimensional features according to the gradient boosting tree algorithm, and select the feature quantity with the greatest correlation from the fitted features as the target feature; the feature extraction from the environment image includes: Establish multiple target detection frames, use each target detection frame to extract multi-channel color features from multiple environmental images of the sewer, and generate multiple feature sub-images; Calculate the intersection-and-union ratio between any two target detection frames as the correlation between the any two target detection frames; splice multiple feature sub-maps according to the correlation to obtain a target feature map; Extract color features, texture features, spectral features and spatial distribution features from the target feature map; The prediction unit is used to fuse the temperature and humidity data with the target features and input them into the trained prediction model to obtain the sewer air quality prediction result; training the prediction model includes: Acquire some temperature and humidity data obtained from monitoring in historical scenarios and environmental images corresponding to the temperature and humidity as training samples; Extract features from the environment images in the training samples, use the PCA algorithm to reduce the dimension of the extracted features, fit the reduced-dimensional features according to the gradient boosting tree algorithm, and select the feature with the greatest correlation from the fitted features; The temperature and humidity data are fused with the most relevant feature quantity to train the GRU network model with self-attention mechanism; A loss function is constructed using the root mean square error. If the value of the loss function is greater than a first threshold, feature quantities with minor correlation are selected from the fitted features to reconstruct the fusion features and iteratively train the GRU network model until the value of the loss function is less than the first threshold, thereby generating a prediction model. The purification control unit is used to generate an air purification instruction according to the air quality prediction result, and use the air purification instruction to treat the sewer.

6. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store computer program code, wherein the computer program code includes computer instructions, and when the processor executes the computer instructions, the electronic device executes the air quality monitoring and management method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes the air quality monitoring and management method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Detection method using fusion network based on attention mechanism, and terminal device

    US11222217B1

  • Systems and methods for improved pipeline leak detection

    US20230332976A1