Graphite ore flotation intelligent optimization method and system based on AI visual recognition

CN122597747APending Publication Date: 2026-08-18SHANDONG HI-SPEED ROAD & BRIDGE INT ENG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610753033.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-28
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0004]本发明为解决现有石墨矿浮选过程中过度依赖人工经验、药剂添加粗放、生产指标波动大的技术问题,提供一种基于AI视觉识别的石墨矿浮选智能优化方法及系统

Benefits of technology

本发明通过引入AI视觉识别技术,构建了从“图像感知”到“状态认知”再到“智能决策”的全闭环自动化控制系统。针对不同的泡沫特征采取不同的特征提取方式,精确地量化分析浮选泡沫的视觉特征,并将其转化为对石墨品位和回收率等关键指标的预测,以及泡沫状态(如“贫矿”、“富矿”、“过浮”等)的分类;采用注意力增强的残差网络并引入可变形卷积和高效通道注意力模块,快速、准确预测泡沫的泡沫的品味、回收率等指标;在此基础上,采用基于深度确定性策略算法的强化学习智能体作为决策模块,快速、准确地制定出最优的药剂掺量方案,并自动执行调整。这不仅完全替代了传统的人工经验操作,消除了人为因素带来的不确定性,而且实现了药剂添加的精准化、动态化控制,有效提高了石墨回收率和精矿品位,显著降低了药剂消耗和生产成本,保证了浮选工艺的长期稳定运行。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122597747A_ABST
    Figure CN122597747A_ABST
Patent Text Reader

Abstract

The application provides a graphite ore flotation intelligent optimization method and system based on AI visual identification, and relates to the technical field of mineral processing. The method comprises the following steps: acquiring a flotation foam image in real time through an image acquisition module, extracting multi-dimensional features such as foam size distribution, stability, color depth, texture and flow rate after improved bilateral filtering denoising and adaptive histogram equalization enhancement, predicting the graphite grade, recovery rate and foam state category according to the features by an attention-enhanced ResNet50 model, dynamically generating an optimal reagent scheme by combining a safety constraint and a reward function through a reinforcement learning agent based on a deep deterministic policy gradient, and finally automatically adjusting a reagent feeding device by a control execution module to realize closed-loop optimization control. The application can accurately predict the indicators of the foam and dynamically optimize the reagent feeding scheme according to the indicators, and significantly improves the production efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of mineral processing technology, and in particular to an intelligent optimization method and system for graphite ore flotation based on AI visual recognition. Background Technology

[0002] Graphite, as an important non-metallic mineral resource, is widely used in metallurgy, chemical industry, new energy, and other fields. Flotation is the main method for graphite beneficiation. Its principle is to utilize the differences in the physicochemical properties of the surfaces of graphite and gangue minerals. By adding flotation reagents, the graphite minerals adhere to air bubbles and float to the surface, thus achieving separation. During the flotation process, the amount of reagents (such as collectors, frothers, and depressants) added is crucial, directly affecting concentrate grade, recovery rate, and production costs.

[0003] Currently, the vast majority of graphite beneficiation plants still rely on manual, experience-based operation. Operators visually observe the surface characteristics of flotation froth, such as its shape, size, color, and flowability, judging the flotation conditions based on experience and manually adjusting the reagent dosage accordingly. This traditional method has many shortcomings: First, it heavily depends on the operator's experience and sense of responsibility, is highly subjective, and the varying skill levels of different operators lead to large fluctuations in production indicators; second, manual observation is inherently lagging, unable to provide immediate and accurate responses to changes in operating conditions; and finally, the inability to precisely quantify reagent dosage often results in reagent waste, increased production costs, and even affects the quality of the final product. Summary of the Invention

[0004] This invention addresses the technical problems of excessive reliance on manual experience, crude reagent addition, and large fluctuations in production indicators in existing graphite ore flotation processes by providing an intelligent optimization method and system for graphite ore flotation based on AI visual recognition.

[0005] S1. Collect flotation foam image data and construct a flotation working condition image sample library; S2. Preprocess the foam image data and extract image features; S3. Construct a flotation state identification model for graphite ore, perform multi-task joint prediction on image features to obtain graphite grade and recovery rate indicators, and identify the current state category of foam. S4. Construct a decision optimization model, and dynamically optimize the decision based on the predicted value of graphite grade, the predicted value of recovery rate and the current state category of foam, and dynamically generate the optimal flotation reagent dosage scheme.

[0006] As a further technical solution, S1 includes: Collect froth images under different working conditions during the flotation process of graphite ore to form a flotation froth image sample set; Each foam image in the sample set is associated and labeled by professional technicians. The labeling information includes the graphite grade data, recovery rate data, foam state category, and flotation reagent addition and adjustment parameters adapted to the working condition. The labeled associated data is organized and stored to form a standardized flotation condition image sample library.

[0007] As a further technical solution, preprocessing in S2 includes: Preprocessing includes improved bilateral filtering for noise reduction and contrast-adaptive histogram equalization; The improved bilateral filtering denoising uses an adaptive gray-domain standard deviation, combined with iterative filtering and edge-preserving enhancement processing. The formula for the adaptive gray-domain standard deviation is as follows: in, For grayscale and standard deviation, This represents the local variance of pixel grayscale within the filtering window. and This is an empirical constant.

