CNN-LSTM model-based chemical chromogenic reaction time sequence characteristic analysis method
By applying a deep learning model based on CNN-LSTM in chemical reaction monitoring, the problem of insufficient real-time and accuracy of color change monitoring of chemical reactions in the prior art is solved, and efficient real-time monitoring of color change of chemical reactions is achieved.
Patent Information
- Application Number
- CN202411900524.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-04
AI Technical Summary
Existing deep learning models face challenges in real-time monitoring and prediction in the monitoring of color changes in chemical reactions, especially when color changes occur subtle or fast.
Using a deep learning model based on CNN-LSTM, images of the reaction area are collected through a high-resolution camera, and image preprocessing is performed. The spatial features of the image are extracted using CNN, and time series information is captured in combination with LSTM to establish a model for monitoring the color changes of chemical reactions.
Real-time monitoring of color changes of chemical reactions is achieved, the accuracy and real-time monitoring is improved, the cost and operational risks are reduced, and the subtle or rapid changes of color changes can be better identified and detected.
Smart Images

Figure CN119762940A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the application of deep learning models in the field of environmental monitoring, including the preparation of different concentration gradient image data sets based on time series, image feature value extraction, and the establishment of a CNN-LSTM concentration prediction model. Background Art
[0002] In the field of chemical reaction monitoring, traditional monitoring methods include chemical titration, electrochemical method, chromatography and instrument monitoring method, etc. These methods have their own limitations: chemical titration is time-consuming and relies on visual judgment, which is prone to errors; electrochemical method has a limited monitoring range and cannot cover all types of chemical reactions; chromatography requires expensive instruments and is time-consuming; instrument monitoring method relies on manual observation, has poor flexibility, and poses a threat to the safety of operators in dangerous reaction environments.
[0003] With the development of deep learning technology, especially the combined application of convolutional neural network (CNN) and long short-term memory network (LSTM), a new solution is provided for chemical reaction monitoring. CNN is good at extracting local features of image data, while LSTM can capture long-term dependencies in sequence data. Combining the advantages of both, it is possible to consider both the temporal and spatial information of the data, reduce parameters and reduce the risk of overfitting, and provide more accurate predictions and better performance.
[0004] In practical applications, some studies have used deep learning models to predict the correspondence between the SMILES and nuclear magnetic resonance spectra (including 1H NMR and 13C NMR) spectra of target compounds, thereby achieving automatic monitoring of chemical reaction processes. In addition, some studies have proposed a citrus color change prediction and visualization technology process based on a deep mask generation network to accurately extract the color change characteristics of the orchard. These studies show that the application of deep learning technology in the field of chemical reaction monitoring has broad prospects.
[0005] However, existing deep learning models still face challenges in processing color change monitoring of chemical reactions, especially in real-time monitoring and prediction. The present invention aims to establish a deep learning model based on CNN-LSTM to monitor and analyze the color change of PAD pretreated with o-phenanthroline after adding iron ion solutions of different concentrations, in order to improve the accuracy and real-time performance of monitoring, while reducing costs and operational risks. Summary of the invention
[0006] In order to overcome the above-mentioned deficiencies of the prior art, the present invention proposes a deep learning model based on CNN-LSTM. The model refers to the image processing and time series analysis technology in deep learning, and further improves CNN-LSTM for the problem of monitoring color changes in chemical reactions.
[0007] The technical solution adopted by the present invention is:
[0008] Step 1: Using a single light source for illumination, starting from the first second after the solution is added, a high-resolution camera is used to regularly capture images of the reaction area in a completely dark environment. The total image acquisition time is 18 minutes, and the interval is set to a fixed time interval (one image is captured per second) to ensure continuous monitoring of the reaction process;
[0009] Step 2: Perform preprocessing operations such as normalization, denoising and enhancement on the acquired images to improve the robustness and accuracy of the model;
[0010] Step 2: Use convolutional neural network (CNN) to extract features from the image and capture the spatial characteristics of color changes; design a CNN architecture, including multiple convolutional layers and pooling layers, to automatically learn key features in the image;
[0011] Step 3: Input the features extracted by CNN into the long short-term memory network (LSTM) to model the time series information of color change. The LSTM network can capture long-term dependencies, which is crucial for understanding the dynamic process of chemical reactions.
[0012] Step 4: Use the labeled data set to train the CNN-LSTM model, optimize the model parameters through the back propagation algorithm, and adjust and optimize the model according to the verification results, which may include adjusting the network structure, optimizing hyperparameters, etc.
[0013] Step 5: The model outputs the predicted results of color change and deploys the model to practical applications to achieve automated chemical reaction monitoring.
[0014] Compared with the prior art, the present invention has the following beneficial effects:
[0015] (1) The model is able to better identify and detect the color changes caused by solutions of different iron ion concentrations, especially when the color changes are subtle or occur quickly.
[0016] (2) The model can realize real-time monitoring of color changes in chemical reactions and provide instant feedback for the control and optimization of the chemical reaction process. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 For: Dataset collects chemical reaction images.
[0018] Figure 2 Figure 2: Schematic diagram of image preprocessing.
[0019] Figure 3 Figure 1: LSTM internal structure diagram.
[0020] Figure 4 Figure 2: The structural diagram of CNN.
[0021] Figure 5 Figure 1: The overall architecture diagram of the CNN-LSTM model. DETAILED DESCRIPTION
[0022] The present invention is further described below in conjunction with the accompanying drawings.
[0023] First, add iron ion solution onto the PAD pretreated with o-phenanthroline reagent, and use a high-resolution industrial camera to capture color change images to establish a rich image data set. Figure 1 shown.
[0024] The preprocessing method of the present invention is: keep a copy of the original RGB image before performing circle detection and cropping. Then, when cropping the circular area in the grayscale image, use the same coordinate and size information to crop the corresponding color area from the original RGB image. This makes the circle detection more accurate while not losing color feature information. The image preprocessing process is as follows: Figure 2 shown.
[0025] The internal structure and workflow of the long short-term memory network (LSTM) unit, including the input module, input gate, forget gate, output gate and memory unit. The input gate (i) controls the update of the memory unit by new information, the forget gate (f) controls the forgetting ratio of historical information in the memory unit, and the output gate (o) determines the current hidden state h. t The output of the memory unit (C) is responsible for storing and updating long-term memory information, such as Figure 3 shown.
[0026] The structural flow of the convolutional neural network (CNN) model includes the input layer, local information extraction module, convolution layer, pooling layer, fully connected layer and output layer. The input layer receives image data, extracts local feature information of the image through the convolution layer, enters the fully connected layer after dimensionality reduction processing in the pooling layer, and finally generates prediction results in the output layer. This structure is used to extract the spatial features of chemical color reaction images as input for subsequent time series analysis, such as Figure 4 shown.
[0027] The CNN-LSTM model consists of three parts: data preprocessing, CNN unit, LSTM unit and output unit. Figure 5 As shown, it mainly includes:
[0028] (1) Raw data: This part is the collected image data, including the reaction process images after the iron ion solution with different concentration gradients was added;
[0029] (2) Preprocessing: image processing of raw data, including image cropping, image filtering, image enhancement, and normalization;
[0030] (3) CNN unit: It consists of multiple convolutional neural networks (CNNs), which are mainly used to extract spatial features of preprocessed images, including color change information during chemical reactions. After each frame of the image is processed by the CNN unit, the corresponding feature vector is output as the input of the time series data.
[0031] (4) The LSTM unit is composed of multiple long short-term memory networks (LSTM), which are mainly used to capture the changing rules of the image feature vector in the time dimension. It receives the feature vector sequence output by the CNN unit and further learns the temporal dynamic characteristics of the color change during the chemical reaction. The multi-layer LSTM network gradually transmits information to form a deep understanding of the color change rules of the reaction process.
[0032] (5) The output part is the model prediction result, which shows the change trend or prediction amount of the color feature signal over time.
[0033] Specific methods
[0034] (1) Due to the particularity of image data, the region of interest is a circular domain. The image after noise reduction is subjected to Hough transform circle detection and cropped to remove irrelevant areas in the image, reduce the amount of data to be processed, and thus reduce computational complexity and processing time. Since Hough transform circle detection is a relatively complex process, the pixel data of our 16-bit deep image is relatively large, which will cause excessive computational complexity. Moreover, converting the image into a grayscale image can improve the accuracy of Hough transform circle detection, but the image becomes a single channel, which will lose the most critical color features of the image. Therefore, the preprocessing method adopted by the present invention is: retain a copy of the original RGB image before performing circle detection and cropping. Then, when cropping the circular area in the grayscale image, use the same coordinate and size information to crop the corresponding color area from the original RGB image. This makes circle detection more accurate while not losing color feature information;
[0035] (2) In order to capture richer color features and make the model more effective, the images collected by industrial cameras are 16-bit deep, with a pixel value range of 0-65535, and the pixel values are relatively large. Therefore, the normalization method is used to map the pixel values to the range of [0,1]. The advantage is that it can speed up the convergence of gradient descent, because the parameter update is more uniform, and there will be no inconsistent update step size due to the large value range;
[0036] (3) Use a convolutional neural network (CNN) to extract features from the processed image data, including:
[0037] Input layer: receives preprocessed image data;
[0038] Convolutional layer: extract local spatial features of the image;
[0039] Pooling layer: Reduce the dimension of feature maps to reduce redundant information;
[0040] Fully connected layer: vectorizes the extracted features and outputs high-dimensional feature information.
[0041] (4) Input the feature sequence output by CNN into the long short-term memory network (LSTM) to capture the dynamic characteristics of the color reaction changing over time. Specifically, it includes:
[0042] Input layer: receives the feature sequence output by CNN;
[0043] Memory unit: learns feature changes at different time points through input gate, forget gate and output gate;
[0044] Output layer: Generates time series feature prediction results.
[0045] (5) The processed image dataset is divided into a training set and a test set. The model is trained using a loss function (mean square error), and the model parameters are adjusted using an optimization algorithm (Adam) to ensure that the model converges and has optimal performance.
[0046] (6) The new color reaction time series image is input into the trained CNN-LSTM model. The model outputs the predicted value of the color reaction intensity at different time points to obtain the color change law. The model prediction results are compared with the actual measurement data to analyze the prediction accuracy and applicability of the model.
[0047] The present invention utilizes the CNN-LSTM model to effectively analyze the temporal variation law of chemical color development reaction, combines the color development image characteristics with the time dynamic characteristics, and realizes the prediction of the color development reaction process.
[0048] The above description is only a specific implementation mode of the present invention. Any feature disclosed in this specification, unless otherwise stated, can be replaced by other equivalent or alternative features with similar purposes; all disclosed features, or all methods or steps in the process, except for mutually exclusive features and / or steps, can be combined in any way.
Claims
1. A method for analyzing the temporal characteristics of chemical color development reactions based on a CNN-LSTM model, characterized in that: The following steps are involved: Step 1. Select o-phenanthroline reagent as the reactant, prepare iron ion solutions with different concentration gradients, pre-treat PAD with o-phenanthroline reagent, use a single light source for reaction monitoring, ensure that image acquisition is performed in a completely dark environment to avoid interference from external light sources, and select a high-resolution camera for image acquisition to ensure that color changes can be clearly captured during the reaction process; Step 2: Starting from the first second after the solution is added, a high-resolution camera is used to regularly capture images of the reaction area in a completely dark environment. The total image acquisition time is 18 minutes, and the interval is set to a fixed time interval (one image is captured per second) to ensure continuous monitoring of the reaction process; Step 3. Preprocess the collected image data, including image grayscale, denoising, contrast enhancement, etc., for subsequent analysis, and use appropriate image processing algorithms to extract color feature information in the image, including RGB values, HSV values, etc., as time series data of the reaction process; Step 4. Annotate the processed image data according to concentration gradient, time and color feature information, and divide them into training set and test set to ensure that the reaction data of each concentration can fully represent the color change during the reaction process; Step 5: Design and train a deep learning model based on a combination of a convolutional neural network (CNN) and a long short-term memory network (LSTM). The CNN part is responsible for extracting the spatial features in each frame of the image, that is, the spatial information of color changes, and the LSTM part is used to capture the time series law of color changes. The input of the model is the image features at each time point, and the output is the color change trend or predicted value over time; Step 6: Use the training set data to train the CNN-LSTM model, optimize the model parameters to minimize the prediction error, use the time series back propagation algorithm to update the gradient during the training process, and use cross-validation and other methods to evaluate the model performance; Step 7: Use the trained CNN-LSTM model to analyze the color change patterns of iron ion solutions with different concentrations over time. Use the time series results output by the model to study the dynamic characteristics of chemical reactions at different concentrations, and compare and verify them with actual experimental data. The trend of color change over time can be presented through charts or heat maps, and the effects of different concentration gradients on reaction rate and color change can be further analyzed.
2. The method according to claim 1, characterized in that: In step 1, a 16-bit deep industrial camera is used to continuously capture continuous images during the chemical color development reaction to establish a rich data set.
3. The method according to claim 1, characterized in that: The preprocessing method in step 3 is innovated and optimized by using the method of extracting the coordinates of the circumscribed rectangle of the circular area.
Citation Information
Cited By
Color titration identification method, system and equipment based on combined prediction model
CN121010653A
Color titration recognition method, system, and device based on combined prediction model
CN121010653B