Intelligent medical wastewater treatment online quality monitoring method

Through the intelligent online quality monitoring method of medical wastewater treatment, sensors are used to collect data in real time and build deep learning models for prediction, the problem of inefficiency of traditional monitoring methods is solved, real-time and accurate wastewater quality monitoring and prediction is achieved, and the timeliness and accuracy of treatment effects is improved.

CN119804808AInactive Publication Date: 2025-04-11HUNAN JIECHENG ENVIRONMENTAL PROTECTION TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510307763.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-04-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional medical wastewater treatment monitoring methods are inefficient, difficult to achieve continuous and dynamic monitoring, and cannot fully utilize historical data for prediction, resulting in lag and blindness of treatment measures.

Method used

Intelligent online quality monitoring method for medical wastewater treatment is adopted, and water quality data is collected in real time by installing sensors in medical wastewater treatment facilities, and data is transmitted to the central monitoring platform using wireless communication technology to perform data pre-treatment and feature extraction. Then, a deep learning-based CNN-LSTM hybrid model is built, historical data is trained, wastewater quality prediction model is built, and the model is deployed in the online monitoring system to monitor and analyze wastewater data in real time, set early warning thresholds, and abnormal diagnosis and parameter adjustments are performed.

Benefits of technology

Real-time and accurate medical wastewater quality monitoring is achieved, the timeliness and accuracy of treatment effects is improved, the lag and blindness of treatment measures is reduced, and the prediction accuracy of wastewater treatment quality and the stability of monitoring system are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119804808A_ABST
    Figure CN119804808A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent medical wastewater treatment online quality monitoring method. According to the method, the CNN-LSTM hybrid model is adopted, so that remarkable beneficial effects are shown. The construction of the CNN module can effectively extract local features in time sequence data, such as short-term fluctuation of water quality indexes, which is difficult to capture by a traditional method. The application of the pooling layer not only reduces the feature dimension, but also retains the key information, reduces the calculation complexity, and improves the processing efficiency. The construction of an LSTM module enables a model to capture a long-term dependency relationship in time sequence data, such as seasonal change or periodic trend, which is difficult to realize by a traditional time sequence analysis method. Through fusion of CNN and LSTM, the model realizes organic combination of feature extraction and time sequence modeling, not only retains local details, but also considers an overall trend, so that the beneficial effects of improving prediction accuracy, simplifying a calculation process and ensuring long-term stability are achieved, and powerful technical support is provided for intelligent medical wastewater treatment online quality monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of medical wastewater treatment, and specifically relates to an intelligent online quality monitoring method for medical wastewater treatment. Background Art

[0002] With the continuous development of the medical industry, the problem of medical wastewater treatment has become increasingly prominent. Medical wastewater contains a large amount of harmful substances. If it is discharged directly without effective treatment, it will cause serious harm to the environment and public health. Therefore, it has become an urgent need in the field of environmental protection and public health to treat medical wastewater efficiently and safely and ensure that it meets the discharge standards. In the process of medical wastewater treatment, real-time and accurate monitoring is the key link to ensure the treatment effect.

[0003] However, traditional monitoring methods mainly rely on manual sampling and laboratory analysis, which is not only inefficient but also difficult to achieve continuous and dynamic monitoring. In addition, these methods have limitations in data analysis and processing, and cannot fully utilize historical data to predict wastewater quality, resulting in lag and blindness in treatment measures. Summary of the invention

[0004] The purpose of the present invention is to provide an intelligent online quality monitoring method for medical wastewater treatment in order to solve the above-mentioned problems.

[0005] The technical solution adopted by the present invention is as follows: an intelligent online quality monitoring method for medical wastewater treatment, the method comprising the following steps: S1: Use sensors installed in medical wastewater treatment facilities to collect water quality data in real time, including key indicators such as pH value, chemical oxygen demand, biological oxygen demand, suspended solids, and ammonia nitrogen; transmit the collected data to the central monitoring platform through wireless communication technology; S2: Preprocess the data transmitted to the central monitoring platform, including data cleaning, denoising and normalization, to ensure the validity and accuracy of the data; S3: Extract features from the pre-processed data to identify the characteristic variables that have the greatest impact on wastewater quality; select the most representative and discriminative feature subsets through feature selection algorithms; S4: Using deep learning technology, a mixture of convolutional neural networks and long short-term memory networks is used to build a model, train historical data, and build a wastewater quality prediction model; S5: Deploy the trained model to the online monitoring system to monitor and analyze the wastewater data transmitted in real time; set the warning threshold. Once the monitoring data exceeds the preset threshold, the system will immediately issue a warning message to notify relevant personnel to handle it; S6: When the system issues an early warning, the abnormality diagnosis module is started to conduct in-depth analysis of the abnormal data to determine the cause and location of the abnormality; the abnormality diagnosis results are displayed using data visualization technology to help operators quickly locate the problem; S7: Automatically or manually adjust the operating parameters of the wastewater treatment facility based on the abnormal diagnosis results; S8: The system automatically generates wastewater treatment quality monitoring reports, including real-time data, early warning information, abnormal diagnosis results and adjustment measures; and stores the reports in a database for subsequent query and analysis; S9: Regularly update and maintain the monitoring system, including software upgrades, hardware maintenance and sensor calibration, to ensure stable operation of the system and accuracy of monitoring data; continuously optimize and improve monitoring methods based on actual operating conditions and technological developments.