[0008] As a further technical solution, image feature extraction in S2 includes: Image features include: foam size distribution, bubble breakage rate, foam color depth, texture feature parameters, and foam flow velocity vector; By segmenting the image, the regions of each bubble are obtained, and the pixel area, equivalent diameter and roundness of each bubble are calculated. Then, the mean, standard deviation and skewness of the bubble area in the whole image are statistically analyzed to form a statistical feature that quantitatively describes the morphology of the bubble. The Hungarian algorithm is used to establish the matching relationship between bubbles in adjacent frames. The Euclidean distance of the centroid is used as the matching cost. The bubble life cycle is tracked, and the bubble life time, average life time, life time standard deviation, half-life and bubble breakage rate are calculated. The stability index is obtained by normalizing the above indicators and then weighting and fusing them. First- to fourth-order statistical features are calculated for grayscale images, including grayscale mean, grayscale variance, skewness, and kurtosis; at the same time, first-order color moments, second-order color moments, and third-order color moments are calculated for the original RGB three channels respectively, to comprehensively characterize the color depth of the foam. An improved gray-level co-occurrence matrix method was used to calculate the gray-level co-occurrence matrices in four directions: 0°, 45°, 90°, and 135°, and then weighted and averaged them to fuse them. Based on the fused matrix, five texture parameters, namely contrast, correlation, energy, homogeneity, and entropy, were calculated. The Farneback dense optical flow algorithm is used to calculate the pixel motion displacement between two adjacent frames, construct a Gaussian pyramid, and solve the displacement vector by fitting the local image surface with a quadratic polynomial. The horizontal and vertical velocity components are obtained by combining the camera sampling frequency, and then the average velocity magnitude, main flow direction, velocity field divergence and velocity direction histogram of the whole image are calculated.

[0009] As a further technical solution, the S3 graphite ore flotation state identification model includes: The attention-enhanced residual network model uses ResNet50 as its backbone network and replaces standard convolutions with deformable convolutions, while embedding an efficient channel attention module after each residual stage. The model is trained using a multi-task joint loss function, which is obtained by weighted summation of the mean squared error loss for grade prediction, the mean squared error loss for recovery rate prediction, and the cross-entropy loss for foam state classification.

[0010] As a further technical solution, the decision optimization model in S4 includes: The policy optimization model employs a reinforcement learning agent based on a deep deterministic policy gradient algorithm; The state space of the agent consists of real-time operating information output by the attention-enhanced residual network model, including graphite grade prediction, recovery rate prediction, foam state category, grade change rate, recovery rate change rate, time since the last adjustment, last reagent adjustment amount, and grade trend. The action space of the intelligent agent is a continuous value, defined as the adjustment coefficient of the amount of each flotation reagent added. The adjustment coefficient includes the collector adjustment coefficient, the frother adjustment coefficient, the inhibitor adjustment coefficient, and the pH adjuster adjustment coefficient. The reward function for the agent is constructed by weighting five factors: quality reward, recovery rate reward, stability reward, cost penalty, and action smoothness penalty. Network parameters are updated using a soft update method based on the reward function.

[0011] This invention also provides an intelligent optimization system for graphite ore flotation based on AI visual recognition, comprising: The image acquisition module is used to acquire foam images in real time during the graphite ore flotation process; An image processing module, connected to the image acquisition module, is used to preprocess the foam image and extract image features that reflect the foam's shape, texture, color, and flow state. The AI ​​recognition module is connected to the image processing module and has a trained graphite ore flotation state recognition model embedded in it. The model is used to predict the graphite grade and / or recovery rate in the current flotation slurry based on the image features and to identify the current state category of the froth. The decision optimization module, connected to the AI ​​recognition module, has a built-in flotation reagent system knowledge base and optimization algorithm, which is used to dynamically match and generate the optimal flotation reagent dosage scheme based on the predicted graphite grade and / or recovery rate indicators and the foam state category. The control execution module, connected to the decision optimization module and the dosing equipment, is used to generate control commands based on the optimal flotation reagent dosage scheme to adjust the reagent addition amount of the dosing equipment.

[0012] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements an intelligent optimization method for graphite ore flotation based on AI visual recognition.

[0013] Beneficial effects of this invention: This invention introduces AI visual recognition technology to construct a fully closed-loop automated control system encompassing "image perception," "state cognition," and "intelligent decision-making." Different feature extraction methods are employed for different foam characteristics to accurately quantify and analyze the visual features of flotation foam, transforming them into predictions of key indicators such as graphite grade and recovery rate, as well as classification of foam states (e.g., "low-grade ore," "high-grade ore," "over-floating"). An attention-enhanced residual network, incorporating deformable convolution and efficient channel attention modules, rapidly and accurately predicts foam grade, recovery rate, and other indicators. Based on this, a reinforcement learning agent based on a deep deterministic strategy algorithm serves as the decision-making module, quickly and accurately formulating the optimal reagent dosage scheme and automatically executing adjustments. This not only completely replaces traditional manual experience-based operations, eliminating uncertainties caused by human factors, but also achieves precise and dynamic control of reagent addition, effectively improving graphite recovery rate and concentrate grade, significantly reducing reagent consumption and production costs, and ensuring the long-term stable operation of the flotation process. Attached Figure Description

[0014] 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.

[0015] Figure 1 This is a schematic diagram of the process of the present invention; Figure 2 This is a diagram of the prediction model structure. Detailed Implementation

[0016] 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. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] Example 1 S1. Obtain foam images during the graphite ore flotation process. A high-definition industrial camera, supplementary lighting, and a protective cover are installed above the froth layer of the flotation machine to acquire real-time, stable images of the froth on the flotation cell surface. The acquisition frequency can be set according to actual operating conditions, for example, acquiring 2-5 frames per second. To obtain high-quality images, the camera lens should be perpendicular to the froth layer surface, and the supplementary lighting is used to eliminate the influence of ambient light variations.

[0018] Foam images under different operating conditions during the flotation of graphite ore are collected to form a flotation foam image sample set. Specifically, professional technicians associate and annotate each foam image in the sample set. The annotation information includes the graphite grade data, recovery rate data, foam state category (such as normal state, low-grade ore state with insufficient reagents, high-grade ore state with excessive reagents, viscous pulp state, etc.), and the addition or adjustment parameters of flotation reagents (including collectors, frothers, depressants, etc.) suitable for the operating condition. The annotated "foam image-operating condition information-reagent parameters" association data is organized and stored to construct a standardized flotation operating condition image sample library.

