Bubble characteristic parameter determination method and device, storage medium and electronic equipment
Through machine vision and deep learning technology, high-precision bubble detection under electrolytic conditions is achieved, and the problem of difficulty in bubble detection during electrolytic hydrogen production is solved. The detailed characteristic parameters of the bubble are obtained and the bubble behavior is established. The relationship with working conditions parameters improves the safety and efficiency of the hydrogen production process.
Patent Information
- Application Number
- CN202411418968.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-10-11
AI Technical Summary
During the process of electrolyzing hydrogen production, bubble detection is difficult under working conditions. The prior art cannot achieve high-precision and fast bubble detection, and it cannot effectively analyze the complex coupling relationship between bubble behavior characteristics and working conditions parameters.
Using machine vision method, by inputting the bubble image into the segmentation model for processing, the position information of the bubble and the segmentation mask are obtained, and the motion path and characteristic parameters of the bubble are determined in combination with a dynamic tracking algorithm, including static and dynamic characteristic parameters. Image enhancement and segmentation are used using deep learning models such as MaskTransfiner and URetinex-Net to improve the accuracy of bubble detection.
It significantly improves the accuracy and speed of bubble detection, and can accurately obtain characteristic parameters such as the size, shape, and motion trajectory of bubbles. It overcomes the problem of small object detection under complex working conditions and the problem of accuracy reduction under unbalanced light conditions, and realizes bubbles. Effective correlation between behavior and working condition parameters.
Smart Images