[0006] In a preferred embodiment, in step S1, the pH sensor adopts an industrial-grade sensor of model pH-100, with a measuring range of 0-14 and an accuracy of ±0.01; the COD sensor is COD-200, with a measuring range of 0-1000 mg / L and an accuracy of ±5%; the BOD sensor is BOD-150, with a measuring range of 0-1000 mg / L and an accuracy of ±5%; the SS sensor is SS-120, with a measuring range of 0-1000 mg / L and an accuracy of ±5%; the ammonia nitrogen sensor is NH3-N-110, with a measuring range of 0-100 mg / L and an accuracy of ±2%; these sensors collect data once a minute, and package the data in JSON format through the built-in Wi-Fi module, and transmit it to the central monitoring platform through the HTTP protocol; the data packet contains a timestamp, the readings of each sensor and the device status information to ensure the integrity and real-time nature of the data.

[0007] In a preferred embodiment, in step S2, data preprocessing is divided into three sub-steps; first, data cleaning is performed by calculating the Z-score to identify outliers, the formula is: Z=X-μ / σ, where X is a single data point, μ is the mean, and σ is the standard deviation; if |Z|>3, it is determined to be an outlier and is eliminated; missing values ​​are filled by linear interpolation; secondly, denoising is performed by using the Symlets8 basis function of the wavelet transform to perform a 5-layer decomposition, retaining the low-frequency components, and reconstructing the denoised data; finally, normalization uses the minimum-maximum normalization method to scale the data to the [0,1] interval, the formula is Xnorm=(X-Xmin) / (Xmax-Xmin), where Xmin and Xmax are the minimum and maximum values ​​of the data, respectively.

[0008] In a preferred embodiment, in step S3, PCA is first used for feature extraction, and the principal components with a cumulative contribution rate of 95% are retained; then, a tree-based feature selection method, specifically a random forest classifier, is used to screen features by calculating the importance scores of the features; the importance scores are based on the reduction in Gini impurity, and the features with the top 10 importance scores are selected as the final feature subset.

[0009] In a preferred embodiment, in step S4, the specific process includes: S4-1. Data preparation: Collect historical medical wastewater treatment data, including time series data and static data; normalize the data to make the input data range consistent; S4-2. Construct CNN module: design convolutional layers to extract local features from time series data; use pooling layers to reduce feature dimensions and retain important information; S4-3. Constructing LSTM modules: Designing LSTM layers to capture long-term dependencies in time series data; LSTM units can remember past information and make predictions about the future; S4-4. Fusion of CNN and LSTM: Using the output of CNN as the input of LSTM to achieve the fusion of feature extraction and time series modeling; S4-5. Add a fully connected layer: Add a fully connected layer after LSTM to output the final prediction result; S4-6. Model training: Use historical data to train the model and optimize the model parameters through the back propagation algorithm; use the loss function to measure the difference between the predicted value and the true value; S4-7. Model evaluation and optimization: Use the validation set to evaluate model performance, such as accuracy and recall; adjust the model structure or parameters based on the evaluation results, such as increasing the number of CNN layers and adjusting the number of LSTM units; The calculation formula of the convolutional layer of the convolutional neural network is: ; in Represents the convolution output of the lth layer; Represents the convolution kernel weight of the lth layer, which is used to identify specific features; Represents the input feature map of the l-1th layer, that is, the data output by the previous layer; Represents the bias term of the lth layer, which is used to adjust the output; ” indicates a convolution operation; The core formula of LSTM unit includes: Cell state update formula: Ct=ft⊙Ct-1+it⊙Ct~; Hidden state update formula: ht=ot⊙tanh(Ct); Where Ct represents the cell state at the current moment and stores long-term information; ft represents the output of the forget gate, which determines how much past information is retained; it represents the output of the input gate, which determines how much new information is added; Ct~ represents the candidate cell state, which is used to update the cell state; ht represents the hidden state at the current moment, which is used for output and transmission to the next layer; ot represents the output of the output gate, which determines how much information is output in the current cell state; ⊙ represents element multiplication, which means multiplication of corresponding elements; Tanh represents the hyperbolic tangent activation function, which compresses the value between -1 and 1; The calculation formula of the fully connected layer is: Y = Wf·H+bf; Where Y represents the final prediction output, that is, the predicted value of wastewater quality; Wf represents the fully connected layer weight matrix, which is used to map the LSTM output to the predicted value; H represents the output of the LSTM module, which contains the long-term dependency information of the time series; bf represents the fully connected layer bias term, which is used to adjust the output.

