Turbidity self-adaptive bubble detection system and method based on dynamic threshold regulation and control

The bubble detection system, with its dynamic threshold control and anti-interference optimization, solves the problem of misjudgment and missed detection in liquids with high and low turbidity, achieves accurate differentiation between bubbles and solid impurities, improves the stability and sample compatibility of the detection system, and supports bubble detection in complex extraction scenarios.

CN121856253APending Publication Date: 2026-04-14NINGBO XINGBOYUAN INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing bubble detection methods are prone to misjudgment in high-turbidity liquids and to missed detection in low-turbidity liquids. They also cannot effectively distinguish between bubbles and solid impurities, have weak anti-interference capabilities, cannot achieve real-time matching of detection parameters with liquid state, and have sample compatibility limited to a specific turbidity range, making it difficult to meet the needs of complex extraction scenarios.

Method used

A turbidity adaptive bubble detection system based on dynamic threshold control is adopted, which achieves accurate bubble detection through dual-camera collaborative shooting, multi-angle light intensity data acquisition, dynamic threshold control, anti-interference optimization, and result output modules.

Benefits of technology

It improves the accuracy of bubble detection in liquids of different turbidities, eliminates the influence of external interference on the detection data, enhances the stability and reliability of the system in complex industrial environments, achieves accurate differentiation between bubbles and solid impurities, and supports bubble detection and process optimization in liquids with different turbidity ranges.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121856253A_ABST
    Figure CN121856253A_ABST
Patent Text Reader

Abstract

The invention discloses a turbidity self-adaptive bubble detection system based on dynamic threshold regulation and control and a method thereof. The system comprises a data acquisition module, a data preprocessing module, a dynamic threshold regulation and control module, an anti-interference optimization module, a bubble identification and judgment module and a result output module which are connected in sequence. According to the method, a dynamic threshold regulation and control mechanism is adopted, the detection threshold is adjusted in real time according to the liquid turbidity based on the piecewise linear fitting algorithm, the problems of misjudgment of a fixed threshold in high-turbidity liquid and missing detection of the fixed threshold in low-turbidity liquid are effectively solved, and the accuracy of bubble detection in liquid with different turbidity is improved; through combination of double-camera shooting and multi-image feature extraction and introduction of adversarial network anti-interference optimization, bubbles and solid impurities are accurately distinguished, interference of the impurities on a bubble detection result is avoided, influences of interference factors such as external light and equipment vibration on detection data are eliminated, and the detection accuracy is improved. And the stability and the reliability of the system in a complex industrial environment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of liquid detection technology, and more specifically, to a turbidity adaptive bubble detection system and method based on dynamic threshold control. Background Technology

[0002] During the extraction process, the presence of air bubbles in the liquid can severely affect extraction efficiency and product quality, thus requiring real-time and accurate bubble detection. Currently, commonly used bubble detection methods often employ a fixed threshold method, which involves setting a preset threshold for light intensity or image features; when the detected signal exceeds this threshold, it is identified as a bubble.

[0003] However, the turbidity of the liquid during extraction changes dynamically due to factors such as raw material composition and reaction progress. Fixed threshold methods have significant drawbacks: in high-turbidity liquids, the intensity of scattered light is high, easily misinterpreting turbidity signals as bubble signals, leading to a higher false detection rate; in low-turbidity liquids, the signal differences generated by bubbles are small, making it difficult for fixed thresholds to capture weak bubble signals, resulting in missed detections. Furthermore, existing systems cannot effectively distinguish between bubbles and solid impurities, as they share certain similarities in optical signals or image features, easily causing confusion. The systems also have weak anti-interference capabilities; external light fluctuations and equipment vibrations can affect detection accuracy. Data linkage is poor, failing to achieve real-time matching of detection parameters with liquid state. Sample compatibility is limited to liquids within a specific turbidity range, making it difficult to meet the needs of complex extraction scenarios.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] To address the aforementioned technical problems in related technologies, this invention proposes a turbidity adaptive bubble detection system and method based on dynamic threshold control. Through dynamic threshold control mechanism, anti-interference optimization of adversarial network, and dual-camera shooting, it achieves accurate detection of bubbles in liquids with different turbidities, thus overcoming the above-mentioned shortcomings of the prior art.

[0006] To achieve the above-mentioned technical objectives, the technical solution of the present invention is implemented as follows: A turbidity adaptive bubble detection system based on dynamic threshold control includes a data acquisition module, a data preprocessing module, a dynamic threshold control module, an anti-interference optimization module, a bubble recognition and judgment module, and a result output module connected in sequence; wherein: The data acquisition module is used to simultaneously acquire image data of bubbles inside the extraction container and light intensity data from multiple angles; including: The dual-camera collaborative unit includes a side CMOS camera installed in the lower part of the container sidewall and tilted at 45° and a top CMOS camera installed vertically above the container. The dual cameras are controlled by a multi-source synchronous triggering module to achieve synchronous shooting and are used to construct a three-dimensional coordinate model of the bubble and track the bubble life cycle based on ORB feature point matching and time series correlation algorithms. The light intensity sensing array consists of three sets of laser scattering-transmission sensors arranged in an equilateral triangle. The laser emitter and receiver are installed at a 60° angle to collect the scattered light intensity values ​​(Isc1, Isc2, Isc3) and transmitted light intensity values ​​(Itr1, Itr2, Itr3) at different angles. The multi-source synchronous triggering module generates a synchronous triggering signal based on the FPGA chip, and controls the dual cameras and the light intensity sensing array to perform synchronous acquisition with a time synchronization accuracy of ≤2μs. The data preprocessing module is used to perform hierarchical preprocessing and feature association on the acquired image data and light intensity data; The dynamic threshold control module is used to dynamically generate detection thresholds based on preprocessed data, including: The ratio calculation unit is used to calculate the turbidity characteristic ratio C, the signal fluctuation ratio R, and the cross-modal correlation ratio M. The weight fusion unit dynamically allocates the weights (ωC, ωR, ωM) of C, R, and M through an attention mechanism, and calculates the comprehensive feature value K = ωC×C + ωR×R + ωM×M. The threshold fitting unit uses the K-means clustering algorithm to divide the K value into multiple intervals, and uses the weighted least squares method to fit each interval to obtain the dynamic detection threshold Ti = ai×K + bi.

