A pyrite flotation froth image recognition method and system

CN122821528APending Publication Date: 2026-09-25GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611024511.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-10
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0003]传统浮选工艺依赖人工目视观察泡沫状态进行操作调整,存在以下缺陷:(1)主观性强——不同操作人员对同一泡沫状态的判定差异可达30%以上;(2)响应滞后——人工观察周期通常为15~30分钟/次,远低于浮选状态变化的实际时间尺度(分钟级);(3)难以量化——人工记录仅为定性描述(如“泡沫偏大”“泡沫偏细”),无法形成可追溯的工艺参数映射关系

Benefits of technology

(1)噪声抑制与细节保留的协同优化:本发明通过小波频域分离+自适应NL-means滤波(h动态调整0.5~1.5倍σ_noise)+BayesShrink软阈值(保留60%~90%边缘系数)+CLAHE(CNR达12.8 dB),在30张测试图上PSNR均值32.4 dB,比中值滤波(26.8 dB)高5.6 dB,比固定阈值小波去噪(29.2 dB)高3.2 dB,直径>15像素泡沫边缘保留率98%。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122821528A_ABST
    Figure CN122821528A_ABST
Patent Text Reader

Abstract

The application discloses a pyrite flotation froth image recognition method and system, and the method comprises the following steps: acquiring an initial image of a pyrite flotation froth to be recognized; pre-processing the initial image through multi-scale wavelet decomposition combined with adaptive threshold processing to obtain a denoising enhanced image; calculating multi-direction multi-scale Gabor filter responses according to the denoising enhanced image and fusing the responses to obtain a Gabor fusion response image, simultaneously calculating a phase consistency image, and performing weighted fusion on the two images and performing non-maximum suppression processing to obtain a continuous edge image; obtaining foreground markers and background markers based on the continuous edge image, performing marker-controlled watershed segmentation with the foreground markers and the background markers as constraints, and performing secondary correction on regions with a convexity lower than a threshold value to obtain independent froth regions after segmentation; extracting geometric features of the independent froth regions and counting scene-level global features, and determining a flotation state according to a mapping relationship between the global features and a preset dynamic threshold value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of pyrite formation and image recognition technology, specifically relating to a method and system for recognizing flotation foam images of pyrite. Background Technology

[0002] Pyrite (mainly composed of pyrite, FeS2) is an important sulfur resource, widely used in sulfuric acid production, iron metallurgy, and chemical industries. In the pyrite flotation process, froth behavior (including froth size, distribution density, stability, and color characteristics) is a core indicator for evaluating flotation efficiency, recovery rate, and concentrate grade.

[0003] Traditional flotation processes rely on manual visual observation of foam state for operational adjustments, which has the following drawbacks: (1) strong subjectivity - different operators may have different judgments on the same foam state by more than 30%; (2) delayed response - the manual observation cycle is usually 15 to 30 minutes / time, which is far lower than the actual time scale (minute level) of flotation state changes; (3) difficult to quantify - manual records are only qualitative descriptions (such as "foam too big" or "foam too fine"), and cannot form a traceable process parameter mapping relationship.

[0004] In recent years, automatic analysis of foam images based on machine vision has become a key direction for improving the level of intelligent flotation. However, existing technologies still have significant limitations in the pyrite flotation scenario: (1) Severe image noise interference (SNR<15dB): The illumination range of the flotation site is 500~2000 lux, accompanied by oil splashes, water mist, etc. Existing mean filtering / median filtering is prone to over-smoothing the edges of tiny foams with a diameter of <30 pixels when suppressing noise, resulting in an information loss of about 40%. (2) Blurred edges: Pyrite foam has multi-scale (diameter 0.1~5mm corresponds to 15~300 pixels) and weak contrast characteristics (foam gray level 80~120, background 50~80, ΔI≈30~40), Canny operator gradient response <50, and edge breakage rate reaches 45%~55%. (3) Insufficient segmentation accuracy: When the foam coverage is >60%, the traditional watershed oversegmentation rate is 30%~40%, and the segmentation IoU is only 0.65~0.75. (4) Large deviation in morphological parameter calculation: The correlation coefficient R between the average diameter of the foam and the artificially calibrated Pearson coefficient is only 0.70~0.78. Summary of the Invention

[0005] This application aims to address the shortcomings of existing technologies and provides the following solutions: A method for recognizing froth images in pyrite flotation includes the following steps: An initial image of the flotation foam of pyrite to be identified is obtained, and the initial image is preprocessed by multi-scale wavelet decomposition combined with adaptive thresholding to obtain a denoised and enhanced image. The multi-directional, multi-scale Gabor filter response is calculated based on the denoised and enhanced image and fused to obtain a Gabor fused response map. At the same time, a phase consistency map is calculated. The Gabor fused response map and the phase consistency map are weighted and fused and then subjected to non-maximum suppression processing to obtain a continuous edge map. The distance transformation is calculated based on the continuous edge map and the foreground marker is extracted. The background marker is extracted after the continuous edge map is dilated. The watershed segmentation with marker control is performed with the foreground marker and the background marker as constraints. The regions with convexity below the threshold are corrected in a second step to obtain the segmented independent foam regions. Extract the geometric features of each independent foam region and statistically analyze the scene-level global features. Determine the flotation state based on the mapping relationship between the global features and the preset dynamic threshold.

