A multi-modal fusion attention mechanism potassium dichromate titration method
By combining image and spectral information with a multimodal fusion attention mechanism and the GoogLeNet network, an automatic titration endpoint identification system was constructed, which solved the problems of large errors in manual judgment and environmental influence, and achieved high-precision and low-cost titration endpoint identification.
Patent Information
- Application Number
- CN202211586011.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-04
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2043-02-04
AI Technical Summary
In the current technology for potassium dichromate titration determination, manual determination of the titration endpoint has large errors, color sensors and electrode methods are greatly affected by the environment, and the cost is high, making it difficult to accurately identify the titration endpoint.
By employing a multimodal fusion attention mechanism, combined with a GoogLeNet network and an OpenMV camera, an automated titration analysis system with multi-level velocity modes is constructed to identify color changes through image and spectral fusion. The titration endpoint is then determined using a deep neural network.
It improves the accuracy of titration endpoint identification, reduces costs, minimizes environmental impact, and increases the speed and efficiency of titration analysis.
Smart Images

Figure CN115953361B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of machine vision and chemical detection, and relates to a multi-modal fusion attention mechanism determination method, which is suitable for determination of chemical oxygen demand. BACKGROUND
[0002] In wastewater treatment, chemical oxygen demand is an important parameter for describing organic pollution in wastewater, and the dichromate method is a standard method for determining chemical oxygen demand specified by the International Organization for Standardization, and is a widely used analysis and test method at home and abroad. Among them, the potassium dichromate method is a method for determining the chemical oxygen demand of water by using potassium dichromate as an oxidizing agent, which is widely used and suitable for surface water, industrial wastewater, domestic sewage and the like, and is an important determination method for industrial wastewater in wastewater treatment plants, printing and dyeing, papermaking, petrochemical and other industries.
[0003] The chromium element exhibits multiple valence states and multiple colors in the solution, the hexavalent chromium solution is yellow, the trivalent chromium solution is blue-green, and the chromate solution is orange. In the titration analysis of the potassium dichromate determination of chemical oxygen demand, the iron reagent is used as an indicator, and the potassium dichromate oxidizes the organic matter in the wastewater. In this process, the color of the measured solution changes from yellow to blue-green, and then the excess potassium dichromate is titrated with ferrous ammonium sulfate. When the potassium dichromate is gradually reduced by the ferrous ammonium sulfate, the ferrous ammonium sulfate is slightly excessive, and can be detected by the iron reagent, showing red as the titration end point.
[0004] In the titration analysis process, determining the titration end point is a key operation step. At present, the general laboratory adopts a manual method of determining the titration end point, that is, the operator identifies the color change of the solution by the naked eye to determine whether the titration end point is reached, and the subjective factors and the proficiency of the cooperation of the hands and eyes will affect the accuracy of the titration. Some laboratories use a color sensor to replace the human eye to identify the color, and realize color detection through the reflection ratio of three primary colors, but this method has high requirements for the environment in which the solution is located, is easily affected by the reflected light of the beaker, the environmental brightness and the like, and cannot accurately determine the color change when the turbidity of the water is high. Some laboratories use an electrode method to determine the titration end point by detecting the mutation of the electrode potential, but this method needs to use different electrodes in different titration experiments, the replacement process of the electrodes is complex, the electrodes are directly in contact with the solution, the electrodes are easily corroded by the organic matter in the wastewater, the service life is reduced, the cost of the instrument is high, and the storage requirements are strict.
[0005] Therefore, a potassium dichromate titration determination method with a multi-modal fusion attention mechanism is proposed, a camera with low cost and convenience is used, the titration end point is determined by machine vision to identify the slight color change, the algorithm network of the color identification is improved to avoid the influence of non-solution colors, the color of the chromium element in the solution is accurately identified, and the accuracy of the potassium dichromate titration determination is improved. SUMMARY
[0006] The application provides a potassium dichromate titration method based on a multi-modal fusion attention mechanism. A plurality of attention mechanisms and a GoogLeNet network are fused to avoid the loss of important information caused by the excessive length of the network calculation and improve the attention to the color information of the solution to be measured. The image and spectral information of two different modes are fused through a deep neural network to enrich the color feature information, identify the slight color change, accurately extract the color feature value, and improve the accuracy of the potassium dichromate titration. The method comprises the following steps during the determination:
[0007] Step (1) obtaining the initial volume and concentration of the standard solution and performing multi-stage speed mode titration analysis;
[0008] The magnetic stirring rod is placed in the solution to be measured.
[0009] The opening and closing time of the electromagnetic valve is set in advance to change the flow from large to small, so that the titration speed is automatically changed from large to small, and a multi-stage speed titration mode is formed. The standard solution is automatically titrated in the multi-stage speed mode by the electromagnetic valve.
[0010] The magnetic field generated at the bottom of the solution to be measured drives the magnetic stirring rod to move at a uniform speed in a circular motion, and the solution to be measured is heated to control the temperature of the titration analysis process, so that the standard solution and the solution to be measured are fully mixed.
[0011] Step (2) collecting the state image of the solution to be measured and performing a pretreatment operation;
[0012] During the titration analysis process, the OpenMV camera is used to collect the state image of the solution to be measured in real time.
[0013] The resolution of the state image is 640x480, and the vector of each pixel point is described by three color components of red, green and blue.
[0014] The state image is pretreated to extract the image features and obtain the pretreated state image. The pretreatment operation includes grayscale, geometric transformation and image enhancement.
[0015] Step (3) inputting the pretreated state image into the multi-attention mechanism network fused with GoogLeNet for processing to output a state image feature matrix.
[0016] Step (3.1) constructing the Inception structure of the multi-attention mechanism network fused with GoogLeNet.
[0017] The Inception structure is divided into four branches, branch one is a 1x1 convolutional layer, branch two is a 3x3 convolutional layer and a 1x1 convolutional layer, branch three is a 5x5 convolutional layer and a 1x1 convolutional layer, and branch four is a 3x3 max-pooling layer and a 1x1 convolutional layer, and the four branches are input into a deep convolutional layer and are connected and output;
[0018] Step (3.2) constructs a main branch of the multi-attention mechanism network fused with GoogLeNet;
[0019] The main branch of the multi-attention mechanism network fused with GoogLeNet includes five modules B, one module O and four max-pooling layers; the five modules B are respectively denoted as B1, B2, B3, B4 and B5, and a 3x3 max-pooling layer with a stride of 2 is used to connect each module B; the serial connection path of the five modules B, the module O and the four max-pooling layers together constitutes the main branch of the multi-attention mechanism network fused with GoogLeNet;
[0020] The module B1 is a 7x7 convolutional layer;
[0021] The module B2 is composed of a 1x1 convolutional layer, a 3x3 convolutional layer and two local normalization layers, and the 1x1 convolutional layer and the 3x3 convolutional layer are connected in series between the two local normalization layers;
[0022] The module B3 is a serial connection of two Inception structures;
[0023] The module B4 is a serial connection of five Inception structures, and the outputs of the first and fourth Inception structures are respectively connected to an auxiliary classifier C for avoiding gradient disappearance when the gradient is conducted forward;
[0024] The auxiliary classifier C is composed of a 5x5 average pooling layer, two 1x1 convolutional layers and two fully connected layers;
[0025] The module B5 is a serial connection of two Inception structures;
[0026] The module O is composed of a 7x7 average pooling layer, a fully connected layer and a regression output layer;
[0027] Step (3.3) introduces an attention mechanism branch into the main branch of the multi-attention mechanism network of GoogLeNet to obtain a multi-attention mechanism network fused with GoogLeNet;
[0028] At the input end of the main branch of the multi-attention mechanism network fused with GoogLeNet, attention mechanism branch one and branch two are introduced, the output end of branch one is connected to the output end of module O; the output end of branch two is connected to the output end of module B3; at the input end of module B4, attention mechanism branch three and branch four are introduced; the output end of branch three is connected to the output end of module B4; the output end of branch four is connected to the output end of module B5;
[0029] When the input end of the attention mechanism branch is encountered in the main branch of the multi-attention mechanism network fused with GoogLeNet, the weight parameter is obtained as the input of the attention mechanism branch, and the size of the weight parameter is consistent with the size of the state image after the preprocessing operation; the weight parameter is directly transmitted back through the attention mechanism branch, and is multiplied with the main branch of the multi-attention mechanism network fused with GoogLeNet accordingly;
[0030] The main branch of the multi-attention mechanism network fused with GoogLeNet and the attention mechanism branch jointly constitute the multi-attention mechanism network fused with GoogLeNet;
[0031] Step (3.3) inputs the state image after the preprocessing operation into the multi-attention mechanism network fused with GoogLeNet, and outputs the processed state image feature matrix;
[0032] Step (4) the spectrometer collects the spectrum and obtains the spectrum data matrix of the to-be-measured solution;
[0033] The wavelength range of the spectrometer is 320nm-1100nm, the accuracy is 5nm, and the resolution is 1nm;
[0034] The spectrum of the to-be-measured solution is collected in real time by the spectrometer, and the spectrum is processed to obtain the spectrum data matrix of the to-be-measured solution, and the size of the spectrum data matrix is consistent with the size of the state image feature matrix;
[0035] Step (5) multi-modal fusion is performed on the state image feature matrix and the spectrum data matrix, and color feature values are output;
[0036] The state image feature matrix is a matrix output by the multi-attention mechanism network fused with GoogLeNet;
[0037] The spectrum data matrix is a matrix output after processing by the spectrometer;
[0038] The state image feature matrix and the spectrum data matrix are input into the input layer of the deep neural network, and the color feature values of the to-be-measured solution are output by the output layer after calculation and processing by the hidden layer;
[0039] Step (6) determines whether the titration analysis reaches the titration endpoint according to the color feature values;
[0040] The standard for judging that the titration analysis reaches the titration end point is that the color characteristic value reaches the allowable error range of the chemical reaction color end point value;
[0041] Step (7) if it is judged that the titration analysis does not reach the titration end point, continue the titration analysis; if it reaches the titration end point, stop the titration analysis;
[0042] Step (8) calculate and output the content of the solution to be measured;
[0043] After stopping the titration, the content of the solution to be measured is calculated and output according to the initial volume and concentration of the standard solution.
[0044] The present application has the following advantages and effects relative to the prior art:
[0045] (1) The method of fusing multiple attention mechanisms and GoogLeNet network is proposed, and a multi-attention mechanism network fused with GoogLeNet is built, which can avoid the loss of important information due to the excessive length of the network calculation, and can strengthen the attention to the color information of the solution to be measured and reduce the influence of other environmental information, thereby improving the accuracy of color feature extraction in image processing.
[0046] (2) In terms of instruments, automatic titration analysis with multiple speed modes is adopted to reduce the titration time, and in terms of algorithm network, the Inception structure is adopted to greatly reduce the number of parameters and the amount of calculation, thereby improving the speed and efficiency of titration analysis from two aspects.
[0047] (3) The image and spectrum of two different modalities are fused to accurately identify the color of the solution to be measured, and the slight change of the color is identified to judge the titration end point, thereby improving the accuracy of titration analysis. DETAILED DESCRIPTION
[0048] Figure 1 is a flowchart of the method of the present application.
[0049] Figure 2 is an Inception structure of the multi-attention mechanism network fused with GoogLeNet of the present application.
[0050] Figure 3 is a structure diagram of the multi-attention mechanism network fused with GoogLeNet of the present application.
[0051] Figure 4 is a structure diagram of module B1 in the multi-attention mechanism network fused with GoogLeNet of the present application.
[0052] Figure 5is a structural diagram of module B2 in the multi-attention mechanism network of the fusion GoogLeNet of the application.
[0053] Figure 6 is a structural diagram of module B3 in the multi-attention mechanism network of the fusion GoogLeNet of the application.
[0054] Figure 7 is a structural diagram of module B4 in the multi-attention mechanism network of the fusion GoogLeNet of the application.
[0055] Figure 8 is a structural diagram of module B5 in the multi-attention mechanism network of the fusion GoogLeNet of the application.
[0056] Figure 9 is a structural diagram of module O in the multi-attention mechanism network of the fusion GoogLeNet of the application.
[0057] Figure 10 is a structural diagram of auxiliary classifier C in the multi-attention mechanism network of the fusion GoogLeNet of the application.
[0058] Figure 11 is a structural diagram of the deep neural network of the application. DETAILED DESCRIPTION
[0059] A potassium dichromate titration method of a multi-modal fusion attention mechanism is provided in the application, which is described in detail in combination with the drawings as follows:
[0060] Figure 1 is a flowchart of the method of the application. First, the initial volume and concentration of the standard solution are obtained for calculation after the titration analysis is completed, and the to-be-measured solution is subjected to titration analysis. In order to shorten the time of the titration process without affecting the judgment of the titration end point, a multi-stage speed mode is used for titration analysis, and the flow rate is changed from large to small by pre-setting the opening and closing size and on-off time of the electromagnetic valve, so as to realize the function of automatically changing the titration speed from large to small. Then, the state image of the to-be-measured solution is collected in real time by the OpenMV camera and subjected to pretreatment operation. The state image after the pretreatment operation is input into the multi-attention mechanism network of the fusion GoogLeNet for processing, and a state image feature matrix is output. Then, the spectrum is collected in real time by the spectrometer, and a spectrum data matrix of the to-be-measured solution is obtained, the state image feature matrix and the spectrum data matrix are subjected to multi-modal fusion by the deep neural network, and a color feature value is output. According to the color feature value, it is judged whether the titration analysis reaches the titration end point or not. If the titration analysis does not reach the titration end point, the titration analysis is continued, and if the titration analysis reaches the titration end point, the titration analysis is stopped. Finally, the content of the to-be-measured solution is calculated and output according to the initial volume and concentration of the standard solution.
[0061] Figure 2is the Inception structure of the fusion GoogLeNet multi-attention mechanism network of the application. First, the output value of the previous layer is input into the Inception structure. Then, the back transmission is divided into four branches, branch one is a 1*1 convolution layer, branch two is a 3*3 convolution layer and a 1*1 convolution layer, branch three is a 5*5 convolution layer and a 1*1 convolution layer, and branch four is a 3*3 maximum pooling layer and a 1*1 convolution layer. Finally, the four branches are input into the deep convolution layer and connected and output. The use of the Inception structure can greatly reduce the number of parameters and reduce the amount of calculation.
[0062] Figure 3 is the structure diagram of the fusion GoogLeNet multi-attention mechanism network of the application. First, the state image after preprocessing operation is input into the fusion GoogLeNet multi-attention mechanism network, and the back transmission is divided into three branches, one main branch composed of five modules B, one module O and four maximum pooling layers, and two attention mechanism branches. Then, the state image after preprocessing operation is multiplied by the weight parameters of the second attention mechanism branch through the processing of module B1, maximum pooling layer, module B2, maximum pooling layer and module B3 along the main branch of the fusion GoogLeNet multi-attention mechanism network. Then, it is multiplied by the weight parameters of the third attention mechanism branch through the processing of maximum pooling layer and module 4, and then multiplied by the weight parameters of the fourth attention mechanism branch through the processing of maximum pooling layer and module B5. Finally, it is multiplied by the weight parameters of the first attention mechanism branch after the processing of module O, and the state image feature matrix is output. The introduction of multiple attention mechanism branches can avoid the loss of important information due to the too long calculation length of the GoogLeNet network, improve the attention of the color information of the test solution, reduce the influence of other environmental information, and improve the accuracy of color recognition.
[0063] Figure 4 is the structure diagram of module B1 in the fusion GoogLeNet multi-attention mechanism network of the application. It is composed of a 7*7 convolution layer.
[0064] Figure 5 is the structure diagram of module B2 in the fusion GoogLeNet multi-attention mechanism network of the application. First, input from the local normalization layer. Then, pass through a 1*1 convolution layer and a 3*3 convolution layer. Finally, output from the local normalization layer.
[0065] Figure 6 is the structure diagram of module B3 in the fusion GoogLeNet multi-attention mechanism network of the application. Module B3 is a series connection of two Inception structures.
[0066] Figure 7is a structural diagram of module B4 in the multi-attention mechanism network of the fusion GoogLeNet of the present application. Module B4 includes five Inception structures and two auxiliary classifiers C, and one auxiliary classifier C is connected at the output of the first Inception structure and the fourth Inception structure respectively, for avoiding gradient vanishing when conducting gradient forward.
[0067] Figure 8 is a structural diagram of module B5 in the multi-attention mechanism network of the fusion GoogLeNet of the present application. Module B5 is a series connection of two Inception structures.
[0068] Figure 9 is a structural diagram of module O in the multi-attention mechanism network of the fusion GoogLeNet of the present application. First, input from a 7*7 average pooling layer. Then, pass through a fully connected layer. Finally, output from a regression output layer.
[0069] Figure 10 is a structural diagram of auxiliary classifier C in the multi-attention mechanism network of the fusion GoogLeNet of the present application. It is composed of a 5*5 average pooling layer, two 1*1 convolution layers and two fully connected layers, for avoiding gradient vanishing when conducting gradient forward.
[0070] Figure 11 is a structural diagram of the deep neural network of the present application. First, input the state image feature matrix and the spectral data matrix to the input layer of the deep neural network. Then, calculate and process through the hidden layer. Finally, output the color characteristic value of the solution to be tested by the output layer.
[0071] The above only describes the preferred embodiments of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation using the content of the present application specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for determining potassium dichromate titration based on a multimodal fusion attention mechanism, characterized in that, Multiple attention mechanisms are fused with the GoogLeNet network to avoid the loss of important information due to excessive network computation length, thereby increasing the focus on the color information of the test solution. Image and spectral information from two different modalities are fused through a deep neural network to enrich color feature information, identify subtle color changes, accurately extract precise color feature values, and improve the accuracy of potassium dichromate titration. The determination process includes the following steps: Step (1) Obtain the initial volume and concentration of the standard solution and perform a multi-stage rate mode titration analysis; Place the magnetic stirring rod into the solution to be tested; The solenoid valve's on / off state and on / off time are preset to gradually decrease the flow rate, thereby achieving the function of automatically decreasing the titration speed and forming a multi-stage speed titration mode; the standard solution is automatically titrated and analyzed in a multi-stage speed mode using the solenoid valve. A magnetic field is generated at the bottom of the solution to be tested, which drives the magnetic stirring rod to make uniform circular motion and heats the solution to be tested. This controls the temperature of the titration analysis process and ensures that the standard solution and the solution to be tested are fully mixed. Step (2) Acquire images of the state of the solution to be tested and perform preprocessing operations; During the titration analysis, an OpenMV camera was used to capture real-time images of the state of the solution to be tested. The resolution of the state image is 640×480, and the vector of each pixel is described by three color components: red, green, and blue. The state image is preprocessed to extract image features, resulting in a preprocessed state image. The preprocessing operations include grayscale conversion, geometric transformation, and image enhancement. Step (3) inputs the preprocessed state image into the multi-attention mechanism network fused with GoogLeNet for processing, and outputs the state image feature matrix; Step (3.1) Construct the Inception structure of a multi-attention mechanism network that integrates GoogLeNet; The Inception architecture consists of four branches: branch one is a 1×1 convolutional layer, branch two is a 3×3 convolutional layer and a 1×1 convolutional layer, branch three is a 5×5 convolutional layer and a 1×1 convolutional layer, and branch four is a 3×3 max pooling layer and a 1×1 convolutional layer. The inputs of the four branches are connected to the deep convolutional layers and outputs. Step (3.2) Construct the main branch of the multi-attention mechanism network that integrates GoogLeNet; The main branch of the multi-attention mechanism network fused with GoogLeNet consists of five modules B, one module O, and four max pooling layers. The five modules B are denoted as B1, B2, B3, B4, and B5, and each module B is connected by a 3×3 max pooling layer with a stride of 2. The concatenated paths of the five modules B, one module O, and four max pooling layers together constitute the main branch of the multi-attention mechanism network fused with GoogLeNet. Step (3.3) introduces an attention mechanism branch into the main branch of the GoogLeNet multi-attention mechanism network to obtain a multi-attention mechanism network that integrates GoogLeNet; In the input of the main branch of the multi-attention mechanism network that integrates GoogLeNet, attention mechanism branches one and two are introduced. The output of branch one is connected to the output of module O; the output of branch two is connected to the output of module B3. In the input of module B4, attention mechanism branches three and four are introduced. The output of branch three is connected to the output of module B4; the output of branch four is connected to the output of module B5. When the input of the attention mechanism branch is encountered in the main branch of the multi-attention mechanism network that integrates GoogLeNet, the weight parameters are obtained as the input of the attention mechanism branch. The size of the weight parameters is consistent with the size of the state image after preprocessing. The weight parameters are directly passed backward through the attention mechanism branch and are multiplied accordingly with the main branch of the multi-attention mechanism network that integrates GoogLeNet; The main branch and attention mechanism branch of the multi-attention mechanism network that integrates GoogLeNet together constitute the multi-attention mechanism network that integrates GoogLeNet. Step (3.4) inputs the preprocessed state image into the multi-attention mechanism network that fuses GoogLeNet, and outputs the processed state image feature matrix; Step (4) The spectrometer acquires the spectrum and obtains the spectral data matrix of the solution to be tested; The spectrometer has a wavelength range of 320 nm - 1100 nm, an accuracy of 5 nm, and a resolution of 1 nm. The spectra of the solution to be tested are acquired in real time by a spectrometer, and the spectra are processed to obtain the spectral data matrix of the solution to be tested. The size of the spectral data matrix is the same as the size of the state image feature matrix. Step (5) performs multimodal fusion of the state image feature matrix and the spectral data matrix to output color feature values; The state image feature matrix is a matrix output by a multi-attention mechanism network that incorporates GoogLeNet; The spectral data matrix is the matrix output by the spectrometer after processing. The state image feature matrix and spectral data matrix are input into the input layer of the deep neural network. After calculation and processing by the hidden layer, the color feature value of the solution to be tested is output by the output layer. Step (6) Determine whether the titration analysis has reached the titration endpoint based on the color characteristic value; The standard for determining whether a titration has reached its endpoint is that the color characteristic value has reached the allowable error range of the chemical reaction's color endpoint value. Step (7): If it is determined that the titration analysis has not reached the titration endpoint, continue the titration analysis; if the titration endpoint has been reached, stop the titration analysis. Step (8) Calculate and output the content of the solution to be tested; After the titration is stopped, the content of the test solution is calculated and output based on the initial volume and concentration of the standard solution.
2. The method for determining the potassium dichromate titration of the multimodal fusion attention mechanism according to claim 1, characterized in that, In step (3.2), the five modules B are denoted as B1, B2, B3, B4, and B5, respectively. Module B1 is a 7×7 convolutional layer. Module B2 consists of a 1×1 convolutional layer, a 3×3 convolutional layer, and two local normalization layers. The 1×1 convolutional layer and the 3×3 convolutional layer are connected in series between the two local normalization layers. Module B3 is a series connection of two Inception structures; Module B4 is a series of five Inception structures. The outputs of the first and fourth Inception structures are each connected to an auxiliary classifier C to prevent gradient vanishing when propagating gradients forward. The auxiliary classifier C consists of a 5×5 average pooling layer, two 1×1 convolutional layers, and two fully connected layers. Module B5 is a series connection of two Inception structures; Module O consists of a 7×7 average pooling layer, a fully connected layer, and a regression output layer.
Citation Information
Patent Citations
Spatial spectrum attention hyperspectral image classification method based on Octave convolution
CN110516596A
Multi-modal emotion recognition method based on feature-time attention mechanism
CN112784798A