[0007] Furthermore, in the dual-camera collaborative unit, the side CMOS camera is used to capture the dynamic contour and speed of the bubble's rising process, and the top CMOS camera is used to obtain the planar distribution density of the bubble; the dual-camera collaborative unit performs weighted fusion of the bubble morphology features in the side view image and the distribution features in the top view image, assigning a weight of 0.6 to the side view features and a weight of 0.4 to the top view features; the data collected by the light intensity sensing array is processed by mean filtering to eliminate single-point measurement deviation, and the timestamp error with the image data is controlled within ≤5ms; the sampling frequency of the light intensity data is 10-50Hz.

[0008] Furthermore, the data preprocessing module includes: The image preprocessing unit is used to sequentially perform guided filtering, Retinex algorithm grayscale correction, and adaptive threshold segmentation based on the maximum inter-class variance method on the image. The light intensity data preprocessing unit is used to sequentially perform pulse interference removal based on the improved 3σ criterion, wavelet transform denoising, and LSTM model trend prediction smoothing on the light intensity data. The cross-modal feature association unit is used to construct the mapping relationship between image grayscale features and light intensity change rate, and to filter effective association data by calculating the Pearson correlation coefficient.

[0009] Furthermore, in the data preprocessing module: the parameters of the guided filter are set to a radius of 5 and a regularization parameter of 0.1; the improved 3σ criterion uses a sliding window mechanism to dynamically update the mean and standard deviation; the wavelet transform uses the db4 wavelet basis for 3-level decomposition; the condition for screening effective correlated data is that the absolute value of the Pearson correlation coefficient |r| ≥ 0.7.

[0010] Further, in the dynamic threshold control module: the turbidity feature ratio C = (Isc1'+Isc2'+Isc3') / 3 ÷ (Itr1'+Itr2'+Itr3') / 3, where Isc' and Itr' are the preprocessed light intensity values; the signal fluctuation ratio R = Δ(Isc_avg') / Δ(Itr_avg'), where Δ is the average difference between 5 adjacent frames of data; the cross-modal correlation ratio M = the average gray level of the bubble candidate region in the image / the average value of the light intensity data; the number of clusters in the K-means clustering is 4, dividing the K value into four turbidity intervals: low, medium-low, medium-high, and high; the dynamic threshold control module is also equipped with a threshold calibration unit, which is used to fine-tune the fitting coefficients ai and bi using a Bayesian optimization algorithm after every 100 frames of data are collected.

[0011] Furthermore, the anti-interference optimization module is built on an improved WGAN-GP. Its generator adopts a structure that integrates U-Net and attention mechanism, and the discriminator adopts a PatchGAN structure. It also has suppression branches for light interference, equipment vibration interference and electromagnetic interference, which are used to optimize the preprocessed data to remove interference. The bubble recognition and judgment module uses a CNN-LSTM fusion model to extract and fuse static image features and dynamic temporal features, and combines Kalman filter position prediction and bubble volume change rate verification to distinguish bubbles from solid impurities. The result output module is used to output the detection results, including a monitoring interface for real-time display of the three-dimensional distribution thermogram and parameter curve of bubbles, an intelligent early warning unit with three-level early warning thresholds, and a data linkage analysis unit that communicates with the external process control system through the OPC UA protocol and performs correlation analysis.

[0012] Furthermore, in the anti-interference optimization module: for the suppression branch of illumination interference, the generator corrects the pixel grayscale of the uneven illumination areas in the image; for the suppression branch of equipment vibration interference, an optical flow estimation module is introduced to calculate the inter-frame motion vector of the image for inverse compensation, and Kalman filtering is combined for secondary suppression; for the suppression branch of electromagnetic interference, a wavelet packet denoising branch is added at the light intensity data input end; the training of the network adopts joint optimization of adversarial loss and L1 reconstruction loss, with a weight ratio of 1:3.

[0013] Furthermore, in the bubble recognition and judgment module: the extracted multimodal features include: the duration and rise rate of the signal peak from the light intensity data, and the three-dimensional morphological features, LBP texture features, and motion trajectory smoothness of the bubble from the image data; in the CNN-LSTM fusion model, the CNN part adopts a ResNet18 network, and the LSTM part is a network structure with 2 hidden layers and 128 hidden units; the Kalman filter is used to predict the position of the bubble in the next frame and match it with the actual detection position. When the matching degree is ≥0.8, it is determined to be the same target.

[0014] Furthermore, in the result output module: the three-level early warning thresholds include: bubble density greater than 5 bubbles / cm³, average bubble diameter greater than 3mm, and bubble coalescence frequency greater than 10 times / min; the data linkage analysis unit uses the random forest algorithm to establish a correlation analysis model between detection data and process parameters to output process optimization suggestions; the system adopts an edge-cloud collaborative storage architecture, storing recent high-frequency data locally and aggregated historical statistical data in the cloud.