[0006] Preferably, the method for obtaining the denoised and enhanced image includes: The initial image is decomposed into low-frequency and high-frequency sub-bands using the Db4 wavelet basis. Adaptive nonlocal mean filtering is applied to the low-frequency sub-band to obtain the first processing result. In the adaptive nonlocal mean filtering process of the low-frequency sub-band, the search window size is 21×21 pixels, the neighborhood block size is 7×7 pixels, and the filter attenuation parameter is... h The adjustment is made dynamically based on the ratio of the local standard deviation to the noise standard deviation. The adaptive threshold shrinkage processing of the high-frequency sub-bands uses the BayesShrink method to calculate the threshold of each high-frequency sub-band, and uses a soft threshold function to shrink the coefficients to obtain the second processing result. The first processing result and the second processing result are reconstructed by wavelet, and the reconstructed image is subjected to contrast-limited adaptive histogram equalization to obtain the denoised and enhanced image.

[0007] Preferably, the method for obtaining the continuous edge map includes: A Gabor filter bank with 8 directions and 3 wavelengths is constructed. The response amplitude of each Gabor filter is applied to the denoised and enhanced image pixel by pixel. The maximum value of the response amplitude under all directions and wavelengths is taken as the Gabor fusion response map. The phase consistency map was calculated using 5 high-frequency channels, with a starting wavelength of 3 pixels and a scale spacing of 1.3 times. The weights of the Gabor fusion response map and the phase consistency map are set respectively, and the Gabor fusion response map and the phase consistency map are weighted and fused based on the set weights to obtain the fused image; The fused image is subjected to non-maximum suppression processing, and local maximum points are retained in a 3×3 neighborhood along the gradient direction, and the continuous edge map with a single pixel width is output.

[0008] Preferably, the method for obtaining the independent foam region includes: A distance map is obtained by calculating the distance transformation based on the continuous edge map, a dynamic threshold is determined based on the mean and standard deviation of the distance map, and foreground markers are extracted based on the dynamic threshold; Based on the continuous edge map, two morphological dilations are performed using a 5×5 circular structural element to obtain a dilated edge map. Based on the dilated edge map, regions with a distance greater than 10 pixels from the dilated edge are marked to obtain background markings. Based on the foreground and background labels, the gradient magnitude map is segmented by a watershed with label control to obtain an initial segmentation label map; Based on the initial segmentation label map, calculate the actual area and convex hull area of ​​each segmented region, and determine the region with convexity less than 0.7 based on the ratio of the actual area to the convex hull area of ​​each segmented region. Based on the regions with convexity below 0.7, a lightweight U-Net is triggered for secondary correction to obtain the final independent foam region.

[0009] Preferably, the method for determining the flotation state includes: Extract the area and perimeter of each independent foam region, calculate the equivalent diameter based on the area of ​​each independent foam region, and calculate the mean of the foam equivalent diameter based on the equivalent diameter; The roundness is calculated based on the area and perimeter of each independent foam region, and the average roundness of the foam is calculated based on the roundness. The foam load-bearing capacity is calculated based on the number of each independent foam region and the actual physical area of ​​the image. The diameter variation coefficient is calculated based on the equivalent diameter of each independent foam region and the mean equivalent diameter of the foam. The flotation state is determined based on the mapping relationship between the average equivalent diameter of the foam, the average roundness of the foam, the foam carrying capacity, the diameter variation coefficient, and a preset dynamic threshold.

[0010] The present invention also provides a flotation foam image recognition system for pyrite, the system applying the above-mentioned method, including: an image preprocessing module, a weighted fusion module, a region segmentation module, and a state determination module; The image preprocessing module is used to acquire an initial image of the flotation foam of pyrite to be identified, and to preprocess the initial image by multi-scale wavelet decomposition combined with adaptive thresholding to obtain a denoised and enhanced image. The weighted fusion module calculates and fuses the multi-directional, multi-scale Gabor filter response based on the denoised and enhanced image to obtain a Gabor fusion response map. At the same time, it calculates the phase consistency map, weights and fuses the Gabor fusion response map and the phase consistency map, and performs non-maximum suppression processing to obtain a continuous edge map. The region segmentation module calculates distance transformation and extracts foreground markers based on the continuous edge map, extracts background markers after dilating the continuous edge map, performs watershed segmentation with marker control using the foreground markers and background markers as constraints, and performs secondary correction on regions with convexity below a threshold to obtain segmented independent foam regions. The state determination module is used to extract the geometric features of each independent foam region and statistically analyze the scene-level global features. Based on the mapping relationship between the global features and the preset dynamic threshold, the flotation state is determined.

[0011] Compared with the prior art, the beneficial effects of this application are as follows: (1) Synergistic optimization of noise suppression and detail preservation: This invention achieves a PSNR of 32.4 dB on 30 test images through wavelet frequency domain separation + adaptive NL-means filtering (h dynamically adjusts σ_noise by 0.5~1.5 times) + BayesShrink soft threshold (preserves 60%~90% of edge coefficients) + CLAHE (CNR reaches 12.8 dB), which is 5.6 dB higher than median filtering (26.8 dB) and 3.2 dB higher than fixed threshold wavelet denoising (29.2 dB). The edge preservation rate of foam with a diameter >15 pixels is 98%.

[0012] (2) Improved edge detection accuracy in weak contrast: The Gabor (8 directions × 3 scales) + PC weighted fusion (α=0.6, β=0.4) of this invention has an F1-score of 0.86 and an edge breakage rate of <8%, which is a qualitative improvement compared to Canny (breakage rate of 45%~55%).

