Method and device for monitoring chemical reaction gas in real time and storage medium
By using cross-installed linear array cameras and DBPP-Net networks, the equivalent diameter and volume of chemical reaction gases are monitored in real time, and the problems of high equipment investment and high human resource consumption in the existing technology are solved, and the intelligentization and automation of the chemical reaction process is realized, and laboratory safety is improved.
Patent Information
- Application Number
- CN202510200912.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-03-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing chemical reaction gas monitoring methods have problems such as high equipment investment, high human and time resources consumption, and require professional knowledge and skills, making it difficult to achieve intelligence and automation of chemical reaction processes.
Two cross-installed linear array cameras are used to collect the bubble profile video frame images generated during the chemical reaction. Through time stamp synchronization, image stitching, matching and correction, the pre-trained DBPP-Net network is input to output the equivalent diameter and volume of the bubbles, and the chemical reaction speed is monitored in real time.
Real-time monitoring of chemical reaction gases is realized, the intelligence and automation of reaction speed is improved, experimental costs and human resource consumption are reduced, and the safety of chemical laboratories is improved.
Smart Images

Figure CN119672033A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a real-time monitoring method, device and storage medium for chemical reaction gas, belonging to the technical field of chemical laboratory safety. Background Art
[0002] In the process of studying chemical bubble reaction monitoring methods, there were early traditional methods such as drainage method and barometer to measure gas pressure, and later instruments such as gas analyzers and gas flow meters were developed. The above methods have defects in the current intelligent and automated experimental environment. The gas detection method using gas analyzers requires expensive instruments and equipment, which will greatly increase the equipment investment and operating costs of the laboratory. The drainage method and the use of gas flow meters require a long time for sample preparation, analysis and result processing. This may require more manpower and time resources, and may reduce the efficiency of the experiment. At the same time, the above methods all require professional knowledge and skills to operate and interpret the results. This may require training and the participation of professionals, increasing labor costs and energy investment. Summary of the invention
[0003] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a method, device and storage medium for real-time monitoring of chemical reaction gases, thereby realizing real-time monitoring of chemical reaction gases and solving the problem that the reaction speed in the current chemical experiment process is not intelligent and automated enough.
[0004] To achieve the above object, the present invention is implemented by adopting the following technical solutions: In a first aspect, the present invention provides a method for real-time monitoring of chemical reaction gases, comprising: Acquire video frame images of bubble contours generated under set chemical reaction conditions by using two cross-mounted linear array cameras, and synchronize the images through time stamps; Detect the coordinate information of the bubble contour in the synchronized image, and determine whether it needs to be spliced with the next frame of image according to the y-axis coordinate information of the bubble contour; After stitching, the Hungarian algorithm is used to optimally match the bubble contours in the stitched images to obtain the matched bubble contours; Obtaining a correction coefficient according to the matched bubble contour, and correcting the bubble contour according to the correction coefficient; The corrected image and the coordinates of the bubble contour are input into the pre-trained DBPP-Net network, and the equivalent diameter and equivalent volume of the bubble are output; According to the equivalent diameter and equivalent volume of the bubbles, the total volume of bubbles generated per second is counted, and compared with the upper limit of the abnormal reaction rate obtained in advance from the chemical reaction formula database to determine whether the chemical reaction rate is abnormal, thereby realizing real-time monitoring of chemical reaction gases.
[0005] Furthermore, the method further includes: preprocessing the video frame images acquired by the two line array cameras, specifically including: Obtain the minimum bounding rectangle parameters and area parameters of the bubble outline of the video frame images in the two linear array cameras; Threshold screening is performed based on the minimum bounding rectangle parameters and area parameters of the bubble contour to delete noise contours and occluded contours; The holes in the filtered image are filled through morphological operations to complete the preprocessing operation.
[0006] Furthermore, the method of using the Hungarian algorithm to optimally match the bubble contours in the stitched image to obtain bubble contours matched by two line array cameras includes: The bubble contour is detected again on the images stitched from the two line array cameras; Sort the detected bubble contours according to the y coordinates of the stitched image; Set two linear array cameras as the first camera and the second camera respectively, and obtain the circumscribed rectangle parameters of each bubble outline in the first camera and the second camera. , , , and , , , ,in, , , , are the x-axis and y-axis coordinates of the upper left corner of the bounding rectangle of the bubble outline of the first camera, and the width and height of the minimum bounding rectangle, respectively. , , , are the x-axis and y-axis coordinates of the upper left corner of the circumscribed rectangle of the bubble outline of the second camera, and the width and height of the minimum circumscribed rectangle; Calculate the vertical velocity corresponding to each bubble outline in the first camera and the second camera , the formula is as follows: ; in, is the height difference of the line array camera, is the scanning time of each line of the linear array camera; According to the vertical speed Calculate the vertical correction factor ; Where g is the acceleration due to gravity; Calculate the loss value of each pair according to the vertical correction coefficient , the formula is as follows: ; in, and is to set the weight; When the parameters of the bubble contour meet the following conditions, Set to infinity: ; ; in, is the height error threshold of the two contours of the same bubble, The y-axis error threshold of two contours of the same bubble; The loss value of each pair Composition loss matrix ; For the loss matrix Apply the Hungarian algorithm to find the bubble contour that matches the two line array cameras , .
[0007] Furthermore, obtaining a correction coefficient according to the matched bubble contour and correcting the bubble contour according to the correction coefficient includes: Get the vertical correction factor of the current paired bubble outline , get the horizontal coordinates from the horizontal correction coefficient database and With the true horizontal coordinate and The Euclidean distance Minimum horizontal correction factor of the coordinate and ,in: ; Among them, the horizontal correction coefficient and The methods for obtaining include: Use a large number of spheres of uniform size to simulate and calculate the actual pixel height of the spheres for: ; Calculate the true horizontal coordinates and The horizontal correction factor and for: ; ; Outline the bubble , Vertical correction factor Perform vertical correction and adjust the horizontal correction coefficient and Perform horizontal correction, specifically: The contour corresponding to the first camera is is the profile height, Resize the outline width, and the outline corresponding to the second camera is is the profile height, Resize the outline width.
[0008] Furthermore, the coordinates of the corrected image and bubble contour are input into a pre-trained DBPP-Net network to output the equivalent diameter and equivalent volume of the bubble, including: The bubble contour images of the two linear array cameras are resized and the coordinates of the contours are normalized to obtain the feature maps of the first camera and the second camera. and ; The feature map and The feature extraction is performed through the backbone network in the DBPP-Net network. The backbone network includes multiple CBS modules, DWC2F modules and SPPF modules. The feature map and The feature map obtained after the first DWC2F module is and ; The feature map obtained by the SPPF module is and ; The feature map is and feature map The upsampled features are concatenated into a cross-fused feature map containing two feature maps. ; The feature map is and feature map The upsampled features are concatenated into a cross-fused feature map containing two feature maps. ; The feature map With cross fusion feature map Convolution and DWC2F module downsampling to obtain the final image feature map ; The feature map With cross fusion feature map Convolution and DWC2F module downsampling to obtain the final image feature map ; The coordinate information , , , Normalize and then pass the fully connected layer to get the coordinate information feature vector ; The final image feature map The image feature vector is obtained by flattening the layer and then passing it through the fully connected layer. and ; The coordinate information feature vector With the image feature vector , The tensors are concatenated into a fused feature vector, and then regressed through a series of fully connected layers and Dropout layers to output the result vector, which are represented as the equivalent diameter and equivalent volume of the bubble, respectively.
[0009] Furthermore, the training method of the DBPP-Net network includes: By dropping a large number of steel balls of different sizes and shapes with known dimensions, two contour images and coordinate information of each steel ball are calculated, and the diameter and volume of the steel ball are used as regression results. All data are divided into test set and training set according to the set ratio; The DBPP-Net network is trained using the MAE mean absolute error as the loss function. The formula is as follows: ; Among them, MAE is the mean absolute error, is a specific truth value, is the measured value, is the total number of steel balls; Then perform weight training on the DBPP-Net network to obtain the model weight that performs best on the test set, and save the weight.
[0010] Furthermore, the DBPP-Net network includes a CBS module, a CBR module, a DWBottleneck module, a DWC2F module, and an SPPF module, wherein: The CBS module includes a convolutional layer, a batch normalization layer, Activation function; The CBR module includes a convolution layer, a batch normalization layer, Activation function; The DWBottleneck module is used to pass the feature map through the CBS module once and then through the maximum pooling layer to perform feature fusion; The DWC2F module is used to pass the feature map through the CBR module once, and then separate it into two parts according to the depth. After one part passes through the DWBottleneck module n times, the output of each layer of the DWBottleneck module is feature fused with the other part separated by depth, and then the CBR module is passed once to obtain the final output; The SPPF module is used to pass the feature map through the CBS module once and perform tensor splicing of the output results of the CBS module and the output results of the pooling layer of multiple scales.
[0011] In a second aspect, the present invention provides a chemical reaction gas real-time monitoring device, comprising: The acquisition and passing module is used to acquire the video frame images of the bubble contour generated under the set chemical reaction conditions by using two cross-mounted linear array cameras, and synchronize the images through timestamps; The detection and splicing module is used to detect the coordinate information of the bubble contour in the synchronized image, and determine whether it needs to be spliced with the next frame of image according to the y-axis coordinate information of the bubble contour; A matching module is used to optimally match the bubble contours in the spliced images using the Hungarian algorithm after splicing to obtain matched bubble contours; A correction module, used for obtaining a correction coefficient according to the matched bubble contour, and correcting the bubble contour according to the correction coefficient; A processing module is used to input the coordinates of the rectified image and bubble contour into the pre-trained DBPP-Net network and output the equivalent diameter and equivalent volume of the bubble; The monitoring module is used to count the total volume of bubbles generated per second based on the equivalent diameter and equivalent volume of the bubbles, and compare it with the upper limit of the abnormal reaction rate obtained in advance from the chemical reaction formula database to determine whether the chemical reaction rate is abnormal, thereby realizing real-time monitoring of chemical reaction gases.
[0012] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the aforementioned methods.
[0013] In a fourth aspect, the present invention provides a computer device, comprising: Memory, for storing computer programs / instructions; A processor is used to execute the computer program / instructions to implement the steps of any of the aforementioned methods.
[0014] In a fifth aspect, the present invention provides a computer program product, comprising a computer program / instruction, which implements the steps of any one of the aforementioned methods when executed by a processor.
[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention provides a method, device and storage medium for real-time monitoring of chemical reaction gas. Combining the characteristics of a linear array camera, the generated bubbles are read only once. Compared with other methods of obtaining bubble parameters through vision, the reading speed can be improved. In addition, during the process that bubbles are generated from a bubble generating device and then continuously merged between small bubbles and then rise, bubbles generated by different reaction rates can also be well captured, thus solving the problem that the current chemical experiment process is not intelligent and automated enough to obtain the reaction speed. 2. The created DBPP-Net network can well integrate the contour information and coordinate information of the two images for joint output. The created network model has stronger feature extraction capabilities than the ordinary CNN network, and does not require a very deep network layer to achieve good results. According to the cross-feature fusion, the two contours of the same bubble can be well associated together, which is conducive to the subsequent output of parameters such as bubble volume. Due to different reaction rates, the generated image has a certain distortion compared to the original image, and the distortion caused by different reaction speeds can be offset by combining coordinate information.
[0016] 3. Build a database of chemical reaction formulas, which can provide early warnings for abnormal reactions through quick queries, improve the safety of chemical laboratories, and significantly reduce the risks brought by chemical experiments. And each parameter of bubble generation can be observed and provided to scientific researchers, and the characteristics of the reaction process can be found from each profile of the reaction status. And because of the bubble generation device, it is not limited to various experimental vessels that produce chemical reactions. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic diagram of the overall hardware design framework of the device provided by the embodiment of the present invention; Figure 2 is a flow chart of a method for real-time monitoring of chemical reaction gases provided by an embodiment of the present invention; Figure 3 It is a schematic diagram of a DBPP-Net network provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0018] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0019] Embodiment 1: This embodiment introduces a method for real-time monitoring of chemical reaction gas, comprising: Acquire video frame images of bubble contours generated under set chemical reaction conditions by using two cross-mounted linear array cameras, and synchronize the images through time stamps; Detect the coordinate information of the bubble contour in the synchronized image, and determine whether it needs to be spliced with the next frame of image according to the y-axis coordinate information of the bubble contour; After stitching, the Hungarian algorithm is used to optimally match the bubble contours in the stitched images to obtain the matched bubble contours; Obtaining a correction coefficient according to the matched bubble contour, and correcting the bubble contour according to the correction coefficient; The corrected image and the coordinates of the bubble contour are input into the pre-trained DBPP-Net (Dual-input bubble parameter prediction Net) network, and the equivalent diameter and equivalent volume of the bubble are output; According to the equivalent diameter and equivalent volume of the bubbles, the total volume of bubbles generated per second is counted, and compared with the upper limit of the abnormal reaction rate obtained in advance from the chemical reaction formula database to determine whether the chemical reaction rate is abnormal, thereby realizing real-time monitoring of chemical reaction gases.
[0020] like Figure 2 As shown, the real-time monitoring method for chemical reaction gas provided in this embodiment specifically involves the following steps: Step 1: Start inputting chemical expressions on the computer terminal and start the power switches of the linear array camera and light source; When needed, turn on the power switches of the linear array camera and light source according to computer instructions, which can reduce laboratory power consumption and avoid disconnecting related power switches when no one is around to ensure laboratory safety.
[0021] The whole system was started by manually entering the chemical expression in the computer terminal and turning on the power switches of the line array camera and the light source.
[0022] Step 2: Image data acquisition and synchronization of two line array cameras; The image needs to be collected and synchronized. The specific steps are as follows: S21, equipment installation steps; The two cameras are defined as the first camera and the second camera. The first camera is set 7mm above the second camera and is cross-mounted. The specific installation image is as follows: Figure 1 As shown; S22, collecting camera images; The camera image and the timestamp of the camera image are read through the callback stream and saved in their respective queues.
[0023] S23, synchronized images; The camera image is taken out according to the timestamp. In case of camera frame leakage or frame error, the synchronized image with the corresponding timestamp is matched and synchronized according to the timestamp.
[0024] Step 3: Preprocess the contour of the image information; Since tiny bubbles in the image have a small impact on the overall system error and affect the overall speed, they are considered as noise contours. In the image, there may be abnormal objects blocking the system, and the large contours are considered as blocked contours. Due to the optical characteristics of the linear array camera, real bubbles have circular holes in the image, which need to be filled. Finally, the preprocessed image is formed. The specific steps are as follows: S31, contour detection and extraction of contour features; Detect the entire image through contours and obtain the minimum bounding rectangle parameters , , , and , , , The x-axis and y-axis coordinates of the upper left corner of the circumscribed rectangle of the contour, and the width and height of the minimum circumscribed rectangle; get the area parameters of the contour , .
[0025] S32, screening contour; According to the area of the contour , , minimum bounding rectangle parameters , and , Threshold is used to filter out noise contours, normal contours, and occluded contours. Noise contours and occluded contours are deleted, and normal contours are retained.
[0026] S33, hole filling; According to the morphological operation, the image is morphologically expanded, and then the original image and the image after the morphological operation are intersected. This operation is performed continuously until the image does not change and then the holes are filled.
[0027] Step 4: Determine whether the preprocessed image needs to be spliced with the next frame of the image; Since the contour at the same moment may not appear in the same frame of the image or the contour at the same moment may be incomplete in the current frame, it is necessary to complete the contour in conjunction with the next frame. The specific steps are as follows: S41, contour sorting; The two preprocessed synchronized images are subjected to contour detection, and the contours of the two images are sorted from top to bottom according to the y-axis coordinates.
[0028] S42, screening the outline to determine whether the next frame needs to be spliced; The respective contours of the bottom positions of the two synchronized images are screened out, and the coordinate information of the two contours is checked. According to the y-axis coordinate information of the two contours, if the bottom contour of the first camera touches the bottom of the image, or the bottom of the second camera is only a small distance away from the bottom of the image, it is determined that it needs to be spliced with the next frame of the image, and subsequent processing is performed after the image splicing is completed; if the above situation does not occur, it is determined that the image has been spliced and subsequent processing is performed.
[0029] Step 5: Perform contour detection and Hungarian algorithm matching based on the spliced images; All contours of the stitched images need to be matched one by one. The Hungarian algorithm needs to be used to calculate the optimal matching error, and one-to-one matching is performed based on the optimal matching error. The specific steps are as follows: S51, calculating required parameters; Sort the outlines of the stitched images corresponding to the first camera and the second camera according to the y coordinates of the stitched images; obtain the minimum bounding rectangle parameters of each outline of the first camera and the second camera , , , and , , , The x-axis and y-axis coordinates of the upper left corner of the circumscribed rectangle of the corresponding contour, and the width and height of the minimum circumscribed rectangle; Calculate the vertical velocity corresponding to each contour in the first camera and the second camera ,in The height difference of the camera is 7mm, and 0.025ms is the scanning time of each line of the linear array camera: ; Based on the scanning time of each line being 0.025ms, the vertical correction factor is ; S52, calculating a loss matrix according to the parameters; Due to the real physical properties of bubbles, the height error of the two contours of the same bubble is within the threshold and the y-axis error of the two contours is also within the threshold Within, that is, the conditions are: ; ; Use the weights to calculate the loss value for each pair , when the profile parameters are in the above conditions, Set to infinity; ; in and is to set the weight, is the vertical correction factor; Each pair of loss values Composition loss matrix ; The Hungarian algorithm is used to find the optimal solution as the matching result, and the corresponding contour of the match is defined as , .
[0030] Step 6: Obtain vertical correction coefficients and horizontal correction coefficients from the matched contour, and perform correction according to the correction coefficients; Due to the different reaction rates of bubbles, the contour height in the image is not the real contour height, but the vertical distortion caused by the bubble speed. The degree of distortion is inversely proportional to the reaction speed, and vertical correction needs to be performed based on the vertical correction coefficient obtained from the vertical speed. Due to the horizontal distance between the bubble and the camera, the bubble will produce a certain horizontal distortion in the horizontal direction, which requires horizontal correction. The specific steps are as follows: S61, calculate vertical correction ; Obtain the vertical correction coefficient according to S1 in step 5; Sort the outlines of the stitched images corresponding to the first camera and the second camera according to the y coordinates of the stitched images; obtain the minimum bounding rectangle parameters of each outline of the first camera and the second camera , , , and , , , The x-axis and y-axis coordinates of the upper left corner of the circumscribed rectangle of the corresponding contour, and the width and height of the minimum circumscribed rectangle; Calculate the vertical velocity corresponding to each contour in the first camera and the second camera ,in The height difference of the camera is 7mm, and 0.025ms is the scanning time of each line of the linear array camera: ; Based on the scanning time of each line being 0.025ms, the vertical correction factor is .
[0031] S62. Calculate the horizontal correction coefficient and ; Find the horizontal coordinates in the database based on the horizontal correction coefficient database and With the true horizontal coordinate and The Euclidean distance Minimum horizontal correction factor of the coordinate and ; ; Construction of horizontal correction coefficient database: Use a large number of uniform-sized spheres to simulate and obtain the vertical correction coefficients from step 5 above. for: ; Get the true pixel height of the sphere for: ; Calculate the true horizontal coordinates and The horizontal correction factor and for: ; .
[0032] S63, contour image correction is performed according to the correction coefficient; The outline , Vertical correction factor Perform vertical correction and adjust the horizontal correction coefficient and Perform horizontal correction, that is, the contour corresponding to the first camera is adjusted according to is the profile height, Resize the outline width, and the outline corresponding to the second camera is is the profile height, Resize the outline width.
[0033] Step 7: Input the corrected contour images and coordinates of the two cameras into the DBPP-Net network to obtain equivalent volume and equivalent diameter parameters; The two contour images and the coordinates of the two contours of each bubble after correction , , , Input into DBPP-Net network to output the equivalent diameter and equivalent volume of the bubble. The specific network structure is as follows Figure 3 shown.
[0034] Specific modules in DBPP-Net network: CBS module: consists of convolution layer (Conv), batch normalization layer (BN), Activation function (SiLu).
[0035] CBR module: consists of convolution layer (Conv), batch normalization layer (BN), Activation function (ReLu).
[0036] DWCBS module: consists of a depth-separable convolutional layer (DWConv), a batch normalization layer (BN), Activation function (SiLu).
[0037] DWBottleneck module: The original features are merged with the features after passing through the DWCBS module once and then through the maximum pooling layer.
[0038] DWC2F module: It first passes through the CBR module once, and then is separated into two parts according to the depth. After one part passes through the DWBottleneck module n times, the output of each layer of the DWBottleneck module is fused with the other part separated by depth, and then the CBR module is passed again to obtain the final output.
[0039] SPPF (Fast Spatial Pyramid Pooling) module: Through a CBS module, the output of the CBS module is concatenated with the output of pooling layers of multiple scales to enhance feature expression capabilities.
[0040] The specific operation steps are: (1) Fill the two contour images to the same size , the coordinates of the two contours are normalized. The feature maps of the first camera and the second camera are recorded as and .
[0041] (2) The two contour-filled images are passed through the backbone network for feature extraction. The backbone network consists of a series of CBS modules, DWC2F modules, and SPPF modules. The feature map obtained after the first DWC2F module is and ; The feature map obtained by the SPPF module is and .
[0042] (3) The characteristics of the DWC2F module With another feature map SPPF module features The upsampled features are concatenated into cross-fusion features containing two feature maps. ; The other side also gets the cross-fusion feature .
[0043] (4) Then use the SPPF module to obtain With cross-fusion features Final image features obtained by convolution and DWC2F module downsampling ; The final image features are also obtained on the other side .
[0044] (5) Coordinate information , , , Normalize and pass through the fully connected layer to get the final size The coordinate information feature vector of .
[0045] (6) The final image features Through the flattening layer and then the fully connected layer, the final size is Image feature vector and .
[0046] (7) The coordinate information feature vector With the image feature vector , Concatenate the tensors into a size of The fused feature vector is then regressed through a series of fully connected layers and Dropout layers (random inactivation layers) and the output result is The vectors are represented as the equivalent diameter and equivalent volume of the bubble respectively.
[0047] The training process of the DBPP-Net network is as follows: (1) By dropping a large number of steel balls of different sizes and shapes with known dimensions, two contour images and coordinate information of each steel ball are obtained through step 6, and the diameter and volume of the steel ball are used as regression results. All data are divided into a test set and a training set in a ratio of 1:4.
[0048] (2) Use MAE mean absolute error as the loss function for training.
[0049] ; The above MAE is the mean absolute error, is a specific truth value, is the measured value, is the total number of steel balls; The model is weighted and trained to obtain the model weight that performs best on the test set, and the weight is saved.
[0050] Step 8: Count the total volume of bubbles generated per second, query the database for the upper limit of the abnormal reaction speed of the chemical reaction formula, and issue an early warning when the upper limit is reached; Count the total volume of bubbles generated per second, query the database for the upper limit of abnormal reaction speed of the chemical reaction formula, and issue an early warning when the upper limit is reached. The specific steps are: S81, obtaining an upper limit value of abnormal reaction speed; Query the upper limit of abnormal reaction rate according to the chemical reaction formula database.
[0051] S82, obtaining the current reaction speed; The total volume of bubbles produced per second is calculated to be the reaction rate of gas production per second.
[0052] S83, issue an early warning; When the current reaction speed is greater than the upper limit of abnormal reaction speed, an alarm is issued.
[0053] Embodiment 2: This embodiment provides a chemical reaction gas real-time monitoring device, comprising: The acquisition and passing module is used to acquire the video frame images of the bubble contour generated under the set chemical reaction conditions by using two cross-mounted linear array cameras, and synchronize the images through timestamps; The detection and splicing module is used to detect the coordinate information of the bubble contour in the synchronized image, and determine whether it needs to be spliced with the next frame of image according to the y-axis coordinate information of the bubble contour; A matching module is used to optimally match the bubble contours in the spliced images using the Hungarian algorithm after splicing to obtain matched bubble contours; A correction module, used for obtaining a correction coefficient according to the matched bubble contour, and correcting the bubble contour according to the correction coefficient; A processing module is used to input the coordinates of the rectified image and bubble contour into the pre-trained DBPP-Net network and output the equivalent diameter and equivalent volume of the bubble; The monitoring module is used to count the total volume of bubbles generated per second based on the equivalent diameter and equivalent volume of the bubbles, and compare it with the upper limit of the abnormal reaction rate obtained in advance from the chemical reaction formula database to determine whether the chemical reaction rate is abnormal, thereby realizing real-time monitoring of chemical reaction gases.
[0054] The specific functional implementation of each of the above modules can be found in the relevant contents of the method in Example 1 and will not be elaborated here.
[0055] Embodiment 3, this embodiment provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of any one of the methods described in Embodiment 1 are implemented.
[0056] Embodiment 4: This embodiment provides a computer device, including: Memory, for storing computer programs / instructions; A processor, configured to execute the computer program / instructions to implement the steps of any one of the methods described in Example 1.
[0057] Embodiment 5: This embodiment provides a computer program product, including a computer program / instruction, which implements the steps of any method described in Embodiment 1 when executed by a processor.
[0058] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
[0059] It should be understood by those skilled in the art that the embodiments of the present disclosure may be provided as methods, systems or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0060] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0061] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0062] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure rather than to limit its protection scope. Although the present disclosure has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that after reading the present disclosure, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the disclosed claims to be approved.
Claims
1. A method for real-time monitoring of chemical reaction gases, characterized in that: include: Acquire video frame images of bubble contours generated under set chemical reaction conditions by using two cross-mounted linear array cameras, and synchronize the images through time stamps; Detect the coordinate information of the bubble outline in the synchronized image, and determine whether it needs to be spliced with the next frame of image according to the y-axis coordinate information of the bubble outline; After stitching, the Hungarian algorithm is used to optimally match the bubble contours in the stitched images to obtain the matched bubble contours; Obtaining a correction coefficient according to the matched bubble contour, and correcting the bubble contour according to the correction coefficient; The corrected image and the coordinates of the bubble contour are input into the pre-trained DBPP-Net network, and the equivalent diameter and equivalent volume of the bubble are output; According to the equivalent diameter and equivalent volume of the bubbles, the total volume of bubbles generated per second is counted, and compared with the upper limit of the abnormal reaction rate obtained in advance from the chemical reaction formula database to determine whether the chemical reaction rate is abnormal, thereby realizing real-time monitoring of chemical reaction gases.
2. The method for real-time monitoring of chemical reaction gases according to claim 1, characterized in that: The method further includes: preprocessing the video frame images acquired by the two line array cameras, specifically including: Obtain the minimum bounding rectangle parameters and area parameters of the bubble outline of the video frame images in the two linear array cameras; Threshold screening is performed based on the minimum bounding rectangle parameters and area parameters of the bubble contour to delete noise contours and occluded contours; The holes in the filtered image are filled through morphological operations to complete the preprocessing operation.
3. The method for real-time monitoring of chemical reaction gases according to claim 1, characterized in that: The Hungarian algorithm is used to optimally match the bubble contours in the stitched image to obtain bubble contours matched by two line array cameras, including: The bubble contour is detected again on the images stitched from the two line array cameras; Sort the detected bubble contours according to the y coordinates of the stitched image; Set two linear array cameras as the first camera and the second camera respectively, and obtain the circumscribed rectangle parameters of each bubble outline in the first camera and the second camera. , , , and , , , ,in, , , , are the x-axis and y-axis coordinates of the upper left corner of the bounding rectangle of the bubble outline of the first camera, and the width and height of the minimum bounding rectangle, respectively. , , , are the x-axis and y-axis coordinates of the upper left corner of the circumscribed rectangle of the bubble outline of the second camera, and the width and height of the minimum circumscribed rectangle; Calculate the vertical velocity corresponding to each bubble outline in the first camera and the second camera , the formula is as follows: ; in, is the height difference of the line array camera, is the scanning time of each line of the linear array camera; According to the vertical speed Calculate the vertical correction factor ; Where g is the acceleration due to gravity; Calculate the loss value of each pair according to the vertical correction coefficient , the formula is as follows: ; in, and is to set the weight; When the parameters of the bubble contour meet the following conditions, Set to infinity: ; ; in, is the height error threshold of the two contours of the same bubble, The y-axis error threshold of two contours of the same bubble; The loss value of each pair Composition loss matrix ; For the loss matrix Apply the Hungarian algorithm to find the bubble contours that match the two linear array cameras , .
4. The method for real-time monitoring of chemical reaction gas according to claim 3, characterized in that: The step of obtaining a correction coefficient according to the matched bubble contour and correcting the bubble contour according to the correction coefficient includes: Get the vertical correction factor of the current paired bubble outline , get the horizontal coordinates from the horizontal correction coefficient database and With the true horizontal coordinate and The Euclidean distance Minimum horizontal correction factor of the coordinate and ,in: ; Among them, the horizontal correction coefficient and The methods for obtaining include: Use a large number of spheres of uniform size to simulate and calculate the actual pixel height of the spheres for: ; Calculate the true horizontal coordinates and The horizontal correction factor and for: ; ; Outline the bubble , Vertical correction factor Perform vertical correction and adjust the horizontal correction coefficient and Perform horizontal correction, specifically: The contour corresponding to the first camera is is the profile height, Resize the outline width, and the outline corresponding to the second camera is is the profile height, Resize the outline width.
5. The method for real-time monitoring of chemical reaction gases according to claim 4, characterized in that: The coordinates of the corrected image and bubble contour are input into the pre-trained DBPP-Net network, and the equivalent diameter and equivalent volume of the bubble are output, including: The bubble contour images of the two linear array cameras are resized and the coordinates of the contours are normalized to obtain the feature maps of the first camera and the second camera. and ; The feature map and The feature extraction is performed through the backbone network in the DBPP-Net network. The backbone network includes multiple CBS modules, DWC2F modules and SPPF modules. The feature map and The feature map obtained after the first DWC2F module is and ; The feature map obtained by the SPPF module is and ; The feature map is and feature map The upsampled features are concatenated into a cross-fused feature map containing two feature maps. ; The feature map is and feature map The upsampled features are concatenated into a cross-fused feature map containing two feature maps. ; The feature map With cross fusion feature map Convolution and DWC2F module downsampling to obtain the final image feature map ; The feature map With cross fusion feature map Convolution and DWC2F module downsampling to obtain the final image feature map ; The coordinate information , , , Normalize and then pass the fully connected layer to get the coordinate information feature vector ; The final image feature map The image feature vector is obtained by flattening the layer and then passing it through the fully connected layer. and ; The coordinate information feature vector With the image feature vector , The tensors are concatenated into a fused feature vector, and then regressed through a series of fully connected layers and Dropout layers to output the result vector, which are represented as the equivalent diameter and equivalent volume of the bubble, respectively.
6. The method for real-time monitoring of chemical reaction gases according to claim 5, characterized in that: The training method of the DBPP-Net network includes: By dropping a large number of steel balls of different sizes and shapes with known dimensions, two contour images and coordinate information of each steel ball are calculated, and the diameter and volume of the steel ball are used as regression results. All data are divided into test set and training set according to the set ratio; The DBPP-Net network is trained using the MAE mean absolute error as the loss function. The formula is as follows: ; Among them, MAE is the mean absolute error, is a specific truth value, is the measured value, is the total number of steel balls; Then perform weight training on the DBPP-Net network to obtain the model weight that performs best on the test set, and save the weight.
7. The method for real-time monitoring of chemical reaction gases according to claim 5, characterized in that: The DBPP-Net network includes a CBS module, a CBR module, a DWBottleneck module, a DWC2F module, and an SPPF module, wherein: The CBS module includes a convolutional layer, a batch normalization layer, Activation function; The CBR module includes a convolution layer, a batch normalization layer, Activation function; The DWBottleneck module is used to pass the feature map through the CBS module once and then through the maximum pooling layer to perform feature fusion; The DWC2F module is used to pass the feature map through the CBR module once, and then separate it into two parts according to the depth. After one part passes through the DWBottleneck module n times, the output of each layer of the DWBottleneck module is feature fused with the other part separated by depth, and then the CBR module is passed once to obtain the final output; The SPPF module is used to pass the feature map through the CBS module once and perform tensor splicing of the output results of the CBS module and the output results of the pooling layer of multiple scales.
8. A chemical reaction gas real-time monitoring device, characterized in that: include: The acquisition and passing module is used to acquire the video frame images of the bubble contour generated under the set chemical reaction conditions by using two cross-mounted linear array cameras, and synchronize the images through timestamps; The detection and splicing module is used to detect the coordinate information of the bubble contour in the synchronized image, and determine whether it needs to be spliced with the next frame of image according to the y-axis coordinate information of the bubble contour; A matching module is used to optimally match the bubble contours in the spliced images using the Hungarian algorithm after splicing to obtain matched bubble contours; A correction module, used for obtaining a correction coefficient according to the matched bubble contour, and correcting the bubble contour according to the correction coefficient; A processing module is used to input the coordinates of the rectified image and bubble contour into the pre-trained DBPP-Net network and output the equivalent diameter and equivalent volume of the bubble; The monitoring module is used to count the total volume of bubbles generated per second based on the equivalent diameter and equivalent volume of the bubbles, and compare it with the upper limit of the abnormal reaction rate obtained in advance from the chemical reaction formula database to determine whether the chemical reaction rate is abnormal, thereby realizing real-time monitoring of chemical reaction gases.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.
10. A computer device, characterized in that: include: Memory, for storing computer programs / instructions; A processor, configured to execute the computer program / instructions to implement the steps of the method according to any one of claims 1 to 7.
Citation Information
Cited By
Bubble separation volume prediction and gas injection optimization control method, system and equipment of immersed non-isothermal gas injection system
CN122334099A