[0015] According to another aspect of the present invention, a turbidity adaptive bubble detection method based on dynamic threshold control is provided, applied to any of the systems described in the present invention, the method comprising: The data acquisition module simultaneously acquires image data of the bubble and light intensity data from multiple angles; The data preprocessing module performs hierarchical preprocessing and cross-modal feature correlation on the acquired image data and light intensity data; The dynamic threshold control module calculates the turbidity feature ratio, signal fluctuation ratio, and cross-modal correlation ratio based on the preprocessed data, and dynamically fuses the weights to obtain a comprehensive feature value K, which is then used to generate a dynamic detection threshold through clustering and fitting. The anti-interference optimization module uses an improved generative adversarial network to optimize the preprocessed data for interference removal. The bubble recognition and judgment module integrates multimodal features and combines spatiotemporal verification to identify bubbles and distinguish solid impurities. The results output module displays the detection results in real time, issues alarms based on warning thresholds, and links with external process systems.

[0016] The beneficial effects of this invention are as follows: By employing a dynamic threshold control mechanism and adjusting the detection threshold in real time according to the liquid turbidity based on a piecewise linear fitting algorithm, this invention effectively solves the problems of misjudgment in high-turbidity liquids and missed detection in low-turbidity liquids with a fixed threshold, thus improving the accuracy of bubble detection in liquids of different turbidities. Through dual-camera imaging combined with multi-image feature extraction and the introduction of adversarial network anti-interference optimization, it achieves accurate differentiation between bubbles and solid impurities, avoiding interference from impurities on bubble detection results and eliminating the influence of external light, equipment vibration, and other interference factors on the detection data, thereby improving the stability and reliability of the system in complex industrial environments. Simultaneously, the data from each module of the system are linked in real time, and the detection parameters are dynamically matched with the liquid turbidity state. It has strong sample compatibility and can be applied to the detection of bubbles in liquids with different turbidity ranges during extraction. Furthermore, the detection results can be directly linked to the process control system, providing data support for the optimization of the extraction process. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is an overall architecture diagram of the turbidity adaptive bubble detection system based on dynamic threshold control according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the data acquisition module installation layout of the turbidity adaptive bubble detection system based on dynamic threshold control according to an embodiment of the present invention; Figure 3 This is a flowchart of the dynamic threshold control module of the turbidity adaptive bubble detection system based on dynamic threshold control according to an embodiment of the present invention. Figure 4 This is a schematic diagram of an improved WGAN-GP network structure for a turbidity adaptive bubble detection system based on dynamic threshold control, as described in an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention are within the scope of protection of the present invention.

[0020] like Figure 1-4As shown in the figure, a turbidity adaptive bubble detection system based on dynamic threshold control according to an embodiment of the present invention includes a data acquisition module, a data preprocessing module, a dynamic threshold control module, an anti-interference optimization module, a bubble recognition and judgment module, and a result output module. The modules are connected in sequence and work together.

[0021] 1. Acquisition Module: Includes a dual-camera collaborative unit, a light intensity sensor array, and a multi-source synchronous triggering module.

[0022] Dual-camera collaborative unit: The dual-camera assembly uses industrial CCD cameras, mounted on the side and top of the extraction container respectively. Synchronization is achieved through a synchronous triggering unit (implemented using an FPGA chip, trigger delay ≤1μs). The side camera (16mm focal length, F2.0 aperture) is mounted at a 45° angle on the lower part of the extraction container's side wall to capture side-view images of the liquid, focusing on capturing the dynamic characteristics of the rising bubbles (such as outline, diameter, and rising speed). The top camera (25mm focal length, F1.8 aperture) is mounted vertically above the container to obtain the planar distribution density and regional aggregation of the bubbles. When the two cameras work together, the side and top view images are first spatially registered using ORB feature points to establish a three-dimensional coordinate mapping relationship for the bubble. Then, the bubble morphology features in the side view image and the distribution features in the top view image are weighted and fused (side view feature weight 0.6, top view feature weight 0.4) to provide multi-dimensional data for subsequent recognition. At the same time, a time series association algorithm is introduced to perform inter-frame matching between the trajectory of the same bubble in the side view image and its position in the top view image to achieve bubble life cycle tracking. Light intensity sensing array: The light intensity sensor is an integrated sensor consisting of three sets of laser scattering-transmission sensors (wavelength 650nm, measurement range 0-50000lux), arranged in an equilateral triangle. The laser emitter and receiver are installed at a 60° angle, simultaneously acquiring the scattered light intensity values ​​(Isc1 / Isc2 / Isc3) and transmitted light intensity values ​​(Itr1 / Itr2 / Itr3) of the liquid at different angles in real time. Mean filtering is used to eliminate single-point measurement deviations. The sampling frequency is 10-50Hz, and the synchronous trigger unit ensures that the timestamp error between the light intensity data and the image data is ≤5ms, guaranteeing the timeliness of data linkage. Multi-source synchronous triggering module: Based on Xilinx Artix-7 FPGA chip, it generates synchronous triggering signal (rising edge trigger, pulse width 10μs) to achieve time synchronization accuracy of ≤2μs between dual camera shooting and light intensity acquisition, ensuring spatiotemporal consistency of multi-source data.

[0023] 2. Preprocessing module: It adopts a "layered preprocessing + feature enhancement" architecture to achieve noise suppression and effective information extraction from multi-source data.