[0013] (3) Significantly improved segmentation accuracy of adhered foam: The marker-controlled watershed (k=1.6 dynamic threshold + 10 pixel background safety distance) of this invention achieves a segmentation IoU of 0.91 on a 1000-frame test set (compared to 0.72 for the traditional watershed), reducing oversegmentation errors by more than 85%. In extreme adhered foam scenarios, the U-Net secondary correction improves the segmentation IoU from 0.78 to 0.93.

[0014] (4) Reliability of morphological parameter calculation: The average diameter of the foam in this invention has a Pearson correlation coefficient of R=0.94 with the value measured by artificial microscope (0.78 in the traditional method), and the RMSE is reduced from 0.112mm to 0.046mm (a reduction of 58.9%). Attached Figure Description

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

[0016] Figure 1 This is a schematic diagram of the method flow according to an embodiment of the present invention. Detailed Implementation

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

[0018] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0019] Example 1 In this embodiment, as Figure 1 As shown, a method for recognizing froth images in pyrite flotation includes the following steps: S1. Obtain the initial image of the flotation foam of pyrite to be identified, and preprocess the initial image by multi-scale wavelet decomposition combined with adaptive thresholding to obtain a denoised and enhanced image.

[0020] The method for obtaining the denoised and enhanced image includes: performing a 3-level wavelet decomposition on the initial image using the Db4 wavelet basis to obtain the low-frequency sub-band and high-frequency sub-band of the initial image; performing adaptive nonlocal mean filtering on the low-frequency sub-band to obtain the first processing result. In the adaptive nonlocal mean filtering process of the low-frequency sub-band, the search window size is 21×21 pixels, the neighborhood block size is 7×7 pixels, and the filter attenuation parameter is... h The standard deviation is dynamically adjusted based on the ratio of local standard deviation to noise standard deviation; the adaptive threshold shrinkage processing of high-frequency sub-bands uses the BayesShrink method to calculate the threshold of each high-frequency sub-band, and uses a soft threshold function to shrink the coefficients to obtain the second processing result; the first processing result and the second processing result are reconstructed by wavelet, and the reconstructed image is subjected to contrast-limited adaptive histogram equalization processing to obtain a denoised and enhanced image.