[0010] In a preferred embodiment, in step S5, the trained CNN-LSTM hybrid model is deployed to an online monitoring system based on TensorFlow Serving; the model input is the wastewater data transmitted in real time, and the output is the predicted value of wastewater quality in the next hour; the warning threshold is set according to the upper limit of the 95% confidence interval of historical data, such as the COD warning threshold is set to 120 mg / L; the real-time monitoring system uses Apache Kafka as the data access layer, and Spark Streaming performs real-time data processing and analysis; the warning information is notified to relevant personnel in the form of SMS and email through the AWS SNS service to ensure timely response; the system is deployed on an AWS EC2 instance to ensure high availability and scalability.

[0011] In a preferred embodiment, in step S6, the anomaly diagnosis module adopts the Isolation Forest algorithm, and the key parameters include the number of n_estimators trees, which is set to 100, the number of max_samples samples, which is set to 256, and the contamination anomaly ratio, which is set to 0.01; the anomaly score threshold is set to 0.5, and data points with scores below this threshold are considered anomalies.

[0012] In a preferred embodiment, in step S7, according to the abnormal diagnosis result, the system automatically adjusts the operating parameters of the wastewater treatment facility including: the dosage of chemical additives and the aeration volume to restore the wastewater treatment effect; and monitors the adjusted treatment effect in real time to ensure that the wastewater quality meets the standards.

[0013] In a preferred embodiment, in step S8, the report is in PDF format and is generated by Python's ReportLab library; the report structure includes: Cover: report title, generation time, name of medical institution; Abstract: A brief overview of wastewater treatment during the monitoring period; Real-time data: Displays real-time data of key water quality indicators in tables and charts; Warning information: lists all warning information triggered during the monitoring period, including warning indicators, warning values, and triggering time; Abnormal diagnosis results: Displays abnormal data points detected by the Isolation Forest algorithm and possible abnormal cause analysis; Parameter adjustment record: record in detail all parameter adjustment operations during the monitoring period, including adjustment parameters, values ​​before and after adjustment, and adjustment time; Effect evaluation: By comparing the changes in water quality indicators before and after the adjustment, the impact of parameter adjustment on wastewater treatment effect can be evaluated; Conclusion and Recommendations: Based on the monitoring data and analysis results, recommendations for improving the wastewater treatment process are proposed.

[0014] In a preferred embodiment, in step S9, the software update includes: regularly checking updates of TensorFlow, Keras, and sklearn libraries to ensure that the latest versions are used to obtain performance improvements and security enhancements; Hardware maintenance includes: sensor calibration is performed once a quarter, using standard solutions to calibrate the sensor to ensure measurement accuracy.

[0015] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: 1. In the present invention, the CNN-LSTM hybrid model used shows significant beneficial effects. First, the consistency of the input data is ensured through the normalization process in the data preparation stage, which provides a stable foundation for subsequent model training. The construction of the CNN module can effectively extract local features in time series data, such as short-term fluctuations in water quality indicators, which are difficult to capture by traditional methods. The application of the pooling layer not only reduces the feature dimension, but also retains key information, reduces the computational complexity, and improves processing efficiency. The construction of the LSTM module enables the model to capture long-term dependencies in time series data, such as seasonal changes or cyclical trends, which are difficult to achieve with traditional time series analysis methods. By integrating CNN and LSTM, the model realizes the organic combination of feature extraction and time series modeling, which not only retains local details, but also considers the overall trend, greatly improving the accuracy of the prediction. After adding the fully connected layer, the model can map complex time series features to the final prediction results, realizing the direct conversion from data to predicted values. The back propagation algorithm is used to optimize the parameters in the model training stage to ensure the best fit of the model on historical data, while the choice of the loss function ensures the minimum difference between the predicted value and the true value.