[0024] Image layer preprocessing: The bottom layer uses guided filtering (radius 5, regularization parameter 0.1) instead of traditional Gaussian filtering to preserve bubble edge details while denoising; the middle layer uses the Retinex algorithm to separate the image illumination component and reflection component to correct the image grayscale shift caused by changes in external light; the top layer uses adaptive thresholding (maximum inter-class variance method) to initially extract bubble candidate regions. Light intensity data preprocessing: First, pulse interference is removed by improving the 3σ criterion (introducing a dynamic update mechanism for the mean and standard deviation within a sliding window). Then, wavelet transform (db4 wavelet basis, decomposition level 3) is used to separate the signal trend term and noise term. Finally, the trend term is predicted in the short term using an LSTM model (prediction step size 3), thus achieving data smoothing and dynamic trend prediction. Cross-modal feature association: Construct a mapping relationship between image grayscale features and light intensity change rate, and calculate the correlation between the two using the Pearson correlation coefficient (|r|≥0.7 is considered a valid correlation), providing association enhancement data for subsequent modules.

[0025] 3. Threshold Adjustment Module: Based on the preprocessed scattered light intensity value (Isc') and transmitted light intensity value (Itr'), the detection threshold is dynamically adjusted using a ratio system + piecewise linear fitting algorithm. Specifically, this includes: The multi-dimensional ratio system is constructed by calculating two core ratio parameters: First, the turbidity characteristic ratio C = Isc' / Itr', reflecting the overall turbidity level of the liquid, i.e., turbidity characteristic ratio C = (Isc1 + Isc2 + Isc3) / 3 ÷ (Itr1 + Itr2 + Itr3) / 3, reflecting the static turbidity of the liquid; second, the dynamic fluctuation ratio R = ΔIsc' / ΔItr' (where Δ is the difference between adjacent sampling periods), characterizing the instantaneous change trend of the light intensity signal. That is, the signal fluctuation ratio R = Δ(Isc_avg) / Δ(Itr_avg) (Δ is the average difference between 5 adjacent frames), characterizing the dynamic change trend; the cross-modal correlation ratio M = average gray level of the bubble region in the image / average light intensity, establishing the correlation strength between the image and the light signal. The weights are dynamically allocated through the attention mechanism (ωC+ωR+ωM=1, and the weights are optimized in real time by gradient descent) to obtain the comprehensive feature value K=ωC×C+ωR×R+ωM×M, which takes into account both static turbidity and dynamic fluctuation characteristics. Adaptive segmented fitting: The comprehensive feature value K is divided into four segments: low turbidity (0-0.25), medium-low turbidity (0.25-0.5), medium-high turbidity (0.5-0.75), and high turbidity (0.75-1.0). Each segment is fitted with an independent linear threshold formula based on experimental data: Low turbidity T1 = a1 × K + b1, Medium-low turbidity T2 = a2 × K + b2, Medium-high turbidity T3 = a3 × K + b3, High turbidity T4 = a4 × K + b4 (a1 × K + b4) / (a1 × K + b1) -a4 and b1-b4 are the fitting coefficients, which were calibrated through repeated experiments with 10 sets of standard solutions of different turbidities (0-100 NTU), and the goodness of fit R² ≥ 0.98. That is, the K-means clustering algorithm (number of clusters 4) is used to automatically divide the interval range of K, and for each interval, the weighted least squares method (the weight is the sample confidence level, which is determined by the data signal-to-noise ratio) is used to perform linear fitting, and the threshold formula is obtained: T_i = a_i × K + b_i (i = 1-4, a_i and b_i are the fitting coefficients). Threshold dynamic calibration: After collecting 100 frames of data, the fitting coefficients are fine-tuned using a Bayesian optimization algorithm to avoid misjudgments caused by sudden threshold changes, ensuring that the threshold always adapts to the dynamic changes in liquid turbidity, and finally outputting the dynamic detection threshold T.

[0026] 4. Interference Optimization Module: An improved adversarial network (WGAN-GP) is used to optimize the preprocessed image data and light intensity data to resist interference, and a multi-source anti-interference network is constructed. Specifically, it includes three parts: network structure design, training strategy and interference suppression mechanism.

[0027] Network Architecture: The generator adopts an improved U-Net structure with an attention mechanism. The encoder contains four convolutional blocks (each block consists of two 3×3 convolutional layers + a BatchNorm layer + a LeakyReLU activation function with a stride of 2) to extract interference features. The decoder has four deconvolutional blocks that fuse features from different levels of the encoder through skip connections, ultimately outputting interference-free data of the same size as the input. The discriminator uses a PatchGAN structure with five convolutional layers (the first four layers are 4×4 convolutions + a BatchNorm layer + a LeakyReLU, and the last layer is a 1×1 convolution to output the discrimination result), and introduces a gradient penalty term (GP) to avoid mode collapse. Training strategy optimization: The training set contains three types of typical interference data extracted from the scene (light interference; equipment vibration interference; electromagnetic interference), with a total of 100,000 labeled samples collected (each sample contains the original interference data and the corresponding clean data). The training process uses the Adam optimizer, with a batch size of 32, an initial learning rate of 2e-4, which decays to 0.5 every 50 rounds, and iterates for 200 rounds. The Wasserstein distance is used as the loss function to ensure that the distribution difference between the generator output data and the clean data is minimized. Interference suppression mechanism: For light interference, the generator corrects the pixel grayscale of unevenly lit areas and enhances the edges of images blurred by vibration; for device vibration interference, an optical flow estimation module (Farneback algorithm) is introduced to calculate the inter-frame motion vector of the image, and reverse compensation is performed on the vibration-blurred areas. Combined with the Kalman filter algorithm, transient pulse interference is suppressed for the second time, and finally the effective elimination of multiple types of interference is achieved; for electromagnetic interference, a wavelet packet denoising branch is added to the light intensity data input end (decomposition level 4, reconstruction threshold adopts Birgé-Massart strategy).