Figure CN119229126A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of hydrogen production by water electrolysis, and in particular, to a method and device for determining bubble characteristic parameters, a storage medium, and an electronic device. Background Art
[0002] Hydrogen production by water electrolysis is a clean and efficient method of hydrogen production, which can promote the development of hydrogen energy, reduce dependence on fossil energy, improve the environment, increase energy utilization, and also contribute to the development of new industries. Real-time and accurate detection and control of bubbles under working conditions is of great significance to ensure the safety and efficiency of the hydrogen production process.
[0003] However, real-time, high-precision bubble detection under working conditions is facing some key challenges: (1) Because the size, shape and distribution of bubbles may be very uneven, high-precision and robust detection methods are required; (2) Bubbles move very fast under working conditions, requiring detection equipment and software algorithms that can respond quickly; (3) During the electrolysis process, factors such as current, voltage, and temperature may change frequently, and these changes will directly affect the generation and behavior of bubbles. How to analyze the complex coupling relationship between the behavior characteristics of bubbles and working parameters is also a challenge for the rational and efficient regulation of working parameters.
[0004] With regard to the problem of difficulty in detecting bubbles at electrodes on both sides of electrolyzed water in related technologies, no effective solution has yet been proposed. Summary of the invention
[0005] The embodiments of the present application provide a method and device for determining bubble characteristic parameters, a storage medium, and an electronic device to at least solve the problem of difficulty in detecting bubbles at electrodes on both sides of electrolyzed water in the prior art.
[0006] According to an embodiment of the embodiments of the present application, a method for determining bubble characteristic parameters is provided, comprising: inputting a first bubble image into a segmentation model for processing to obtain position information of multiple bubbles at a first moment and a bubble segmentation mask, wherein the bubble image includes the multiple bubbles, and the first moment is a shooting moment of the first bubble image; dynamically tracking the multiple bubbles in the multiple first bubble images to obtain movement paths of the multiple bubbles, wherein the shooting moments of the multiple first bubble images are different, and the movement paths are used to indicate the position information of the bubbles at different moments; determining the bubble segmentation masks of the multiple bubbles at different moments according to the movement paths, and determining the bubble characteristic parameters of the multiple bubbles according to the movement paths and the bubble segmentation masks at different moments, wherein the bubble characteristic parameters include static characteristic parameters and dynamic characteristic parameters.
[0007] In an exemplary embodiment, before inputting the first bubble image into the segmentation model for processing, the method also includes: acquiring a video stream of the target area through a camera device to obtain a bubble video stream; reading a first number of second bubble images from the bubble video stream through a producer thread and adding them to a cache queue; reading the first number of second bubble images from the cache queue through a consumer thread, and preprocessing the second bubble images to obtain the first bubble image.
[0008] In an exemplary embodiment, the second bubble image is preprocessed to obtain the first bubble image, including: performing transmittance calculation on the second bubble image to obtain a transmittance value of the second bubble image; when it is determined that the transmittance value of a third bubble image in the second bubble image is lower than a first preset threshold, performing histogram equalization on the third bubble image according to a standard bubble image to obtain a processed third bubble image, wherein the second bubble image includes the standard bubble image; and inputting the processed third bubble image into a low-light enhancement model for processing to obtain the first bubble image.
[0009] In an exemplary embodiment, a first bubble image is input into a segmentation model for processing to obtain position information of multiple bubbles at a first moment and a bubble segmentation mask, including: segmenting the first bubble image through a first segmentation model, and extracting results from the segmented first bubble image to obtain first position information and a first bubble segmentation mask of large bubbles, wherein the multiple bubbles include the large bubbles, and the bubble volume of the large bubbles is greater than a second preset threshold; segmenting the first bubble image through a second segmentation model, and performing bubble detection on the segmented first bubble image to obtain second position information and a second bubble segmentation mask of small bubbles, wherein the multiple bubbles include the small bubbles, and the bubble volume of the small bubbles is less than the second preset threshold, and the segmentation model includes the first segmentation model and the second segmentation model; generating a fourth bubble image according to the first position information, the first bubble segmentation mask, the second position information and the second bubble segmentation mask, wherein the fourth bubble image includes the position information and the bubble segmentation mask of the multiple bubbles at the first moment.
[0010] In an exemplary embodiment, before inputting the first bubble image into the segmentation model for processing, the method also includes: establishing a bubble data set, wherein the bubble data set includes multiple bubble images carrying bubble segmentation masks; determining a loss function according to the type of the segmentation model, wherein the loss function is used to train the segmentation model; and training the segmentation model according to the bubble data set and the loss function.
[0011] In an exemplary embodiment, the multiple bubbles are dynamically tracked in the multiple first bubble images to obtain the motion paths of the multiple bubbles, including: extracting the appearance features of the first bubble in the multiple bubbles to obtain the first appearance features, and extracting the appearance features of the multiple second bubbles in the fifth bubble image to obtain the multiple second appearance features, respectively calculating the cosine distances between the first appearance features and the multiple second appearance features to obtain multiple cosine distance values, wherein the shooting time of the fifth bubble image is the next moment after the first moment; predicting the motion trajectory of the first bubble by using a Kalman filter to calculate a first index value between the future position predicted by the first bubble and the multiple second bubbles, wherein the first index value is used to indicate the motion trajectory of the first bubble the overlap between the position at the next moment and the second bubble; respectively calculate the average absolute difference in the direction of the movement speed of the first bubble and the multiple second bubbles to obtain multiple directional absolute differences; respectively calculate the absolute difference in the confidence of the first bubble and the multiple second bubbles to obtain multiple confidence absolute differences, wherein the confidence is determined by the segmentation model; construct a cost matrix according to the multiple cosine distance values, the multiple first index values, the multiple directional absolute differences and the multiple confidence absolute differences, and process the cost matrix through the Hungarian algorithm to determine a third bubble from the multiple second bubbles, wherein the third bubble is the bubble corresponding to the first bubble at the next moment after the first moment; determine the movement path of the first bubble according to the multiple third bubbles.
[0012] In an exemplary embodiment, determining the bubble characteristic parameters of the plurality of bubbles according to the motion path and the bubble segmentation mask at different moments includes at least one of the following: counting the number of bubbles in the first bubble image according to the bubble segmentation mask; determining the equivalent volume of the plurality of bubbles according to the cross-sectional area of the bubble segmentation mask and the size information of the reference object in the first bubble image; determining the real-time radius of the plurality of bubbles at the first moment according to the plurality of equivalent volumes; calculating the gas content of the liquid flowing through the target area in a target time period according to the liquid flow rate in the target area and the equivalent volume, wherein the start time of the target time period is the time when the target bubble enters the target area, and the end time of the target time period is the time when the target bubble leaves the target area, and the static characteristic parameters include: the number of bubbles, the equivalent volume, the real-time radius, and the gas content; determining the average flow rate of the plurality of bubbles according to the actual height information of the target area and the time length of the target time period; counting the movement behavior of the plurality of bubbles in the target area according to the motion path and the bubble segmentation mask at different moments, wherein the movement behavior includes the movement direction of the bubbles, and the dynamic characteristic parameters include the average flow rate and the movement behavior.
[0013] According to another embodiment of the embodiment of the present application, a device for determining bubble characteristic parameters is also provided, including: a processing module, used to input a first bubble image into a segmentation model for processing, to obtain position information and a bubble segmentation mask of multiple bubbles at a first moment, wherein the bubble image includes the multiple bubbles, and the first moment is the shooting moment of the first bubble image; a tracking module, used to dynamically track the multiple bubbles in the multiple first bubble images, to obtain movement paths of the multiple bubbles, wherein the shooting moments of the multiple first bubble images are different, and the movement paths are used to indicate the position information of the bubbles at different moments; a determination module, used to determine the bubble segmentation masks of the multiple bubbles at different moments according to the movement paths, and to determine the bubble characteristic parameters of the multiple bubbles according to the movement paths and the bubble segmentation masks at different moments, wherein the bubble characteristic parameters include static characteristic parameters and dynamic characteristic parameters.
[0014] According to another aspect of an embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for focusing the target area when running.
[0015] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-mentioned method for focusing the target area through the computer program.
[0016] In an embodiment of the present application, a first bubble image is first input into a segmentation model for processing to obtain position information of different bubbles at a first moment and a bubble segmentation mask, wherein the bubble image contains a plurality of bubbles, and the first moment is the shooting moment of the first bubble image; then, the plurality of bubbles are dynamically tracked in the plurality of first bubble images to obtain movement paths of the bubbles, wherein the shooting moments of the first bubble images are different, and the movement paths are used to indicate the position information of the bubbles at different moments; bubble segmentation masks of the plurality of bubbles at different moments are determined according to the movement paths, and then bubble characteristic parameters of the bubbles are determined according to the movement paths and the bubble segmentation masks at different moments, and the bubble characteristic parameters include static characteristic parameters and dynamic characteristic parameters; the above scheme is adopted in combination with a high-precision segmentation model to significantly improve the accuracy of bubble detection, thereby obtaining accurate bubble characteristic parameters; thereby solving the problem of difficulty in bubble detection at electrodes on both sides of water electrolysis in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 It is a hardware structure block diagram of a computer terminal of an optional method for determining bubble characteristic parameters according to an embodiment of the present application;
[0019] Figure 2 is a flow chart of a method for determining bubble characteristic parameters according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of an optional producer-consumer design pattern according to an embodiment of the present application;
[0021] Figure 4 is a schematic diagram of an optional bubble image preprocessing process according to an embodiment of the present application;
[0022] Figure 5 is a schematic diagram of an optional U-Retinex model structure according to an embodiment of the present application;
[0023] Figure 6 is a schematic diagram of an optional MaskTransfiner detection process according to an embodiment of the present application;
[0024] Figure 7 is a schematic diagram of an optional bubble image segmentation process according to an embodiment of the present application;
[0025] Figure 8 It is a schematic diagram of the overall process of an optional high-precision bubble detection method according to an embodiment of the present application;
[0026] Fig. 9 It is a structural block diagram of a device for determining bubble characteristic parameters according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices; "plurality" means two or more.
[0029] The method embodiments provided in the embodiments of the present application can be executed on a computer terminal or a similar computing system. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal for determining a bubble characteristic parameter according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a processing system such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.
[0030] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the characteristic parameters of bubbles in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage systems, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the secure text via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0031] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet.
[0032] In the related art, two bubble detection methods, namely electrical resistance tomography and laser scattering, are proposed.
[0033] Electrical resistance tomography, also known as electrical resistance tomography (ERT), is an online real-time detection technology that analyzes the medium distribution of the measured field through the correspondence between conductivity and medium. This technology is used to provide a two-dimensional image of the gas phase distribution in the cross section of the chromatographic column of the bubble reaction tower to study the effect of liquid rheological properties on gas holdup. The experimental results show that when the viscosity of the liquid increases, the liquid gas holdup will decrease and reach a minimum or stable value. However, due to its low resolution, electrical resistance tomography cannot measure the gas holdup in all cases.
[0034] However, when using electrical resistance tomography for submillimeter bubble detection under working conditions, it will face the following difficulties: First, for small bubbles or sparsely distributed bubbles, the resistance change may be small and difficult to detect. At the same time, the insufficient spatial resolution of tomography makes it very difficult to identify the number of bubbles. Second, electrical resistance tomography requires the use of complex electrode arrays and circuit systems to measure resistance, which increases the complexity and cost of the equipment. In terms of data processing, complex algorithms are needed to parse and interpret the data, which requires a lot of computing resources and affects the speed of real-time feedback. Third, electrical resistance tomography cannot directly provide quantifiable indicators such as the gas content of the liquid, the size, shape and movement speed of the bubbles.
[0035] The laser scattering method is based on the Mie scattering theory (Mie theory), which is based on the Maxwell equations of electromagnetic waves. It is a strict mathematical solution for the diffraction of a plane linearly polarized monochromatic wave by a uniform sphere with arbitrary diameter and arbitrary composition in a uniform medium. Compared with the acoustic method, the laser scattering method does not destroy the structure of the bubble and can identify submillimeter bubbles, so it has become one of the important methods for bubble detection.
[0036] The laser scattering method also has the following major challenges for bubble detection under working conditions: First, in terms of sensitivity and accuracy, due to the low opacity of submillimeter bubbles, their transparent properties may affect the diffraction and scattering of the laser, resulting in a weak scattering signal that is difficult to detect accurately. Second, in terms of environmental conditions, bubble detection may be affected by factors such as temperature, humidity, and light. Therefore, accurate detection requires a specific environment. Third, in terms of safety, laser scattering equipment may produce strong light, so safety precautions may need to be taken during use to prevent damage to the operator's eyes.
[0037] Therefore, in order to further improve the detection efficiency and directly obtain the bubble morphology characteristics under working conditions, this application uses machine vision methods to carry out research.
[0038] In this embodiment, a method for determining bubble characteristic parameters is provided, which is applied to a computer terminal. Figure 2 is a flow chart of a method for determining bubble characteristic parameters according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0039] Step S202, inputting the first bubble image into the segmentation model for processing to obtain position information of a plurality of bubbles at a first moment and a bubble segmentation mask, wherein the bubble image includes the plurality of bubbles, and the first moment is the shooting moment of the first bubble image;
[0040] Step S204, dynamically tracking the multiple bubbles in the multiple first bubble images to obtain movement paths of the multiple bubbles, wherein the multiple first bubble images are taken at different times, and the movement paths are used to indicate position information of the bubbles at different times;
[0041] Step S206, determining bubble segmentation masks of the multiple bubbles at different moments according to the motion path, and determining bubble feature parameters of the multiple bubbles according to the motion path and the bubble segmentation masks at different moments, wherein the bubble feature parameters include static feature parameters and dynamic feature parameters.
[0042] By adopting the above steps, the first bubble image is first input into the segmentation model for processing to obtain the position information of different bubbles at the first moment and the bubble segmentation mask, wherein the bubble image contains multiple bubbles, and the first moment is the shooting moment of the first bubble image; then, the multiple bubbles are dynamically tracked in the multiple first bubble images to obtain the movement paths of the bubbles, wherein the shooting moments of the first bubble images are different, and the movement paths are used to indicate the position information of the bubbles at different moments; the bubble segmentation masks of the multiple bubbles at different moments are determined according to the movement paths, and then the bubble characteristic parameters of the bubbles are determined according to the movement paths and the bubble segmentation masks at different moments, and the bubble characteristic parameters include static characteristic parameters and dynamic characteristic parameters; the above scheme is adopted in combination with a high-precision segmentation model to significantly improve the accuracy of bubble detection, thereby obtaining accurate bubble characteristic parameters; thereby solving the problem of difficulty in bubble detection at electrodes on both sides of electrolyzed water in the related technology.
[0043] Optionally, execute the above step S202: before inputting the first bubble image into the segmentation model for processing, the method also includes: acquiring a video stream of the target area through a camera device to obtain a bubble video stream; reading a first number of second bubble images from the bubble video stream through a producer thread, and adding them to a cache queue; reading the first number of second bubble images from the cache queue through a consumer thread, and preprocessing the second bubble images to obtain the first bubble image.
[0044] In the embodiment of the present application, a high-speed shadow imaging system is built to collect data. The system mainly includes a high-speed camera, a host computer control system, an illumination source, a light homogenizer, and a hydrogen production device. The high-speed camera is located directly in front of the electrode, and the light source is located directly behind the electrode. Figure 3As shown in the figure, the producer-consumer design pattern can decouple video stream reading and video stream inference. This design model consists of two parts, namely the producer and the consumer. The producer is responsible for reading a specified number of bubble images (i.e., the second bubble image mentioned above) from the camera for inference. When the actual deep learning model is inferred, inference is performed according to the number of batch images to achieve the optimal throughput of the GPU. This producer-consumer design model also meets the model's need to read a batch of images from the cache queue each time.
[0045] Furthermore, the second bubble image is preprocessed to obtain the first bubble image, including: performing transmittance calculation on the second bubble image to obtain a transmittance value of the second bubble image; when it is determined that the transmittance value of the third bubble image in the second bubble image is lower than a first preset threshold, performing histogram equalization on the third bubble image according to the standard bubble image to obtain a processed third bubble image, wherein the second bubble image includes the standard bubble image; and inputting the processed third bubble image into a low-light enhancement model for processing to obtain the first bubble image.
[0046] like Figure 4 As shown in the figure, as the electrolysis time becomes longer, after the transmittance index is calculated, the processing method for the bubble image with a transmittance lower than the first preset threshold (that is, the third bubble image mentioned above) is as follows: first, the first image in the training image is used as a benchmark (that is, the standard bubble image mentioned above) to perform histogram equalization to improve the contrast and brightness of the image; secondly, the transformation of the image from low transmittance to high transmittance is regarded as a low-light enhancement problem, and the bubble image is simultaneously input into the low-light enhancement model URetinex-Net to further enhance the image.
[0047] Optionally, other methods may be used to select the standard bubble image, such as by machine identifying the image whose image parameters are closest to a preset threshold and using it as the standard bubble image, or by manual selection, which is not limited in this application.
[0048] It should be noted that URetinex-Net is an innovative framework for image enhancement in low-light environments. It combines traditional Retinex theory with deep neural networks to provide a new solution for low-light image enhancement. Its deep unfolding network can more accurately estimate the brightness distribution of the image, thereby improving the image brightness while retaining the original color information and details. Figure 5 As shown in the figure, the network structure diagram of URetinex-Net is shown. We effectively enhance the accuracy of bubble detection and significantly reduce the missed detection rate by applying advanced methods of low-light enhancement tasks to solve the problem of reduced image transmittance in the water electrolysis process.
[0049] Optionally, the first bubble image is input into a segmentation model for processing to obtain position information of multiple bubbles at a first moment and a bubble segmentation mask, including: segmenting the first bubble image through a first segmentation model, and performing bubble detection on the segmented first bubble image to obtain first position information and a first bubble segmentation mask of large bubbles, wherein the multiple bubbles include the large bubbles, and the bubble volume of the large bubbles is greater than a second preset threshold; segmenting the first bubble image through a second segmentation model, and performing bubble detection on the segmented first bubble image to obtain second position information and a second bubble segmentation mask of small bubbles, wherein the multiple bubbles include the small bubbles, and the bubble volume of the small bubbles is less than the second preset threshold, and the segmentation model includes the first segmentation model and the second segmentation model; generating a fourth bubble image according to the first position information, the first bubble segmentation mask, the second position information and the second bubble segmentation mask, wherein the fourth bubble image includes the position information and the bubble segmentation mask of the multiple bubbles at the first moment.
[0050] In this application, for larger bubbles (i.e. the large bubbles mentioned above), the change in the light and dark relationship between the center and the surrounding can be clearly observed, and the characteristics are obvious. However, due to scale reasons, there is a problem of easy mutual occlusion between large bubbles. If they cannot be accurately divided, it will seriously affect the accuracy of bubble detection and the subsequent calculation of morphological dimensions. Therefore, this application decides to use deep learning to capture this feature and achieve high-precision individual bubble division, thereby achieving accurate bubble detection and segmentation.
[0051] Optionally, the MaskTransfiner model based on Transformer can be used to implement the detection and segmentation of specific bubbles. Figure 6 The figure shows the detection flow chart of MaskTransfiner, which decomposes the image area into a quadtree and combines the Transformer-based method to correct the error-prone tree nodes in parallel, and finally achieves the prediction of highly accurate instance masks at a low computational cost, thereby obtaining bubble segmentation masks, and the error-prone nodes existing in the detection boundary are also segmented more accurately. Through this solution, the boundaries between large bubbles gradually become clearer, and the problem of low morphological size calculation accuracy caused by the unclear boundary division of traditional model detection is effectively solved.
[0052] As for the detection and segmentation of small-sized bubbles (i.e. the small bubbles mentioned above), in actual high-speed bubble images, as the bubble scale decreases, the texture features continue to decrease. Increasing the detection accuracy from the perspective of increasing the number of small bubble annotations alone has high labor costs and great difficulty. In-depth observation found that the morphology of small bubbles is similar to that of traditional spots. Therefore, based on the similarities between the two, this application migrates the process of traditional spot detection to the detection of small bubbles. The specific process is as follows: Figure 7 shown.
[0053] In order to ensure that the detection of large bubbles is not affected during the detection of small bubbles, we segmented the original image and divided the original 1280*800 image into 256 blocks, each of which is 80*50 in size. At the same time, in order to ensure that the smallest bubbles can be detected, we also expanded each individual block by 2 times. The adaptive contrast enhancement algorithm is also applied to the separation, thereby enlarging the difference between the bubble body and the surrounding environment in the highly magnified image. Finally, the segmented images are input into the spot detector in sequence, and the constraint parameters (roundness, area, convexity) of the spot detector are used to filter some bubbles, thereby avoiding some extremely small impurities in the gas-liquid system.
[0054] It should be noted that the above data such as 1280*800 and 256 blocks are only used as examples and can be set to other values in actual application, and do not limit this application.
[0055] The detection process of large bubbles and small bubbles is performed synchronously, and finally the large bubble segmentation result and the small bubble segmentation result are merged to generate a fourth bubble image.
[0056] Optionally, before inputting the first bubble image into the segmentation model for processing, the method also includes: establishing a bubble data set, wherein the bubble data set includes multiple bubble images carrying bubble segmentation masks; determining a loss function according to the type of the segmentation model, wherein the loss function is used to train the segmentation model; and training the segmentation model according to the bubble data set and the loss function.
[0057] First, a bubble dataset is established, and nearly 10,000 bubble segmentation instances are annotated (i.e., bubble images are annotated with bubble segmentation masks), providing a large number of learning samples for model training. Then, the loss function used to train the segmentation model is determined according to the type of segmentation model selected, and then the bubble dataset and loss function are used to complete the training process of the segmentation model.
[0058] Optionally, dynamically tracking the multiple bubbles in the multiple first bubble images to obtain the movement paths of the multiple bubbles includes: extracting the appearance features of the first bubble in the multiple bubbles to obtain the first appearance feature, and extracting the appearance features of the multiple second bubbles in the fifth bubble image to obtain the multiple second appearance features, respectively calculating the cosine distances between the first appearance feature and the multiple second appearance features to obtain multiple cosine distance values, wherein the shooting time of the fifth bubble image is the next moment after the first moment; predicting the motion trajectory of the first bubble by using a Kalman filter to calculate a first index value between the future position predicted by the first bubble and the multiple second bubbles, wherein the first index value is used to indicate the movement of the first bubble to the next time The method comprises the following steps: calculating the degree of overlap between the position at the first moment and the second bubble; calculating the average absolute difference in the direction of the movement speed of the first bubble and the multiple second bubbles respectively, and obtaining multiple directional absolute differences; calculating the absolute difference in the confidence of the first bubble and the multiple second bubbles respectively, and obtaining multiple confidence absolute differences, wherein the confidence is determined by the segmentation model; constructing a cost matrix according to the multiple cosine distance values, the multiple first index values, the multiple directional absolute differences and the multiple confidence absolute differences, and processing the cost matrix through the Hungarian algorithm to determine a third bubble from the multiple second bubbles, wherein the third bubble is the bubble corresponding to the first bubble at the next moment after the first moment; and determining the movement path of the first bubble according to the multiple third bubbles.
[0059] After model detection, the output results will include information about the bubble location, which are the upper left corner and lower right corner of the detection box corresponding to the bubble (i.e. the above position information), as well as the confidence. The output results are passed to the Hybrid-SORT model as input. The Hybrid-SORT model will calculate the position of the next matching target based on five dimensions of information, including confidence, speed, position, appearance features, and height. The specific calculation process includes:
[0060] 1. Based on the SimCLR framework, the appearance features of each bubble are extracted to obtain the first appearance features, and the cosine distance is used as the similarity measure between the tracking bubble (i.e., the second bubble) and the detection bubble (i.e., the first bubble), that is, the cosine distance value;
[0061] 2. According to the position information of the detected bubble, the Kalman filter is used to estimate the next frame motion of the bubble, and the front and rear bubbles are distinguished by combining the height information of the bubble, and the HMIOU index (i.e., the first index value mentioned above) is used as the similarity measure between the tracked bubble and the detected bubble;
[0062] 3. Combined with the velocity direction information of the bubble, the average absolute difference in velocity direction of the four corner points of the tracking bubble and the detection bubble is calculated as a similarity measurement index (i.e., the above-mentioned absolute difference in direction);
[0063] 4. In order to deal with the situation where tracking is lost when bubbles are occluded, the feature that the confidence is lower when the bubbles are occluded is utilized, and the absolute difference between the confidences (i.e. the above-mentioned absolute difference in confidence) is used as the similarity measure between the tracked bubbles and the detected bubbles.
[0064] Taking all the similarity measures of the above dimensions into consideration, a total cost matrix is calculated, and the best one-to-one matching between the tracking bubble and the detection bubble is obtained using the Hungarian algorithm. Thus, the motion path of each individual bubble is determined based on the tracking and matching results of each frame.
[0065] The high-precision mask obtained in the above manner can effectively calculate the particle size distribution of bubbles, count the number of bubbles in each frame, and calculate indicators such as gas holdup in combination with operating parameters. Specifically. Determining bubble characteristic parameters of the plurality of bubbles according to the motion path and the bubble segmentation masks at different moments includes at least one of the following: counting the number of bubbles in the first bubble image according to the bubble segmentation mask; determining the equivalent volume of the plurality of bubbles according to the cross-sectional area of the bubble segmentation mask and the size information of the reference object in the first bubble image; determining the real-time radius of the plurality of bubbles at the first moment according to the plurality of equivalent volumes; calculating the gas content of the liquid flowing through the target area within the target time period including bubbles according to the liquid flow rate in the target area and the equivalent volume, wherein the start time of the target time period is the time when the target bubble enters the target area, and the end time of the target time period is the time when the target bubble leaves the target area, and the static characteristic parameters include: the number of bubbles, the equivalent volume, the real-time radius, and the gas content; determining the average flow rate of the plurality of bubbles according to the actual height information of the target area and the time length of the target time period; counting the movement behavior of the plurality of bubbles in the target area according to the motion path and the bubble segmentation masks at different moments, wherein the movement behavior includes the movement direction of the bubbles, and the dynamic characteristic parameters include the average flow rate and the movement behavior.
[0066] The calculation of bubble characteristic parameters includes static characteristic parameter calculation and dynamic characteristic parameter calculation:
[0067] Static feature parameters:
[0068] 1. Quantity statistics: For each image, the segmentation results of large and small bubbles in the multi-process segmentation stage are combined to count the total number of bubbles found, and the change curve is continuously updated with the video stream;
[0069] 2. Equivalent radius source: The bubble is a near sphere. By calculating the cross-sectional area of the front view and combining it with the size of the actual reference object, the equivalent radius and the equivalent volume of the bubble can be approximately calculated;
[0070] 3. Real-time radius distribution: In order to observe the process of changes in the size of a large number of bubbles during the electrolysis process, we calculated the radius of each bubble in each frame (i.e., the real-time radius mentioned above) and analyzed it in the form of a kernel density map;
[0071] 4. Gas holdup estimation: Combining the actual liquid flow rate, tracking effect bubbles, and the volume calculated from the equivalent radius, the flow rate in a certain area of the pipeline within the time interval is determined, and the bubble volume in this interval is calculated, thereby obtaining the gas holdup of the electrolysis system within a certain period of time.
[0072] Dynamic feature parameters:
[0073] 1. Airflow velocity estimation: By counting the number of frames tracked by each bubble and the height difference between the first and last frames of tracking, combined with the real-world height information of the pipe in the picture, the average flow velocity of the bubble over a period of time is calculated;
[0074] 2. Bubble motion behavior distribution: In order to observe the upward or downward movement of bubbles during the electrolysis process, the velocity direction of the bubbles is tracked in each frame, and the motion curve is continuously updated with the video stream.
[0075] In order to speed up the process of drawing results, multi-threading technology can be used to draw a variety of collected data indicators. Specifically, it is necessary to draw the changes in the number of bubble images in each frame, the real-time bubble radius distribution of bubbles in the cumulative frame, the gas content estimation of the cumulative frame, the estimated changes in the bubble flow rate, and the bubble estimation of the bubble motion behavior. If only calculated in the main thread, most of the indicators that need to be updated in real time will be seriously affected, resulting in untimely updates. Therefore, this application uses the python language to create multiple drawing threads, and each thread draws a type of indicator separately. In each thread, the image data source is obtained by reading the indicator data file updated in real time by the main thread at intervals.
[0076] This application uses advanced deep learning detection segmentation, tracking algorithm models and image enhancement models to achieve high-precision detection of bubbles under the working conditions of water electrolysis and hydrogen production. This method can not only obtain static parameters such as bubble size and morphology, but also obtain dynamic parameters such as bubble motion trajectory, and effectively overcome the problems of small targets being difficult to detect under complex working conditions, significantly reduced detection accuracy under unbalanced light conditions, and high annotation costs for bubble tracking data sets. Specifically, the average number of bubble detections per frame is increased by about 23 (only using low-light enhancement models and histogram equalization), and the number of detections of small targets per frame (using spot detection algorithms) is nearly 100. The tracking algorithm is based on the motion model and comprehensively utilizes the information of the five dimensions of the bubble, eliminating the problem of excessive annotation costs using deep learning models. At the same time, it also introduces indicator calculations into bubble detection, realizing the study of static characteristics and dynamic behaviors of bubbles.
[0077] Generally speaking, the overall implementation process of the above-mentioned method for determining bubble characteristic parameters is as follows: Figure 8 As shown, the following steps are included:
[0078] Step 1: Extract the video stream from the high-speed camera through the producer-consumer concurrent design model;
[0079] Step 2: Determine whether to pre-process the image and enhance the low-light model based on the image transmittance;
[0080] Step 3: The pre-processed image is input into the segmentation model to obtain the bubble position and bubble segmentation mask;
[0081] Step 4: Calculate individual similarity based on bubble position and bubble behavior characteristics between frames to achieve individual positioning dynamic tracking;
[0082] Step 5: Count the number of bubbles and particle size distribution in each frame and calculate bubble characteristic parameter indicators such as gas holdup based on the working conditions;
[0083] Step 6: Use multi-threaded processing technology to parallelize data flow and draw analysis results.
[0084] This application proposes an innovative method for detecting, segmenting, tracking and analyzing bubbles in electrolyzed water based on computer vision and machine learning, focusing on solving the problem of difficulty in detecting bubbles at electrodes on both sides of electrolyzed water in hydrogen energy production and difficulty in establishing a connection with operating parameters. This method significantly improves the accuracy of bubble detection by combining a high-precision target detection and segmentation model in deep learning and an image enhancement model under dynamic unbalanced light conditions, and uses machine learning to establish a relationship between bubble morphological behavior characteristics and operating parameters (current density, pressure, temperature), thereby developing an intelligent real-time control strategy for operating conditions, and providing a new safe, reliable and efficient solution for modeling and control of hydrogen production systems by electrolysis.
[0085] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0086] Fig. 9 is a structural block diagram of a device for determining bubble characteristic parameters according to an embodiment of the present application; Fig. 9 As shown, including:
[0087] a processing module 92, configured to input the first bubble image into the segmentation model for processing to obtain position information of a plurality of bubbles at a first moment and a bubble segmentation mask, wherein the bubble image includes the plurality of bubbles, and the first moment is a shooting moment of the first bubble image;
[0088] A tracking module 94, configured to dynamically track the plurality of bubbles in the plurality of first bubble images to obtain movement paths of the plurality of bubbles, wherein the plurality of first bubble images are taken at different times, and the movement paths are used to indicate position information of the bubbles at different times;
[0089] The determination module 96 is used to determine the bubble segmentation masks of the multiple bubbles at different times according to the motion path, and determine the bubble characteristic parameters of the multiple bubbles according to the motion path and the bubble segmentation masks at different times, wherein the bubble characteristic parameters include static characteristic parameters and dynamic characteristic parameters.
[0090] Through the above-mentioned device, the first bubble image is first input into the segmentation model for processing to obtain the position information of different bubbles at the first moment and the bubble segmentation mask, wherein the bubble image contains multiple bubbles, and the first moment is the shooting moment of the first bubble image; then, the multiple bubbles are dynamically tracked in the multiple first bubble images to obtain the movement paths of the bubbles, wherein the shooting moments of the first bubble images are different, and the movement paths are used to indicate the position information of the bubbles at different moments; the bubble segmentation masks of the multiple bubbles at different moments are determined according to the movement paths, and then the bubble characteristic parameters of the bubbles are determined according to the movement paths and the bubble segmentation masks at different moments, and the bubble characteristic parameters include static characteristic parameters and dynamic characteristic parameters; the above-mentioned scheme is adopted in combination with a high-precision segmentation model to significantly improve the accuracy of bubble detection, thereby obtaining accurate bubble characteristic parameters; thereby solving the problem of difficulty in bubble detection at electrodes on both sides of water electrolysis in the related technology.
[0091] Optionally, the above-mentioned processing module 92 is also used to capture the video stream of the target area through a camera device to obtain a bubble video stream; read a first number of second bubble images from the bubble video stream through a producer thread and add them to a cache queue; read the first number of second bubble images from the cache queue through a consumer thread, and pre-process the second bubble images to obtain the first bubble image.
[0092] In the embodiment of the present application, a high-speed shadow imaging system is built to collect data. The system mainly includes a high-speed camera, a host computer control system, an illumination source, a light homogenizer, and a hydrogen production device. The high-speed camera is located directly in front of the electrode, and the light source is located directly behind the electrode. Figure 3 As shown in the figure, the producer-consumer design pattern can decouple video stream reading and video stream inference. This design model consists of two parts, namely the producer and the consumer. The producer is responsible for reading a specified number of bubble images (i.e., the second bubble image mentioned above) from the camera for inference. When the actual deep learning model is inferred, inference is performed according to the number of batch images to achieve the optimal throughput of the GPU. This producer-consumer design model also meets the model's need to read a batch of images from the cache queue each time.
[0093] Optionally, the above-mentioned processing module 92 is also used to calculate the transmittance of the second bubble image to obtain the transmittance value of the second bubble image; when it is determined that the transmittance value of the third bubble image in the second bubble image is lower than the first preset threshold, histogram equalization is performed on the third bubble image according to the standard bubble image to obtain a processed third bubble image, wherein the second bubble image includes the standard bubble image; the processed third bubble image is input into the low-light enhancement model for processing to obtain the first bubble image.
[0094] like Figure 4 As shown in the figure, as the electrolysis time becomes longer, after the transmittance index is calculated, the processing method for the bubble image with a transmittance lower than the first preset threshold (that is, the third bubble image mentioned above) is as follows: first, the first image in the training image is used as a benchmark (that is, the standard bubble image mentioned above) to perform histogram equalization to improve the contrast and brightness of the image; secondly, the transformation of the image from low transmittance to high transmittance is regarded as a low-light enhancement problem, and the bubble image is simultaneously input into the low-light enhancement model URetinex-Net to further enhance the image.
[0095] Optionally, other methods may be used to select the standard bubble image, such as by machine identifying the image whose image parameters are closest to a preset threshold and using it as the standard bubble image, or by manual selection, which is not limited in this application.
[0096] It should be noted that URetinex-Net is an innovative framework for image enhancement in low-light environments. It combines traditional Retinex theory with deep neural networks to provide a new solution for low-light image enhancement. Its deep unfolding network can more accurately estimate the brightness distribution of the image, thereby improving the image brightness while retaining the original color information and details. Figure 5 As shown in the figure, the network structure diagram of URetinex-Net is shown. We effectively enhance the accuracy of bubble detection and significantly reduce the missed detection rate by applying advanced methods of low-light enhancement tasks to solve the problem of reduced image transmittance in the water electrolysis process.
[0097] Optionally, the above-mentioned processing module 92 is also used to segment the first bubble image through a first segmentation model, and perform bubble detection on the segmented first bubble image to obtain first position information of large bubbles and a first bubble segmentation mask, wherein the multiple bubbles include the large bubbles, and the bubble volume of the large bubbles is greater than a second preset threshold; segment the first bubble image through a second segmentation model, and perform bubble detection on the segmented first bubble image to obtain second position information of small bubbles and a second bubble segmentation mask, wherein the multiple bubbles include the small bubbles, and the bubble volume of the small bubbles is less than the second preset threshold, and the segmentation model includes the first segmentation model and the second segmentation model; generate a fourth bubble image according to the first position information, the first bubble segmentation mask, the second position information and the second bubble segmentation mask, wherein the fourth bubble image includes the position information and bubble segmentation mask of the multiple bubbles at the first moment.
[0098] In this application, for larger bubbles (i.e. the large bubbles mentioned above), the change in the light and dark relationship between the center and the surrounding can be clearly observed, and the characteristics are obvious. However, due to scale reasons, there is a problem of easy mutual occlusion between large bubbles. If they cannot be accurately divided, it will seriously affect the accuracy of bubble detection and the subsequent calculation of morphological dimensions. Therefore, this application decides to use deep learning to capture this feature and achieve high-precision individual bubble division, thereby achieving accurate bubble detection and segmentation.
[0099] Optionally, the MaskTransfiner model based on Transformer can be used to implement the detection and segmentation of specific bubbles. Figure 6 The figure shows the detection flow chart of MaskTransfiner, which decomposes the image area into a quadtree and combines the Transformer-based method to correct the error-prone tree nodes in parallel, and finally achieves the prediction of highly accurate instance masks at a low computational cost, thereby obtaining bubble segmentation masks, and the error-prone nodes existing in the detection boundary are also segmented more accurately. Through this solution, the boundaries between large bubbles gradually become clearer, and the problem of low morphological size calculation accuracy caused by the unclear boundary division of traditional model detection is effectively solved.
[0100] As for the detection and segmentation of small-sized bubbles (i.e. the small bubbles mentioned above), in actual high-speed bubble images, as the bubble scale decreases, the texture features continue to decrease. Increasing the detection accuracy from the perspective of increasing the number of small bubble annotations alone has high labor costs and great difficulty. In-depth observation found that the morphology of small bubbles is similar to that of traditional spots. Therefore, based on the similarities between the two, this application migrates the process of traditional spot detection to the detection of small bubbles. The specific process is as follows: Figure 7 shown.
[0101] In order to ensure that the detection of large bubbles is not affected during the detection of small bubbles, we segmented the original image and divided the original 1280*800 image into 256 blocks, each of which is 80*50 in size. At the same time, in order to ensure that the smallest bubbles can be detected, we also expanded each individual block by 2 times. The adaptive contrast enhancement algorithm is also applied to the separation, thereby enlarging the difference between the bubble body and the surrounding environment in the highly magnified image. Finally, the segmented images are input into the spot detector in sequence, and the constraint parameters (roundness, area, convexity) of the spot detector are used to filter some bubbles, thereby avoiding some extremely small impurities in the gas-liquid system.
[0102] It should be noted that the above data such as 1280*800 and 256 blocks are only used as examples and can be set to other values in actual application, and do not limit this application.
[0103] The detection process of large bubbles and small bubbles is performed synchronously, and finally the large bubble segmentation result and the small bubble segmentation result are merged to generate a fourth bubble image.
[0104] Optionally, the above-mentioned processing module 92 is also used to establish a bubble data set, wherein the bubble data set includes multiple bubble images carrying bubble segmentation masks; determine a loss function according to the type of the segmentation model, wherein the loss function is used to train the segmentation model; and train the segmentation model according to the bubble data set and the loss function.
[0105] First, a bubble dataset is established, and nearly 10,000 bubble segmentation instances are annotated (i.e., bubble images are annotated with bubble segmentation masks), providing a large number of learning samples for model training. Then, the loss function used to train the segmentation model is determined according to the type of segmentation model selected, and then the bubble dataset and loss function are used to complete the training process of the segmentation model.
[0106] Optionally, the tracking module 94 is further used to extract appearance features of a first bubble among the multiple bubbles to obtain a first appearance feature, and to extract appearance features of multiple second bubbles in a fifth bubble image to obtain multiple second appearance features, and to respectively calculate cosine distances between the first appearance feature and the multiple second appearance features to obtain multiple cosine distance values, wherein the shooting moment of the fifth bubble image is the next moment after the first moment; and to predict the motion trajectory of the first bubble by using a Kalman filter to calculate a first index value between the future position predicted based on the first bubble and the multiple second bubbles, wherein the first index value is used to indicate the overlap between the first bubble's position at the next moment and the second bubbles. degree; respectively calculating the average absolute difference in the direction of the movement speed of the first bubble and the plurality of second bubbles to obtain a plurality of directional absolute differences; respectively calculating the absolute difference in the confidence of the first bubble and the plurality of second bubbles to obtain a plurality of confidence absolute differences, wherein the confidence is determined by the segmentation model; constructing a cost matrix according to the plurality of cosine distance values, the plurality of first index values, the plurality of directional absolute differences and the plurality of confidence absolute differences, and processing the cost matrix through the Hungarian algorithm to determine a third bubble from the plurality of second bubbles, wherein the third bubble is the bubble corresponding to the first bubble at the next moment after the first moment; determining the movement path of the first bubble according to the plurality of third bubbles.
[0107] After model detection, the output results will include information about the bubble location, which are the upper left corner and lower right corner of the detection box corresponding to the bubble (i.e. the above position information), as well as the confidence. The output results are passed to the Hybrid-SORT model as input. The Hybrid-SORT model will calculate the position of the next matching target based on five dimensions of information, including confidence, speed, position, appearance features, and height. The specific calculation process includes:
[0108] 1. Based on the SimCLR framework, the appearance features of each bubble are extracted to obtain the first appearance features, and the cosine distance is used as the similarity measure between the tracking bubble (i.e., the second bubble) and the detection bubble (i.e., the first bubble), that is, the cosine distance value;
[0109] 2. According to the position information of the detected bubble, the Kalman filter is used to estimate the next frame motion of the bubble, and the front and rear bubbles are distinguished by combining the height information of the bubble, and the HMIOU index (i.e., the first index value mentioned above) is used as the similarity measure between the tracked bubble and the detected bubble;
[0110] 3. Combined with the velocity direction information of the bubble, the average absolute difference in velocity direction of the four corner points of the tracking bubble and the detection bubble is calculated as a similarity measurement index (i.e., the above-mentioned absolute difference in direction);
[0111] 4. In order to deal with the situation where tracking is lost when bubbles are occluded, the feature that the confidence is lower when the bubbles are occluded is utilized, and the absolute difference between the confidences (i.e. the above-mentioned absolute difference in confidence) is used as the similarity measure between the tracked bubbles and the detected bubbles.
[0112] Taking all the similarity measures of the above dimensions into consideration, a total cost matrix is calculated, and the best one-to-one matching between the tracking bubble and the detection bubble is obtained using the Hungarian algorithm. Thus, the motion path of each individual bubble is determined based on the tracking and matching results of each frame.
[0113] Optionally, the above-mentioned determination module 96 is also used to perform at least one of the following steps to determine the bubble characteristic parameters of the multiple bubbles: counting the number of bubbles in the first bubble image according to the bubble segmentation mask; determining the equivalent volume of the multiple bubbles according to the cross-sectional area of the bubble segmentation mask and the size information of the reference object in the first bubble image; determining the real-time radius of the multiple bubbles at the first moment according to the multiple equivalent volumes; calculating the gas content of the liquid flowing through the target area during the target time period containing bubbles according to the liquid flow rate in the target area and the equivalent volume, wherein the start time of the target time period is the time when the target bubble enters the target area, and the end time of the target time period is the time when the target bubble leaves the target area, and the static characteristic parameters include: the number of bubbles, the equivalent volume, the real-time radius, and the gas content; determining the average flow rate of the multiple bubbles according to the actual height information of the target area and the time length of the target time period; counting the movement behavior of the multiple bubbles in the target area according to the movement path and the bubble segmentation mask at different moments, wherein the movement behavior includes the movement direction of the bubbles, and the dynamic characteristic parameters include the average flow rate and the movement behavior.
[0114] The calculation of bubble characteristic parameters includes static characteristic parameter calculation and dynamic characteristic parameter calculation:
[0115] Static feature parameters:
[0116] 1. Quantity statistics: For each image, the segmentation results of large and small bubbles in the multi-process segmentation stage are combined to count the total number of bubbles found, and the change curve is continuously updated with the video stream;
[0117] 2. Equivalent radius source: The bubble is a near sphere. By calculating the cross-sectional area of the front view and combining it with the size of the actual reference object, the equivalent radius and the equivalent volume of the bubble can be approximately calculated;
[0118] 3. Real-time radius distribution: In order to observe the process of changes in the size of a large number of bubbles during the electrolysis process, we calculated the radius of each bubble in each frame (i.e., the real-time radius mentioned above) and analyzed it in the form of a kernel density map;
[0119] 4. Gas holdup estimation: Combining the actual liquid flow rate, tracking effect bubbles, and the volume calculated from the equivalent radius, the flow rate in a certain area of the pipeline within the time interval is determined, and the bubble volume in this interval is calculated, thereby obtaining the gas holdup of the electrolysis system within a certain period of time.
[0120] Dynamic feature parameters:
[0121] 1. Airflow velocity estimation: By counting the number of frames tracked by each bubble and the height difference between the first and last frames of tracking, combined with the real-world height information of the pipe in the picture, the average flow velocity of the bubble over a period of time is calculated;
[0122] 2. Bubble motion behavior distribution: In order to observe the upward or downward movement of bubbles during the electrolysis process, the velocity direction of the bubbles is tracked in each frame, and the motion curve is continuously updated with the video stream.
[0123] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0124] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0125] S1, inputting a first bubble image into a segmentation model for processing to obtain position information of a plurality of bubbles at a first moment and a bubble segmentation mask, wherein the bubble image includes the plurality of bubbles, and the first moment is a shooting moment of the first bubble image;
[0126] S2, dynamically tracking the multiple bubbles in the multiple first bubble images to obtain movement paths of the multiple bubbles, wherein the multiple first bubble images are taken at different times, and the movement paths are used to indicate position information of the bubbles at different times;
[0127] S3, determining bubble segmentation masks of the multiple bubbles at different moments according to the motion path, and determining bubble characteristic parameters of the multiple bubbles according to the motion path and the bubble segmentation masks at different moments, wherein the bubble characteristic parameters include static characteristic parameters and dynamic characteristic parameters.
[0128] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0129] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0130] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0131] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0132] S1, inputting a first bubble image into a segmentation model for processing to obtain position information of a plurality of bubbles at a first moment and a bubble segmentation mask, wherein the bubble image includes the plurality of bubbles, and the first moment is a shooting moment of the first bubble image;
[0133] S2, dynamically tracking the multiple bubbles in the multiple first bubble images to obtain movement paths of the multiple bubbles, wherein the multiple first bubble images are taken at different times, and the movement paths are used to indicate position information of the bubbles at different times;
[0134] S3, determining bubble segmentation masks of the multiple bubbles at different moments according to the motion path, and determining bubble characteristic parameters of the multiple bubbles according to the motion path and the bubble segmentation masks at different moments, wherein the bubble characteristic parameters include static characteristic parameters and dynamic characteristic parameters.
[0135] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0136] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0137] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0138] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for determining bubble characteristic parameters, characterized in that: include: Inputting a first bubble image into a segmentation model for processing to obtain position information of a plurality of bubbles at a first moment and a bubble segmentation mask, wherein the bubble image includes the plurality of bubbles, and the first moment is a shooting moment of the first bubble image; Dynamically tracking the multiple bubbles in the multiple first bubble images to obtain movement paths of the multiple bubbles, wherein the multiple first bubble images are taken at different times, and the movement paths are used to indicate position information of the bubbles at different times; Bubble segmentation masks of the multiple bubbles at different moments are determined according to the motion path, and bubble feature parameters of the multiple bubbles are determined according to the motion path and the bubble segmentation masks at different moments, wherein the bubble feature parameters include static feature parameters and dynamic feature parameters.
2. The method for determining bubble characteristic parameters according to claim 1, characterized in that: Before inputting the first bubble image into the segmentation model for processing, the method further includes: The video stream of the target area is collected by a camera device to obtain a bubble video stream; Reading a first number of second bubble images from the bubble video stream through a producer thread, and adding the images to a cache queue; The first number of second bubble images are read from the cache queue through a consumer thread, and the second bubble images are preprocessed to obtain the first bubble images.
3. The method for determining bubble characteristic parameters according to claim 2, characterized in that: Preprocessing the second bubble image to obtain the first bubble image includes: performing transmittance calculation on the second bubble image to obtain a transmittance value of the second bubble image; When it is determined that the transmittance value of the third bubble image in the second bubble image is lower than a first preset threshold, performing histogram equalization on the third bubble image according to a standard bubble image to obtain a processed third bubble image, wherein the second bubble image includes the standard bubble image; The processed third bubble image is input into the low-light enhancement model for processing to obtain the first bubble image.
4. The method for determining bubble characteristic parameters according to claim 1, characterized in that: The first bubble image is input into the segmentation model for processing to obtain position information of multiple bubbles at the first moment and a bubble segmentation mask, including: Segmenting the first bubble image by using a first segmentation model, and performing bubble detection on the segmented first bubble image to obtain first position information of large bubbles and a first bubble segmentation mask, wherein the plurality of bubbles include the large bubbles, and a bubble volume of the large bubbles is greater than a second preset threshold; The first bubble image is segmented by a second segmentation model, and bubble detection is performed on the segmented first bubble image to obtain second position information of small bubbles and a second bubble segmentation mask, wherein the plurality of bubbles include the small bubbles, the bubble volume of the small bubbles is less than the second preset threshold, and the segmentation model includes the first segmentation model and the second segmentation model; A fourth bubble image is generated according to the first position information, the first bubble segmentation mask, the second position information, and the second bubble segmentation mask, wherein the fourth bubble image includes the position information and the bubble segmentation mask of the plurality of bubbles at the first moment.
5. The method for determining bubble characteristic parameters according to claim 4, characterized in that: Before inputting the first bubble image into the segmentation model for processing, the method further includes: Establishing a bubble data set, wherein the bubble data set includes a plurality of bubble images carrying bubble segmentation masks; Determining a loss function according to the type of the segmentation model, wherein the loss function is used to train the segmentation model; The segmentation model is trained according to the bubble dataset and the loss function.
6. The method for determining bubble characteristic parameters according to claim 1, characterized in that: Dynamically tracking the plurality of bubbles in the plurality of first bubble images to obtain movement paths of the plurality of bubbles includes: performing appearance feature extraction on a first bubble among the plurality of bubbles to obtain a first appearance feature, and performing appearance feature extraction on a plurality of second bubbles in a fifth bubble image to obtain a plurality of second appearance features, and respectively calculating cosine distances between the first appearance feature and the plurality of second appearance features to obtain a plurality of cosine distance values, wherein a shooting time of the fifth bubble image is a moment next to the first moment; Predicting the motion trajectory of the first bubble by using a Kalman filter to calculate a first index value between a future position predicted by the first bubble and the plurality of second bubbles, wherein the first index value is used to indicate an overlap between a position of the first bubble at a next moment and the second bubbles; respectively calculating the average absolute difference in the directions of the movement speeds of the first bubble and the plurality of second bubbles to obtain the absolute differences in the directions; respectively calculating absolute differences between the confidences of the first bubble and the plurality of second bubbles to obtain a plurality of absolute differences in confidences, wherein the confidences are determined by the segmentation model; A cost matrix is constructed according to the multiple cosine distance values, the multiple first index values, the multiple directional absolute differences, and the multiple confidence absolute differences, and the cost matrix is processed by a Hungarian algorithm to determine a third bubble from the multiple second bubbles, wherein the third bubble is a bubble corresponding to the first bubble at a next moment of the first moment; The movement path of the first bubble is determined according to the plurality of third bubbles.
7. The method for determining bubble characteristic parameters according to claim 1, characterized in that: Determining bubble characteristic parameters of the plurality of bubbles according to the motion path and the bubble segmentation masks at different moments includes at least one of the following: counting the number of bubbles in the first bubble image according to the bubble segmentation mask; determining the equivalent volumes of the plurality of bubbles according to the cross-sectional area of the bubble segmentation mask and size information of the reference object in the first bubble image; Determine the real-time radius of the plurality of bubbles at the first moment according to the plurality of equivalent volumes; Calculating the gas holdup of the liquid including bubbles flowing through the target area within a target time period according to the liquid flow rate in the target area and the equivalent volume, wherein the start time of the target time period is the time when the target bubble enters the target area, and the end time of the target time period is the time when the target bubble leaves the target area, and the static characteristic parameters include: the number of bubbles, the equivalent volume, the real-time radius, and the gas holdup; Determining an average flow rate of the plurality of bubbles according to actual height information of the target area and the length of the target time period; The movement behaviors of the multiple bubbles in the target area are counted according to the movement path and the bubble segmentation masks at different moments, wherein the movement behavior includes the movement direction of the bubbles, and the dynamic characteristic parameters include the average flow velocity and the movement behavior.
8. A device for determining bubble characteristic parameters, characterized in that: include: a processing module, configured to input the first bubble image into the segmentation model for processing to obtain position information of a plurality of bubbles at a first moment and a bubble segmentation mask, wherein the bubble image includes the plurality of bubbles, and the first moment is a shooting moment of the first bubble image; A tracking module, used for dynamically tracking the multiple bubbles in the multiple first bubble images to obtain the motion paths of the multiple bubbles, wherein the multiple first bubble images are taken at different times, and the motion paths are used to indicate the position information of the bubbles at different times; a determination module, used for determining the bubble segmentation masks of the multiple bubbles at different times according to the motion paths, and determining the bubble characteristic parameters of the multiple bubbles according to the motion paths and the bubble segmentation masks at different times, wherein the bubble characteristic parameters include static characteristic parameters and dynamic characteristic parameters.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
Citation Information
Patent Citations
Bubble trajectory tracking method based on feature matching algorithm
CN113838089A
Leveler detection method and device
CN114018289A
Deep learning-based airtight container airtightness water detection method
CN115760771A
Gas drive experiment video real-time analysis method and device based on improved YOLOv8 + DeepSORT
CN118247701A
Method for morphology identification, trajectory tracking and velocity measurement of high-concentration microbubbles
US20230326038A1