[0016] 2. In the present invention, in the model evaluation and optimization stage, by using the validation set to evaluate the model performance, such as accuracy, recall and other indicators, the deficiencies of the model can be discovered in time and adjusted. This iterative optimization process enables the model to continuously adapt to new data features and changing trends, and maintains long-term monitoring accuracy. The convolution layer calculation formula of the convolutional neural network recognizes specific features through the convolution kernel weights, and the bias term adjusts the output, thereby realizing deep mining of complex water quality data. The core formula of the LSTM unit effectively manages the information flow through the collaborative work of the forget gate, input gate and output gate, so that the model can remember important information for a long time and forget irrelevant information, thereby improving the stability and reliability of the prediction. The fully connected layer maps the time series information output by the LSTM to the final wastewater quality prediction value. This direct mapping relationship simplifies the prediction process and reduces the error accumulation in the intermediate links. Thus, the method improves the prediction accuracy, enhances the model adaptability, simplifies the calculation process and ensures the beneficial effects of long-term stability, providing strong technical support for intelligent online quality monitoring of medical wastewater treatment. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 The figure is a schematic diagram of the process principle of the method of the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0019] Example: Reference Figure 1 , An intelligent online quality monitoring method for medical wastewater treatment, the method comprising the following steps: S1: Use sensors installed in medical wastewater treatment facilities to collect water quality data in real time, including key indicators such as pH value, chemical oxygen demand (COD), biological oxygen demand (BOD), suspended solids (SS), and ammonia nitrogen. Transmit the collected data to the central monitoring platform through wireless communication technology; S2: Preprocess the data transmitted to the central monitoring platform, including data cleaning, denoising and normalization, to ensure the validity and accuracy of the data; S3: Extract features from the pre-processed data to identify the characteristic variables that have the greatest impact on wastewater quality. Use feature selection algorithms to select the most representative and discriminative feature subsets; S4: Using deep learning technology, a mixture of convolutional neural network (CNN) and long short-term memory network (LSTM) was used to build a model, train historical data, and construct a wastewater quality prediction model; S5: Deploy the trained model to the online monitoring system to monitor and analyze the real-time transmitted wastewater data. Set the warning threshold. Once the monitoring data exceeds the preset threshold, the system will immediately issue a warning message to notify relevant personnel to handle it; S6: When the system issues an early warning, the abnormal diagnosis module is activated to conduct in-depth analysis of the abnormal data to determine the cause and location of the abnormality. The abnormal diagnosis results are displayed using data visualization technology to help operators quickly locate the problem; S7: According to the abnormal diagnosis results, automatically or manually adjust the operating parameters of the wastewater treatment facilities, such as the dosage of chemical additives, aeration volume, etc., to restore the wastewater treatment effect. Real-time monitoring of the adjusted treatment effect to ensure that the wastewater quality meets the standards; S8: The system automatically generates wastewater treatment quality monitoring reports, including real-time data, early warning information, abnormal diagnosis results and adjustment measures, etc. The reports are stored in the database for subsequent query and analysis; S9: Regularly update and maintain the monitoring system, including software upgrades, hardware overhauls, and sensor calibration, to ensure stable operation of the system and accuracy of monitoring data. Continuously optimize and improve monitoring methods based on actual operating conditions and technological developments.

[0020] In step S1, the pH sensor uses an industrial-grade sensor of model pH-100, with a measuring range of 0-14 and an accuracy of ±0.01; the COD sensor is COD-200, with a measuring range of 0-1000mg / L and an accuracy of ±5%; the BOD sensor is BOD-150, with a measuring range of 0-1000mg / L and an accuracy of ±5%; the SS sensor is SS-120, with a measuring range of 0-1000mg / L and an accuracy of ±5%; the ammonia nitrogen sensor is NH3-N-110, with a measuring range of 0-100mg / L and an accuracy of ±2%. These sensors collect data once a minute, and package the data in JSON format through the built-in Wi-Fi module, and transmit it to the central monitoring platform through the HTTP protocol. The data packet contains timestamps, sensor readings, and device status information to ensure data integrity and real-time performance.

[0021] In step S2, data preprocessing is divided into three sub-steps. First, data cleaning is performed by calculating the Z-score to identify outliers, and the formula is: Z=X-μ / σ, where X is a single data point, μ is the mean, and σ is the standard deviation. If |Z|>3, it is determined to be an outlier and is eliminated. Missing values ​​are filled using linear interpolation. Secondly, denoising uses the Symlets8 basis function of the wavelet transform to perform a 5-layer decomposition, retain the low-frequency components, and reconstruct the denoised data. Finally, normalization uses the minimum-maximum normalization method to scale the data to the [0,1] interval, and the formula is Xnorm=X-Xmin / Xmax-Xmin, where Xmin and Xmax are the minimum and maximum values ​​of the data, respectively.