[0028] 5. Recognition and Judgment Module: Adopts an intelligent recognition mechanism of "multimodal feature fusion + spatiotemporal correlation verification".

[0029] Multimodal feature extraction: Extract signal peak duration (bubble signal lasts 2-10 frames, impurity signal lasts 1-3 frames) and rise rate (bubble rise rate 0.5-2 cm / s, impurity settling or suspension) from light intensity data; extract three-dimensional morphological features (volume, surface area, sphericity), texture features (LBP texture histogram, bubble texture uniformity ≥0.85), and motion features (trajectory smoothness, bubble trajectory smoothness ≥0.9) from dual-camera images. Feature fusion and classification: A CNN-LSTM fusion model is adopted. The CNN part (ResNet18) extracts static features of the image, and the LSTM part (2 hidden layers, 128 hidden units) extracts dynamic temporal features of light intensity and image. Multimodal features are fused through feature splicing layer to output preliminary recognition results (bubbles / impurities / interference). Spatiotemporal correlation verification: For targets initially identified as bubbles, Kalman filtering is used to predict their position in the next frame, and the position is matched with the actual detection position (if the matching degree is ≥0.8, they are determined to be the same target). At the same time, the correlation between the bubble volume change rate in the side view image (volume expansion rate during the rise ≤5% / cm) and the distribution density in the top view image is verified to eliminate false bubble signals and finally output accurate bubble recognition results.

[0030] 6. Output Module: Construct a multi-dimensional output system of "real-time monitoring + intelligent early warning + data linkage".

[0031] Real-time monitoring interface: Developed using Qt+OpenGL, it realizes real-time rendering of 3D bubble distribution heat map (color depth represents bubble density), key parameter curves (turbidity characteristic value K, dynamic threshold T, bubble number change trend), and bubble life cycle tracking (displaying the generation, rise, coalescence, and bursting process of a single bubble). Intelligent early warning mechanism: Set three-level early warning thresholds (Level 1: Bubble density > 5 bubbles / cm³, Level 2: Average bubble diameter > 3mm, Level 3: Bubble coalescence frequency > 10 times / min). When an anomaly is detected, multi-terminal early warning is issued through audible and visual alarms, SMS notifications (based on 4G module) and system pop-ups. Data Linkage and Analysis: Through the OPCUA protocol, bidirectional communication with the extraction process PLC is achieved. It can not only upload bubble detection data (sampling period of 100ms), but also receive process parameters (such as stirring rate and extractant flow rate) and establish a correlation analysis model (using random forest algorithm) to output process optimization suggestions (such as reducing the stirring rate by 5%-10% to reduce bubble generation). At the same time, an edge-cloud collaborative storage architecture is adopted, with nearly 72 hours of high-frequency data (sampling frequency of 50Hz) stored locally and historical statistical data (aggregated by hour) stored in the cloud (Alibaba Cloud OSS) to support data backtracking and process review.

[0032] A simulated extraction device was set up in the laboratory. Liquid samples with turbidity of 10 NTU (low turbidity), 50 NTU (medium turbidity), and 90 NTU (high turbidity) were prepared. Air bubbles and solid impurities (particle size 0.1-0.5 mm) were added to each sample, and the system was tested. Test results showed that the system had a bubble false detection rate of less than 2% in low-turbidity liquids and a bubble false detection rate of less than 3% in high-turbidity liquids. The accuracy of distinguishing between bubbles and solid impurities was higher than 95%, and the anti-interference capability met the requirements of industrial settings. The specific process is as follows: I. System Initialization and Parameter Configuration (Preparations) Hardware Deployment: Complete the installation of the data acquisition module—the side CMOS camera (focal length 16mm, aperture F2.0) is fixed at a 45° angle to the lower middle part of the side wall of the extraction container, and the top CMOS camera (focal length 25mm, aperture F1.8) is vertically installed on the top of the container. Both are connected to the light intensity sensing array (3 groups of 650nm laser scattering-transmission sensors, distributed in an equilateral triangle) through an FPGA synchronous triggering module (XilinxArtix-7 chip) to ensure that the trigger delay is ≤1μs; the light intensity sensor transmitter and receiver are installed at a 60° angle, and the sampling frequency is set to 10-50Hz.

[0033] Software initialization: Start the industrial control computer and load the preset parameters: WGAN-GP anti-interference model (completed after 200 rounds of iterative training, including branches for light, vibration, and electromagnetic interference suppression), CNN-LSTM fusion recognition model (ResNet18+2 layers of LSTM hidden layers, 128 hidden units), dynamic threshold fitting coefficients (a1-a4, b1-b4, calibrated by 0-100NTU standard solution experiments, R²≥0.98), three-level warning thresholds (bubble density > 5 bubbles / cm³, average diameter > 3mm, aggregation frequency > 10 times / min) and OPCUA communication protocol parameters (sampling period 100ms).

[0034] Sample preparation: Prepare the target turbidity liquid (low turbidity 10 NTU / medium turbidity 50 NTU / high turbidity 90 NTU) in the simulated extraction device, add solid impurities of known particle size (0.1-0.5 mm), and use a stirring device to simulate the liquid flow state during the extraction process to ensure sample homogeneity.

[0035] II. Data Acquisition and Synchronous Transmission (Core Actions of the Data Acquisition Module) Multi-source data synchronous acquisition: Start the multi-source synchronous trigger module to generate a rising edge trigger signal (pulse width 10μs) to control the dual cameras and light intensity sensor array to work synchronously, with time synchronization accuracy ≤2μs.