[0021] In this embodiment, the specific steps include: (1) Wavelet decomposition and subband division Original flotation cell grayscale imageI ( x , y Input the wavelet decomposition module and perform a 3-level decomposition using the Db4 wavelet basis. The selection criteria for the Db4 wavelet basis are: among the Daubechies wavelet family, Db4 has tight support (support length 8) and a fourth-order vanishing moment, which can better balance frequency domain localization capability and computational efficiency. The determination of the decomposition level L=3 is based on: at a resolution of 1280×1024, after 3 levels of decomposition... The sub-band size is 160×128, capable of resolving bubbles with a diameter >16 pixels; if L=4, then... The 80×64 size causes fine bubbles to mix in high-frequency artifacts. Output: 1 low-frequency subband. (Background noise + foam main structure) and 9 high-frequency sub-bands ( , , , , , , , , ).

[0022] (2) Low-frequency subband Processing – Improved Non-Local Means (NL-means) Filtering right Subband per pixel i Within a 21×21 search window (covering approximately 3 times the average bubble spacing), calculate the weighted average of similar blocks to its 7×7 neighborhood blocks: , in, This represents the original grayscale value at pixel i. j This represents the neighboring pixel index within the search window. W This represents the search window. This represents the similarity weight between pixel i and its neighboring pixel j. This represents the original gray value at neighboring pixel j. This represents the squared Euclidean distance between two neighboring blocks. Indicates the adaptive smoothing parameter. h Indicates the adaptive smoothing parameter. k Represents the coefficient. This represents the squared Euclidean distance between two neighborhood blocks. Represents the normalization constant. pass Median absolute deviation (MAD) estimation of subband minimum-scale wavelet coefficients.

[0023] k Dynamic adjustment of coefficients: .in =0.8 is the baseline coefficient; l =0.5 is the sensitivity adjustment coefficient (empirical value); In pixels i The local standard deviation within a 21×21 window centered on the denominator. When (High noise areas, such as oil stains). k Increase to 1.1~1.5; when (Areas with rich textures, such as near the edge of a bubble). k Reduce to 0.5~0.7.

[0024] (3) Adaptive threshold shrinkage processing of high-frequency subbands The thresholds for each high-frequency subband were calculated using the BayesShrink method: in, pass MAD estimation, This represents the variance of the current subband coefficients.

[0025] Soft threshold function: The advantage of soft thresholding over hard thresholding is better continuity and avoidance of ringing artifacts. In this embodiment, validation set tests show that the PSNR of soft thresholding is approximately 0.8~1.2 dB higher than that of hard thresholding. Special processing: First layer high-frequency sub-band ( , , Contains the most edge details, using a more conservative threshold. This reduces the loss of small foam edges.

[0026] (4) Contrast-limited adaptive histogram equalization (CLAHE) enhancement The wavelet-reconstructed image is input into the CLAHE module. The selection of the 8×8 grid size is based on the following: after dividing the 1280×1024 image into 8×8 grids, each grid is 160×128 pixels (containing 3~5 bubbles), which ensures local contrast enhancement and adaptability while avoiding the block effect caused by an excessively small grid.

[0027] The determination of the contrast limiting threshold of 0.02 is based on the following: scanning limit values ​​of 0.005 to 0.05 with contrast-to-noise ratio (CNR) as the optimization target on 30 training images. At 0.02, the CNR reaches the maximum value of 12.8 dB, which is 3.3 dB and 2.6 dB higher than 0.01 (9.5 dB) and 0.03 (10.2 dB), respectively.

[0028] (5) The processed The image after NL-means filtering and the nine high-frequency subbands (after thresholding) are then subjected to inverse wavelet transform (IDWT) to reconstruct the denoised and enhanced image. .

[0029] S2. Calculate the multi-directional, multi-scale Gabor filter response based on the denoised and enhanced image and fuse them to obtain the Gabor fusion response map. At the same time, calculate the phase consistency map. Weight the Gabor fusion response map and the phase consistency map and perform non-maximum suppression processing to obtain the continuous edge map.

[0030] The method for obtaining a continuous edge map includes: constructing a Gabor filter bank with 8 directions and 3 wavelengths; applying each Gabor filter to the denoised and enhanced image pixel by pixel to calculate the response amplitude; taking the maximum response amplitude under all directions and wavelengths as the Gabor fusion response map; calculating the phase consistency map using 5 high-frequency channels, with a starting wavelength of 3 pixels and a scale interval of 1.3 times; setting the weights of the Gabor fusion response map and the phase consistency map respectively, and performing weighted fusion of the Gabor fusion response map and the phase consistency map based on the set weights to obtain the fused image; performing non-maximum suppression processing on the fused image, retaining local maximum points in a 3×3 neighborhood along the gradient direction, and outputting a continuous edge map with a single pixel width.

[0031] In this embodiment, the specific steps include: (1) Design and response calculation of multi-directional Gabor filter bank Build 8 directions ( =0°, 22.5°, 45°, 67.5°, 90°, 112.5°, 135°, 157.5°) and 3 wavelengths ( l A Gabor filter bank (24 filters in total) with dimensions of 2, 4, and 8 pixels. Wavelength selection is based on the fact that the edge width of the pyrite froth is approximately 2-8 pixels. l Taking 2 / 4 / 8 will cover this range.

[0032] The Gabor kernel function is: , , in, Represents the spatial coordinates after rotation. Indicates the wavelength of the Gabor filter; This indicates the filter direction angle, controlling the direction of the parallel fringes of the Gabor function; This indicates an even-symmetric phase, which has the strongest response to edges; This represents the standard deviation of the Gaussian envelope, controls the spatial coverage of the filter, has a bandwidth of 1 octave, and is a Daugman standard setting. It represents the aspect ratio (ellipticity) of space.

[0033] right Apply each Gabor filter pixel by pixel and calculate the response amplitude. ,in, Indicates direction ,wavelength Below, pixels ( x , y Gabor filter response amplitude at () Represents convolution. Indicates specifying and Gabor convolution kernel for parameters. Fusion response. This ensures that the edges of the foam in any direction are captured, where, This means taking the maximum value from the responses of 24 filters (8 directions × 3 wavelengths) to ensure that edges of any direction and width are captured.

[0034] (2) Calculation of Phase Congruency Model In the Fourier domain, the edge positions correspond to the positions where the phases of each frequency component are most consistent: in, Represents pixels x The phase consistency value at the point of intersection is as close to 1 as possible to indicate an edge. At edges, the value is typically >0.3, while at non-edges it is <0.15. n Indicates the frequency channel number, take n =1,2,3,4,5; Indicates the first n Each frequency channel in pixel x The amplitude at that point; Indicates the first n Each frequency channel in pixel x Local phase at; Represents pixels x The weighted average local phase at a given point is obtained by averaging the phases of each frequency channel according to their amplitude. The frequency spread weighting function suppresses regions where only a single frequency component dominates (non-true edges). T This represents the noise compensation threshold, which is estimated from the median of the response amplitudes of all frequency channels. Here, the estimated median value of the frequency response amplitude is taken. e To prevent the denominator from being zero, take the small constant value. e = 0.0001; starting wavelength 3 pixels, scale spacing 1.3 times.

[0035] The core advantage of phase coherence lies in its reliance on the phase alignment of local frequency components rather than grayscale gradients; therefore, even if Δ I ≈30, PC The value can still reliably mark the edge position.

[0036] (3) Edge intensity map fusion and non-maximum suppression (NMS) Fusion formula: in, This represents the edge intensity map after fusion—the larger the value, the higher the probability that the pixel is an edge; α The fusion weights representing the Gabor response are determined by an F1-score grid search on zero labeled ground truth images; β The fusion weights represent phase consistency; This represents the Gabor filter fusion response value normalized to the [0,1] interval; This indicates the phase consistency calculation result, independent of changes in illumination.

[0037] Weight α and β Determination: Using F1-score as the optimization metric, on 30 labeled ground truth edge images, the optimization was performed... α , β ∈{0.3,0.4,0.5,0.6,0.7} α + β =1) Perform a grid search. α =0.6, β The highest F1-score (0.86) is achieved when Gabor is 0.4, and Gabor alone... α =1, β =0) is 0.79, used alone PC ( α =0, β =1) is 0.81.

[0038] NMS operation: Preserves local maxima within a 3×3 neighborhood along the gradient direction (computed by Sobel), quantizing the gradient direction to four directions (0°, 45°, 90°, 135°). Outputs a continuous edge map with a single pixel width. .

[0039] S3. Calculate the distance transformation based on the continuous edge map and extract the foreground marker. After dilating the continuous edge map, extract the background marker. Perform watershed segmentation with the foreground and background markers as constraints and perform secondary correction on the regions with convexity below the threshold to obtain the segmented independent foam regions.

[0040] The method for obtaining independent bubble regions includes: calculating a distance map based on a continuous edge map, determining a dynamic threshold based on the mean and standard deviation of the distance map, and extracting foreground markers based on the dynamic threshold; performing two morphological dilation operations on the continuous edge map using 5×5 circular structuring elements to obtain a dilated edge map, and marking regions with a distance greater than 10 pixels from the dilated edge map to obtain background markers; performing watershed segmentation with marker control on the gradient magnitude map based on the foreground and background markers to obtain an initial segmentation label map; calculating the actual area and convex hull area of ​​each segmented region based on the initial segmentation label map, and determining regions with convexity less than 0.7 based on the ratio of the actual area to the convex hull area of ​​each segmented region; and triggering a lightweight U-Net for secondary correction based on regions with convexity less than 0.7 to obtain the final independent bubble regions.

[0041] In this embodiment, the specific steps include: (1) Automatic extraction of foreground markers - foam center positioning right Calculate the Euclidean distance transformation to obtain the distance map. D (x, y). Then perform morphological opening operations (3×3 circular structuring element, radius = 2 pixels) to suppress edge noise.

[0042] Foreground marker extraction formula: in, This represents the set of foreground marker points—the set of pixel coordinates belonging to the center of the bubble; Represents pixels ( x , y The Euclidean distance transformation value at () is the vertical distance from the pixel to the nearest edge; This represents the mean of the entire distance map, reflecting the average horizontal distance from the center of the bubble to its edge; The standard deviation represents the distance distribution across the entire distance map, reflecting the degree of dispersion in the distance distribution. c Indicates the adjustable threshold coefficient — cThe larger the value, the fewer the markers (conservative). c Smaller numbers indicate more markers (looserer approach), grid search determines the result. c =1.6.

[0043] coefficient c Determination: Scan from 1.0 to 3.0 (step size 0.2) on 30 labeled ground truth images, with segmentation IoU as the optimization metric. c The IoU is highest (0.89) when the value is 1.6. c <1.4 Introducing too much noise markers, c >2.0 Loss of the true bubble center.

[0044] Adaptive adjustment: When foam coverage Initiate density factor adjustment at time: . Prediction is achieved through simple threshold segmentation.

[0045] (2) Automatic extraction of background markers right Perform morphological dilation (5×5 circular structuring element, radius = 3 pixels, dilate twice), and mark areas > 10 pixels from the dilated edge as background. .

[0046] The 10-pixel constraint is based on the fact that the gap width of pyrite foam is typically 5-15 pixels, with 10 pixels being the median and a safe distance. Verification tests show that 8 pixels results in missegmentation in some scenes, and 12 pixels leaves some adhesion gaps unmarked; 10 pixels represents the optimal balance.

[0047] (3) Label-controlled watershed segmentation by (Prospect) and (Background) As a constraint, for the gradient magnitude map Implementing a watershed algorithm with tag control: ① Mark as foreground seed (grayscale 255). ① Mark the pixels as background seeds (grayscale 0), the rest as pending (128). ② Construct a priority queue, with adjacent pixels of seed points arranged in ascending order of gradient value. ③ Start with pixels of small gradient value and flood the queue, assigning each pixel to its nearest neighbor seed category. If two adjacent pixels are of different seed categories, mark them as a watershed line. ④ When the queue is empty, all pending pixels have been assigned, and the segmentation label map is output. .

[0048] Secondary correction (extreme adhesion scenario): for Calculate the convex hull area for each label region. and actual area ,like (If the actual area is less than 70% of the convex hull area, it indicates severe concave distortion, i.e., unsegmented, adhered foam). Therefore, the regions meeting the criteria are cropped into 256×256 image blocks and input into the lightweight U-Net for fine segmentation. This represents the actual pixel area of ​​the current label region, obtained by counting the pixels within the region; The area of ​​the convex hull of the current label region is calculated by obtaining the convex hull of the region boundary point set using the Graham scan algorithm and then calculating the polygon area. The value indicates convexity—the closer to 1, the more convex; the closer to 0, the more severe the concave distortion.

[0049] U-Net architecture: Encoder with 4 layers (each layer has 2 3×3 convolutions, channel count 16→128), decoder with 4 symmetrical layers and skip connections. Total parameters are approximately 786k (<1M). Training data: 200 frames of live images with 12000 bubble instances labeled (8500 normal + 3500 extremely adherent), split into training / validation / test sets in a 7:2:1 ratio. Adam optimizer, initial learning rate... Batch size 8, training for 100 epochs (early stopping condition: validation loss does not decrease for 5 consecutive epochs). Test set split IoU=0.93.

[0050] S4. Extract the geometric features of each independent foam region and statistically analyze the scene-level global features. Determine the flotation state based on the mapping relationship between the global features and the preset dynamic threshold.

[0051] The method for determining the flotation state includes: extracting the area and perimeter of each independent foam region; calculating the equivalent diameter based on the area of ​​each independent foam region; calculating the mean of the equivalent foam diameter based on the equivalent diameter; calculating the roundness based on the area and perimeter of each independent foam region; calculating the mean of the roundness based on the roundness; calculating the foam carrying capacity based on the number of independent foam regions and the actual physical area of ​​the image; calculating the diameter variation coefficient based on the equivalent diameter of each independent foam region and the mean of the equivalent foam diameter; and determining the flotation state based on the mapping relationship between the mean of the equivalent foam diameter, the mean of the roundness, the foam carrying capacity, the diameter variation coefficient, and a preset dynamic threshold.

[0052] In this embodiment, the specific steps include: (1) Single-bubble level geometric feature extraction For each independent segmented region Calculate the following geometric features: Equivalent diameter: ; Circularity: , For an ideal perfect circle, Indicates irregularity; Convexity: The convex hull area is calculated using Graham scanning to reflect the surface roughness. Represents the convex hull area – Graham scan calculates the convex hull (minimum convex polygon bounding box) of the boundary point set and then sums it according to the polygon area formula; perimeter After extracting the boundary through chain code encoding, calculate the cumulative step size (horizontal / vertical step size = 1 pixel, diagonal step size = ...). (pixels).

[0053] (2) Scene-level global feature statistics Will Grouped by process range: 0.1~0.5mm (fine bubbles), 0.5~1.0mm (medium bubbles), >1.0mm (coarse bubbles).

[0054] Calculate the mean: ,in, This indicates the total number of independent bubbles in the current frame; Foam load-bearing capacity: ,in, This represents the actual physical area corresponding to the image. = 1280×1024×0.012= 131.072 mm2, calibration coefficient 1 pixel = 0.01mm; Coefficient of variation of diameter: This reflects the uniformity of the foam, among which... The standard deviation of the equivalent diameter of all foams is: .

[0055] (3) Dynamic threshold mapping model A mapping rule was established from morphological characteristics to flotation process indicators. The thresholds were based on 12 months of historical operation records from the cooperative concentrator (approximately 10,000 labeled samples), and the following judgment conditions were established: ① >1.2mm and A concentration <0.65 indicates excessively large and irregular foam. Recommended processes include reducing the aeration volume by 5%–10% or reducing the amount of collector by 3%–5%. ② <0.4mm and If the number of particles is less than 0.5 per mm², the foam is considered too small and sparse. The recommended process is to increase the amount of collector by 3% to 5% or increase the aeration by 5% to 10%. ③0.4mm≤ ≤1.2mm and If the value is ≥0.65, it is considered to be in a normal state, and the recommended process is to maintain the current process parameters.

[0056] Example 2 In this embodiment, the following alternatives can be used: This invention adopts a four-stage sequential framework of "denoising → edge enhancement → segmentation → morphological recognition", which can be replaced by an end-to-end deep learning framework (such as DeepLabV3+ of MobileNetV3 encoder). However, the end-to-end framework requires a large amount of labeled data (recommended >50,000 frames) and its interpretability is lower than that of the modular solution of this invention.

[0057] Geometric features ( , C , S This can be replaced with texture features (LBP 3×3 neighborhood P=8, R=1 or GLCM). d =1, i =0° / 45° / 90° / 135°) or frequency domain features (FFT spectral energy distribution), combined with an SVM classifier, can achieve a classification accuracy of over 85%.

[0058] Example 3 In this embodiment, the technical solution of the present invention is described in detail using the actual production scenario of the flotation workshop of a pyrite beneficiation plant. This embodiment aims to verify its effectiveness under complex operating conditions and is not intended to limit the scope of protection.

[0059] I. Experimental Environment and Data Acquisition Hardware environment: Image acquisition: Hikvision MV-CA050-10GC industrial camera (resolution 1280×1024, 30fps, 2 / 3-inch CMOS), installed 1.2m above the liquid surface of the XCF-8 flotation cell (effective volume 8m³), with a lens tilt angle of 45°, equipped with a 36W ring diffuse LED light source (color temperature 6000K).

[0060] Processing terminal: Industrial PC (Intel Core i7-10700, 16GB DDR4, NVIDIA GTX 1650, 256GB SSD), Ubuntu 20.04 LTS.

[0061] Data objects: Covering four operating conditions—normal flotation (concentrate grade ≥48%, recovery rate ≥85%), excessive reagent (foam diameter >2mm, grade drops to 42%), insufficient aeration (foam <0.3mm, recovery rate drops to 72%), and high noise interference (slurry splashing + water mist). The test set contains 1000 frames, with an additional 200 frames used for U-Net training.

[0062] II. Detailed Explanation of Implementation Steps Step S1: Image Denoising and Enhancement Input: Raw RGB to grayscale (cv2.cvtColor, cv2.COLOR_BGR2GRAY), size 1280×1024, 8-bit depth. The measured SNR of this frame is 12.8 dB.

[0063] Wavelet decomposition: using the PyWavelets library (pywt.wavedec2, wavelet='Db4', level=3). Output (160×128) and 9 high-frequency subbands.

[0064] Low-frequency processing: MAD method estimation =8.3 (MAD=5.6÷0.6745=8.3). Search window 21×21, block 7×7. Central foam area =7.2, =0.87, k =0.8 × 0.87 ≈ 0.70, h =5.8; Oily area =14.1, =1.70, k =0.8×(1+0.5×0.70)=1.08, h =9.0. After NL-means filtering, the background noise is smoothed, and the grayscale of the foam body is not distorted.

[0065] High-frequency processing (taking LH3 as an example): =68.9, =156.3, =9.3, =68.9 / 9.3=7.4. After soft thresholding, approximately 72% of the coefficients are retained, removing random noise. Reconstruction and CLAHE: After reconstruction with pywt.waverec2, cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8)) is used for processing. The grayscale difference is reduced from the original Δ I =25~40 increased to Δ I =60~100.

[0066] Step S2: Reinforce the foam edges Gabor filtering: 24 filters are constructed using OpenCV's `cv2.getGaborKernel`, followed by `cv2.filter2D` convolution. Taking a horizontal foam boundary as an example, the response is 0.72 in the 45° direction but only 0.15 in the 0° direction, verifying the necessity of multi-directional filtering.

[0067] PC calculation: Kovesi method (5 high-frequency channels, starting wavelength 3 pixels, scale spacing 1.3 times). PC value at foam boundary is 0.35~0.65, and <0.10 outside the boundary. PC value in unevenly lit areas (upper left shadow, grayscale 45~60) is still >0.30.

[0068] Fusion + NMS: After normalization to [0,1], and The fusion ratio was 0.6:0.4, 3×3 NMS. All 87 foam edges in this frame were continuous and intact, with an average breakage of 0.8 points per foam.

[0069] Step S3: Foam Segmentation Foreground marker: scipy.ndimage.distance_transform_edt calculates the distance transformation. =24.7 pixels, =11.3 pixels, dynamic threshold = 24.7 + 1.6 × 11.3 = 42.8 pixels, 63 foreground markers were extracted (61 of them accurately correspond to the real bubble center, with an accuracy of 96.8%).

[0070] Background marking: cv2.dilate (5×5 circular kernel, 2 operations), marking areas >10 pixels from the edge after dilation as background (occupying 32% of the image area).

[0071] Watershed segmentation: skimage.segmentation.watershed takes the gradient map as input. It outputs 63 independent regions, of which 3 groups are extremely contiguous (accounting for 12% of the area), triggering a second correction by U-Net, correctly separating them into 2-3 independent bubbles. The final output is 65 independent bubble regions.

[0072] Step S4: Shape Recognition and State Determination Typical bubble calculation: Area A = 3682 pixels² ⇒ =2×sqrt(3682 / π)≈68.5 pixels⇒0.685mm; Perimeter P=312 pixels⇒C=4π×3682 / 3122≈0.48; Convex hull area =4511 pixels 2⇒ S =0.82.

[0073] Frame statistics: =0.712mm, =0.52, =0.496 pieces / mm2, CV =0.38.

[0074] Status determination: =0.712mm is within the normal range of 0.4~1.2mm, but =0.52<0.65 and <0.5 mm, 42% of the foam is concentrated in the <0.5 mm fine bubble range. The overall judgment is that the low inflation volume leads to fine foam.

[0075] Output recommendation: "It is recommended to increase the inflation volume by 8%, or adjust the foaming agent (MIBC) dosage by 5%, and reassess after observing for 30 minutes." III. Effect Verification and Quantitative Comparison The results of this invention were quantitatively compared with manually labeled ground truth and traditional methods (median filtering 5×5 + Canny threshold (30,80) + traditional watershed). The results of a 1000-frame test set are as follows: (1) The comparison of segmentation accuracy is shown in Table 1: Table 1 .

[0076] (2) Parameter reliability Fifty frames were randomly selected from the test set, and the average foam diameter was manually measured by laboratory personnel using a microscope (accuracy ±0.02 mm): In this invention, R = 0.94 (p<0.001), RMSE = 0.046 mm; in the conventional method, R = 0.78 (p<0.001), RMSE = 0.112 mm; the correlation coefficient increased from 0.78 to 0.94, and the RMSE decreased by 58.9%.

[0077] (3) Processing efficiency The average processing time per frame (1280×1024) was 38.2ms (±5.1ms), approximately 26 fps. The time spent on each step was as follows: S1 denoising 11.3ms (29.6%), S2 edge enhancement 14.7ms (38.5%), S3 segmentation 8.5ms (22.2%), and S4 shape recognition 3.7ms (9.7%). Edge enhancement took the longest time; further optimization using GPU acceleration or FFT could be considered.

[0078] Example 4 In this embodiment, a flotation foam image recognition system for pyrite includes: an image preprocessing module, a weighted fusion module, a region segmentation module, and a state determination module.

[0079] The image preprocessing module is used to acquire the initial image of the flotation foam of pyrite to be identified. The initial image is preprocessed by multi-scale wavelet decomposition combined with adaptive thresholding to obtain a denoised and enhanced image.

[0080] The weighted fusion module calculates and fuses the multi-directional, multi-scale Gabor filter response based on the denoised and enhanced image to obtain the Gabor fusion response map. At the same time, it calculates the phase consistency map, weights and fuses the Gabor fusion response map and the phase consistency map, and performs non-maximum suppression processing to obtain the continuous edge map.

[0081] The region segmentation module calculates distance transformation and extracts foreground markers based on the continuous edge map, extracts background markers after dilating the continuous edge map, performs watershed segmentation with marker control based on foreground and background markers as constraints, and performs secondary correction on regions with convexity below the threshold to obtain segmented independent foam regions.

[0082] The state determination module is used to extract the geometric features of each independent foam region and statistically analyze the scene-level global features. Based on the mapping relationship between the global features and the preset dynamic threshold, the flotation state is determined.

[0083] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A method for recognizing froth images in pyrite flotation, characterized in that, Includes the following steps: An initial image of the flotation foam of pyrite to be identified is obtained, and the initial image is preprocessed by multi-scale wavelet decomposition combined with adaptive thresholding to obtain a denoised and enhanced image. Based on the denoised and enhanced image, calculate the multi-directional and multi-scale Gabor filter response and fuse them to obtain the Gabor fused response map. At the same time, calculate the phase consistency map. Weight the Gabor fused response map and the phase consistency map and perform non-maximum suppression processing to obtain the continuous edge map. The distance transformation is calculated based on the continuous edge map and the foreground marker is extracted. The background marker is extracted after the continuous edge map is dilated. The watershed segmentation with marker control is performed with the foreground marker and the background marker as constraints. The regions with convexity below the threshold are corrected in a second step to obtain the segmented independent foam regions. Extract the geometric features of each independent foam region and statistically analyze the scene-level global features. Determine the flotation state based on the mapping relationship between the global features and the preset dynamic threshold.

2. The method for recognizing froth images in pyrite flotation according to claim 1, characterized in that, The method for obtaining the denoised and enhanced image includes: The initial image is decomposed into low-frequency and high-frequency sub-bands using the Db4 wavelet basis. Adaptive nonlocal mean filtering is applied to the low-frequency sub-band to obtain the first processing result. In the adaptive nonlocal mean filtering process of the low-frequency sub-band, the search window size is 21×21 pixels, the neighborhood block size is 7×7 pixels, and the filter attenuation parameter is... h The adjustment is made dynamically based on the ratio of the local standard deviation to the noise standard deviation. The adaptive threshold shrinkage processing of the high-frequency sub-bands uses the BayesShrink method to calculate the threshold of each high-frequency sub-band, and uses a soft threshold function to shrink the coefficients to obtain the second processing result. The first processing result and the second processing result are reconstructed by wavelet, and the reconstructed image is subjected to contrast-limited adaptive histogram equalization to obtain the denoised and enhanced image.

3. The method for recognizing froth images in pyrite flotation according to claim 1, characterized in that, The method for obtaining the continuous edge map includes: A Gabor filter bank with 8 directions and 3 wavelengths is constructed. The response amplitude is calculated by applying each Gabor filter to the denoised and enhanced image pixel by pixel. The maximum value of the response amplitude under all directions and wavelengths is taken as the Gabor fusion response map. The phase consistency map was calculated using 5 high-frequency channels, with a starting wavelength of 3 pixels and a scale spacing of 1.3 times. The weights of the Gabor fusion response map and the phase consistency map are set respectively, and the Gabor fusion response map and the phase consistency map are weighted and fused based on the set weights to obtain the fused image; The fused image is subjected to non-maximum suppression processing, and local maximum points are retained in a 3×3 neighborhood along the gradient direction, and the continuous edge map with a single pixel width is output.

4. The method for recognizing froth images in pyrite flotation according to claim 1, characterized in that, The method for obtaining the independent foam region includes: A distance map is obtained by calculating the distance transformation based on the continuous edge map, a dynamic threshold is determined based on the mean and standard deviation of the distance map, and foreground markers are extracted based on the dynamic threshold; Based on the continuous edge map, two morphological dilations are performed using a 5×5 circular structural element to obtain a dilated edge map. Based on the dilated edge map, regions with a distance greater than 10 pixels from the dilated edge are marked to obtain background markings. Based on the foreground and background labels, the gradient magnitude map is segmented by a watershed with label control to obtain an initial segmentation label map; Based on the initial segmentation label map, calculate the actual area and convex hull area of ​​each segmented region, and determine the region with convexity less than 0.7 based on the ratio of the actual area to the convex hull area of ​​each segmented region. Based on the regions with convexity below 0.7, a lightweight U-Net is triggered for secondary correction to obtain the final independent foam region.

5. The method for recognizing froth images in pyrite flotation according to claim 1, characterized in that, The methods for determining the flotation state include: Extract the area and perimeter of each independent foam region, calculate the equivalent diameter based on the area of ​​each independent foam region, and calculate the mean of the foam equivalent diameter based on the equivalent diameter; The roundness is calculated based on the area and perimeter of each independent foam region, and the average roundness of the foam is calculated based on the roundness. The foam load-bearing capacity is calculated based on the number of each independent foam region and the actual physical area of ​​the image. The diameter variation coefficient is calculated based on the equivalent diameter of each independent foam region and the mean equivalent diameter of the foam. The flotation state is determined based on the mapping relationship between the average equivalent diameter of the foam, the average roundness of the foam, the foam carrying capacity, the diameter variation coefficient, and a preset dynamic threshold.

6. A flotation froth image recognition system for pyrite, wherein the system applies the method described in any one of claims 1-5, characterized in that, include: Image preprocessing module, weighted fusion module, region segmentation module, and state determination module; The image preprocessing module is used to acquire an initial image of the flotation foam of pyrite to be identified, and to preprocess the initial image by multi-scale wavelet decomposition combined with adaptive thresholding to obtain a denoised and enhanced image. The weighted fusion module calculates and fuses the multi-directional, multi-scale Gabor filter response based on the denoised and enhanced image to obtain a Gabor fusion response map. At the same time, it calculates the phase consistency map, weights and fuses the Gabor fusion response map and the phase consistency map, and performs non-maximum suppression processing to obtain a continuous edge map. The region segmentation module calculates distance transformation and extracts foreground markers based on the continuous edge map, extracts background markers after dilating the continuous edge map, performs watershed segmentation with marker control using the foreground markers and background markers as constraints, and performs secondary correction on regions with convexity below a threshold to obtain segmented independent foam regions. The state determination module is used to extract the geometric features of each independent foam region and statistically analyze the scene-level global features. Based on the mapping relationship between the global features and the preset dynamic threshold, the flotation state is determined.