[0022] In step S3, PCA is first used for feature extraction, and the principal components with a cumulative contribution rate of 95% are retained. Then, a tree-based feature selection method, specifically a random forest classifier, is used to screen features by calculating the importance score of the features. The importance score is based on the reduction in Gini impurity, and the top 10 features with the importance score are selected as the final feature subset. This process is implemented using Python's sklearn library, and the key parameters include n_estimators (the number of trees, set to 100), max_features (the number of features, set to sqrt(n_features)), and random_state (random seed, set to 42).

[0023] In step S4, the specific process includes: S4-1. Data preparation: Collect historical medical wastewater treatment data, including time series data (such as daily water quality indicators) and static data (such as treatment facility parameters). Normalize the data to make the input data range consistent.

[0024] S4-2. Construct CNN module: Design convolutional layers to extract local features from time series data. Use pooling layers to reduce feature dimensions and retain important information.

[0025] S4-3. Construct LSTM modules: Design LSTM layers to capture long-term dependencies in time series data. LSTM units can remember past information and make predictions about the future.

[0026] S4-4. Fusion of CNN and LSTM: The output of CNN is used as the input of LSTM to achieve the fusion of feature extraction and time series modeling.

[0027] S4-5. Add a fully connected layer: Add a fully connected layer after LSTM to output the final prediction result.

[0028] S4-6. Model training: Use historical data to train the model and optimize the model parameters through the back propagation algorithm. Use the loss function (such as mean square error) to measure the difference between the predicted value and the true value.

[0029] S4-7. Model evaluation and optimization: Use the validation set to evaluate model performance, such as accuracy, recall, etc. Adjust the model structure or parameters based on the evaluation results, such as increasing the number of CNN layers and adjusting the number of LSTM units; The calculation formula of the convolutional layer of the convolutional neural network is: ; in Represents the convolution output of the lth layer; Represents the convolution kernel weight of the lth layer, which is used to identify specific features; Represents the input feature map of the l-1th layer, that is, the data output by the previous layer; Represents the bias term of the lth layer, which is used to adjust the output; ” indicates a convolution operation; The core formula of LSTM unit includes: Cell state update formula: Ct=ft⊙Ct-1+it⊙Ct~; Hidden state update formula: ht=ot⊙tanh(Ct); Where Ct represents the cell state at the current moment and stores long-term information.

[0030] ft represents the output of the forget gate, which determines how much past information is retained.

[0031] it represents the output of the input gate and determines how much new information is added.

[0032] Ct~ represents the candidate cell state and is used to update the cell state.

[0033] ht represents the hidden state at the current moment, which is used for output and passing to the next layer.

[0034] ot represents the output gate output, which determines how much information is output by the current cell state.

[0035] ⊙ represents element multiplication, which means the corresponding elements are multiplied.

[0036] Tanh represents the hyperbolic tangent activation function, which compresses the value between -1 and 1; The calculation formula of the fully connected layer is: Y = Wf·H+bf; Where Y represents the final prediction output, i.e., the predicted value of wastewater quality. Wf represents the weight matrix of the fully connected layer, which is used to map the LSTM output to the predicted value. H represents the output of the LSTM module, which contains the long-term dependency information of the time series. bf represents the bias term of the fully connected layer, which is used to adjust the output.

[0037] In step S5, the trained CNN-LSTM hybrid model is deployed to the online monitoring system based on TensorFlow Serving. The model input is the wastewater data transmitted in real time, and the output is the predicted value of wastewater quality in the next hour. The warning threshold is set according to the upper limit of the 95% confidence interval of historical data, such as the COD warning threshold is set to 120 mg / L. The real-time monitoring system uses Apache Kafka as the data access layer, and Spark Streaming is used for real-time data processing and analysis. The warning information is notified to relevant personnel in the form of SMS and email through the AWS SNS service to ensure timely response. The system is deployed on AWS EC2 instances to ensure high availability and scalability.

[0038] In step S6, the abnormal diagnosis module uses the Isolation Forest algorithm, and the key parameters include n_estimators (the number of trees, set to 100), max_samples (the number of samples, set to 256) and contamination (the abnormal proportion, set to 0.01). The abnormal score threshold is set to 0.5, and data points with scores below this threshold are considered abnormal. Data visualization uses Matplotlib and Seaborn libraries to generate time series graphs to show the trend of indicator changes, scatter plots to show the distribution of abnormal data, and heat maps to show feature correlation. The visualization results are displayed on the monitoring interface through the Flask Web framework, and operators can view and analyze them in real time.