[0036] Dual-camera collaborative acquisition: The side camera captures the dynamic contour, diameter, and rising speed of the bubble during its ascent, while the top camera acquires the planar distribution density of the bubble; ORB feature point matching is used to achieve spatial registration of the side and top view images, establish a three-dimensional coordinate mapping of the bubble, and a time series association algorithm is used to complete the inter-frame matching of the bubble life cycle.

[0037] Light intensity data acquisition: Three sets of sensors simultaneously acquire scattered light intensity (Isc1 / Isc2 / Isc3) and transmitted light intensity (Itr1 / Itr2 / Itr3). Single-point deviations are eliminated by mean filtering to ensure that the data and image timestamp error is ≤5ms.

[0038] Data transmission: The acquisition card transmits image data (RAW format) and light intensity data (CSV format) to the industrial control computer in real time and stores them in the local cache (with reserved space for 72 hours of high-frequency data storage).

[0039] III. Data Preprocessing (Data Preprocessing Module: Layered Processing) Image layering preprocessing: Low-level denoising: OpenCV is used to implement guided filtering (radius 5, regularization parameter 0.1) to suppress noise while preserving bubble edge details.

[0040] Mid-level grayscale correction: The Retinex algorithm is used to separate the image illumination and reflection components to correct grayscale shifts caused by fluctuations in external light.

[0041] Top-level candidate region extraction: Adaptive threshold segmentation is performed using the Otsu's method to initially screen out suspected bubble regions.

[0042] Light intensity data preprocessing: Pulse interference removal: Based on Python numpy, an improved 3σ criterion is implemented (the sliding window size is set to 20 frames, and the mean and standard deviation are dynamically updated) to remove pulse signals caused by electromagnetic interference.

[0043] Noise separation: Wavelet transform is performed using the db4 wavelet basis (decomposition level 3) to separate the signal trend term from the noise term.

[0044] Dynamic trend prediction: Short-term prediction of trend terms is achieved by using an LSTM model (prediction step size 3) to smooth the data.

[0045] Cross-modal feature association: Calculate the Pearson correlation coefficient between image gray-level features (mean gray-level of bubble candidate region) and light intensity change rate, filter valid associated data with |r|≥0.7, remove unrelated abnormal data, and form a multi-source fusion preprocessing dataset.

[0046] IV. Dynamic Threshold Calculation (Adaptively generated by the dynamic threshold control module) Multi-dimensional ratio calculation: Based on preprocessed light intensity data (Isc', Itr') and image features, three core ratios are calculated: Turbidity characteristic ratio C = (Isc1' + Isc2' + Isc3') / 3 ÷ (Itr1' + Itr2' + Itr3') / 3 (reflects the static turbidity of the liquid); Signal fluctuation ratio R = Δ(Isc_avg') / Δ(Itr_avg') (Δ is the average difference between 5 adjacent frames, representing the dynamic change trend); Cross-modal correlation ratio M = mean gray level of bubble region in image / mean light intensity (establishes the correlation strength between image and light signal).

[0047] Weighted fusion of comprehensive feature values: Weights are dynamically allocated through an attention mechanism (ωC+ωR+ωM=1, optimized in real time based on gradient descent) to calculate the comprehensive feature value K=ωC×C+ωR×R+ωM×M.

[0048] Interval partitioning and threshold fitting: The K-means clustering algorithm (number of clusters 4) is called to automatically divide K into four turbidity intervals: low (0-0.25), low-medium (0.25-0.5), medium-high (0.5-0.75), and high (0.75-1.0). For each interval, the weighted least squares method (weight is the data signal-to-noise ratio) is used to fit the threshold formula T_i=a_i×K+b_i (i=1-4).

[0049] Threshold dynamic calibration: After collecting 100 frames of data, the fitting coefficients are fine-tuned through a Bayesian optimization algorithm to avoid threshold abrupt changes, and finally outputs a dynamic detection threshold T that adapts to the current turbidity.

[0050] V. Anti-interference optimization (multi-branch processing of the anti-interference optimization module) Data input: Input the preprocessed image data and light intensity data into the improved WGAN-GP network (built based on the TensorFlow framework).

[0051] Multi-branch interference suppression: Illumination interference suppression: The generator (U-Net + Attention structure) performs pixel grayscale correction on areas of uneven illumination in the image to preserve the true outline of the bubble.

[0052] Vibration interference suppression: The inter-frame motion vector is calculated by the optical flow estimation module (Farneback algorithm) to perform reverse compensation for the vibration-blurred area, and Kalman filtering is used to suppress transient pulse interference.

[0053] Electromagnetic interference suppression: The light intensity data is processed by wavelet packet denoising branch (decomposition level 4, Birgé-Massart reconstruction threshold) to remove electromagnetic noise.

[0054] Clean data output: The interference removal effect is verified by a discriminator (PatchGAN structure). The Wasserstein distance is used as the loss function (adversarial loss and L1 reconstruction loss weight ratio is 1:3). The optimized data with the smallest difference from the clean data distribution is output.

[0055] VI. Bubble Recognition and Judgment (The bubble recognition and judgment module accurately distinguishes bubbles) Multimodal feature extraction: Light intensity characteristics: extract signal peak duration (bubbles 2-10 frames / impurities 1-3 frames), rise rate (bubbles 0.5-2 cm / s / impurities settling / suspension); Image features: Extract the three-dimensional morphology of the bubble (volume, surface area, sphericity), LBP texture histogram (bubble texture uniformity ≥ 0.85), and motion trajectory smoothness (bubble ≥ 0.9).

[0056] Feature fusion and preliminary classification: The CNN-LSTM fusion model receives the optimized data, ResNet18 extracts static features of the image, and LSTM extracts dynamic temporal features. After fusion by the feature splicing layer, the preliminary recognition results (bubbles / impurities / interference) are output.