[0019] S2. Foam image data preprocessing and feature extraction 1. Because foam images from industrial sites are easily affected by lighting noise, sensor thermal noise, and environmental particle noise during acquisition, these noises can degrade image quality and affect the accuracy of subsequent feature extraction. Therefore, this embodiment employs an improved bilateral filtering algorithm for denoising foam images. This algorithm can effectively remove noise while preserving foam edges, bubble boundaries, and texture details to the maximum extent, avoiding edge blurring problems caused by traditional Gaussian filtering or mean filtering.

[0020] (1) Image grayscale conversion and normalization: The acquired RGB foam image is converted into a grayscale image, and the pixel values ​​are normalized to map the grayscale range to the [0,1] interval to enhance the numerical stability of subsequent filtering processing.

[0021] (2) Set the filter window size , usually take or Set the standard deviation of the spatial domain. and grayscale standard deviation ,in Controlling spatial proximity weights, Controlling grayscale similarity weights. To adapt to texture variations in different regions of the bubble image, this embodiment introduces an adaptive adjustment mechanism: in, This represents the local variance of pixel grayscale within the filtering window. and These are empirical constants, taken as 0.5 and 0.1 respectively.

[0022] (3) Pixel-by-pixel filtering calculation: For each target pixel in the image Take its size as the center A neighborhood window. For each neighboring pixel within that window... Calculate spatial weights and grayscale weight : Spatial weights: Grayscale weight: In the formula, For target pixels The gray value at the point Indicates neighboring pixels The grayscale value at the point.

[0023] The total weights of the improved bilateral filter are: The target pixel is obtained by taking a weighted average of the grayscale values ​​of all pixels within the window. Filtered grayscale values: In the formula, Indicate size The filtering window, Represents target pixel The filtered grayscale value, This represents the combined weight of each neighboring pixel q.