[0039] In step S7, the system automatically adjusts the operating parameters of the wastewater treatment facility according to the abnormal diagnosis result.

[0040] In step S8, the report is in PDF format and is generated using Python's ReportLab library. The report structure includes: Cover: report title, generation time, and name of medical institution.

[0041] Abstract: Provides a brief overview of wastewater treatment during the monitoring period.

[0042] Real-time data: Displays real-time data of key water quality indicators in the form of tables and charts.

[0043] Warning information: Lists all warning information triggered during the monitoring period, including warning indicators, warning values, and triggering time.

[0044] Abnormal diagnosis results: Displays abnormal data points detected by the Isolation Forest algorithm and possible abnormal cause analysis.

[0045] Parameter adjustment record: Detailed record of all parameter adjustment operations during the monitoring period, including adjustment parameters, values ​​before and after adjustment, and adjustment time.

[0046] Effect evaluation: By comparing the changes in water quality indicators before and after adjustment, the impact of parameter adjustment on wastewater treatment effect is evaluated.

[0047] Conclusion and Recommendations: Based on the monitoring data and analysis results, recommendations for improving the wastewater treatment process are proposed.

[0048] In step S9, software updates include: regularly checking updates of libraries such as TensorFlow, Keras, and sklearn to ensure that the latest versions are used to obtain performance improvements and security enhancements. The update process includes verifying the functionality and compatibility of the new version in a test environment and then deploying it to a production environment. At the same time, the CNN-LSTM hybrid model is iteratively optimized based on actual operation conditions, such as adjusting the network structure and optimizing hyperparameters.

[0049] Hardware maintenance includes: sensor calibration is performed once a quarter, using standard solutions to calibrate the sensor to ensure measurement accuracy. Hardware overhaul includes checking the operating status of equipment such as sensors, communication modules and servers, and replacing faulty parts. Maintenance records are managed through the management system of the central monitoring platform for easy tracking and maintenance plan formulation.

[0050] In the present invention, the CNN-LSTM hybrid model used shows significant beneficial effects. First, the consistency of input data is ensured through normalization processing in the data preparation stage, providing a stable foundation for subsequent model training. Constructing a CNN module can effectively extract local features in time series data, such as short-term fluctuations in water quality indicators, which are difficult to capture with traditional methods. The application of the pooling layer not only reduces the feature dimension, but also retains key information, reduces computational complexity, and improves processing efficiency. The construction of the LSTM module enables the model to capture long-term dependencies in time series data, such as seasonal changes or cyclical trends, which are difficult to achieve with traditional time series analysis methods. By fusing CNN and LSTM, the model realizes the organic combination of feature extraction and time series modeling, retains local details, and considers the overall trend, greatly improving the accuracy of prediction. After adding the fully connected layer, the model can map complex time series features to the final prediction results, realizing the direct conversion from data to predicted values. The back propagation algorithm is used to optimize parameters in the model training stage to ensure the best fit of the model on historical data, while the choice of the loss function ensures the minimum difference between the predicted value and the true value.

[0051] In the present invention, in the model evaluation and optimization stage, by using the validation set to evaluate the model performance, such as accuracy, recall and other indicators, the deficiencies of the model can be discovered in time and adjusted. This iterative optimization process enables the model to continuously adapt to new data features and changing trends, and maintains long-term monitoring accuracy. The convolution layer calculation formula of the convolutional neural network recognizes specific features through the convolution kernel weight, and the bias term adjusts the output, thereby realizing deep mining of complex water quality data. The core formula of the LSTM unit effectively manages the information flow through the collaborative work of the forget gate, input gate and output gate, so that the model can remember important information for a long time and forget irrelevant information, thereby improving the stability and reliability of the prediction. The fully connected layer maps the time series information output by the LSTM to the final wastewater quality prediction value. This direct mapping relationship simplifies the prediction process and reduces the error accumulation in the intermediate links. Thus, the method improves the prediction accuracy, enhances the model adaptability, simplifies the calculation process and ensures the beneficial effects of long-term stability, and provides strong technical support for intelligent online quality monitoring of medical wastewater treatment.