[0057] Spatiotemporal correlation verification: Position matching: The position of the bubble in the next frame is predicted by Kalman filtering and matched with the actual detected position (if the matching degree is ≥0.8, it is determined to be the same target). Volume verification: Verify the correlation between the bubble volume expansion rate (≤5% / cm) in the side view image and the distribution density in the top view image; Final judgment: Remove false bubble signals and output accurate bubble recognition results (including parameters such as number, density, diameter, and distribution area).

[0058] VII. Results Output and Linkage (Multi-dimensional Response of Results Output Module) Real-time monitoring: Real-time rendering of the interface developed with Qt+OpenGL - 3D distribution heatmap of bubbles (color depth represents density), key parameter curves (turbidity K, dynamic threshold T, bubble number trend), and tracking of the life cycle of a single bubble (generation-rise-coalescence-rupture).

[0059] Intelligent early warning: By comparing the identification results with the three-level early warning threshold, if an anomaly is triggered (such as bubble density > 5 bubbles / cm³), an audible and visual alarm, 4G module SMS notification, and system pop-up window will be activated immediately to achieve multi-terminal synchronous early warning.

[0060] Data linkage and storage: Process linkage: Through bidirectional communication with the PLC via the OPCUA protocol, it uploads detection data and receives process parameters such as stirring rate and extractant flow rate; the random forest association analysis model outputs process optimization suggestions (such as reducing the stirring rate by 5%-10%) based on the data correlation degree.

[0061] Data storage: Local storage of high-frequency data (50Hz) for the past 72 hours, and cloud storage (Alibaba Cloud OSS) for aggregated storage of historical statistical data by the hour, supporting data backtracking and process review.

[0062] In summary, by employing the above-mentioned technical solution of this invention, and by using a dynamic threshold control mechanism, the detection threshold is adjusted in real time according to the liquid turbidity based on a piecewise linear fitting algorithm. This effectively solves the problems of misjudgment in high-turbidity liquids and missed detection in low-turbidity liquids when the threshold is fixed, thus improving the accuracy of bubble detection in liquids of different turbidities. By combining dual-camera shooting with multi-image feature extraction and introducing adversarial network anti-interference optimization, accurate differentiation between bubbles and solid impurities is achieved, avoiding interference from impurities on bubble detection results and eliminating the influence of external light, equipment vibration and other interference factors on detection data, thereby improving the stability and reliability of the system in complex industrial environments. At the same time, the data of each module of the system are linked in real time, the detection parameters are dynamically matched with the liquid turbidity state, the sample compatibility is strong, and it can be applied to the detection of bubbles in liquids with different turbidity ranges during the extraction process. Moreover, the detection results can be directly linked to the process control system, providing data support for the optimization of the extraction process.

[0063] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A turbidity adaptive bubble detection system based on dynamic threshold control, characterized in that, It includes, in sequence, a data acquisition module, a data preprocessing module, a dynamic threshold control module, an anti-interference optimization module, a bubble recognition and judgment module, and a result output module; wherein: The data acquisition module is used to simultaneously acquire image data of bubbles inside the extraction container and light intensity data from multiple angles; including: The dual-camera collaborative unit includes a side CMOS camera installed in the lower part of the container sidewall and tilted at 45° and a top CMOS camera installed vertically above the container. The dual cameras are controlled by a multi-source synchronous triggering module to achieve synchronous shooting and are used to construct a three-dimensional coordinate model of the bubble and track the bubble life cycle based on ORB feature point matching and time series correlation algorithms. The light intensity sensing array consists of three sets of laser scattering-transmission sensors arranged in an equilateral triangle. The laser emitter and receiver are installed at a 60° angle to collect the scattered light intensity values ​​(Isc1, Isc2, Isc3) and transmitted light intensity values ​​(Itr1, Itr2, Itr3) at different angles. The multi-source synchronous triggering module generates a synchronous triggering signal based on the FPGA chip, and controls the dual cameras and the light intensity sensing array to perform synchronous acquisition with a time synchronization accuracy of ≤2μs. The data preprocessing module is used to perform hierarchical preprocessing and feature association on the acquired image data and light intensity data; The dynamic threshold control module is used to dynamically generate detection thresholds based on preprocessed data, including: The ratio calculation unit is used to calculate the turbidity characteristic ratio C, the signal fluctuation ratio R, and the cross-modal correlation ratio M. The weight fusion unit dynamically allocates the weights (ωC, ωR, ωM) of C, R, and M through an attention mechanism, and calculates the comprehensive feature value K = ωC×C + ωR×R + ωM×M. The threshold fitting unit uses the K-means clustering algorithm to divide the K value into multiple intervals, and uses the weighted least squares method to fit each interval to obtain the dynamic detection threshold Ti = ai×K + bi.

2. The turbidity adaptive bubble detection system based on dynamic threshold control according to claim 1, characterized in that, In the dual-camera collaborative unit, the side CMOS camera is used to capture the dynamic contour and speed of the bubble's rising process, and the top CMOS camera is used to obtain the planar distribution density of the bubble. The dual-camera collaborative unit performs weighted fusion of the bubble morphology features in the side view image and the distribution features in the top view image, assigning a weight of 0.6 to the side view features and a weight of 0.4 to the top view features. The data collected by the light intensity sensing array is processed by mean filtering to eliminate single-point measurement deviation, and the timestamp error with the image data is controlled within ≤5ms. The sampling frequency of the light intensity data is 10-50Hz.

