Artificial intelligence-based gas-liquid interface precise positioning method
By optimizing the gas-liquid interface localization using a multi-level structural model and a self-attention mechanism, the problems of untimely dynamic response and failure to consider environmental factors in traditional methods are solved, achieving high-precision and highly adaptable interface recognition.
Patent Information
- Application Number
- CN202510514040.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-04-23
AI Technical Summary
Traditional methods for precise localization of gas-liquid interfaces suffer from untimely dynamic response, failure to consider environmental factors, and analysis based on a single data source, leading to inaccurate localization accuracy. Furthermore, insufficient global information extraction and deep feature relationships in image data analysis, along with improper model parameter settings, all affect localization accuracy.
A multi-level structural model is designed, which combines image data, time series data and environmental data processing layers. A multi-window self-attention mechanism and a offset self-attention mechanism are adopted, and the model parameters are optimized using cosine transform initialization and dynamic spiral search strategy.
It significantly improves the accuracy, real-time performance, and adaptability of gas-liquid interface localization, enhancing the accuracy of localization in complex environments and the accuracy of model output results.
Smart Images

Figure CN120388073B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a method for precise positioning of gas-liquid interfaces based on artificial intelligence. Background Technology
[0002] The gas-liquid interface refers to the interface between a gas and a liquid. It is widely present in nature and various industrial applications. The accurate positioning of the gas-liquid interface is crucial for many scientific and engineering problems. Therefore, artificial intelligence-based methods for precise positioning of gas-liquid interfaces have emerged. This method uses artificial intelligence technology to automatically identify and accurately locate the position of the gas-liquid interface. By intelligently analyzing images or sensor data of the gas-liquid interface, it can achieve high-precision positioning of the gas-liquid interface, providing more advanced technical support for related industries and scientific research.
[0003] However, traditional gas-liquid interface precise localization methods suffer from technical problems such as untimely dynamic response, failure to consider environmental factors, and analysis of a single data source, resulting in inaccurate gas-liquid interface localization accuracy. Furthermore, traditional gas-liquid interface precise localization methods in image data analysis suffer from insufficient global information extraction and deep feature relationship capture, leading to inaccurate gas-liquid interface localization accuracy. Existing models applicable to multi-level gas-liquid interface localization also suffer from inaccurate model output results due to improper setting of built-in parameters. Summary of the Invention
[0004] To address the above issues and overcome the shortcomings of existing technologies, this invention provides an artificial intelligence-based method for precise gas-liquid interface localization. Addressing the technical problems of untimely dynamic response, lack of consideration for environmental factors, and reliance on a single data source in traditional gas-liquid interface localization methods, which lead to inaccurate localization accuracy, this solution innovatively designs a multi-layered structural model. This model solves the accuracy and adaptability problems of traditional methods in gas-liquid interface localization by comprehensively analyzing image data, time-series data, and environmental data. The image data processing layer processes image data to provide a preliminary gas-liquid interface position; the dynamic time-series data processing layer processes time-series data to capture the dynamic trend of the gas-liquid interface changing over time and accurately track the interface position; and the environmental data processing layer processes environmental data to adapt to various complex environments. The effective combination of these three layers significantly improves the localization accuracy, real-time performance, and adaptability of the gas-liquid interface. Furthermore, it addresses the technical problems of insufficient global information extraction and deep feature relationship capture in traditional gas-liquid interface precise localization methods during image data analysis, which leads to inaccurate localization accuracy. To address the issue of inaccurate gas-liquid interface localization, this solution innovatively proposes an image data processing method based on multi-window self-attention and multi-window offset self-attention mechanisms. This enhances the adaptability of gas-liquid interface localization in complex and dynamically changing environments and improves its accuracy. The multi-window self-attention mechanism ensures precise weighting of local features and effectively extracts global information, solving the problem of traditional methods failing to consider local dependencies during global feature fusion, thus improving the accuracy of gas-liquid interface localization. The multi-window offset self-attention mechanism optimizes the window selection range, effectively capturing deep-seated relationships between features, further enhancing the accuracy of gas-liquid interface localization. Furthermore, addressing the technical problem of inaccurate model output due to improper built-in parameter settings in existing multi-level gas-liquid interface localization models, this solution employs a cosine transform initialization method, a dynamic spiral search strategy, and a dynamic adjustment term factor to improve the algorithm for obtaining optimal model parameters. This yields the optimal parameter combination, improving the accuracy of model output and thus enhancing the precision of gas-liquid interface localization.
[0005] The technical solution adopted by this invention is as follows: The present invention provides an artificial intelligence-based method for precise positioning of the gas-liquid interface, which includes the following steps:
[0006] Step S1: Obtain gas-liquid interface positioning data;
[0007] Step S2: Raw data optimization processing;
[0008] Step S3: Construct a multi-level gas-liquid interface localization model;
[0009] Step S4: Enhance the performance of the gas-liquid interface localization model;
[0010] Step S5: Real-time and precise positioning of the gas-liquid interface.
[0011] Further, in step S1, acquiring gas-liquid interface positioning data specifically involves collecting raw gas-liquid interface positioning data using an industrial camera and sensors; the raw gas-liquid interface positioning data includes historical gas-liquid interface data and real-time gas-liquid interface data; both the historical and real-time gas-liquid interface data include gas-liquid interface image data and environmental data; the historical gas-liquid interface data also includes historical gas-liquid interface location data.
[0012] Further, in step S2, the raw data optimization processing is used to optimize the raw data for gas-liquid interface positioning. Specifically, it involves performing image data optimization processing, environmental data optimization processing, and data time synchronization on the raw data for gas-liquid interface positioning to obtain optimized gas-liquid interface positioning data.
[0013] Step S21: Image data optimization processing to obtain an optimized gas-liquid interface image, specifically including image denoising, image enhancement, and image registration;
[0014] Step S22: Environmental data optimization processing, specifically including data cleaning and standardization processing;
[0015] Step S23: Data time synchronization, used to analyze the relationship between the gas-liquid interface and environmental changes; specifically, based on the timestamps of the image data and environmental data, each image data frame is synchronized with the environmental data for the corresponding time period.
[0016] Further, in step S3, the construction of a multi-level gas-liquid interface localization model, used to identify the location of the gas-liquid interface through the model, specifically involves designing an image data processing layer, a dynamic time-series data processing layer, an environmental data processing layer, and a model output layer to obtain the multi-level gas-liquid interface localization model; including the following steps:
[0017] Step S31: Design an image data processing layer to obtain the preliminary location of the gas-liquid interface from the gas-liquid interface image data, specifically including the following steps:
[0018] Step S311: Gas-liquid interface image feature extraction, specifically including the following steps:
[0019] Step S3111: Local feature extraction of the gas-liquid interface, used to extract local spatial features from the gas-liquid interface image, specifically using a size of... The convolution kernel performs convolution processing on the gas-liquid interface optimization image, adjusts the number of channels in the input feature map, and then utilizes... The convolution kernel further extracts local spatial features. After each convolution operation, batch normalization is performed to standardize the convolution output, and then the ReLU activation function is used to perform a nonlinear transformation on the convolution output to obtain the local feature map of the gas-liquid interface. The formulas used are as follows:
[0020] ;
[0021] In the formula, This represents the value of the output feature map after the (l+1)th convolutional layer. Represents the ReLU activation function. This indicates a normalization operation. This represents the weight values of the (l+1)th convolutional kernel. The position in the output feature map after the l-th convolutional operation is... The value of m represents the number of channels in the input feature map. , and Indicates the size of the convolution kernel. , and This represents the offset of the convolution kernel in the spatial dimension. , and This represents the stride of the convolution kernel as it slides along each dimension. This represents the bias term for the (l+1)th layer convolution operation;
[0022] Step S3112: Extraction of macroscopic features of gas-liquid interface, used to identify macroscopic features of gas-liquid interface. Specifically, dilated convolution is introduced to perform convolution processing on the gas-liquid interface optimization image, batch normalization operation is performed on the feature map after dilated convolution processing, and the ReLU activation function is used to introduce nonlinear transformation on the processed feature map to finally obtain the macroscopic feature map of gas-liquid interface.
[0023] Step S3113: Feature stitching, specifically, stitching the local feature map of the gas-liquid interface and the macroscopic feature map of the gas-liquid interface together to obtain a comprehensive feature map of the gas-liquid interface. ;
[0024] Step S312: Obtain global dependencies for the gas-liquid interface, which specifically includes the following steps:
[0025] Step S3121: Preliminary fusion of gas-liquid interface features, specifically, firstly, the comprehensive feature map of the gas-liquid interface is fused. Perform multi-window self-attention calculation to obtain window merging features. ,right Layer normalization is performed and then input into the MLP module for feature enhancement. Finally, residual connections are used to obtain a preliminary fused feature map. The multi-window self-attention calculation specifically involves calculating based on the comprehensive feature map of the gas-liquid interface. The size is divided into multiple non-overlapping sizes. Small window, , and Let the depth, height, and width of the window represent the values, respectively. Self-attention is calculated for each window to obtain its weighted features. These weighted features are then combined and output using residual connections. The formulas used are as follows:
[0026] ;
[0027] ;
[0028] In the formula, Indicates preliminary fusion characteristics. The layer normalization function is represented. This represents the multi-window self-attention computation function. Describes the multilayer perceptron function. Indicates window merging characteristics;
[0029] Step S3122: Deep fusion of gas-liquid interface features, specifically, firstly, the preliminary fusion features... Perform multi-window offset self-attention calculation to obtain offset window merging features. ,right Layer normalization is performed and then input into the MLP module for feature enhancement. Finally, residual connections are used to obtain a preliminary fused feature map. The window offset self-attention calculation is specifically based on the gas-liquid interface comprehensive feature map. The size is divided into multiple non-overlapping sizes. Small window, simultaneously set offset Offset the window. , and Let represent the depth, height, and width offsets of the window, respectively. Self-attention is calculated for each offset window to obtain the weighted features of each offset window. The weighted features of each offset window are then merged and output as features through residual connections. The formulas used are as follows:
[0030] ;
[0031] ;
[0032] In the formula, Indicates deep fusion characteristics, This indicates the window offset self-attention calculation function. This indicates the offset window merging feature;
[0033] Step S313: Obtain the preliminary location of the gas-liquid interface using the following formula:
[0034] ;
[0035] In the formula, This indicates the initial location of the gas-liquid interface. The output weight matrix represents the initial position of the gas-liquid interface. The output bias parameter indicates the initial position of the gas-liquid interface. This represents the Sigmoid activation function;
[0036] Step S32: Design a dynamic temporal data processing layer to track the temporal changes in the gas-liquid interface position and optimize the gas-liquid interface localization results. Specifically, this involves processing the temporal information of historical gas-liquid interface position data through a Long Short-Term Memory (LSTM) network to obtain the dynamic temporal characteristics of the gas-liquid interface. The formula used is as follows:
[0037] ;
[0038] In the formula, Indicates the function that executes the unit. This indicates the hidden state at the previous moment. This indicates the current input historical gas-liquid interface position data;
[0039] Step S33: Design an environmental data processing layer to optimize the localization results of the gas-liquid interface using environmental data. Specifically, this involves processing the environmental data through a fully connected layer to obtain the environmental characteristics of the gas-liquid interface. The formula used is as follows:
[0040] ;
[0041] In the formula, The weight matrix represents the environmental data. The bias term parameter represents the environmental data. Represents environmental data;
[0042] Step S34: Design the model output layer to obtain the final position of the gas-liquid interface; the formula used is as follows:
[0043] ;
[0044] In the formula, Indicates the final position of the gas-liquid interface. The output weight matrix represents the final position of the gas-liquid interface. The output bias parameter indicates the final position of the gas-liquid interface.
[0045] Further, in step S4, enhancing the performance of the gas-liquid interface localization model specifically includes training a multi-level gas-liquid interface localization model, obtaining the optimal hyperparameters of the model, and adjusting the hyperparameters of the model to obtain an optimized multi-level gas-liquid interface localization model; including the following steps:
[0046] Step S41: Training the multi-level gas-liquid interface localization model, specifically, using the historical gas-liquid interface data to train the multi-level gas-liquid interface localization model, and obtaining the trained multi-level gas-liquid interface localization model.
[0047] Step S42: Obtain the optimal hyperparameters of the model, which are used to obtain the optimal hyperparameter combination of the trained multi-level gas-liquid interface localization model. Specifically, the optimal hyperparameter combination of the model is obtained using an improved optimization algorithm, including the following steps:
[0048] Step S421: Initialize the population individual positions, specifically by using the cosine transform initialization method to initialize the search individuals; the formula used is as follows:
[0049] ;
[0050] In the formula, This represents the i-th chaotic sequence value. Indicates being between Random numbers uniformly distributed within a range Indicates being between Random numbers uniformly distributed within a range This indicates the initial position of the i-th individual. and These represent the lower and upper limits of the search, respectively.
[0051] Step S422: Calculate the fitness value, specifically by calculating the fitness value f of each individual in the population. i The performance of the multi-level gas-liquid interface localization model trained based on individual locations is used as the fitness value of each individual. Individuals are then sorted from best to worst fitness value, and the location of the individual with the highest current global fitness value is obtained. ;
[0052] Step S423: Individual global search behavior, the specific formula used is as follows:
[0053] ;
[0054] In the formula, t represents the current iteration number. This represents the position of the i-th individual in the t-th generation of the population. This represents the position of the i-th individual in the (t+1)-th generation of the population. This represents the position of the i-th individual in the (t-1)-th generation of the population. This represents the position of the individual in the population with the worst fitness value in the t-th iteration. Indicates being between Random numbers uniformly distributed within a range Indicates being between Random numbers uniformly distributed within a range Represents dynamic coefficients. This represents the offset coefficient, and its value range is... , Indicates the barrier threshold. This indicates that no obstacles were encountered. This indicates that an obstacle has been encountered;
[0055] Step S424: Optimal solution derivation behavior, specifically, the optimal solution derivation behavior is performed through a dynamic spiral search strategy, using the following formula:
[0056] ;
[0057] ;
[0058] ;
[0059] In the formula, This indicates the position of the i-th derived individual in the (t+1)-th generation of the population. This indicates the position of the i-th derived individual in the t-th generation population. This represents the position of the individual in the population with the best fitness value in the t-th iteration. This indicates the lower boundary of the derived individual's location. Indicates the upper boundary of the position of the derived individual. and Let represent the maximum and minimum values in the solution space, respectively. and Indicates being between Random numbers uniformly distributed within a range This represents a constant used for controlling path updates. Indicates the maximum number of iterations;
[0060] Step S425: Individual local exploration behavior, specifically, adjusting search behavior through dynamic adjustment factors, using the following formula:
[0061] ;
[0062] ;
[0063] ;
[0064] In the formula, This represents the lower boundary of an individual's local exploration. This represents the upper boundary of an individual's local exploration. Represents a random number that follows a normal distribution. Indicates being between Random numbers uniformly distributed within a range This represents a dynamic adjustment factor used to adjust an individual's local exploratory behavior;
[0065] Step S426: Competitive global perturbation behavior, the specific formula used is as follows:
[0066] ;
[0067] In the formula, Indicates being between A random number that is uniformly distributed within a range;
[0068] Step S427: Obtain the optimal combination of hyperparameters for the model, specifically when the individual fitness value f i When the fitness threshold is exceeded and the maximum number of iterations is reached, the search is terminated and the global optimal position of the individual is obtained, thus obtaining the optimal combination of hyperparameters of the model.
[0069] Step S43: Adjust the hyperparameters of the model. Specifically, adjust the hyperparameters of the trained multi-level gas-liquid interface localization model according to the optimal hyperparameter combination of the model to obtain the optimized multi-level gas-liquid interface localization model.
[0070] Furthermore, in step S5, the real-time accurate positioning of the gas-liquid interface specifically involves inputting the real-time gas-liquid interface data into the optimized multi-level gas-liquid interface positioning model to obtain the real-time accurate gas-liquid interface position result, thereby enabling continuous monitoring of the interface's changing trend.
[0071] The beneficial effects achieved by the present invention using the above solution are as follows:
[0072] (1) In view of the technical problems of untimely dynamic response, lack of consideration of environmental factors and analysis of single data source in the traditional gas-liquid interface precise positioning method, which leads to inaccurate gas-liquid interface positioning accuracy, this solution innovatively designs a multi-level structure model. This model solves the accuracy and adaptability problems of traditional methods in gas-liquid interface positioning by comprehensively analyzing image data, time series data and environmental data. The image data processing layer processes the image data to provide the preliminary gas-liquid interface position. The dynamic time series data processing layer processes the time series data to capture the dynamic trend of gas-liquid interface changes over time in real time and accurately track the position of the interface. The environmental data processing layer processes the environmental data and can adapt to different complex environments. Through the effective combination of the above three layers, the positioning accuracy, real-time performance and adaptability of the gas-liquid interface are significantly improved.
[0073] (2) In view of the technical problems of insufficient global information extraction and deep feature relationship capture in traditional gas-liquid interface precise localization methods in image data analysis, which leads to inaccurate gas-liquid interface localization accuracy, this solution innovatively proposes an image data processing method based on multi-window self-attention mechanism and multi-window offset self-attention mechanism. This enhances the adaptability of gas-liquid interface localization in complex and dynamically changing environments and improves the gas-liquid interface localization accuracy. Through the multi-window self-attention mechanism, the accurate weighting of local features is ensured and global information can be effectively extracted. This solves the problem that traditional methods fail to consider local dependencies when fusing global features, thereby improving the accuracy of gas-liquid interface localization. Through the multi-window offset self-attention mechanism, the window selection range is optimized and the deep relationship between features is effectively captured, further improving the accuracy of gas-liquid interface localization.
[0074] (3) In view of the technical problem that the existing multi-level gas-liquid interface localization model has improper built-in parameter settings, resulting in inaccurate model output results, this solution adopts the cosine transformation initialization method, dynamic spiral search strategy and dynamic adjustment term factor improvement algorithm to obtain the optimal parameters of the model, obtain the optimal parameter combination, improve the accuracy of the model output results, and thus improve the accuracy of gas-liquid interface localization. Attached Figure Description
[0075] Figure 1 A flowchart illustrating the precise gas-liquid interface positioning method based on artificial intelligence provided by this invention;
[0076] Figure 2 This is a flowchart illustrating step S2;
[0077] Figure 3 This is a flowchart illustrating step S3;
[0078] Figure 4 This is a flowchart illustrating step S4;
[0079] Figure 5 This is a flowchart illustrating step S31;
[0080] Figure 6 This is a flowchart illustrating step S42;
[0081] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. Detailed Implementation
[0082] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. 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 without creative effort are within the scope of protection of the present invention.
[0083] In the description of this invention, it should be understood that the terms "upper", "lower", "front", "rear", "left", "right", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the system or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0084] Example 1, see Figure 1 The technical solution adopted by the present invention is as follows: The present invention provides an artificial intelligence-based method for precise positioning of the gas-liquid interface, which includes the following steps:
[0085] Step S1: Obtain gas-liquid interface positioning data, specifically by collecting raw gas-liquid interface positioning data using an industrial camera and sensors;
[0086] Step S2: Raw data optimization processing, used to optimize the raw data of gas-liquid interface positioning, specifically to perform image data optimization processing, environmental data optimization processing and data time synchronization on the raw data of gas-liquid interface positioning to obtain optimized gas-liquid interface positioning data;
[0087] Step S3: Construct a multi-level gas-liquid interface localization model to identify the location of the gas-liquid interface. Specifically, design an image data processing layer, a dynamic time series data processing layer, an environmental data processing layer, and a model output layer to obtain the multi-level gas-liquid interface localization model.
[0088] Step S4: Enhance the performance of the gas-liquid interface localization model, specifically including training the multi-level gas-liquid interface localization model, obtaining the optimal hyperparameters of the model, and adjusting the hyperparameters of the model to obtain the optimized multi-level gas-liquid interface localization model.
[0089] Step S5: Real-time accurate positioning of the gas-liquid interface, specifically by inputting real-time data into the optimized model to obtain the real-time accurate gas-liquid interface position result.
[0090] Example 2, see Figure 1This embodiment is based on the above embodiment. In step S1, acquiring the gas-liquid interface positioning data specifically involves collecting raw gas-liquid interface positioning data using an industrial camera and sensors. The raw gas-liquid interface positioning data includes historical gas-liquid interface data and real-time gas-liquid interface data. Both the historical and real-time gas-liquid interface data include gas-liquid interface image data and environmental data. The gas-liquid interface image data includes upper gas-liquid interface images, side gas-liquid interface images, and oblique side gas-liquid interface images. The environmental data includes temperature data and pressure data. The historical gas-liquid interface data also includes historical gas-liquid interface position data.
[0091] Example 3, see Figure 1 and Figure 2 This embodiment is based on the above embodiment. In step S2, the raw data optimization processing is used to optimize the raw data for gas-liquid interface positioning, and specifically includes the following steps;
[0092] Step S21: Image data optimization processing to obtain an optimized gas-liquid interface image, specifically including image denoising, image enhancement, and image registration; the image denoising specifically uses a Gaussian filtering algorithm to remove random noise and background interference from the image, ensuring image clarity; the image enhancement specifically uses contrast enhancement, brightness adjustment, and edge enhancement techniques to enhance the visual features of the gas-liquid interface image; the image registration is used to ensure the data consistency and accuracy of multi-view images, specifically by using a feature point matching algorithm to perform image alignment operations on gas-liquid interface images taken from different angles;
[0093] Step S22: Environmental data optimization processing, specifically including data cleaning and standardization processing; the data cleaning process involves removing missing values, outliers, and duplicate values from the environmental data; the standardization processing is based on the min-max normalization method to standardize the data.
[0094] Step S23: Data time synchronization, used to analyze the relationship between the gas-liquid interface and environmental changes; specifically, based on the timestamps of the image data and environmental data, each image data frame is synchronized with the environmental data for the corresponding time period.
[0095] Example 4, see Figure 1 and Figure 3 This embodiment is based on the above embodiment. In step S3, the construction of the multi-level gas-liquid interface localization model specifically includes the following steps;
[0096] Step S31: Design an image data processing layer to extract the position of the gas-liquid interface from the gas-liquid interface image data and obtain the preliminary position of the gas-liquid interface.
[0097] Step S32: Design a dynamic temporal data processing layer to track the temporal changes in the gas-liquid interface position and optimize the gas-liquid interface localization results. Specifically, this involves processing the temporal information of historical gas-liquid interface position data through a Long Short-Term Memory (LSTM) network to obtain the dynamic temporal characteristics of the gas-liquid interface. The formula used is as follows:
[0098] ;
[0099] In the formula, Indicates the function that executes the unit. This indicates the hidden state at the previous moment. This indicates the current input historical gas-liquid interface position data;
[0100] Step S33: Design an environmental data processing layer to optimize the localization results of the gas-liquid interface using environmental data. Specifically, this involves processing the environmental data through a fully connected layer to obtain the environmental characteristics of the gas-liquid interface. The formula used is as follows:
[0101] ;
[0102] In the formula, The weight matrix represents the environmental data. The bias term parameter represents the environmental data. Represents environmental data;
[0103] Step S34: Design the model output layer to obtain the final position of the gas-liquid interface; the formula used is as follows:
[0104] ;
[0105] In the formula, Indicates the final position of the gas-liquid interface. The output weight matrix represents the final position of the gas-liquid interface. The output bias parameter indicates the final position of the gas-liquid interface.
[0106] By performing the above operations, this solution addresses the technical problems of untimely dynamic response, lack of consideration for environmental factors, and analysis of a single data source in traditional gas-liquid interface precision positioning methods, which lead to inaccurate gas-liquid interface positioning accuracy. This solution innovatively designs a multi-layered structural model. This model solves the accuracy and adaptability problems of traditional methods in gas-liquid interface positioning by comprehensively analyzing image data, time-series data, and environmental data. The image data processing layer processes image data to provide a preliminary gas-liquid interface position; the dynamic time-series data processing layer processes time-series data to capture the dynamic trend of gas-liquid interface changes over time and accurately track the interface position; and the environmental data processing layer processes environmental data to adapt to different complex environments. Through the effective combination of these three layers, the positioning accuracy, real-time performance, and adaptability of the gas-liquid interface are significantly improved.
[0107] Example 5, see Figure 1 and Figure 5 This embodiment is based on the above embodiment. In step S31, the design of the image data processing layer specifically includes the following steps:
[0108] Step S311: Gas-liquid interface image feature extraction, specifically including the following steps:
[0109] Step S3111: Local feature extraction of the gas-liquid interface, used to extract local spatial features from the gas-liquid interface image, specifically using a size of... The convolution kernel performs convolution processing on the gas-liquid interface optimization image, adjusts the number of channels in the input feature map, and then utilizes... The convolution kernel further extracts local spatial features. After each convolution operation, batch normalization is performed to standardize the convolution output, and then the ReLU activation function is used to perform a nonlinear transformation on the convolution output to obtain the local feature map of the gas-liquid interface. The formulas used are as follows:
[0110] ;
[0111] In the formula, This represents the value of the output feature map after the (l+1)th convolutional layer. Represents the ReLU activation function. This indicates a normalization operation. This represents the weight values of the (l+1)th convolutional kernel. The position in the output feature map after the l-th convolutional operation is... The value of m represents the number of channels in the input feature map. , and Indicates the size of the convolution kernel. , and This represents the offset of the convolution kernel in the spatial dimension. , and This represents the stride of the convolution kernel as it slides along each dimension. This represents the bias term for the (l+1)th layer convolution operation;
[0112] Step S3112: Extraction of macroscopic features of the gas-liquid interface, used to identify the macroscopic features of the gas-liquid interface. Specifically, dilated convolution is introduced to perform convolution processing on the optimized gas-liquid interface image, batch normalization is performed on the feature map after dilated convolution processing, and a nonlinear transformation is introduced on the processed feature map using the ReLU activation function to finally obtain the macroscopic feature map of the gas-liquid interface; the specific parameters of the dilated convolution are set to the selected size. The convolution kernel is set to have an inflation rate of 3;
[0113] Step S3113: Feature stitching, specifically, stitching the local feature map of the gas-liquid interface and the macroscopic feature map of the gas-liquid interface together to obtain a comprehensive feature map of the gas-liquid interface. ;
[0114] Step S312: Obtain global dependencies for the gas-liquid interface, which specifically includes the following steps:
[0115] Step S3121: Preliminary fusion of gas-liquid interface features, specifically, firstly, the comprehensive feature map of the gas-liquid interface is fused. Perform multi-window self-attention calculation to obtain window merging features. ,right Layer normalization is performed and then input into the MLP module for feature enhancement. Finally, residual connections are used to obtain a preliminary fused feature map. The multi-window self-attention calculation specifically involves calculating based on the comprehensive feature map of the gas-liquid interface. The size is divided into multiple non-overlapping sizes. Small window, , and Let the depth, height, and width of the window represent the values, respectively. Self-attention is calculated for each window to obtain its weighted features. These weighted features are then combined and output using residual connections. The formulas used are as follows:
[0116] ;
[0117] ;
[0118] In the formula, Indicates preliminary fusion characteristics. The layer normalization function is represented. This represents the multi-window self-attention computation function. Describes the multilayer perceptron function. Indicates window merging characteristics;
[0119] Step S3122: Deep fusion of gas-liquid interface features, specifically, firstly, the preliminary fusion features... Perform multi-window offset self-attention calculation to obtain offset window merging features. ,right Layer normalization is performed and then input into the MLP module for feature enhancement. Finally, residual connections are used to obtain a preliminary fused feature map. The window offset self-attention calculation is specifically based on the gas-liquid interface comprehensive feature map. The size is divided into multiple non-overlapping sizes. Small window, simultaneously set offset Offset the window. , and Let represent the depth, height, and width offsets of the window, respectively. Self-attention is calculated for each offset window to obtain the weighted features of each offset window. The weighted features of each offset window are then merged and output as features through residual connections. The formulas used are as follows:
[0120] ;
[0121] ;
[0122] In the formula, Indicates deep fusion characteristics, This indicates the window offset self-attention calculation function. This indicates the offset window merging feature;
[0123] Step S313: Obtain the preliminary location of the gas-liquid interface using the following formula:
[0124] ;
[0125] In the formula, This indicates the initial location of the gas-liquid interface. The output weight matrix represents the initial position of the gas-liquid interface. The output bias parameter indicates the initial position of the gas-liquid interface. This represents the Sigmoid activation function.
[0126] By performing the above operations, this solution addresses the technical problem of insufficient global information extraction and deep feature relationship capture in traditional gas-liquid interface precision localization methods in image data analysis, which leads to inaccurate gas-liquid interface localization accuracy. It innovatively proposes an image data processing method based on a multi-window self-attention mechanism and a multi-window offset self-attention mechanism. This enhances the adaptability of gas-liquid interface localization in complex and dynamically changing environments and improves its accuracy. The multi-window self-attention mechanism ensures accurate weighting of local features and effectively extracts global information, solving the problem of traditional methods failing to consider local dependencies during global feature fusion, thus improving the accuracy of gas-liquid interface localization. The multi-window offset self-attention mechanism optimizes the window selection range and effectively captures deep relationships between features, further improving the accuracy of gas-liquid interface localization.
[0127] Example 6, see Figure 1 , Figure 4 and Figure 6 This embodiment is based on the above embodiment. In step S4, the enhancement of the gas-liquid interface localization model performance specifically includes the following steps:
[0128] Step S41: Training the multi-level gas-liquid interface localization model, specifically, using the historical gas-liquid interface data to train the multi-level gas-liquid interface localization model, and obtaining the trained multi-level gas-liquid interface localization model.
[0129] Step S42: Obtain the optimal hyperparameters of the model, which are used to obtain the optimal hyperparameter combination of the trained multi-level gas-liquid interface localization model. Specifically, the optimal hyperparameter combination of the model is obtained using an improved optimization algorithm, including the following steps:
[0130] Step S421: Initialize the population individual positions, specifically by using the cosine transform initialization method to initialize the search individuals; the formula used is as follows:
[0131] ;
[0132] In the formula, This represents the i-th chaotic sequence value. Indicates being between Random numbers uniformly distributed within a range Indicates being between Random numbers uniformly distributed within a range This indicates the initial position of the i-th individual. and These represent the lower and upper limits of the search, respectively.
[0133] Step S422: Calculate the fitness value, specifically by calculating the fitness value f of each individual in the population. iThe performance of the multi-level gas-liquid interface localization model trained based on individual locations is used as the fitness value of each individual. Individuals are then sorted from best to worst fitness value, and the location of the individual with the highest current global fitness value is obtained. ;
[0134] Step S423: Individual global search behavior, the specific formula used is as follows:
[0135] ;
[0136] In the formula, t represents the current iteration number. This represents the position of the i-th individual in the t-th generation of the population. This represents the position of the i-th individual in the (t+1)-th generation of the population. This represents the position of the i-th individual in the (t-1)-th generation of the population. This represents the position of the individual in the population with the worst fitness value in the t-th iteration. Indicates being between Random numbers uniformly distributed within a range Indicates being between Random numbers uniformly distributed within a range Represents dynamic coefficients. This represents the offset coefficient, and its value range is... , Indicates the barrier threshold. This indicates that no obstacles were encountered. This indicates that an obstacle has been encountered;
[0137] Step S424: Optimal solution derivation behavior, specifically, the optimal solution derivation behavior is performed through a dynamic spiral search strategy, using the following formula:
[0138] ;
[0139] ;
[0140] ;
[0141] In the formula, This indicates the position of the i-th derived individual in the (t+1)-th generation of the population. This indicates the position of the i-th derived individual in the t-th generation population. This represents the position of the individual in the population with the best fitness value in the t-th iteration. This indicates the lower boundary of the derived individual's location. Indicates the upper boundary of the position of the derived individual. and Let represent the maximum and minimum values in the solution space, respectively. and Indicates being between Random numbers uniformly distributed within a range This represents a constant used for controlling path updates. Indicates the maximum number of iterations;
[0142] Step S425: Individual local exploration behavior, specifically, adjusting search behavior through dynamic adjustment factors, using the following formula:
[0143] ;
[0144] ;
[0145] ;
[0146] In the formula, This represents the lower boundary of an individual's local exploration. This represents the upper boundary of an individual's local exploration. Represents a random number that follows a normal distribution. Indicates being between Random numbers uniformly distributed within a range This represents a dynamic adjustment factor used to adjust an individual's local exploratory behavior;
[0147] Step S426: Competitive global perturbation behavior, the specific formula used is as follows:
[0148] ;
[0149] In the formula, Indicates being between A random number that is uniformly distributed within a range;
[0150] Step S427: Obtain the optimal combination of hyperparameters for the model, specifically when the individual fitness value f i When the fitness threshold is exceeded and the maximum number of iterations is reached, the search is terminated and the global optimal position of the individual is obtained, thus obtaining the optimal combination of hyperparameters of the model.
[0151] Step S43: Adjust the hyperparameters of the model. Specifically, adjust the hyperparameters of the trained multi-level gas-liquid interface localization model according to the optimal hyperparameter combination of the model to obtain the optimized multi-level gas-liquid interface localization model.
[0152] By performing the above operations, this solution addresses the technical problem of inaccurate model output results due to improper setting of built-in parameters in existing multi-level gas-liquid interface localization models. It employs a cosine transform initialization method, a dynamic spiral search strategy, and an improved algorithm for obtaining optimal model parameters using dynamic adjustment factors. This yields the optimal parameter combination, improves the accuracy of model output results, and thus enhances the precision of gas-liquid interface localization.
[0153] Example 6, see Figure 1 This embodiment is based on the above embodiment. In step S5, the real-time accurate positioning of the gas-liquid interface specifically involves inputting the real-time gas-liquid interface data into the optimized multi-level gas-liquid interface positioning model to obtain the real-time accurate gas-liquid interface position result, thereby enabling continuous monitoring of the interface's changing trend.
[0154] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0155] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention.
[0156] The present invention and its embodiments have been described above. This description is not restrictive, and the accompanying drawings are only one embodiment of the present invention; the actual structure is not limited thereto. In conclusion, if those skilled in the art are inspired by this description and design similar structures and embodiments without departing from the spirit of the invention, such designs should fall within the protection scope of the present invention.
Claims
1. A precise gas-liquid interface localization method based on artificial intelligence, characterized in that: The method includes the following steps: Step S1: Obtain gas-liquid interface positioning data. By collecting data, obtain the raw gas-liquid interface positioning data. Step S2: Raw data optimization processing, used to optimize the raw data of gas-liquid interface positioning, specifically to perform image data optimization processing, environmental data optimization processing and data time synchronization on the raw data of gas-liquid interface positioning to obtain optimized gas-liquid interface positioning data; Step S3: Construct a multi-level gas-liquid interface localization model for accurate identification of the gas-liquid interface location. Specifically, by comprehensively analyzing image data, time-series data, and environmental data, a multi-level structural model is designed and constructed to obtain the multi-level gas-liquid interface localization model. This model first analyzes the gas-liquid interface image data through an image data processing layer to obtain the preliminary location of the gas-liquid interface. Then, by processing the time-series data and environmental data of historical gas-liquid interface locations, the processing results of the time-series data and environmental data are integrated in the model output layer to further adjust the preliminary location of the gas-liquid interface, thereby achieving accurate localization of the gas-liquid interface. This includes the following steps: Step S31: Design an image data processing layer to obtain the preliminary location of the gas-liquid interface from the gas-liquid interface image data. ; Step S32: Design a dynamic temporal data processing layer to track the temporal changes in the gas-liquid interface position and optimize the gas-liquid interface localization results. Specifically, this involves processing the temporal information of historical gas-liquid interface position data through a Long Short-Term Memory (LSTM) network to obtain the dynamic temporal characteristics of the gas-liquid interface. The formula used is as follows: ; In the formula, Indicates the function that executes the unit. This indicates the hidden state at the previous moment. This indicates the current input historical gas-liquid interface position data; Step S33: Design an environmental data processing layer to optimize the localization results of the gas-liquid interface using environmental data. Specifically, this involves processing the environmental data through a fully connected layer to obtain the environmental characteristics of the gas-liquid interface. The formula used is as follows: ; In the formula, The weight matrix represents the environmental data. The bias term parameter represents the environmental data. Represents environmental data; Step S34: Design the model output layer to obtain the final position of the gas-liquid interface; the formula used is as follows: ; In the formula, Indicates the final position of the gas-liquid interface. The output weight matrix represents the final position of the gas-liquid interface. The output bias parameter indicates the final position of the gas-liquid interface. This represents the Sigmoid activation function; Step S4: Enhance the performance of the gas-liquid interface localization model. This is used to optimize the training of the model and improve the hyperparameters of the model, thereby increasing the accuracy of the output results of the multi-level gas-liquid interface localization model. The model is trained using historical data, and the algorithm for obtaining the optimal parameters of the model is improved by using a cosine transform initialization method, a dynamic spiral search strategy, and a dynamic adjustment term factor. The optimal hyperparameter combination of the model is obtained, and the hyperparameters of the model are adjusted according to the optimal hyperparameter combination. Finally, the optimized multi-level gas-liquid interface localization model is obtained. Step S5: Real-time accurate positioning of the gas-liquid interface, specifically by inputting real-time data into the optimized model to obtain the real-time accurate gas-liquid interface position result.
2. The method for precise positioning of gas-liquid interface based on artificial intelligence according to claim 1, characterized in that: In step S31, the design of the image data processing layer specifically includes the following steps: Step S311: Gas-liquid interface image feature extraction, specifically including the following steps: Step S3111: Local feature extraction of the gas-liquid interface, used to extract local spatial features from the gas-liquid interface image, specifically using a size of... The convolution kernel performs convolution processing on the gas-liquid interface optimization image, adjusts the number of channels in the input feature map, and then utilizes... The convolution kernel further extracts local spatial features. After each convolution operation, batch normalization is performed to standardize the convolution output, and then the ReLU activation function is used to perform a nonlinear transformation on the convolution output to obtain the local feature map of the gas-liquid interface. The formulas used are as follows: ; In the formula, This represents the value of the output feature map after the (l+1)th convolutional layer. Represents the ReLU activation function. This indicates a normalization operation. This represents the weight values of the (l+1)th convolutional kernel. The position in the output feature map after the l-th convolutional operation is... The value of m represents the number of channels in the input feature map. , and Indicates the size of the convolution kernel. , and This represents the offset of the convolution kernel in the spatial dimension. , and This represents the stride of the convolution kernel as it slides along each dimension. This represents the bias term for the (l+1)th layer convolution operation; Step S3112: Extraction of macroscopic features of gas-liquid interface, used to identify macroscopic features of gas-liquid interface. Specifically, dilated convolution is introduced to perform convolution processing on the gas-liquid interface optimization image, batch normalization operation is performed on the feature map after dilated convolution processing, and the ReLU activation function is used to introduce nonlinear transformation on the processed feature map to finally obtain the macroscopic feature map of gas-liquid interface. Step S3113: Feature stitching, specifically, stitching the local feature map of the gas-liquid interface and the macroscopic feature map of the gas-liquid interface together to obtain a comprehensive feature map of the gas-liquid interface. ; Step S312: Obtain global dependencies for the gas-liquid interface, which specifically includes the following steps: Step S3121: Preliminary fusion of gas-liquid interface features, specifically, firstly, the comprehensive feature map of the gas-liquid interface is fused. Perform multi-window self-attention calculation to obtain window merging features. ,right Layer normalization is performed and then input into the MLP module for feature enhancement. Finally, residual connections are used to obtain a preliminary fused feature map. The multi-window self-attention calculation specifically involves calculating based on the comprehensive feature map of the gas-liquid interface. The size is divided into multiple non-overlapping sizes. Small window, , and Let the depth, height, and width of the window represent the values, respectively. Self-attention is calculated for each window to obtain its weighted features. These weighted features are then combined and output using residual connections. The formulas used are as follows: ; ; In the formula, Indicates preliminary fusion characteristics. The layer normalization function is represented. This represents the multi-window self-attention computation function. Describes the multilayer perceptron function. Indicates window merging characteristics; Step S3122: Deep fusion of gas-liquid interface features, specifically, firstly, the preliminary fusion features... Perform multi-window offset self-attention calculation to obtain offset window merging features. ,right Layer normalization is performed and then input into the MLP module for feature enhancement. Finally, residual connections are used to obtain a preliminary fused feature map. The window offset self-attention calculation is specifically based on the comprehensive feature map of the gas-liquid interface. The size is divided into multiple non-overlapping sizes. Small window, simultaneously set offset Offset the window. , and Let represent the depth, height, and width offsets of the window, respectively. Self-attention is calculated for each offset window to obtain the weighted features of each offset window. The weighted features of each offset window are then merged and output as features through residual connections. The formulas used are as follows: ; ; In the formula, Indicates deep fusion characteristics, This indicates the window offset self-attention calculation function. This indicates the offset window merging feature; Step S313: Obtain the preliminary location of the gas-liquid interface using the following formula: ; In the formula, This indicates the initial location of the gas-liquid interface. The output weight matrix represents the initial position of the gas-liquid interface. The output bias parameter indicates the initial position of the gas-liquid interface.
3. The method for precise positioning of the gas-liquid interface based on artificial intelligence according to claim 1, characterized in that: In step S4, the enhancement of the gas-liquid interface localization model performance specifically includes training the multi-level gas-liquid interface localization model, obtaining the optimal hyperparameters of the model, and adjusting the hyperparameters of the model to obtain the optimized multi-level gas-liquid interface localization model. Includes the following steps: Step S41: Training the multi-level gas-liquid interface localization model, specifically by using historical gas-liquid interface data to train the multi-level gas-liquid interface localization model, and obtaining the trained multi-level gas-liquid interface localization model. Step S42: Obtain the optimal hyperparameters of the model, which are used to obtain the optimal hyperparameter combination of the trained multi-level gas-liquid interface localization model. Specifically, the optimal hyperparameter combination of the model is obtained using an improved optimization algorithm, including the following steps: Step S421: Initialize the population individual positions, specifically by using the cosine transform initialization method to initialize the search individuals; the formula used is as follows: ; In the formula, This represents the i-th chaotic sequence value. Indicates being between Random numbers uniformly distributed within a range Indicates being between Random numbers uniformly distributed within a range This indicates the initial position of the i-th individual. and These represent the lower and upper limits of the search, respectively. Step S422: Calculate the fitness value, specifically by calculating the fitness value f of each individual in the population. i The performance of the multi-level gas-liquid interface localization model trained based on individual locations is used as the fitness value of each individual. Individuals are then sorted from best to worst fitness value, and the location of the individual with the highest current global fitness value is obtained. ; Step S423: Individual global search behavior, the specific formula used is as follows: ; In the formula, t represents the current iteration number. This represents the position of the i-th individual in the t-th generation of the population. This represents the position of the i-th individual in the (t+1)-th generation of the population. This represents the position of the i-th individual in the (t-1)-th generation of the population. This represents the position of the individual in the population with the worst fitness value in the t-th iteration. Indicates being between Random numbers uniformly distributed within a range Indicates being between Random numbers uniformly distributed within a range Represents dynamic coefficients. This represents the offset coefficient, and its value range is... , Indicates the barrier threshold. This indicates that no obstacles were encountered. This indicates that an obstacle has been encountered; Step S424: Optimal solution derivation behavior, specifically, the optimal solution derivation behavior is performed through a dynamic spiral search strategy, using the following formula: ; ; ; In the formula, This indicates the position of the i-th derived individual in the (t+1)-th generation of the population. This indicates the position of the i-th derived individual in the t-th generation population. This represents the position of the individual in the population with the best fitness value in the t-th iteration. This indicates the lower boundary of the derived individual's location. Indicates the upper boundary of the position of the derived individual. and Let represent the maximum and minimum values in the solution space, respectively. and Indicates being between Random numbers uniformly distributed within a range This represents a constant used for controlling path updates. Indicates the maximum number of iterations; Step S425: Individual local exploration behavior, specifically, adjusting search behavior through dynamic adjustment factors, using the following formula: ; ; ; In the formula, This represents the lower boundary of an individual's local exploration. This represents the upper boundary of an individual's local exploration. Represents a random number that follows a normal distribution. Indicates being between Random numbers uniformly distributed within a range This represents a dynamic adjustment factor used to adjust an individual's local exploratory behavior; Step S426: Competitive global perturbation behavior, the specific formula used is as follows: ; In the formula, Indicates being between A random number that is uniformly distributed within a range; Step S427: Obtain the optimal combination of hyperparameters for the model, specifically when the individual fitness value f i When the fitness threshold is exceeded and the maximum number of iterations is reached, the search is terminated and the global optimal position of the individual is obtained, thus obtaining the optimal combination of hyperparameters of the model. Step S43: Adjust the hyperparameters of the model. Specifically, adjust the hyperparameters of the trained multi-level gas-liquid interface localization model according to the optimal hyperparameter combination of the model to obtain the optimized multi-level gas-liquid interface localization model.
4. The method for precise positioning of gas-liquid interface based on artificial intelligence according to claim 1, characterized in that: In step S5, the real-time accurate positioning of the gas-liquid interface specifically involves inputting real-time gas-liquid interface data into the optimized multi-level gas-liquid interface positioning model to obtain the real-time accurate gas-liquid interface position result, thereby enabling continuous monitoring of the interface's changing trend.
5. The method for precise positioning of gas-liquid interface based on artificial intelligence according to claim 1, characterized in that: In step S1, acquiring gas-liquid interface positioning data specifically involves collecting raw gas-liquid interface positioning data using an industrial camera and sensors. The raw gas-liquid interface positioning data includes historical gas-liquid interface data and real-time gas-liquid interface data. Both the historical and real-time gas-liquid interface data include gas-liquid interface image data and environmental data. The historical gas-liquid interface data also includes historical gas-liquid interface location data.
6. The method for precise localization of the gas-liquid interface based on artificial intelligence according to claim 1, characterized in that: In step S2, the raw data optimization processing is used to optimize the raw data of gas-liquid interface positioning. Specifically, it involves image data optimization processing, environmental data optimization processing, and data time synchronization of the raw data of gas-liquid interface positioning to obtain optimized gas-liquid interface positioning data. Step S21: Image data optimization processing to obtain an optimized gas-liquid interface image, specifically including image denoising, image enhancement, and image registration; Step S22: Environmental data optimization processing, specifically including data cleaning and standardization processing; Step S23: Data time synchronization, used to analyze the relationship between the gas-liquid interface and environmental changes; specifically, based on the timestamps of the image data and environmental data, each image data frame is synchronized with the environmental data for the corresponding time period.
Citation Information
Patent Citations
Oil tank liquid level ultrasonic measurement method and system based on LSTM, terminal and storage medium
CN113566929A
Method for predicting effluent quality of sewage treatment system
CN117273540A