[0052] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0053] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. Intelligent online quality monitoring method for medical wastewater treatment, characterized by: The method comprises the following steps: S1: Use sensors installed in medical wastewater treatment facilities to collect water quality data in real time, including key indicators such as pH value, chemical oxygen demand, biological oxygen demand, suspended solids, and ammonia nitrogen; transmit the collected data to the central monitoring platform through wireless communication technology; S2: Preprocess the data transmitted to the central monitoring platform, including data cleaning, denoising and normalization, to ensure the validity and accuracy of the data; S3: Extract features from the pre-processed data to identify the characteristic variables that have the greatest impact on wastewater quality; Use feature selection algorithms to select the most representative and discriminative feature subsets; S4: Using deep learning technology, a mixture of convolutional neural networks and long short-term memory networks is used to build a model, train historical data, and build a wastewater quality prediction model; S5: Deploy the trained model to the online monitoring system to monitor and analyze the wastewater data transmitted in real time; set the warning threshold. Once the monitoring data exceeds the preset threshold, the system will immediately issue a warning message to notify relevant personnel to handle it; S6: When the system issues an early warning, the abnormal diagnosis module is started to conduct in-depth analysis of the abnormal data to determine the cause and location of the abnormality; the abnormal diagnosis results are displayed using data visualization technology to help operators quickly locate the problem; S7: Automatically or manually adjust the operating parameters of the wastewater treatment facility based on the abnormal diagnosis results; S8: The system automatically generates wastewater treatment quality monitoring reports, including real-time data, early warning information, abnormal diagnosis results and adjustment measures; and stores the reports in a database for subsequent query and analysis; S9: Regularly update and maintain the monitoring system, including software upgrades, hardware maintenance and sensor calibration, to ensure stable operation of the system and accuracy of monitoring data; continuously optimize and improve monitoring methods based on actual operating conditions and technological developments.

2. The intelligent online quality monitoring method for medical wastewater treatment according to claim 1, characterized in that: In step S1, the pH sensor adopts an industrial-grade sensor of model pH-100, with a measuring range of 0-14 and an accuracy of ±0.01; the COD sensor is COD-200, with a measuring range of 0-1000mg / L and an accuracy of ±5%; the BOD sensor is BOD-150, with a measuring range of 0-1000mg / L and an accuracy of ±5%; the SS sensor is SS-120, with a measuring range of 0-1000mg / L and an accuracy of ±5%; the ammonia nitrogen sensor is NH3-N-110, with a measuring range of 0-100mg / L and an accuracy of ±2%; these sensors collect data once a minute, and package the data in JSON format through the built-in Wi-Fi module, and transmit it to the central monitoring platform through the HTTP protocol; the data packet contains a timestamp, the readings of each sensor and the device status information to ensure the integrity and real-time nature of the data.

3. The intelligent online quality monitoring method for medical wastewater treatment according to claim 1, characterized in that: In step S2, data preprocessing is divided into three sub-steps. First, data cleaning is performed by calculating the Z-score to identify outliers, and the formula is: Z=X-μ / σ, where X is a single data point, μ is the mean, and σ is the standard deviation. If |Z|>3, it is determined to be an outlier and is removed. Missing values ​​are filled by linear interpolation. Secondly, denoising is performed by using the Symlets8 basis function of wavelet transform to perform a 5-layer decomposition, retaining low-frequency components, and reconstructing denoised data. Finally, normalization uses the minimum-maximum normalization method to scale the data to the [0,1] interval, and the formula is Xnorm=(X-Xmin) / (Xmax-Xmin), where Xmin and Xmax are the minimum and maximum values ​​of the data, respectively.

4. The intelligent online quality monitoring method for medical wastewater treatment according to claim 1, characterized in that: In step S3, PCA is first used to extract features, and the principal components with a cumulative contribution rate of 95% are retained; then, a tree-based feature selection method, specifically a random forest classifier, is used to screen features by calculating the importance scores of the features; The importance score is based on the reduction in Gini impurity, and the top 10 features with the highest importance scores are selected as the final feature subset.