3. The turbidity adaptive bubble detection system based on dynamic threshold control according to claim 1, characterized in that, The data preprocessing module includes: The image preprocessing unit is used to sequentially perform guided filtering, Retinex algorithm grayscale correction, and adaptive threshold segmentation based on the maximum inter-class variance method on the image. The light intensity data preprocessing unit is used to sequentially perform pulse interference removal based on the improved 3σ criterion, wavelet transform denoising, and LSTM model trend prediction smoothing on the light intensity data. The cross-modal feature association unit is used to construct the mapping relationship between image grayscale features and light intensity change rate, and to filter effective association data by calculating the Pearson correlation coefficient.

4. The turbidity adaptive bubble detection system based on dynamic threshold control according to claim 3, characterized in that, In the data preprocessing module: the parameters of the guided filter are set to a radius of 5 and a regularization parameter of 0.1; the improved 3σ criterion uses a sliding window mechanism to dynamically update the mean and standard deviation; the wavelet transform uses the db4 wavelet basis for 3-level decomposition; the condition for screening effective correlated data is that the absolute value of the Pearson correlation coefficient |r| ≥ 0.

7.

5. The turbidity adaptive bubble detection system based on dynamic threshold control according to claim 1, characterized in that, In the dynamic threshold control module: the turbidity feature ratio C = (Isc1'+Isc2'+Isc3') / 3 ÷ (Itr1'+Itr2'+Itr3') / 3, where Isc' and Itr' are the preprocessed light intensity values; the signal fluctuation ratio R = Δ(Isc_avg') / Δ(Itr_avg'), where Δ is the average difference between 5 adjacent frames; the cross-modal correlation ratio M = the average gray level of the bubble candidate region in the image / the average value of the light intensity data; the number of clusters in the K-means clustering is 4, dividing the K value into four turbidity intervals: low, medium-low, medium-high, and high; the dynamic threshold control module is also equipped with a threshold calibration unit, which is used to fine-tune the fitting coefficients ai and bi using a Bayesian optimization algorithm after every 100 frames of data are collected.

6. The turbidity adaptive bubble detection system based on dynamic threshold control according to claim 1, characterized in that, The anti-interference optimization module is built on an improved WGAN-GP. Its generator adopts a structure that integrates U-Net and attention mechanism, and the discriminator adopts a PatchGAN structure. It also has a suppression branch for light interference, equipment vibration interference and electromagnetic interference, which is used to optimize the preprocessed data to remove interference. The bubble recognition and judgment module uses a CNN-LSTM fusion model to extract and fuse static image features and dynamic temporal features, and combines Kalman filter position prediction and bubble volume change rate verification to distinguish bubbles from solid impurities. The result output module is used to output the detection results, including a monitoring interface for real-time display of the three-dimensional distribution thermogram and parameter curve of bubbles, an intelligent early warning unit with three-level early warning thresholds, and a data linkage analysis unit that communicates with the external process control system through the OPC UA protocol and performs correlation analysis.

7. The turbidity adaptive bubble detection system based on dynamic threshold control according to claim 1, characterized in that, In the anti-interference optimization module: for the light interference suppression branch, the generator corrects the pixel grayscale of unevenly lit areas in the image; for the equipment vibration interference suppression branch, an optical flow estimation module is introduced to calculate the inter-frame motion vector of the image for inverse compensation, and Kalman filtering is combined for secondary suppression; for the electromagnetic interference suppression branch, a wavelet packet denoising branch is added at the light intensity data input end; the network training adopts adversarial loss and L1 reconstruction loss for joint optimization, with a weight ratio of 1:

3.

8. The turbidity adaptive bubble detection system based on dynamic threshold control according to claim 1, characterized in that, In the bubble recognition and judgment module, the extracted multimodal features include: the duration and rise rate of the signal peak from the light intensity data, and the three-dimensional morphological features, LBP texture features, and motion trajectory smoothness of the bubble from the image data; in the CNN-LSTM fusion model, the CNN part uses a ResNet18 network, and the LSTM part is a network structure with 2 hidden layers and 128 hidden units; the Kalman filter is used to predict the position of the bubble in the next frame and match it with the actual detection position. When the matching degree is ≥0.8, it is determined to be the same target.

9. The turbidity adaptive bubble detection system based on dynamic threshold control according to claim 1, characterized in that, In the result output module, the three-level early warning thresholds include: bubble density greater than 5 bubbles / cm³, average bubble diameter greater than 3mm, and bubble coalescence frequency greater than 10 times / min; the data linkage analysis unit uses the random forest algorithm to establish a correlation analysis model between detection data and process parameters to output process optimization suggestions; the system adopts an edge-cloud collaborative storage architecture, storing recent high-frequency data locally and aggregated historical statistical data in the cloud.

10. A turbidity adaptive bubble detection method based on dynamic threshold control, characterized in that, Applied to the system as described in any one of claims 1-9, the method comprises: The data acquisition module simultaneously acquires image data of the bubble and light intensity data from multiple angles; The data preprocessing module performs hierarchical preprocessing and cross-modal feature correlation on the acquired image data and light intensity data; The dynamic threshold control module calculates the turbidity feature ratio, signal fluctuation ratio, and cross-modal correlation ratio based on the preprocessed data, and dynamically fuses the weights to obtain a comprehensive feature value K, which is then used to generate a dynamic detection threshold through clustering and fitting. The anti-interference optimization module uses an improved generative adversarial network to optimize the preprocessed data for interference removal. The bubble recognition and judgment module integrates multimodal features and combines spatiotemporal verification to identify bubbles and distinguish solid impurities. The results output module displays the detection results in real time, issues alarms based on warning thresholds, and links with external process systems.