Real-time water level monitoring method based on causal reasoning generative model
By combining causal reasoning generative models and transformer networks, the problems of accuracy and efficiency in water level monitoring in seepage collection wells were solved, achieving efficient and accurate real-time water level monitoring and ensuring the safety of hydropower stations.
Patent Information
- Application Number
- CN202410779762.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-11-01
AI Technical Summary
Existing water level monitoring methods suffer from sensor drift and insufficient data in seepage collection wells, resulting in inaccurate accuracy. Furthermore, the harsh environment makes visual monitoring difficult, making it hard to achieve high-precision real-time water level monitoring.
We adopt a generative model based on causal reasoning, and through data collection, preprocessing, constraint encoding, model training and system development, we use the transformer network model for feature extraction and causal reasoning constraints to improve the diversity and robustness of the model, and combine it with an adversarial generative model for water level identification.
It has improved the accuracy and efficiency of water level monitoring, reduced the demand for human resources, and achieved high-precision real-time water level monitoring, ensuring the safety of hydropower stations.
Smart Images

Figure CN118887597A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of water level monitoring, and in particular to a real-time water level monitoring method based on a causal reasoning generative model. Background Art
[0002] The leakage water of the dam body in the hydropower station will be uniformly gathered in the leakage collection well. When the water depth in the leakage collection well reaches a certain value, it is necessary to start the pumping equipment to pump out the water in the collection well to prevent excessive water storage from affecting the safety of the dam body. Therefore, it is necessary to always monitor the real-time water level value in the leakage collection well in the dam body to prevent various safety accidents. Traditionally, the real-time water level monitoring in the leakage collection well mainly relies on water level sensors for measurement. Since most water level sensors are immersion pressure type, after a period of use, scale and soil will inevitably be attached, causing the measured value to drift, and the actual water level value and the system reading (display) value will have errors. Long-term operation will be detrimental to the normal operation of the pump and the real-time monitoring of the water level in the collection well. There may even be accidents such as the disappearance of the water level analog value, abnormal changes or large deviations, resulting in the failure to start the pump in time and flooding the plant or the drainage pump being burned due to long-term dry pumping. In recent years, with the rapid development of artificial intelligence technology with AI deep learning as the core, real-time water level monitoring technology based on machine vision has gradually been applied to actual dam maintenance work. The existing vision-based water level monitoring method for leaking water collection wells is mainly divided into the following steps: (1) feature extraction of real-time water level monitoring samples of leaking water collection wells; (2) construction of deep learning models; (3) identification of real-time water level values in leaking water collection wells. Through the above method, the labor cost and maintenance risk factor required in the real-time water level monitoring process of leaking water collection wells are reduced to a certain extent, and the accuracy of real-time water level monitoring is improved. Its disadvantage is that in the process of feature extraction and model optimization, due to the small number of real-time water level monitoring data in leaking water collection wells and the harsh environment (unclear lighting, constant fluctuations in water surface, thick fog, etc.), it is difficult to obtain high-definition and effective image data, which makes the entire model training and real-time water level value monitoring prone to errors, thereby affecting the judgment of the real-time accuracy of the water level in the well. At present, the real-time water level monitoring method based on various visual features has received widespread attention, but due to the particularity of the internal environment of the leaking water collection well itself (insufficient lighting conditions, different viewing angles, water level fluctuations, etc.), the existing method still has room for further improvement.
[0003] CN117684956A proposes a real-time monitoring method for the dynamic water level of the pumping wells in an in-situ leaching uranium mine. The invention completes the monitoring of the dynamic water level of each pumping well in the test mining area, provides a basis for studying flow field regulation and reconstruction technical measures, reasonably distributes the leaching agent flow field, improves the pumping conditions of each unit, promotes balanced leaching in the mining area, and solves the common problem of unbalanced leaching in uranium mines.
[0004] CN220625445U proposes a real-time monitoring device for water level in a hydraulic project, comprising a conduit, a base, a slider, a reflection tube and a floating plate, and is used for real-time monitoring of water level in a hydraulic project.
[0005] The problems of the prior art are mainly manifested in the following aspects:
[0006] (1) Water level monitoring devices based on sensors are prone to current drift and silt or impurities clogging the sensors, resulting in errors in sensor accuracy. In addition, the water collection well environment is harsh, with deep wells, high water levels, wet and slippery conditions, and insufficient lighting. When operating or maintenance personnel conduct water level checks or defect handling, there is a risk of falling from heights or drowning.
[0007] (2) Although the traditional machine vision-based method is a significant improvement over the manual observation model, the real-time water level change data in the water collection well is relatively simple, and it is difficult to collect diverse and sufficient data. The insufficient data volume leads to overfitting of the trained model, resulting in insufficient water level monitoring accuracy. In addition, in the water collection well inside the hydropower station dam, due to changes in viewing angle, lighting, and water surface, it is easy to cause differences in viewpoint, brightness, and scale, making it difficult to build existing deep learning models and effectively complete the real-time water level monitoring of the hydropower station's seepage water collection well. Summary of the invention
[0008] The purpose of the present invention is to overcome the above-mentioned shortcomings and provide a real-time water level monitoring method based on a causal reasoning generative model to solve the problems raised in the background technology.
[0009] In order to solve the above technical problems, the technical solution adopted by the present invention is: a real-time water level monitoring method based on a causal reasoning generative model, which comprises the following steps:
[0010] Step 1: Data collection;
[0011] Step 2: Preprocessing;
[0012] Step 3: Constraint encoding;
[0013] Step 4: Model training;
[0014] Step 5: water level determination;
[0015] Step 6: Monitoring test;
[0016] Step 7: System development.
[0017] Preferably, the step 1 is specifically as follows: photographing and collecting the real-time water level value data through a collection device to obtain the real-time water level value data under the actual state; constructing a corresponding data set X according to the model training requirements for the collected data; dividing the data set into multiple batches according to the model training requirements, wherein each batch contains a number of sample images of real-time water level values; in subsequent model training, randomly selecting a number of sample data (images) under different states from the multiple batches in turn, and then training these data; the state data set collected by this operation can be expressed as X={x1,x2,…x i ,…,x N}, where x i Represented as the i-th image sample, N is the total number of data sets.
[0018] Preferably, step 2 specifically comprises: preprocessing the collected water level sample images of the leakage collection well, including random cropping, scaling, enhancement, dehazing, and twisting operations, so as to facilitate subsequent feature extraction and matching, and enhance the robustness of the data and the generalization ability of the model.
[0019] Preferably, the step 3 comprises the following sub-steps:
[0020] 3.1. Generative model construction: Based on the transformer network model, the pre-processed real-time monitoring data of water level in the water collection wells are input into the network model in batches, and the convolution and pooling operations of the image are used to complete the feature extraction of the input image. The specific operation is shown in formula (1), where θ = {W, b} is a parameter, W is a weight set, b is a bias term, f is an extracted feature, and MLP (Multilayer Perceptron, MLP) is a multi-layer perceptron to realize the feature extraction of the input image.
[0021] f=MLP(W T x+b) (1)
[0022] 3.2. Causal reasoning constraint loss: The causal reasoning model is a model that infers and analyzes the causal relationship between events or behaviors. It finds out the corresponding causes and results by observing and analyzing the root causes and occurrence mechanisms of phenomena, so as to predict and control the occurrence and changes of events or behaviors. Based on the collection of real-time water level monitoring data in the water collection well, the constraint model extracts high-dimensional features and produces them on the image data, paying more attention to the causal information corresponding to the results, and trying to ignore the false correlation between the background and the target. The specific model is expressed as formula (2).
[0023] P(Y|X)=P(Y|do(X→Z)) (2)
[0024] Among them, X and Y represent two related variables, that is, X represents the existing data, Y represents the target data to be generated, and Z represents the false related variable. The do operation represents the intervention operation, that is, the variable X is assigned to Z under the intervention condition; the basic idea of the model is to interfere with the false related variable Z of Y and X, so as to cut off the negative interference of Z on X, and to interfere with Z while preserving X to produce the expected target Y; for the input sample x i During the production process, the generated samples present diverse characteristics. The available samples are called positive samples and are expressed as Unavailable negative samples are represented as The specific generation process is shown in the following formulas (3) and (4).
[0025]
[0026] Where T(·) represents a differentiable mask function, ⊙ represents element-by-element multiplication, T(S m (x i )) is the threshold sigmoid function, and its specific expression pattern is shown in formula (5);
[0027]
[0028] Where σ and ω are both greater than zero, representing the threshold and scaling parameters respectively; then the contrast loss functions generated by positive and negative samples in this process are represented by L pos (θ), L neg (θ), as shown in formulas (6) and (7);
[0029]
[0030] Where y is a label, which takes 1 and 0 in this task, l is the expression of the cross entropy loss function, θ is the model parameter, i is the i-th sample, and f(θ) is the generative model; Then the overall generative loss function L CR It is expressed as shown in formula (8);
[0031] L CR =L pos (θ)+L neg (θ) (8)
[0032] Preferably, step 4 comprises the following sub-steps:
[0033] 4.1 Classification training of water level monitoring data: For the obtained water level monitoring sample images and their corresponding label information, the corresponding features are obtained through the transformer model, and the classification loss function is trained, which is specifically expressed as follows: formula (9) and (10), to realize the training module of real-time water level monitoring;
[0034]
[0035] in represents the predicted label, x i It is represented as the i-th image sample, y represents the true label, that is, the true category label, softmax is a commonly used multi-class function, log is a logarithmic function, L ID To identify the loss function;
[0036] 4.2. Framework overall training: The diversity of input samples is completed by using sample feature reconstruction. By combining the above classification loss and reconstruction loss, the overall loss function of the seepage well water level detection coordinated by feature reconstruction and dual discrimination is shown in formula (11);
[0037] L=λ*L ID +(1-λ)*L CR (11)
[0038] Where L is the overall loss function and λ is the hyperparameter that controls classification and reconstruction.
[0039] Preferably, the step 5 comprises the following sub-steps:
[0040] 5.1 Water level recognition: Based on the feature encoding of the real-time water level sample image, the corresponding water level reference value is set to identify the real-time water level. This step uses the latest feature extraction network transformer model as the backbone network, and uses the adversarial generative model to improve the diversity of samples and realize real-time water level recognition.
[0041] Preferably, step 6 comprises the following sub-steps:
[0042] 6.1. Obtain the optimal model through training, use the trained model to extract the feature vectors of all water level sample images in the water collection well, store the vectors for later use in state classification and recognition;
[0043] 6.2. When testing the water level monitoring, the water level image of the water collection well is detected and classified through the softmax function. The corresponding feature vector is input and classified and identified through the classifier. For each input sample object, the real-time identification and monitoring of the water level is completed.
[0044] Preferably, the step 7 comprises the following sub-steps:
[0045] 7.1 System Development: The development of the real-time water level online monitoring software system for the water collection well adopts the microservice architecture and combines the software development process to develop a defect online identification system based on demand analysis, functional system design, implementation development, test application and other links.
[0046] 7.2 Model application: The real-time water level monitoring model trained by this method is transplanted to the corresponding well-developed software platform to implement interface calls and complete the real-time water level monitoring application in the water collection well under actual production scenarios.
[0047] Beneficial effects of the present invention:
[0048] (1) The present invention achieves the best effect by monitoring the real-time water level and constructing a generative model, setting up several loss functions such as encoding, decoding, and constraint discriminator to cooperate with each other; according to the encoding of the input sample features, a causal reasoning method is adopted to constrain the generation and transformation of sample data by the generative model, thereby improving the diversity and nonlinearity of training samples, increasing the stability and robustness of the model, and improving the actual water level monitoring accuracy.
[0049] (2) In addition, the present invention ensures the robustness of the model through double constraints on the original samples and the encoded features, increases the nonlinearity and diversity of the samples from the data level, and compared with the traditional generative model, the present invention adopts constraints based on causal reasoning to effectively control the noise samples appearing in the generative structure; overall, the detection accuracy and efficiency are enhanced, and it has good mobility; the software system developed based on this algorithm can effectively achieve real-time water level monitoring effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a causal reasoning relationship diagram;
[0051] Figure 2 A diagram of the framework for generative water level real-time identification based on causal reasoning. DETAILED DESCRIPTION
[0052] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0053] like Figure 1 and 2As shown, the water level monitoring problem can essentially be regarded as a target recognition and detection problem. Since the actual water level that needs to be monitored is affected by different objective factors such as lighting, scale, viewing angle, and unequal water surface waves, the difficulty of monitoring the actual water level is increased, and due to the small sample size of the objects to be identified, it is difficult to effectively build a sufficiently robust and stable training model. In response to the above problems, the present invention proposes a real-time water level monitoring method based on a causal reasoning generative model; it mainly involves three parts: the acquisition of water level identification data, the construction of a model, and the recognition of real-time water level values. The first part is mainly for data preparation, including real-time monitoring and collection data and constraint-based production data; the second part constructs a corresponding training model, transforms and maps the generated and actual monitoring data features, highlights and enhances them, and performs feature fusion; the third part realizes the monitoring and recognition of real-time water level values by designing a classification loss function, and its specific steps include:
[0054] Step 1: Data collection: Use the collection equipment to capture the real-time water level data and obtain the real-time water level data under the actual state; construct the corresponding data set X according to the model training requirements; divide the data set into multiple batches according to the model training requirements, where each batch contains several sample images of real-time water level values; in the subsequent model training, randomly select several sample data (images) under different states from multiple batches, and then train these data; the state data set collected by this operation can be expressed as X = {x1, x2, ... x i ,…,x N}, where x i Represented as the i-th image sample, N is the total number of data sets.
[0055] In step 1, the data collection of the acquired image samples mainly includes three steps: specific image collection, data screening and clearing, and data set construction. Specifically:
[0056] 1.1 Obtain real-time water level sample data (image or video) in the seepage water collection well. The acquisition is completed through cameras, cameras, sensors and other equipment. The quality of image acquisition directly affects the accuracy of subsequent analysis and detection, so try to complete the acquisition of image and video data from multiple scales and perspectives to obtain data diversity.
[0057] 1.2 Screen and clean the collected data, use operations such as defogging and transformation to remove low-quality images or video sequences and retain high-quality data samples. At the same time, deduplicate data with high similarity to avoid category deviation caused by too many similar defective samples, increase the diversity of data categories, and improve the robustness of the model.
[0058] 1.3 Construct a data set, randomly select a sequence of data samples as a batch, and for a batch of image samples, select as many samples of different viewing angles, scales, etc. as possible to present as many categories as possible.
[0059] Step 2: Preprocessing: The collected water level sample images of the leakage collection well are preprocessed, including random cropping, scaling, enhancement, dehazing, and twisting operations, to facilitate subsequent feature extraction and matching, and enhance the robustness of the data and the generalization ability of the model.
[0060] In step 2, the acquired image data is preprocessed, which mainly includes four steps: image scaling, image cropping, image angle transformation, and image brightness and contrast adjustment. Specifically:
[0061] 2.1 Image Scaling. Image scaling refers to adjusting the size of an image to the desired size. In artificial intelligence applications, image scaling is often used to adjust the image to the size required by the model. There are two methods for image scaling: nearest neighbor interpolation and bilinear interpolation. Nearest neighbor interpolation refers to setting the value of each pixel to the value of the nearest pixel. This method is simple, but it can result in jagged edges in the image. Bilinear interpolation refers to calculating the value of each pixel using the weighted average of the surrounding four pixels. This method can produce smoother images.
[0062] 2.2 Image Cropping. Image cropping refers to cutting off a part of an image. Image cropping is usually used to remove unnecessary parts of an image and reduce redundant information. Image cropping can be achieved by specifying the coordinates of the upper left corner and lower right corner of the image.
[0063] 2.3 Image Angle Transformation. Image rotation refers to rotating an image by a certain angle. Image rotation is often used to increase the diversity of a dataset. Image rotation can be achieved by specifying the rotation angle. Image flipping refers to flipping an image horizontally or vertically. Image flipping is often used to increase the diversity of a dataset. Image flipping can be achieved by specifying the flipping direction. Image translation refers to moving an image horizontally or vertically. Image translation is often used to increase the diversity of a dataset. Image translation can be achieved by specifying the translation distance.
[0064] 2.4 Image brightness and contrast adjustment. Image brightness adjustment refers to adjusting the brightness of an image. Image brightness adjustment is often used to increase the diversity of a dataset. Image brightness adjustment can be achieved by adjusting the RGB value of each pixel. Image contrast adjustment refers to adjusting the contrast of an image. Image contrast adjustment is often used to increase the diversity of a dataset. Image contrast adjustment can be achieved by adjusting the RGB value of each pixel.
[0065] Step 3: Constraint coding; the specific model used is the transformer network model f(θ), where θ is the model parameter and f is the characteristic expression of the water level of the seepage water collection well. The real-time water level value image sample data is feature encoded, and the generative model is constructed based on causal reasoning. Different from the existing methods, the patent of the present invention is based on the transformer model, and the input image samples are segmented and cropped to perform feature encoding on them. The step 3 includes the following sub-steps:
[0066] 3.1. Generative model construction: Based on the transformer network model, the pre-processed real-time monitoring data of water level in the water collection wells are input into the network model in batches, and the convolution and pooling operations of the image are used to complete the feature extraction of the input image. The specific operation is shown in formula (1), where θ = {W, b} is a parameter, W is a weight set, b is a bias term, f is an extracted feature, and MLP (Multilayer Perceptron, MLP) is a multi-layer perceptron to realize the feature extraction of the input image.
[0067] f=MLP(W T x+b) (1)
[0068] 3.2. Causal reasoning constraint loss: The causal reasoning model is a model that infers and analyzes the causal relationship between events or behaviors. It finds out the corresponding causes and results by observing and analyzing the root causes and occurrence mechanisms of phenomena, so as to predict and control the occurrence and changes of events or behaviors. Based on the collection of real-time water level monitoring data in the water collection well, the constraint model extracts high-dimensional features and produces them on the image data, paying more attention to the causal information corresponding to the results, and trying to ignore the false correlation between the background and the target. The specific model is expressed as formula (2).
[0069] P(Y|X)=P(Y|do(X→Z)) (2)
[0070] Among them, X and Y represent two related variables, that is, X represents the existing data, Y represents the target data to be generated, and Z represents the false related variable. The do operation represents the intervention operation, that is, the variable X is assigned to Z under the intervention condition; the basic idea of the model is to interfere with the false related variable Z of Y and X, so as to cut off the negative interference of Z on X, and to interfere with Z while preserving X to produce the expected target Y; for the input sample x i During the production process, the generated samples present diverse characteristics. The available samples are called positive samples and are expressed as Unavailable negative samples are represented as The specific generation process is shown in the following formulas (3) and (4).
[0071]
[0072] Where T(·) represents a differentiable mask function, ⊙ represents element-by-element multiplication, T(S m (x i )) is the threshold sigmoid function, and its specific expression pattern is shown in formula (5);
[0073]
[0074] Where σ and ω are both greater than zero, representing the threshold and scaling parameters respectively; then the contrast loss functions generated by positive and negative samples in this process are represented by L pos (θ), L neg (θ), as shown in formulas (6) and (7);
[0075]
[0076] Where y is a label. In order to simplify the calculation, it mainly takes two labels, 1 and 0, in this task. l is the expression of the cross entropy loss function, θ is the model parameter, i is the i-th sample, and f(θ) is the generation model. Then the overall generative loss function L CR It is expressed as shown in formula (8);
[0077] L CR =L pos (θ)+L neg (θ) (8)
[0078] Step 4: Model training; Since the method of the present invention is based on a combination of supervised and unsupervised methods to complete water level monitoring, the actual monitored water level data has corresponding label information. For each randomly selected batch sample, according to its corresponding information label, we set the corresponding recognition loss function L ID In addition, the present invention uses a causal reasoning-based approach to constrain the generative model. Similarly, we set the corresponding constraint loss function L CR , combining the two to complete the entire real-time water level monitoring framework and perform corresponding model training. Step 4 includes the following sub-steps:
[0079] 4.1 Classification training of water level monitoring data: For the obtained water level monitoring sample images and their corresponding label information, the corresponding features are obtained through the transformer model, and the classification loss function is trained, which is specifically expressed as follows: formula (9) and (10), to realize the training module of real-time water level monitoring;
[0080]
[0081]
[0082] in represents the predicted label, x i It is represented as the i-th image sample, y represents the true label, that is, the true category label, softmax is a commonly used multi-class function, log is a logarithmic function, L ID To identify the loss function;
[0083] 4.2. Framework overall training: The diversity of input samples is completed by using sample feature reconstruction. By combining the above classification loss and reconstruction loss, the overall loss function of the seepage well water level detection coordinated by feature reconstruction and dual discrimination is shown in formula (11);
[0084] L=λ*L ID +(1-λ)*L CR (11)
[0085] Where L is the overall loss function and λ is the hyperparameter that controls classification and reconstruction.
[0086] Step 5: Water level identification: Based on the feature encoding of the real-time water level sample image, the corresponding water level reference value is set as the basis to identify the real-time water level. As above, this step uses the latest feature extraction network transformer model as the backbone network, and uses the adversarial generative model to improve the diversity of samples and realize real-time water level identification.
[0087] Step 6: Monitoring test: After completing the network model optimization training, use the trained model to test the real-time water level value. For each state sample data, its feature vector can be stored in the database. When state monitoring and identification is required, the feature vector of the query image is compared with all sample features in the database to find the real-time water level value and feed it back to the front-end real-time interface. Step 6 includes the following sub-steps:
[0088] 6.1. Obtain the optimal model through training, use the trained model to extract the feature vectors of all water level sample images in the water collection well, store the vectors for later use in state classification and recognition;
[0089] 6.2. When testing the water level monitoring, the water level image of the water collection well is detected and classified through the softmax function. The corresponding feature vector is input and classified and identified through the classifier. For each input sample object, the real-time identification and monitoring of the water level is completed.
[0090] Step 7: System development. After completing the development of the corresponding real-time water level monitoring algorithm, the corresponding model is packaged and connected to the developed software platform to realize the online and portable real-time water level monitoring function. Step 7 includes the following sub-steps:
[0091] 7.1 System Development: The development of the real-time water level online monitoring software system for the water collection well adopts the microservice architecture and combines the software development process to develop a defect online identification system based on demand analysis, functional system design, implementation development, test application and other links.
[0092] 7.2 Model application: The real-time water level monitoring model trained by this method is transplanted to the corresponding well-developed software platform to implement interface calls and complete the real-time water level monitoring application in the water collection well under actual production scenarios.
[0093] The present invention is used for monitoring and identifying the real-time water level value in the leakage collection well of a hydropower station. The present invention focuses on solving the problems of a small number of water level monitoring samples, rapid water level fluctuations, thick fog in the well, extremely dim lighting, and large differences in observation angles and scales. It uses deep learning as a framework to construct an adversarial production model based on causal reasoning, and uses transfer learning thinking as a guide to generate diversified real-time water level monitoring samples. From the perspective of image recognition, it completes the monitoring and identification of the real-time water level of the leakage collection well, improves the work efficiency of the real-time water level observation of the leakage collection well of the hydropower station, ensures that the water level of the leakage collection well is at a safe value, maintains the overall safety of the dam body of the hydropower station, and ensures the safety of national property and the healthy development of the national economy. Its key technical points are mainly reflected in the following aspects:
[0094] (1) Acquisition and transformation preprocessing of real-time water level monitoring data in order to obtain diverse state feature sample data and complete the optimization training of the model.
[0095] (2) The reconstruction and encoding of the real-time water level sample features in the seepage collection well is mainly based on the transformer model to complete the feature extraction, and then the generative model is used to complete the decoding and reconstruction of the features.
[0096] (3) The original input samples and production samples are combined to achieve joint learning of the two modal data and complete real-time water level monitoring and identification.
[0097] Since the real-time water level change state in the water collection well is single, the data sample volume is small, and it is easily affected by objective factors such as illumination, water mist, viewing angle and scale, the design requirements for the model structure are higher. As one of the best feature extraction models currently, transformer is more suitable in this scenario. While ensuring the detection accuracy, it has better recognition accuracy than the commonly used ResNet50 model. In addition, by jointly training and discriminating the input reconstructed samples and original samples, the diversity and nonlinearity of the sample data are increased, which helps to extract the discriminative features of the sample features. Therefore, considering the above factors, the technical solution involved in the present invention is the most cost-effective technical solution at present.
[0098] In general, the algorithm verification and system development and application based on the technology adopted by the patent of this invention have effectively improved the intelligent management efficiency of existing water level monitoring of water level in water collection wells in real-time monitoring applications of water collection wells in actual hydropower stations. In particular, more than 60% of human resources have been saved (previously, 3 teams were required to take turns to keep an eye on the water level in the well. With the current intelligent video monitoring technology based on deep learning, only 1 person is needed to complete the corresponding task).
[0099] The above embodiments are only preferred technical solutions of the present invention and should not be regarded as limiting the present invention. The protection scope of the present invention shall be the technical solutions recorded in the claims, including equivalent replacement solutions of the technical features in the technical solutions recorded in the claims. That is, equivalent replacement improvements within this scope are also within the protection scope of the present invention.
Claims
1. A real-time water level monitoring method based on a causal reasoning generative model, characterized in that: It includes the following steps: Step 1: Data collection; Step 2: Preprocessing; Step 3: Constraint encoding; Step 4: Model training; Step 5: water level determination; Step 6: Monitoring test; Step 7: System development.
2. The real-time water level monitoring method based on a causal reasoning generative model according to claim 1 is characterized in that: The step 1 is specifically as follows: photographing and collecting real-time water level value data through a collection device to obtain real-time water level value data under a real state; constructing a corresponding data set X according to the model training requirements based on the collected data; dividing the data set into multiple batches according to the model training requirements, wherein each batch contains a number of sample images of real-time water level values; during subsequent model training, randomly selecting a number of sample data (images) under different states from the multiple batches in turn, and then training these data; The state data set collected by this operation can be expressed as X = {x1, x2, ... x i ,…,x N }, where x i Represented as the i-th image sample, N is the total number of data sets.
3. The real-time water level monitoring method based on a causal reasoning generative model according to claim 1 is characterized in that: The step 2 is specifically as follows: preprocessing the collected water level sample images of the leakage collection well, including random cropping, scaling, enhancement, defogging, and twisting operations, so as to facilitate subsequent feature extraction and matching, and enhance the robustness of the data and the generalization ability of the model.
4. The real-time water level monitoring method based on a causal reasoning generative model according to claim 1 is characterized in that: The step 3 comprises the following sub-steps: 3.
1. Generative model construction: Based on the transformer network model, the pre-processed real-time monitoring data of water level in the water collection wells are input into the network model in batches, and the convolution and pooling operations of the image are used to complete the feature extraction of the input image. The specific operation is shown in formula (1), where θ = {W, b} is a parameter, W is a weight set, b is a bias term, f is an extracted feature, and MLP (Multilayer Perceptron, MLP) is a multi-layer perceptron to realize the feature extraction of the input image. f=MLP(WTx+b) (1) 3.
2. Causal reasoning constraint loss: The causal reasoning model is a model that infers and analyzes the causal relationship between events or behaviors. It finds out the corresponding causes and results by observing and analyzing the root causes and occurrence mechanisms of phenomena, so as to predict and control the occurrence and changes of events or behaviors. Based on the collection of real-time water level monitoring data in the water collection well, the constraint model extracts high-dimensional features and produces them on the image data, paying more attention to the causal information corresponding to the results, and trying to ignore the false correlation between the background and the target. The specific model is expressed as formula (2). P(Y|X)=P(Y|do(X→Z)) (2) Among them, X and Y represent two related variables, that is, X represents the existing data, Y represents the target data to be generated, and Z represents the false related variable. The do operation represents the intervention operation, that is, the variable X is assigned to Z under the intervention condition; the basic idea of the model is to interfere with the false related variable Z of Y and X, so as to cut off the negative interference of Z on X, and to interfere with Z while preserving X to produce the expected target Y; for the input sample x i During the production process, the generated samples present diverse characteristics. The available samples are called positive samples and are expressed as Unavailable negative samples are represented as The specific generation process is shown in the following formulas (3) and (4). Where T(·) represents a differentiable mask function, ⊙ represents element-by-element multiplication, T(S m (x i )) is the threshold sigmoid function, and its specific expression pattern is shown in formula (5); Where σ and ω are both greater than zero, representing the threshold and scaling parameters respectively; then the contrast loss functions generated by positive and negative samples in this process are represented by L pos (θ), L neg (θ), as shown in formulas (6) and (7); Where y is a label, which takes 1 and 0 in this task, l is the expression of the cross entropy loss function, θ is the model parameter, i is the i-th sample, and f(θ) is the generative model; Then the overall generative loss function L CR It is expressed as shown in formula (8); L CR =L pos (θ)+L neg (i) (8) 5. The real-time water level monitoring method based on a causal reasoning generative model according to claim 1 is characterized in that: The step 4 comprises the following sub-steps: 4.1 Classification training of water level monitoring data: For the obtained water level monitoring sample images and their corresponding label information, the corresponding features are obtained through the transformer model, and the classification loss function is trained, which is specifically expressed as follows: formula (9) and (10), to realize the training module of real-time water level monitoring; in represents the predicted label, x i It is represented as the i-th image sample, y represents the true label, that is, the true category label, softmax is a commonly used multi-class function, log is a logarithmic function, L ID To identify the loss function; 4.
2. Framework overall training: The diversity of input samples is completed by using sample feature reconstruction. By combining the above classification loss and reconstruction loss, the overall loss function of the seepage well water level detection coordinated by feature reconstruction and dual discrimination is shown in formula (11); L=λ*L ID +(1-λ)*L CR (11) Where L is the overall loss function and λ is the hyperparameter that controls classification and reconstruction.
6. A real-time water level monitoring method based on a causal reasoning generative model according to claim 1, characterized in that: The step 5 comprises the following sub-steps: 5.1 Water level recognition: Based on the feature encoding of the real-time water level sample image, the corresponding water level reference value is set to identify the real-time water level. This step uses the latest feature extraction network transformer model as the backbone network, and uses the adversarial generative model to improve the diversity of samples and realize real-time water level recognition.
7. The real-time water level monitoring method based on a causal reasoning generative model according to claim 1 is characterized in that: The step 6 comprises the following sub-steps: 6.
1. Obtain the optimal model through training, use the trained model to extract the feature vectors of all water level sample images in the water collection well, store the vectors for later use in state classification and recognition; 6.
2. When testing the water level monitoring, the water level image of the water collection well is detected and classified through the softmax function. The corresponding feature vector is input and classified and identified through the classifier. For each input sample object, the real-time identification and monitoring of the water level is completed.
8. The real-time water level monitoring method based on a causal reasoning generative model according to claim 1 is characterized in that: The step 7 comprises the following sub-steps: 7.1 System Development: The development of the real-time water level online monitoring software system for the water collection well adopts the microservice architecture and combines the software development process to develop a defect online identification system based on demand analysis, functional system design, implementation development, test application and other links. 7.2 Model application: The real-time water level monitoring model trained by this method is transplanted to the corresponding well-developed software platform to implement interface calls and complete the real-time water level monitoring application in the water collection well under actual production scenarios.
Citation Information
Cited By
Industrial time sequence event analysis method and device based on causal regularization and medium
CN120654104A