5. The intelligent online quality monitoring method for medical wastewater treatment according to claim 1, characterized in that: In step S4, the specific process includes: S4-1. Data preparation: Collect historical medical wastewater treatment data, including time series data and static data; normalize the data to make the input data range consistent; S4-2. Construct CNN module: design convolutional layers to extract local features from time series data; use pooling layers to reduce feature dimensions and retain important information; S4-3. Constructing LSTM modules: Designing LSTM layers to capture long-term dependencies in time series data; LSTM units can remember past information and make predictions about the future; S4-4. Fusion of CNN and LSTM: Using the output of CNN as the input of LSTM to achieve the fusion of feature extraction and time series modeling; S4-5. Add a fully connected layer: Add a fully connected layer after LSTM to output the final prediction result; S4-6. Model training: Use historical data to train the model and optimize the model parameters through the back propagation algorithm; use the loss function to measure the difference between the predicted value and the true value; S4-7. Model evaluation and optimization: Use the validation set to evaluate model performance, including accuracy and recall; adjust the model structure or parameters based on the evaluation results, including increasing the number of CNN layers and adjusting the number of LSTM units; The calculation formula of the convolutional layer of the convolutional neural network is: ; in Represents the convolution output of the lth layer; Represents the convolution kernel weight of the lth layer, which is used to identify specific features; Represents the input feature map of the l-1th layer, that is, the data output by the previous layer; Represents the bias term of the lth layer, which is used to adjust the output;" ” indicates a convolution operation; The core formula of LSTM unit includes: Cell state update formula: Ct=ft⊙Ct-1+it⊙Ct~; Hidden state update formula: ht=ot⊙tanh(Ct); Where Ct represents the cell state at the current moment and stores long-term information; ft represents the output of the forget gate, which determines how much past information is retained; it represents the output of the input gate, which determines how much new information is added; Ct~ represents the candidate cell state, which is used to update the cell state; ht represents the hidden state at the current moment, which is used for output and transmission to the next layer; ot represents the output of the output gate, which determines how much information is output in the current cell state; ⊙ represents element multiplication, which means multiplication of corresponding elements; Tanh represents the hyperbolic tangent activation function, which compresses the value between -1 and 1; The calculation formula of the fully connected layer is: Y = Wf·H+bf; Where Y represents the final prediction output, that is, the predicted value of wastewater quality; Wf represents the fully connected layer weight matrix, which is used to map the LSTM output to the predicted value; H represents the output of the LSTM module, which contains the long-term dependency information of the time series; bf represents the fully connected layer bias term, which is used to adjust the output.

6. The intelligent online quality monitoring method for medical wastewater treatment according to claim 1, characterized in that: In step S5, the trained CNN-LSTM hybrid model is deployed to an online monitoring system based on TensorFlow Serving; the model input is the wastewater data transmitted in real time, and the output is the predicted value of wastewater quality in the next hour; The warning threshold is set based on the upper limit of the 95% confidence interval of historical data.

7. The intelligent online quality monitoring method for medical wastewater treatment according to claim 1, characterized in that: In step S6, the anomaly diagnosis module adopts the Isolation Forest algorithm, and the key parameters include the number of n_estimators trees, which is set to 100, the number of max_samples samples, which is set to 256, and the contamination anomaly ratio, which is set to 0.01; the anomaly score threshold is set to 0.5, and data points with scores below this threshold are considered anomalies.

8. The intelligent online quality monitoring method for medical wastewater treatment according to claim 1, characterized in that: In step S7, according to the abnormal diagnosis result, the system automatically adjusts the operating parameters of the wastewater treatment facility including the dosage of chemical additives and the aeration volume to restore the wastewater treatment effect; and monitors the adjusted treatment effect in real time to ensure that the wastewater quality meets the standard.

9. The intelligent online quality monitoring method for medical wastewater treatment according to claim 1, characterized in that: In step S8, the report is in PDF format and is generated by Python's ReportLab library; the report structure includes: Cover: report title, generation time, name of medical institution; Abstract: A brief overview of wastewater treatment during the monitoring period; Real-time data: Displays real-time data of key water quality indicators in tables and charts; Warning information: lists all warning information triggered during the monitoring period, including warning indicators, warning values, and triggering time; Abnormal diagnosis results: Displays abnormal data points detected by the Isolation Forest algorithm and possible abnormal cause analysis; Parameter adjustment record: record in detail all parameter adjustment operations during the monitoring period, including adjustment parameters, values ​​before and after adjustment, and adjustment time; Effect evaluation: By comparing the changes in water quality indicators before and after the adjustment, the impact of parameter adjustment on wastewater treatment effect can be evaluated; Conclusion and Recommendations: Based on the monitoring data and analysis results, recommendations for improving the wastewater treatment process are proposed.

10. The intelligent online quality monitoring method for medical wastewater treatment according to claim 1, characterized in that: In step S9, software updates include: regularly checking updates of TensorFlow, Keras, and sklearn libraries to ensure that the latest versions are used to obtain performance improvements and security enhancements; Hardware maintenance includes: sensor calibration is performed once a quarter, using standard solutions to calibrate the sensor to ensure measurement accuracy.

Citation Information

Patent Citations

  • Medical wastewater monitoring data quality control method, device and system

    CN112288021A

  • Hospital sewage quantity prediction method and device based on neural network

    CN116523146A

  • Intelligent constructed wetland monitoring method and system based on machine learning

    CN118095927A

  • Multidirectional monitoring system and method for medical wastewater treatment

    CN118420150A

  • Industrial park environment quality monitoring system

    CN118446513A