[0024] (4) Iterative filtering: To further improve the denoising effect, the image is subjected to two iterative filters. The first filter uses a larger [value]. and (like , To remove a wide range of noise, the second filter uses smaller parameters ( , To preserve the details of the foam texture.

[0025] (5) Edge Preservation Enhancement Processing: Based on the filtered image, calculate the local gradient magnitude. For pixel regions with gradient magnitudes greater than a preset threshold (e.g., 0.15), they are identified as bubble boundary regions and subjected to slight sharpening compensation, as shown in the following formula: Among them The sharpening intensity factor ranges from 0.05 to 0.1. This represents the final image after edge-preserving enhancement. This represents the rate of change in grayscale values ​​of pixels in the filtered image, calculated using the Sobel or Prewitt operator, and is used to identify bubble edge regions. This represents the output image after denoising processing, by Calculated.

[0026] Through the improved bilateral filtering process described above, noise in the foam image is effectively suppressed, while key features such as the edge clarity, texture structure, and flow traces of the foam bubbles are well preserved. This provides high-quality image input for subsequent image feature extraction (such as foam size distribution, bubble breakage rate, texture feature parameters, etc.), significantly improving the prediction accuracy and stability of the AI ​​recognition model.

[0027] 2. Due to the common problems in graphite ore flotation froth images, such as uneven illumination distribution, gradual grayscale changes within the bubbles, and low contrast between bubble edges and the background, directly extracting image features can easily lead to insufficient edge recognition and weakened texture features. Therefore, this embodiment employs the Contrast Limited Adaptive Histogram Equalization (CLAHE) algorithm to enhance the contrast of the froth images. This algorithm effectively improves local contrast while avoiding the problems of excessive noise amplification and bright area saturation caused by traditional histogram equalization.

[0028] (1) Image block processing: the denoised foam grayscale image is processed by dividing the image into blocks. Divide the image into several non-overlapping rectangular sub-blocks. Let the image size be... The size of the sub-block is Typically, m=n=8 or 16 pixels. For areas where the image edge is smaller than the sub-block size, a mirror-symmetric filling method is used for expansion.

[0029] (2) Sub-block histogram calculation and clipping constraints: For each sub-block, calculate its grayscale histogram. ,in , The grayscale level (usually 256). Set the cropping threshold. The pruning threshold is calculated using the following formula to limit excessively high peak values ​​in the histogram: in, This represents the cutting constraint factor, with a value ranging from 2 to 5. This represents the mean of the sub-block histogram.

[0030] Perform the following cropping operation on the histogram of each sub-block: if the pixel count of a certain gray level in the sub-block... Then the count of that gray level will be cropped to... ; Record the total number of pixels that were cropped ; The total number of pixels cropped The pixels are uniformly redistributed across all gray levels, keeping the total number of pixels in each sub-block constant, resulting in a constrained histogram. .

[0031] (3) Sub-block histogram equalization mapping: For each sub-block, based on the constrained histogram Calculate the cumulative distribution function: Gray-scale mapping function for constructing sub-blocks: The original grayscale value of each pixel within the sub-block Through mapping function Convert it to its enhanced grayscale value.

[0032] (4) Bilinear interpolation fusion between sub-blocks: To avoid obvious block effects at the boundaries of sub-blocks, bilinear interpolation is used in the transition region between adjacent sub-blocks. The specific method is as follows: Set the target pixel point Located between the centers of four adjacent sub-blocks A, B, C, and D, the normalized distances from this point to the centers of the four sub-blocks are respectively... , (Value range 0-1). Then the point The enhanced grayscale value is calculated as follows: in, , , , These are the grayscale mapping functions for the corresponding sub-blocks.

[0033] (5) Parameter adaptive optimization: Based on the characteristics of the flotation foam image, an adaptive strategy is adopted to select the clipping constraint coefficient. And the size of the sub-blocks m and n; Collect a set of foam image samples under typical working conditions (including normal, low ore, and high ore states), and calculate the mean local contrast and texture entropy of each image; The optimal parameter range is determined by optimizing the parameter combination using a grid search method, with the objective function being to maximize the information entropy of the output image. Choose a value of 3.0~4.5, and the sub-block size should be 16×16 or 32×32; The optimized parameters are then solidified for subsequent real-time foam image processing.

[0034] (6) Enhancement effect verification: After the contrast enhancement is completed, the following evaluation indicators are calculated for the images before and after enhancement: Global contrast ratio: Root mean square contrast ratio and image grayscale standard deviation; Local contrast: the mean of the absolute values ​​of the grayscale differences between adjacent pixels; Information entropy: ,in grayscale The probability density.

[0035] If the enhanced image information entropy increases by more than a preset threshold (e.g., more than 15%) and the local contrast is significantly enhanced, the enhancement effect is deemed satisfactory; otherwise, the cropping limit coefficient is adjusted. And the size of the sub-blocks, repeat steps (1) to (6) until the quality requirements are met.

[0036] S3. Multi-dimensional feature extraction of foam images 1. Extraction of foam size distribution characteristics The purpose of the foam size parameter calculation module is to transform the segmented bubble regions from pixel sets into numerical features with clear physical meaning. This module calculates basic geometric quantities such as the area, equivalent diameter, and roundness of each bubble, and further statistically analyzes the mean, standard deviation, and skewness of bubble sizes across the entire image range, forming statistical features that quantitatively describe the foam morphology. These features provide crucial numerical inputs for the subsequent AI recognition module to predict graphite grade and foam state category, forming a fundamental step in achieving intelligent control of the flotation process.

[0037] For each bubble region obtained by segmentation, calculate the following geometric parameters one by one: bubble pixel area : equivalent diameter of bubble : Bubble roundness : in, For the first The set of pixels occupied by each bubble Let be the circumference of the bubble.

[0038] Statistically analyze the area distribution of all bubbles in the entire image and calculate the following statistical characteristics: Average bubble area : Standard deviation of area distribution : Area distribution skewness : in This represents the total number of bubbles in the current frame image.

[0039] 2. Extraction of foam stability characteristics Foam stability is a direct indicator of whether the flotation process is operating normally. By extracting indicators such as average bubble duration, half-life, burst rate, and standard deviation of duration, the stability of the foam layer can be quantitatively determined. At the same time, the decision optimization module can automatically adjust the amount of foaming agent based on changes in the stability index.

[0040] For two consecutive image frames, the Hungarian algorithm is used to establish the matching relationship between bubbles. The matching cost between bubble i in frame t and bubble j in frame t+1 is defined as the Euclidean distance between their centroids: in, This represents the Euclidean distance between two bubbles.

[0041] The optimal matching matrix is ​​found by minimizing the total matching cost, as shown in the formula: in, For the optimal matching matrix, for satisfying Bubbles are identified as corresponding to the same bubble in adjacent frames; for unmatched bubbles, if a bubble appears in frame t but does not match in frame t+1, it is marked as disappeared; if a bubble appears in frame t+1 but does not match in frame t, it is marked as a new bubble.

[0042] After completing bubble matching, calculate the number of frames remaining for each bubble k that has completed lifecycle tracking. : in, Indicates the start frame number. Indicates the termination frame number.

[0043] Record the number of image frames for each bubble from its first appearance to its final disappearance. Define the bubble duration for: in, This represents the time interval between adjacent frames.

[0044] Average lifespan of bubbles for: in, This indicates the total number of bubbles that were successfully tracked.

[0045] Duration standard deviation for: The half-life of a bubble is calculated as the time required for 50% of the bubbles in the bubble swarm to disappear. Assume that the number of bubbles decays over time according to an exponential distribution. Then the half-life for: Among them, attenuation rate This was obtained by fitting the bubble number change curve over multiple consecutive frames. Indicates elapsed time Then, the number of bubbles that have not yet burst. This indicates the initial number of bubbles.

[0046] The bubble breakup rate reflects the dynamic behavior of bubbles during flotation and is extracted through the following steps: Optical flow field abrupt change detection: Calculating dense optical flow fields between adjacent frames ,in and Each pixel is located at direction and The velocity component in the direction. The curl of the optical flow field is calculated as a rotational invariant: Rupture event identification: setting a curl threshold When the curl of a pixel exceeds the threshold and the region was inside the bubble in the previous frame, a bubble bursting event is determined to have occurred at that location. The determination formula is as follows: In the formula, This is the foam segmentation result for the current frame, used to ensure that the detected burst time is located in the bubble region and not in the background. This is a function indicating a rupture event.

[0047] Breakup rate calculation: Count the total number of breakup events per unit time and normalize by image area. in, For monitoring time period The total number of breakage events detected within the bubble indicates that the breakage rate is too high, which usually suggests that the bubbles are too fragile and may affect the mineralization effect; conversely, a breakage rate that is too low may mean that the foam is too stable, which is not conducive to the renewal of mineralized bubbles. The area is the image area.

[0048] After normalizing the above indicators, a weighted fusion is performed to obtain the stability index: in, , , , These are reference values ​​under normal operating conditions, calibrated using historical data. , , , These are the weighting coefficients.

[0049] 3. Foam color depth feature extraction In the flotation process of graphite ore, the color depth of the foam is one of the most intuitive visual features for judging the degree of mineralization. Actual production data shows that the correlation coefficient between concentrate grade and the average value of foam grayness can reach more than 0.85, which is the primary feature for AI recognition module to predict grade.

[0050] Gray-scale statistical feature calculation: for gray-scale images Calculate the first to fourth order statistical characteristics: Gray mean : Gray variance : Skewness (third moment) : Kurtosis (fourth order moment) : in, This represents the final average grayscale value. This represents the number of pixels in the vertical direction of the image. This represents the number of pixels in the horizontal direction of the image.

[0051] Color moment feature extraction: Calculate the first-order color moments for each of the three original RGB channels. Second-order color moments and third-order color moments : in, Indicates color channels, Indicates the c-th channel at pixel The output pixel value, This indicates the overall brightness level of channel c.

[0052] 4. Texture feature parameter extraction In flotation froth images of graphite ore, texture features provide a high-order description of the froth surface morphology, structure, and grayscale distribution patterns, revealing microstructural information that simple grayscale statistics cannot reflect. Texture features can capture the spatial dependencies and structural information between bubbles, effectively distinguishing between conditions where bubbles have similar colors but different textures.

[0053] Texture feature parameters were extracted using an improved gray-level co-occurrence matrix method. The specific steps are as follows: Gray-level quantization performs gray-level compression on the preprocessed foam gray-level image, quantizing it from 256 levels to... Level, among which Determined adaptively based on local variance of the image: in, For gray levels, This is a preset constant with a value of 0.05. Represents local variance. This indicates rounding down to the nearest integer.

[0054] GLCM Construction: With a pixel pair stride d=2, calculate the gray-level co-occurrence matrix (GLCM) in four directions (0°, 45°, 90°, 135°). Taking the 0° direction as an example, the GLCM is defined as follows: in, Represents the elements of the gray-level co-occurrence matrix. This is an indicator function that takes the value 1 when the condition is true and 0 otherwise. Indicates the step size.

[0055] Four-direction fusion: The fused GLCM is obtained by weighted averaging of the GLCMs in four directions. in, This represents the fused gray-level co-occurrence matrix. Indicates the direction angle.

[0056] Texture parameter calculation: Based on the fused GLCM, the following 5 texture feature parameters are calculated: Contrast : Correlation : in, Indicates the mean value in the row direction. Indicates the mean in the column direction. Indicates the standard deviation in the row direction. This indicates the standard deviation in the column direction.

[0057] energy : homogeneity : entropy : 5. Foam velocity vector feature extraction Foam velocity vector feature extraction provides dynamic, real-time fluid dynamics information for the flotation process, making up for the temporal motion attributes that static texture and color features cannot describe. It is an indispensable part of closed-loop control and anomaly diagnosis.

[0058] Dense optical flow field calculations employed the Farneback dense optical flow algorithm to calculate pixel motion displacement between adjacent frames. A four-layer Gaussian pyramid was constructed, with the image size halved for each layer. In the top-level image, a quadratic polynomial was used to fit the local image surface. : in, A 2×2 symmetric matrix describing the local curvature of an image. A 2×1 vector describing the local gradient of an image. As a scalar, It is a spatial coordinate vector.

[0059] Assume the displacement between two adjacent frames is Then the polynomial coefficients of the two frames satisfy: Assuming the displacement d is small, Substituting into the expansion and ignoring higher-order terms, we get: Camera sampling frequency is The time interval between two frames for: The formula for calculating the flow velocity is: in, Indicates the horizontal tassel component. Represents the vertical velocity component. Indicates horizontal displacement. This indicates vertical displacement.

[0060] Calculation of statistical characteristics of flow velocity field: Calculate the average flow velocity across the entire map. : in, Represents the horizontal velocity component. This represents the vertical velocity component.

[0061] Calculate the main flow direction : Calculate the divergence of the velocity field : A positive divergence value indicates that the bubbles are expanding and diverging, while a negative value indicates that the bubbles are converging and contracting.

[0062] histogram of flow direction: The 360° direction was divided into 12 intervals (each interval being 30°), and the velocity-energy distribution within each interval was statistically analyzed to form the velocity-direction histogram feature vector. .

[0063] 6. Feature Vector Construction The above six types of features are fused to construct a unified feature vector: This feature vector As input to the AI ​​recognition module, it is used to predict the graphite grade and / or recovery rate in the current flotation slurry, as well as the foam state category.

[0064] S4, Graphite Ore Flotation Status Identification Model The graphite ore flotation state recognition model adopts an attention-enhanced ResNet architecture. This architecture uses ResNet50 as the backbone network and introduces two core improvements: Deformable Convolution (DCNv4) and Efficient Channel Attention (ECA) to adapt to the non-rigid deformation features of bubbles in flotation images and enhance the expressive power of key features.

[0065] 1. Construction of attention-enhanced residual networks (1) Input layer The input layer receives a preprocessed grayscale image of foam, with the image size uniformly normalized to 224×224 pixels. Optionally, image enhancement strategies (such as random rotation, horizontal flipping, and brightness adjustment) are used to augment the training samples online to improve the model's generalization ability.

[0066] (2) Feature extraction backbone network The backbone network adopts the ResNet50 architecture, which includes an initial convolutional layer (7×7 convolutional kernel, stride of 2, output channels of 64) and four residual stages (Stage 1 to Stage 4). Each residual stage is composed of several residual blocks (BottleNeck modules) stacked together.

[0067] The standard 3×3 convolutional layers in each residual stage are replaced and improved with deformable convolution DCNv4 instead of traditional convolution. This deformable convolution introduces a learnable offset, enabling the convolution kernel to adaptively adjust its sampling position based on local features of the bubble image, thereby effectively modeling the deformation characteristics of non-rigid bubbles. The calculation process of DCNv4 can be expressed as follows: in, Indicates the position in the output feature map Pixel value at; This represents the total number of sampling points in the convolution kernel; Indicates the first The convolution kernel weights for each sampling point; Indicates the first Predefined offsets for each sampling point (fixed positions in standard convolution); Indicates the first The learnable offset of each sampling point; Indicates the first The learnable modulation scalar for each sampling point has a value range of [0,1]. This represents the input feature map of the convolutional layer.

[0068] Through the above improvements, the backbone network can adaptively adjust its receptive field to focus on key morphological regions in the foam image while ignoring background and noise interference.

[0069] (3) High-efficiency channel attention module After each residual stage of the backbone network, an Efficient Channel Attention (ECA) module is embedded. The ECA module is used to learn the weight coefficients of each feature channel, strengthen the feature channels that contribute significantly to foam image recognition, and suppress redundant or irrelevant channels.

[0070] The calculation process of the ECA module is as follows: First, the input feature map (in For the number of channels, and Perform global average pooling on the height and width respectively to obtain the global description vector in the channel dimension. : In the formula, Secondly, regarding the global description vector Perform a one-dimensional convolution operation and calculate the attention weights for each channel: In the formula, The kernel size is One-dimensional convolutions are used to capture cross-channel interaction information; The Sigmoid activation function maps the output to the [0,1] interval; The channel attention weight vector obtained through learning, This represents the concatenation of the global average pooling results for all channels.

[0071] Where the kernel size Adaptive to: In the formula, and These are preset constants, taken as 2 and 1 respectively; This indicates taking the nearest odd number. , Indicates the total number of channels.

[0072] Finally, the learned attention weights Compared with the original input feature map Channel-by-channel multiplication yields the enhanced feature map. : In the formula, .

[0073] (4) Output prediction results Enhanced feature map output from the high-efficiency channel attention module Then, it is passed to the network's global average pooling layer and fully connected output layer, ultimately generating three prediction results, specifically: Will The vector is fed into a global average pooling layer and compressed into a feature vector along the spatial dimension. ; Feature vector The taste prediction value is obtained through a fully connected layer with three branch output heads. Recovery rate prediction and foam state category .

[0074] 2. Construction of the joint loss function for multiple tasks The model employs a multi-task joint loss function, which is obtained by weighted summation of regression loss and classification loss: Grade mean square error loss : in, This indicates the actual graphite grade of the b-th sample. This represents the taste of the b-th sample as predicted by the model.

[0075] Recovery rate mean square error loss : in, This represents the actual recovery rate of the b-th sample. This represents the recovery rate predicted by the model for the b-th sample.

[0076] Foam State Classification Cross-Entropy Loss : in, Batch size (preferably 32). The number of foam state categories (4 in this example). Indicates the true label, Predict probabilities for the model.

[0077] Multi-task joint loss function as follows: in, For grade prediction loss, the mean squared error (MSE) loss function is used; To predict loss based on recovery rate, the mean squared error (MSE) loss function is used; For the classification loss of bubble states, the cross-entropy loss function is adopted; , and This represents the weight coefficient of each subtask, with the preferred weight being... , , .

[0078] Model training terminates when any of the following conditions are met: Reach the preset maximum number of training rounds (100 rounds); The validation set loss has not decreased for 10 consecutive rounds (early stopping triggered); The model's prediction accuracy on the test set reached the preset threshold (grade prediction error ≤ ±1.5%, state recognition accuracy ≥ 90%).

[0079] S5, Decision Optimization The decision optimization module has an embedded reinforcement learning agent based on the Deep Deterministic Policy Gradient (DDPG) algorithm, which is used to automatically learn and generate the optimal flotation reagent dosage scheme based on the graphite grade, recovery rate index and foam state category predicted by the AI ​​recognition module.

[0080] 1. Input module State space design, state space The space is a mixture of continuous and discrete variables, consisting of real-time operating condition information output by the AI ​​recognition module: In the formula, This indicates the predicted value of graphite grade in the current flotation pulp; This represents the predicted graphite recovery rate in the current flotation slurry; Indicates the foam state category (0-normal, 1-low ore, 2-high ore, 3-sticky). Indicates the rate of change in taste. ; Indicates the rate of change in recovery rate. ; This indicates the time since the last adjustment, preventing excessively frequent and ineffective adjustments. This indicates the previous dosage adjustment and is used to provide historical information; Indicates the trend of taste (-1 downward, 0 stable, +1 upward).

[0081] 2. Action Decision-Making: Actor Network Forward Reasoning The normalized state vector is input into the Actor online network. In this network, a fully connected structure is used, and the output layer uses the Tanh activation function to produce the original normalized action vector. : in, This indicates the initial collector adjustment factor. This indicates the initial foaming agent adjustment factor. This indicates the initial inhibitor adjustment factor. This indicates the initial pH adjustment factor.

[0082] 3. Training Phase Ornstein-Uhlenbeck (OU) noise is used for motion detection. This time-dependent noise is suitable for inertial systems. in, The original action vector after noise injection is explored. To explore the noise vector.

[0083] The update equation for OU noise is: in, This represents the noise regression rate, with a value of 0.15. This represents the noise fluctuation amplitude, with a value of 0.2. This represents the increment of the Wiener process.

[0084] In practical discrete implementations, the noise update formula is: In the formula, The discretization time step is set to 0.01. These are standard normally distributed random numbers.

[0085] After adding noise, the motion is limited so that it remains within the range of noise. : During the redeployment phase, no noise is added, i.e. .

[0086] 4. Safety Constraints To ensure that the adjustment coefficients of each agent do not exceed the physical boundaries of the normalized action space, a hard constraint limit is adopted: in, This is the motion vector after amplitude limiting.

[0087] This embodiment employs smoothing constraints to limit the variation range of reagent adjustment coefficients within adjacent control cycles, preventing drastic fluctuations in reagent addition due to sudden changes in network output or noise spikes, thus protecting the actuator and stabilizing the flotation process. in, This is the final normalized action vector from the previous control cycle. To determine the Chebyshev norm, take the maximum absolute value of each component of the vector. The maximum permissible variable for a single step is set to 0.3, which means that the adjustment coefficient for each drug will not change by more than 30% of the baseline adjustment amount in a single step.

[0088] If the constraint is violated, a component-by-component shrinkage is performed. For each component i=1,2,3,4, the desired action is calculated. Compared to the previous action The difference: like Then it is corrected to: Otherwise, keep the original value unchanged: Finally, the smooth motion vector is obtained. .

[0089] An expert rule base is built to enforce the reinforcement learning output based on expert experience under extreme working conditions or emergency situations, ensuring production safety. This layer has the highest priority; once triggered, it directly modifies the corresponding action component, unaffected by the aforementioned constraints.

[0090] Table 1 Expert Rule Base The rules are checked sequentially according to their numbers. If multiple rules are triggered at the same time, the one with the strictest enforcement action is selected (for example, if SR3 and SR4 are triggered at the same time, the foaming agent of SR3 will be significantly reduced, and the global limit of SR4 will be executed at the same time).

[0091] The final formula for calculating the safety action vector is: in, Expert experience rules are applied to the expert rule base.

[0092] 5. Actual adjustment amount mapping: in, , , , The baseline addition amount for each reagent is preset based on a flotation condition image sample library. Adjusting the dosage of the collector, Adjust the amount of foaming agent. Adjusting the increment for inhibitors, Adjust the increment for pH adjuster.

[0093] The final absolute dosage of each agent is calculated as follows: in, This is the amount of collector added at the current moment. This represents the amount of foaming agent added at the current moment. The amount of inhibitor added at the current moment. This represents the amount of pH adjuster added at the current moment. This refers to the amount of collector added at the previous moment. This refers to the amount of foaming agent added at the previous moment. This refers to the amount of inhibitor added at the previous moment. This represents the amount of pH adjuster added at the previous moment.

[0094] The amount added must meet physical constraints: in, This is the minimum amount of collector to be added. This is the maximum amount of collector to be added. This is the minimum amount of foaming agent to add. This is the maximum amount of foaming agent that can be added. This is the minimum amount of inhibitor to add. This is the maximum amount of inhibitor to add. This is the minimum amount of pH adjuster to add. This is the maximum amount of pH adjuster that can be added.

[0095] 6. Reward Function Design reward function Used to evaluate the agent's state. Take action below The immediate benefits drive the agent to learn the optimal strategy. The reward function consists of a weighted average of five factors: quality reward, recovery rate reward, stability reward, cost penalty, and action smoothness penalty. The specific definitions of each reward item are as follows: (1) Taste reward Encourage predicted grades to approach target values: in The target grade (preferably 15%). This is the tolerance parameter (preferably 2%).

[0096] (2) Recovery rate bonus Encourage maximizing recycling rates, but avoid doing so at the expense of quality: in For indicator functions, The lower limit threshold for grade (preferably 1.5%) is set, and the recovery rate bonus is zero when the grade is below the lower limit.

[0097] (3) Stability bonus To encourage a stable bubble state and avoid frequent fluctuations: (4) Cost penalty Punish excessive drug consumption: Among them , , , This is expressed as the cost coefficient for each drug.

[0098] (5) Smoothness penalty Punish excessively large changes in movement and encourage smooth adjustment: in, This represents the action vector at the current moment. This vector is the direct output of the agent's decision, and after physical mapping, it is transformed into the absolute change in the amount of each agent added. This is the action vector from the previous moment.

[0099] Therefore, the reward function can be expressed as: In the formula, This represents the weight of the taste target, with a value of 1. This represents the recovery rate weight, with a value of 0.6. This represents the stability weight, with a value of 0.3. This represents the cost penalty weight, with a value of 0.4; This represents the smoothing weight of the action, with a value of 0.1.

[0100] 7. When the number of samples in the experience replay pool is sufficient, the random sampling batch size is: Update the network using the experience tuples as follows: empirical tuples Store in the experience replay pool .

[0101] in, This indicates a termination flag, used to set future reward items after the termination state to zero in the calculation of the target Q value.

[0102] (1) Update the Critic network Calculate the target Q value: in, Indicates the target Q value. Indicates the first The reward obtained after each sample performs an action This represents the discount factor, with a value of 0.99. This represents the Critic network, a value network used to calculate the target Q-value. Update the Critic online network parameters by minimizing the temporal difference (TD) error. : (2) Update the parameters of the Actor online network through policy gradient. : (3) The Actor network is updated using the gradient ascent method: (4) Use soft update to update the target network parameters to stabilize the training process: in: in, and For Critic online network parameters and Actor online network parameters, and For the Critic target network parameters and the Actor target network parameters, The soft update coefficient is set to 0.001.

[0103] The network update merges the online network parameters into the target network parameters at a very small ratio in each step, so that the calculation benchmark of the target Q value keeps evolving slowly and smoothly. This can effectively suppress training oscillations and avoid learning instability caused by drastic changes in the target value.

[0104] Example 2 This embodiment provides an intelligent optimization system for graphite ore flotation based on AI visual recognition, including: an image acquisition module, an image processing module, an AI recognition module, a decision optimization module, and a control execution module.

[0105] The image acquisition module is used to acquire foam images in real time during the graphite ore flotation process; An image processing module, connected to the image acquisition module, is used to preprocess the foam image and extract image features that reflect the foam's shape, texture, color, and flow state. The AI ​​recognition module is connected to the image processing module and has a trained graphite ore flotation state recognition model embedded in it. The model is used to predict the graphite grade and / or recovery rate in the current flotation slurry based on the image features and to identify the current state category of the froth. The decision optimization module, connected to the AI ​​recognition module, has a built-in flotation reagent system knowledge base and optimization algorithm, which is used to dynamically match and generate the optimal flotation reagent dosage scheme based on the predicted graphite grade and / or recovery rate indicators and the foam state category. The control execution module, connected to the decision optimization module and the dosing equipment, is used to generate control commands based on the optimal flotation reagent dosage scheme to adjust the reagent addition amount of the dosing equipment.

[0106] Example 3 This embodiment provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements an intelligent optimization method for graphite ore flotation based on AI visual recognition.

[0107] Readable storage media include: Magnetic storage media: such as hard disks, floppy disks, magnetic tapes, magnetic cards, etc.; Optical storage media: such as CD-ROM, DVD, Blu-ray disc, etc.; Semiconductor storage media: such as read-only memory (ROM), random access memory (RAM), flash memory (including USB flash drives, solid-state drives SSDs), EEPROM, etc.

[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A smart optimization method for graphite ore flotation based on AI visual recognition, characterized in that, include: S1. Collect flotation foam image data and construct a flotation working condition image sample library; S2. Preprocess the foam image data and extract image features; S3. Construct a flotation state identification model for graphite ore, perform multi-task joint prediction on image features to obtain graphite grade and recovery rate indicators, and identify the current state category of foam. S4. Construct a decision optimization model, and dynamically optimize the decision based on the predicted value of graphite grade, the predicted value of recovery rate and the current state category of foam, and dynamically generate the optimal flotation reagent dosage scheme.

2. The intelligent optimization method for graphite ore flotation based on AI visual recognition according to claim 1, characterized in that, S1 includes: Collect froth images under different working conditions during the flotation process of graphite ore to form a flotation froth image sample set; Each foam image in the sample set is associated and labeled by professional technicians. The labeling information includes the graphite grade data, recovery rate data, foam state category, and flotation reagent addition and adjustment parameters adapted to the working condition. The labeled associated data is organized and stored to form a standardized flotation condition image sample library.

3. The intelligent optimization method for graphite ore flotation based on AI visual recognition according to claim 1, characterized in that, Preprocessing in S2 includes: Preprocessing includes improved bilateral filtering for noise reduction and contrast-adaptive histogram equalization; The improved bilateral filtering denoising uses an adaptive gray-domain standard deviation, combined with iterative filtering and edge-preserving enhancement processing. The formula for the adaptive gray-domain standard deviation is as follows: in, For grayscale and standard deviation, This represents the local variance of pixel grayscale within the filtering window. and This is an empirical constant.

4. The intelligent optimization method for graphite ore flotation based on AI visual recognition according to claim 1, characterized in that, Image features extracted from S2 include: Image features include: foam size distribution, bubble breakage rate, foam color depth, texture feature parameters, and foam flow velocity vector; By segmenting the image, the regions of each bubble are obtained, and the pixel area, equivalent diameter and roundness of each bubble are calculated. Then, the mean, standard deviation and skewness of the bubble area in the whole image are statistically analyzed to form a statistical feature that quantitatively describes the morphology of the bubble. The Hungarian algorithm is used to establish the matching relationship between bubbles in adjacent frames. The Euclidean distance of the centroid is used as the matching cost. The bubble life cycle is tracked, and the bubble life time, average life time, life time standard deviation, half-life and bubble breakage rate are calculated. The stability index is obtained by normalizing the above indicators and then weighting and fusing them. First- to fourth-order statistical features are calculated for grayscale images, including grayscale mean, grayscale variance, skewness, and kurtosis; at the same time, first-order color moments, second-order color moments, and third-order color moments are calculated for the original RGB three channels respectively, to comprehensively characterize the color depth of the foam. An improved gray-level co-occurrence matrix method was used to calculate the gray-level co-occurrence matrices in four directions: 0°, 45°, 90°, and 135°, and then weighted and averaged them to fuse them. Based on the fused matrix, five texture parameters, namely contrast, correlation, energy, homogeneity, and entropy, were calculated. The Farneback dense optical flow algorithm is used to calculate the pixel motion displacement between two adjacent frames, construct a Gaussian pyramid, and solve the displacement vector by fitting the local image surface with a quadratic polynomial. The horizontal and vertical velocity components are obtained by combining the camera sampling frequency, and then the average velocity magnitude, main flow direction, velocity field divergence and velocity direction histogram of the whole image are calculated.

5. The intelligent optimization method for graphite ore flotation based on AI visual recognition according to claim 1, characterized in that, The S3 graphite ore flotation state identification model includes: The attention-enhanced residual network model uses ResNet50 as its backbone network and replaces standard convolutions with deformable convolutions, while embedding an efficient channel attention module after each residual stage. The model is trained using a multi-task joint loss function, which is obtained by weighted summation of the mean squared error loss for grade prediction, the mean squared error loss for recovery rate prediction, and the cross-entropy loss for foam state classification.

6. The intelligent optimization method for graphite ore flotation based on AI visual recognition according to claim 1, characterized in that, The decision optimization model in S4 includes: The policy optimization model employs a reinforcement learning agent based on a deep deterministic policy gradient algorithm; The state space of the intelligent agent consists of real-time operating information output by the graphite ore flotation state recognition model, including graphite grade prediction, recovery rate prediction, foam state category, grade change rate, recovery rate change rate, time since last adjustment, last reagent adjustment amount, and grade trend. The action space of the intelligent agent is a continuous value, defined as the adjustment coefficient of the amount of each flotation reagent added. The adjustment coefficient includes the collector adjustment coefficient, the frother adjustment coefficient, the inhibitor adjustment coefficient, and the pH adjuster adjustment coefficient. The reward function for the agent is constructed by weighting five factors: quality reward, recovery rate reward, stability reward, cost penalty, and action smoothness penalty. Network parameters are updated using a soft update method based on the reward function.

7. A smart optimization system for graphite ore flotation based on AI visual recognition, characterized in that, include: The image acquisition module is used to acquire foam images in real time during the graphite ore flotation process; An image processing module, connected to the image acquisition module, is used to preprocess the foam image and extract image features that reflect the foam's shape, texture, color, and flow state. The AI ​​recognition module is connected to the image processing module and has a trained graphite ore flotation state recognition model embedded in it. The model is used to predict the graphite grade and / or recovery rate in the current flotation slurry based on the image features and to identify the current state category of the froth. The decision optimization module, connected to the AI ​​recognition module, has a built-in flotation reagent system knowledge base and optimization algorithm, which is used to dynamically match and generate the optimal flotation reagent dosage scheme based on the predicted graphite grade and / or recovery rate indicators and the foam state category. The control execution module, connected to the decision optimization module and the dosing equipment, is used to generate control commands based on the optimal flotation reagent dosage scheme to adjust the reagent addition amount of the dosing equipment.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the intelligent optimization method for graphite ore flotation based on AI visual recognition as described in any one of claims 1 to 6.