Method for identifying concentrate foam image and predicting concentrate grade qualification rate
By using machine vision technology to identify and process flotation foam images, the subjective problem of manual observation in the flotation process is solved, accurate online prediction of concentrate grade and automated control of the production process are achieved, and the stability and efficiency of flotation production are improved.
Patent Information
- Application Number
- CN202510664560.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-10-10
AI Technical Summary
In the existing flotation process, the method of relying on manual observation of flotation foam is highly subjective, has large errors, and is inefficient, resulting in frequent fluctuations in production indicators, serious loss of mineral raw materials, and large consumption of reagents, making it difficult to achieve stable and efficient flotation production.
Machine vision technology is used to identify the contour of concentrate foam through image acquisition, preprocessing, block adaptive threshold segmentation, image expansion algorithm and convex hull algorithm. Combined with the concentrate foam depth-first search algorithm and scale method, online prediction and automatic control of concentrate grade can be achieved.
It realizes accurate identification and real-time monitoring of concentrate grade, improves the efficiency and automation level of flotation production, provides objective evaluation and optimization basis of the production process, and reduces manual errors and resource waste.
Smart Images

Figure CN120765528A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of froth flotation, and in particular to a method for recognizing concentrate froth images and predicting the qualified rate of concentrate grade. Background Art
[0002] The flotation process is a complex and continuous physical and chemical process carried out in the three phases of gas, solid, and liquid. Plant workers visually observe the flotation foam to subjectively perceive its surface visual characteristics, such as color, size, shape, and flow rate. Based on experience, they manually judge the flotation conditions and adjust flotation production to achieve predetermined production targets. This production method of manually observing the flotation foam is highly subjective, has large errors, and is inefficient. It cannot achieve objective evaluation and understanding of the flotation foam state, resulting in frequent fluctuations in flotation production indicators, severe loss of mineral raw materials, high reagent consumption, and low resource recovery rates. Especially in today's increasingly scarce high-grade mineral resources, the complex composition of the ore source, and the low grade of the original ore, manual flotation production is even more difficult to carry out effectively.
[0003] Given that the visual characteristics of flotation foam contain indicative information closely related to flotation conditions, production indicators, and process operating variables, incorporating machine vision into flotation process monitoring, by simulating the human process of "seeing foam" through computer vision, can enable automatic control and optimized production operations of mineral flotation based on machine vision, thereby improving flotation production efficiency and the level of mineral processing automation. With the rapid development of digital image processing, pattern recognition, and automatic control technologies, machine vision-based mineral flotation process monitoring systems are now able to quantitatively describe and objectively evaluate flotation conditions, addressing the issues of flotation process instability and indicator fluctuations caused by subjective on-site operations. Therefore, machine vision-based optimized control of mineral flotation processes is a development trend that is poised to improve flotation production efficiency and the level of mineral processing automation. Summary of the Invention
[0004] The purpose of the present invention is to provide a method for recognizing concentrate foam images and predicting the qualified rate of concentrate grade, which changes the cumbersome steps of traditional concentrate grade detection relying on manual sampling and testing, realizes real-time soft measurement of concentrate grade online prediction, and can dynamically track the changes of concentrate / sweep area foam and concentrate grade.
[0005] To achieve the above object, the present invention is implemented through the following technical solutions:
[0006] A concentrate foam image recognition method specifically includes the following contents:
[0007] S1, foam image acquisition;
[0008] S2, preprocessing the collected foam images;
[0009] S3. Using a block adaptive threshold segmentation method to distinguish image foreground and background information, and using an image expansion algorithm to obtain the contour information of the foam; using a convex hull algorithm to process the vector information of all concentrate foam contours;
[0010] 1) Block adaptive threshold segmentation algorithm
[0011] Each collected foam image is divided into several sub-modules, and each sub-module automatically sets the optimal threshold according to the pixel information of the image to perform threshold segmentation of the foam image into foreground image and background image;
[0012] 2) Image dilation segmentation algorithm
[0013] Select the high threshold TH and the low threshold TL;
[0014] Discard the points smaller than the low threshold TL and mark the points larger than the high threshold TH;
[0015] The points smaller than the upper threshold TH and larger than the lower threshold TL are determined using connected regions to obtain all identified pixel point information of the concentrate foam contour;
[0016] 3) Convex Hull Algorithm
[0017] All the concentrate foam contours after being processed by the image expansion segmentation algorithm are traversed vertex by vertex for each concentrate foam contour, and the adjacent points form vector information.
[0018] In step S2, the collected foam image is preprocessed including image grayscale processing, image sharpening processing, and image median filtering noise reduction processing:
[0019] 1) Image grayscale processing
[0020] According to the relationship between the color spaces of RGB and YUV images, the corresponding relationship between the brightness value Y and the R, G, and B color components is established. The formula is as follows:
[0021] Y=0.28R+0.55G+0.17B ①
[0022] In formula ①, brightness Y is used to express the grayscale value of the image, and R, G, and B represent red, green, and blue respectively;
[0023] 2) Image sharpening
[0024] Sobel operator is used for sharpening;
[0025] 3) Image median filtering noise reduction processing
[0026] A low-pass filter is used to reduce the high-frequency components in the image;
[0027] Use Gaussian function to perform weighted averaging on image pixels.
[0028] In step S3, the optimal threshold is as follows:
[0029] 1) Block adaptive threshold segmentation algorithm, including:
[0030] a. Let the input image be I, with a size of M×N, and the pixel value of the image be represented as I(x,y), where x and y are the horizontal and vertical coordinates of the image; the image is divided into multiple small blocks, each small block B i,j The size of is w×w, where i and j are the row and column numbers of the small block respectively;
[0031] The image block formula is as follows:
[0032] B i,j ={I(x,y):i≤x <i+w,j≤y<j+w}②
[0033] In formula ②, B i,j Represents the small block in row i and column j;
[0034] b. Local threshold calculation;
[0035] Use the mean method to calculate the small block B i,j The local threshold is as follows:
[0036]
[0037] In formula ③, Indicates small block B i,j The local threshold is the average value of all pixel values in the small block;
[0038] Use the standard deviation method to perform a secondary check to calculate the grayscale mean μ of the small block i,y and standard deviation σ i,j , used to calculate the local threshold The formula is as follows:
[0039]
[0040] According to formula ④ and formula ⑤, the local threshold is calculated by the standard deviation and mean. The formula is as follows:
[0041]
[0042] In formula ⑥, k represents a constant with a value of 0.5 or 1, which is used to control the sensitivity of the threshold;
[0043] OTSU is used to select the automatic threshold value. For each small block B i,j , the OTSU method automatically determines the optimal local threshold by calculating the inter-class variance of the grayscale histogram
[0044] Assume the gray value range of a small block is [0, 255] [0, 255], and its histogram is H i,j (i), where t is the gray value;
[0045] Inter-class variance The formula is as follows:
[0046]
[0047]
[0048] In formulas ⑦-⑩, and represent the normalized weights of the two classes on the left and right of the gray value t, respectively; and represent the gray mean values of the two classes, respectively;
[0049] By maximizing the inter-class variance Select the best local threshold
[0050] c. For each small block B i,j , according to the calculated local threshold T i,j , a binarization operation is performed, and the formula is as follows:
[0051]
[0052] In formula , I i,j (x, y) represents the binarization result of the pixel (x, y) in the small block B i,j , and T bin represents the local threshold of the small block in which the pixel is located;
[0053] d. All small blocks after local binarization need to be merged into a complete binary image, and the merging formula is as follows:
[0054]
[0055] In formula , I bin (x, y) represents the final binary image, , and I i (x, y) represents the binarization result in the corresponding small block;
[0056] e. In order to eliminate the block effect and noise caused by blocking, morphological operations are used, including dilation and erosion operations, and the formula for the dilation operation is as follows:
[0057]
[0058] In formula , S represents the dilation structure element, which is a 3x3 matrix;
[0059] The corrosion operation formula is as follows:
[0060]
[0061] formula and formula Used to remove small noise and smooth edges.
[0062] In step S3, the pixel points are counted using the concentrate foam depth-first search algorithm; the counting and statistics module for the number of foams in the foam image includes the concentrate foam depth-first search algorithm and the scale method:
[0063] 1) Concentrate foam depth-first search algorithm
[0064] The foam image information is traversed pixel by pixel: starting from a starting node, going deep into a branch, then backtracking to the previous node and continuing to explore other branches;
[0065] Record the number of pixels occupied by the concentrate foam, traverse all pixel information in sequence, and count the number of concentrate foams and the number of pixels occupied by each concentrate foam;
[0066] 2) Scale method
[0067] By converting the real distance to the pixel points, the actual size of the pixel points is calculated. Then, the actual size of the concentrate foam is calculated using the number of pixels occupied by the concentrate foam.
[0068] The area occupied by the concentrate foam is projected onto the flotation cell width in the image, which occupies n1 pixels. The width of the uniform concentrate foam occupies n2 pixels. The scale factor is calculated as follows:
[0069]
[0070] In formula ③, w represents the scale coefficient.
[0071] The method for predicting the qualified rate of concentrate grade includes threshold setting and qualified rate calculation:
[0072] 1) Threshold setting
[0073] The user sets the qualified threshold value θ of the concentrate foam particle size;
[0074] 2) Calculation of pass rate
[0075] The formula is as follows:
[0076]
[0077] In formula ④, s iS i represents the size of the i-th identified concentrate froth area, n represents the number of identified concentrate froths, S is the area of the concentrate froth flow in the image, and Y represents the concentrate grade prediction qualified rate.
[0078] The statistical analysis of the concentrate froth recognition result image, the concentrate froth partition information and the concentrate grade prediction qualified rate is stored into a database, and the historical concentrate froth grade recognition statistical result is inquired in real time through the database according to 'year','month' and 'day'.
[0079] Compared with the prior art, the present application has the beneficial effects that:
[0080] 1. Image preprocessing of colleges and universities: image gray processing uses the change relationship of RGB and YUV color space to express the gray value of the image with the brightness value Y, which can highlight the important information of the image, reduce the data amount, and at the same time retain the main features of the image, preparing for subsequent processing; image sharpening processing uses the Sobel operator method for sharpening processing, introduces the average factor to smooth the noise through difference processing, makes the image edge more clear, enhances the detail information of the image, and is beneficial to the extraction and analysis of the subsequent foam features; the use of Gaussian filtering can effectively reduce the high-frequency components in the image, reduce the noise interference of the image, and at the same time, through reasonable control of the size and standard deviation of the convolution kernel, the shape and detail information of the image can be retained to a certain extent, improving the quality and readability of the image;
[0081] 2. Accurate foam recognition: in the aspect of foam image feature value extraction, by calculating the image gradient amplitude and direction, the problem of uneven illumination caused by time and angle factors is overcome, and the edge can be accurately recognized; even if a single threshold value cannot recognize all the foams in different light and dark areas, the system performs block processing on the foam image, and each block module automatically sets the best threshold value according to the pixel information of the image, so as to realize accurate threshold segmentation of the foreground and background images of the image, and improve the accuracy and robustness of foam recognition; the combination use of image dilation segmentation algorithm and convex hull algorithm can effectively process the contour concave problem caused by the overlap of concentrate grade froth contour information or the difference between light and dark, and obtain complete and accurate concentrate grade froth contour pixel point information, providing accurate feature data for further concentrate grade detection;
[0082] 3. Reliable concentrate grade foam counting statistics: The concentrate foam depth-first search algorithm can traverse the processed concentrate grade foam image information pixel by pixel, comprehensively recording the number of pixels occupied by the concentrate foam, thereby accurately counting the number of foams and the number of pixels occupied by each concentrate foam, providing accurate data support for subsequent conversion to true size; the scale method uses the conversion relationship between true distance and pixels to accurately convert the counted number of concentrate grade foam pixels into the corresponding true size, thereby achieving accurate measurement of the size of concentrate grade foam in actual production, providing an important basis for concentrate grade control during the production process;
[0083] 4. Practical Concentrate Grade Prediction Model Qualified Rate Calculation: The threshold setting function allows users to customize the qualified threshold value of concentrate grade foam particle size according to process requirements. It has strong flexibility and adaptability, and can meet the concentrate grade testing needs under different production scenarios and process requirements. The concentrate grade qualified rate calculation formula can accurately calculate the qualified rate of concentrate grade prediction, providing production management personnel with an intuitive indicator to help them timely understand the quality status of concentrate grade, so as to make timely adjustments and optimization of the production process and improve production efficiency and product quality.
[0084] 5. Effective data statistical analysis and management: The statistical analysis module can perform statistical analysis on important data such as concentrate foam identification result images, foam thickness, concentrate foam grade zoning information, and concentrate grade prediction pass rate over a period of time, and store the data in the database, allowing users to query historical concentrate grade foam particle size identification statistical results in real time according to different time dimensions such as "year", "month", and "day". It accumulates a large amount of production data and quality information for enterprises, helps production management personnel conduct in-depth analysis and research on the production process, discover potential problems and patterns in the production process, and provide strong data support and decision-making basis for optimizing production processes, improving product quality and production efficiency;
[0085] 6. Convenient human-machine exchange: The video display unit can display flotation foam video information in real time, allowing operators to intuitively observe the flotation foam status during the production process, promptly detect abnormal situations and make corresponding treatments; the threshold input unit allows users to customize the qualified threshold value of concentrate grade foam according to actual needs. The operation is simple and convenient, which improves the usability and user-friendliness of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] Figure 1 It is a flow chart of the recognition method based on concentrate foam image.
[0087] Figure 2 It is based on the structure diagram of concentrate foam image acquisition.
[0088] Figure 3 This is the foam image before filtering.
[0089] Figure 4 This is the filtered image of the foam image.
[0090] Figure 5 This is a schematic diagram when L is 1.2.
[0091] Figure 6 This is a schematic diagram when L is 1.35.
[0092] Figure 7 This is a schematic diagram when L is 1.5.
[0093] In the picture: 1. Floodlight; 2. Camera; 3. Flotation tank. DETAILED DESCRIPTION
[0094] The present invention will be described in detail below with reference to the accompanying drawings, but it should be noted that the implementation of the present invention is not limited to the following embodiments.
[0095] The following examples are implemented under the premise of the technical solution of the present invention, and provide detailed implementation methods and specific operating processes, but the scope of protection of the present invention is not limited to the following examples. The methods used in the following examples are conventional methods unless otherwise specified.
[0096] Example 1
[0097] See Figure 1 , a method for identifying concentrate foam images, comprising the following steps:
[0098] S1. Image acquisition, which is responsible for collecting foam flow image and video information.
[0099] S2. Preprocessing the collected foam image includes image grayscale processing, image sharpening processing, and image median filtering noise reduction processing to enhance the image layer effect and reduce image noise information. The concentrate foam image preprocessing includes image grayscale processing, image sharpening processing, and image median filtering noise reduction processing to obtain gray and clear concentrate foam image information. The content is as follows:
[0100] 1) Image grayscale processing
[0101] The physical meaning of the Y component is the brightness of the point. This value reflects the brightness level. According to the change relationship between RGB and YUV color space, the correspondence between the brightness value Y and the three color components R / G / B is established. The formula is as follows:
[0102] Y=0.28R+0.55G+0.17B ①
[0103] In formula ①, the brightness value Y is used to express the grayscale value of the image, and R, G, and B represent the three colors of red, green, and blue respectively;
[0104] 2) Image sharpening
[0105] The Sobel operator is used for sharpening. The Sobel operator introduces an average factor and smoothes the noise through differential processing.
[0106] 3) Image median filtering noise reduction processing
[0107] A low-pass filter is used to reduce the high-frequency components in the image; a Gaussian function is used to perform weighted averaging on the image pixels so that the pixels farther away from the center pixel have a smaller weight in the calculation;
[0108] This filtering method is considered a low-pass filter that can reduce the high-frequency components in the image. In the present invention, a convolution kernel needs to be defined first. The size of the convolution kernel determines the degree of filtering. Then the convolution kernel is applied to each pixel of the image, and the new pixel value is obtained by weighted averaging. The present invention uses a sliding window to perform convolution operation on discrete data, that is, Gaussian filtering of the wave image. The formula is as follows:
[0109] g(x,y)=f(x,y)*s(x,y)②
[0110]
[0111] In formulas ② and ③, g(x,y) is the value of the Gaussian function at the point (x,y); f(x,y) represents the original image before threshold processing, and s(x,y) represents the Gaussian filter function; σ is the standard deviation of the Gaussian distribution, which controls the width of the filter. The larger the standard deviation, the stronger the blurring effect; x and y are the offsets relative to the center point, and π represents pi.
[0112] Formulas ② and ③ can be used to control the smoothness of the image; the Gaussian filter weakens the shape and details of the image.
[0113] S3. Applying a block adaptive threshold segmentation algorithm to the foam image pre-processed in step S2, with the image foreground being the identified foam information and the background being the flotation tank slurry; using an image expansion segmentation algorithm to obtain the contour information of the identified mineral foam; using the foam contour information, applying a convex hull algorithm to make the identified foam shape closer to reality;
[0114] 1) Block adaptive threshold segmentation algorithm
[0115] The image gradient amplitude and direction are calculated by the image sharpening processing in step S2, which is used to overcome the uneven illumination problem caused by time and angle, etc. The greater the gradient value is, the greater the pixel value change rate is, and the more obvious the change is. In actual application, the points with gradient amplitude greater than the threshold value are marked as edges. The gradient vector, azimuth angle and edge direction (orthogonal to the gradient vector) of a certain pixel center point are represented. If a single threshold value is set, all the foams in different bright and dark areas cannot be identified. The system algorithm performs block processing on the foam image, and each block automatically sets the best threshold value according to the pixel information of the image to perform threshold segmentation on the foreground and background images of the image.
[0116] The best threshold value is as follows:
[0117] 1) Block adaptive threshold segmentation algorithm, comprising:
[0118] a. Set the input image as I, the size as MxN, and the pixel value of the image as I(x, y), wherein x and y are the horizontal and vertical coordinates of the image. The image is divided into multiple small blocks, and the size of each small block B i,j is w x w, wherein i and j are the row number and column number of the small block, respectively;
[0119] The block formula of the image is as follows:
[0120] B i,j = {I(x, y): i≤x<i+w, j≤y<j+w} (4)
[0121] In formula (4), B i,j represents the small block in the ith row and the jth column;
[0122] b. Local threshold value calculation;
[0123] The local threshold value of the small block B i,j is calculated by using the mean value method, and the formula is as follows:
[0124]
[0125] In formula (5), μ represents the local threshold value of the small block B i,j , which is the average value of all pixel values in the small block;
[0126] The gray mean value μ i,y and the standard deviation σ i,j of the small block are calculated by using the standard deviation method for secondary verification, which is used to calculate the local threshold value The formula is as follows:
[0127]
[0128] According to formula ⑥ and formula ⑦, the local threshold is calculated by the standard deviation and mean. The formula is as follows:
[0129]
[0130] In formula ⑧, k represents a constant with a value of 0.5 or 1, which is used to control the sensitivity of the threshold;
[0131] OTSU is used to select the automatic threshold value. For each small block B i,j , the OTSU method automatically determines the optimal local threshold by calculating the inter-class variance of the grayscale histogram
[0132] Assume that the grayscale value range of the small block is [0,255][0,255], and its histogram is H i,j (i), where t is the grayscale value;
[0133] Between-class variance The formula is as follows:
[0134]
[0135] formula In the equation, they represent the normalized weights of the two classes with grayscale value t; μ1(t) and μ2(t) represent the grayscale means of the two classes respectively;
[0136] By maximizing the between-class variance Select the best local threshold
[0137] c. For each small block B i,j , according to the calculated local threshold T i,j Perform binarization operation, the formula is as follows:
[0138]
[0139] formula middle Indicates small block B i,j The binarization result of pixel (x, y) in T i,j It is represented as the local threshold of the small block where the pixel is located;
[0140] d. All small blocks after local binarization need to be merged into a complete binary image. The merging formula is as follows:
[0141]
[0142] formula middle, I bin (x,y) represents the final binary image, Indicates the binarization result in the corresponding small block;
[0143] e. In order to eliminate the block effect and noise caused by blocking, morphological operations are used, including dilation and erosion operations. The dilation operation formula is as follows:
[0144]
[0145] formula In the equation, S represents the expansion structure element, which is a 3×3 matrix;
[0146] The corrosion operation formula is as follows:
[0147]
[0148] formula and formula Used to remove small noise and smooth edges.
[0149] 2) Image expansion segmentation algorithm: The foreground image after being processed by the block adaptive threshold segmentation algorithm, i.e. the identified concentrate foam image information, is segmented using the image expansion algorithm. The specific operations in the application are as follows:
[0150] Select the high threshold TH and the low threshold TL with a ratio of 3:1. In the present invention, TH=0.3 and TL=0.1;
[0151] Points smaller than the lower threshold are discarded and assigned a value of 0; points larger than the upper threshold are immediately marked (these points are determined edge points) and the present invention assigns a value of 1;
[0152] The points smaller than the upper threshold and larger than the lower threshold are determined using the connected area (i.e., only when they are connected to the TH pixel will they be accepted as edge points, and the present invention assigns 255) to obtain all the identified pixel point information of the concentrate foam contour;
[0153] 3) Convex Hull Algorithm
[0154] The contour information of the concentrate foam has the problem of contour defects caused by overlap or brightness difference. After all the concentrate foam contours are processed by the image expansion segmentation algorithm, each concentrate foam contour is traversed vertex by vertex, and the adjacent points form vector information. The convex hull algorithm is used to process the contour vector information of the entire concentrate foam.
[0155] S4, a module for counting and counting the number of foam particles in the foam image, uses image processing and machine learning algorithms to analyze the image data collected by the camera, identify the key features of the foam target and the change in slurry grade, and determine the target position and size information. The concentrate foam depth-first search algorithm is used to traverse the concentrate foam image information optimized by the convex hull algorithm to obtain the total number of all concentrate foam particles in the image and the number of pixels of each concentrate foam; the scale method is used to calculate the actual size of the concentrate foam;
[0156] The foam counting statistics module includes the concentrate foam depth-first search algorithm and the scale method, as follows:
[0157] 1) Concentrate foam depth-first search algorithm
[0158] The concentrate foam image information processed by the foam recognition module is traversed pixel by pixel. The basic idea of this algorithm is to start from a starting node, go deep into the end of a branch, then backtrack to the previous node and continue to explore other branches. Unlike breadth-first search, this algorithm does not search layer by layer, but visits nodes as deeply as possible until it reaches a node with no unvisited adjacent nodes, and then backtracks to the previous node. This algorithm is suitable for scenarios where the entire path needs to be explored. Therefore, the number of pixels occupied by the concentrate foam is recorded, and all pixel information is traversed in turn to count the number of foams and the number of pixels occupied by each concentrate foam.
[0159] 2) Scale method
[0160] By converting the real distance to the pixel points, the actual size of the pixel points is calculated. Then, the actual size of the concentrate foam is calculated using the number of concentrate foam pixels. The area occupied by the concentrate foam is projected onto the flotation tank width in the image, which occupies a total of n1 pixels. The width of the uniform concentrate foam occupies n2 pixels. The calculation formula for the scale coefficient is as follows:
[0161]
[0162] formula In , w represents the scale factor.
[0163] A method for predicting the qualified rate of concentrate grade based on concentrate foam image recognition. The method for calculating the qualified rate of concentrate grade includes threshold setting and qualified rate calculation.
[0164] 1) Threshold setting
[0165] The user sets the qualified threshold value θ of the concentrate foam particle size;
[0166] 2) Calculation of Concentrate Grade Qualified Rate
[0167] The formula is as follows:
[0168]
[0169] formula In, s i represents the actual size of the concentrate foam area identified by low i, n is the number of identified concentrate foams, S is the concentrate foam flow area in the image, and Y is the qualified rate of concentrate grade prediction.
[0170] Statistical analysis is performed on the concentrate foam identification result images, foam thickness, concentrate foam grade zoning information and concentrate grade prediction pass rate over a period of time, and the information is stored in a database. The database can be used to query the historical concentrate foam particle size identification statistical results in real time by "year", "month" and "day".
[0171] See Figure 2 The concentrate foam image acquisition system includes an industrial high-definition camera, a floodlight 1, image transmission equipment, and an image processing terminal. A bracket is provided above the flotation cell 3, on which the industrial high-definition camera is mounted. To ensure image clarity and brightness uniformity, the industrial high-definition camera is fixed directly above the flotation cell 3, facing the flotation cell 3, and independently adjusts parameters such as exposure time, aperture, and focal length according to different environments. Floodlights 1 are provided on both sides of the industrial high-definition camera to increase the brightness of the foam on the flotation cell 3 and ensure clear features of the slurry image. The industrial high-definition camera is connected to the image server by optical fiber. The video acquisition exposure, focal length, and shooting frequency parameters are adjusted according to different working conditions to intercept static concentrate foam image information from the concentrate foam flow video information on the conveyor belt. An isolation cover is provided above the industrial high-definition camera to prevent dust and water from settling for a long time in complex working environments to reduce the negative impact of long-term dust and mud sedimentation on the video acquisition module. A dust removal fan is provided on the side of the industrial high-definition camera to ensure that there is no dust accumulation on the mirror surface of the camera 2, which does not affect the acquisition of flotation foam video information.
[0172] Example 2
[0173] In this embodiment, a method for concentrate foam image recognition is the same as that in Example 1, and an algorithm optimization process is added thereto. The project "Intelligent Flotation Diagnosis System Based on Foam Analysis" originates from a mining scientific research plan. The processing process of the flotation foam analysis model in the project can be mainly divided into the following steps: image acquisition, grayscale processing, sharpening and dehazing, filtering and noise reduction, threshold segmentation, recognition effect display and result data output.
[0174] (1) Image acquisition
[0175] To ensure the effectiveness of the image acquisition system, you first need to select a light source. You can choose LED long-tube lighting equipment or industrial-grade LED explosion-proof floodlights. Ensure that the brightness of the foam image in the flotation tank is uniform and the light brightness is moderate.
[0176] Regarding camera selection, the Hikvision MV-CS050-10GC model is currently used. Depending on the distance between the camera installation location and the conveyor belt, as well as the strength of the optical fiber, the camera's focal length, exposure time, acquisition frame rate and other parameters need to be adjusted to ensure that the captured image is clear enough.
[0177] (2) Image preprocessing
[0178] Before performing image operations, images need to be preprocessed to increase useful information and remove useless information in the image, thereby enhancing the image's information detectability and the reliability of feature extraction, segmentation, and matching. The image preprocessing methods in this study mainly include grayscale conversion, filtering, and threshold segmentation. Through these preprocessing steps, images can be made clearer and noise interference can be reduced, thereby improving the accuracy and efficiency of subsequent image processing algorithms.
[0179] a. Grayscale processing
[0180] The image information collected by the information acquisition system needs to be grayscale processed to convert the true color image into a grayscale image. This can eliminate the hue and saturation information while retaining the brightness information, making it easier to extract the outline information of the small stones later.
[0181] Grayscale processing is conducive to further processing of images, making it simpler and reducing the amount of data. At the same time, it can highlight the outline of the target of interest and improve the running speed of the program's post-processing. In addition, the processed image can extract the texture features of the image, avoiding the interference and errors caused by color in image recognition. These advantages make grayscale processing an important step in image processing, which can improve the efficiency of image processing and obtain more accurate results.
[0182] b. Median filtering
[0183] Filtering is a common method in image processing to remove fluctuations in certain frequency ranges in the signal and obtain the required frequency signal. This experiment uses median filtering for noise reduction to suppress or eliminate image noise to improve image quality. Compared with other filtering methods, median filtering is simple to operate and easy to implement in software, so it is widely used in the field of image processing.
[0184] The basic algorithm of median filtering is to filter a set of digital signal sequences. First, a window with an odd length is determined, for example, L = 2N + 1, where N is a positive integer. Assume that the regional information samples contained in the window are x(iN), ..., x(i), ..., x(i+N), where x is the information sample position of the anchor point in this region. The L signal sample values in the region are arranged in descending order. The output value of the median filter is the value at position i. The two-dimensional expression of the filter equation is:
[0185] g(x,y)=Med{f(xk,yl)(k,l∈W)} ①
[0186] In formula ①, the original image (see Figure 3 , Figure 4 ) is represented by (x,y), and the obtained image is represented by g(x,y).
[0187] (3) Thresholding
[0188] The purpose of thresholding is to obtain clear image edge contours; in the flotation foam image model, threshold segmentation refers to separating the foam from the background:
[0189] First, convert the image into a black and white binary image;
[0190] The algorithm is then used for object recognition, image separation, edge extraction, and other processing services to determine the optimal threshold T, compare the values of different pixels in the image with the threshold, and set the pixel values greater than this value to 1;
[0191] When the pixel value is lower than the threshold, it is 0. After the threshold operation, only black and white remain in the image, clearly dividing it into two areas, the front and the back.
[0192]
[0193] In formula ②, f(x, y) represents the original image before thresholding, g(x, y) represents the image after thresholding, and T represents the specified threshold. Experiments have shown that setting a threshold too small can lead to over-recognition, while setting a threshold too large can lead to under-recognition. To address these issues, an adaptive thresholding method is used. For locations with high light intensity, a larger threshold is selected; for locations with darker light at the edge of the mineral, a smaller threshold is selected. After testing, the threshold is defined as follows:
[0194] The optimal threshold is as follows:
[0195] 1) Block adaptive threshold segmentation algorithm, including:
[0196] a. Let the input image be I, with a size of M×N, and the pixel value of the image be represented as I(x,y), where x and y are the horizontal and vertical coordinates of the image; the image is divided into multiple small blocks, each small block B i,j The size of is w×w, where i and j are the row and column numbers of the small block respectively;
[0197] The image block formula is as follows:
[0198] B i,j ={I(x,y):i≤x <i+w,j≤y<j+w}②
[0199] In formula ②, B i,j Represents the small block in row i and column j;
[0200] b. Local threshold calculation;
[0201] Use the mean method to calculate the small block B i,j The local threshold is as follows:
[0202]
[0203] In formula ③, Indicates small block B i,j The local threshold is the average value of all pixel values in the small block;
[0204] Use the standard deviation method to perform a secondary check to calculate the grayscale mean μ of the small block i,y and standard deviation σ i,j , used to calculate the local threshold The formula is as follows:
[0205]
[0206] According to formula ④ and formula ⑤, the local threshold is calculated by the standard deviation and mean. The formula is as follows:
[0207]
[0208] In formula ⑥, k represents a constant with a value of 0.5 or 1, which is used to control the sensitivity of the threshold;
[0209] OTSU is used to select the automatic threshold value. For each small block B i,j , the OTSU method automatically determines the optimal local threshold by calculating the inter-class variance of the grayscale histogram
[0210] Assume that the grayscale value range of the small block is [0,255][0,255], and its histogram is H i,j (i), where t is the grayscale value;
[0211] Between-class variance The formula is as follows:
[0212]
[0213]
[0214] In formulas ⑦-⑩, μ1(t) and μ2(t) represent the normalized weights of the two classes with grayscale value t, respectively; μ1(t) and μ2(t) represent the grayscale mean of the two classes, respectively;
[0215] By maximizing the between-class variance Select the best local threshold
[0216] c. For each small block B i,j , according to the calculated local threshold T i,j Perform binarization operation, the formula is as follows:
[0217]
[0218] formula middle Indicates small block B i,j The binarization result of pixel (x, y) in T i,j It is represented as the local threshold of the small block where the pixel is located;
[0219] d. All small blocks after local binarization need to be merged into a complete binary image. The merging formula is as follows:
[0220]
[0221] formula middle, I bin (x,y) represents the final binary image, Indicates the binarization result in the corresponding small block;
[0222] e. In order to eliminate the block effect and noise caused by blocking, morphological operations are used, including dilation and erosion operations. The dilation operation formula is as follows:
[0223]
[0224] formula In the equation, S represents the expansion structure element, which is a 3×3 matrix;
[0225] The corrosion operation formula is as follows:
[0226]
[0227] formula and formula Used to remove small noise and smooth edges, see Figure 5-Figure 7 .
[0228] Through the above mathematical derivation, it can be verified that the use of local threshold calculation solves the shortcomings of the global threshold method in cases of uneven illumination and complex background; different local threshold calculation methods can be selected according to actual application needs; in addition, the blocking strategy and post-processing technology effectively reduce the computational burden and optimize the segmentation effect.
[0229] (4) Use convolutional neural network combined with attention mechanism for feature extraction
[0230] Use convolutional neural networks to extract features from preprocessed images, and gradually extract high-level features from images through multi-layer convolution and pooling operations;
[0231] The calculation formula of the convolution layer is:
[0232]
[0233] In formula ④, h i represents the output of the nth neuron in the convolutional layer, f represents the activation function, and w ij represents the connection weight, x j represents the input signal, b i represents the bias term;
[0234] Introducing an attention gating unit to dynamically adjust the importance of features at different positions and enhance the model's focus on key features;
[0235] The calculation formula of the attention gate unit is:
[0236] α=δ(ω a ·tanh(ω g ·X)) ⑤
[0237] In formula ⑤, α represents the attention weight, f represents the activation function, and w a and w g is the learning parameter, X is the input feature map;
[0238] Finally, the feature map extracted by CNN is fused with the attention weights calculated by the attention mechanism to obtain the final feature representation; this fusion can be performed through methods such as weighted summation, where the attention weights determine the importance of features at each position, allowing the model to focus on key image features more effectively.
[0239] In practical applications, CNN models combined with attention mechanisms have achieved significant performance improvements in tasks such as image recognition and object detection. By dynamically adjusting feature weights, the model can better adapt to different image scenarios, improving its generalization ability and recognition accuracy.
[0240] The feature extraction method of convolutional neural network combined with attention mechanism has brought new ideas and methods to image processing tasks, effectively improving the performance and effect of the model.
[0241] The image preprocessing of the present invention is high-quality: the image grayscale processing uses the change relationship between RGB and YUV color spaces to express the grayscale value of the image with the brightness value Y, which can highlight the important information of the image, reduce the amount of data, and retain the main features of the image to prepare for subsequent processing; the image sharpening processing adopts the Sobel operator method for sharpening processing, introduces the average factor to smooth the noise through differential processing, makes the image edge clearer, enhances the image detail information, and is conducive to the subsequent extraction and analysis of foam features; the use of Gaussian filtering can effectively reduce the high-frequency components in the image and reduce the noise interference of the image. At the same time, by reasonably controlling the size and standard deviation of the convolution kernel, it can maintain the quality to a certain extent. Preserve the shape and detail information of the image, improve the image quality and readability; Accurate foam recognition: In terms of foam image feature value extraction, by calculating the image gradient amplitude and direction, it overcomes the problem of uneven illumination caused by factors such as time and angle, and can accurately identify edges. Even if a single threshold is set, it is impossible to identify all foams in different bright and dark areas. The system divides the foam image into blocks, and each module automatically sets the optimal threshold according to the pixel information of the image, thereby achieving accurate threshold segmentation of the foreground and background images of the image, improving the accuracy and robustness of foam recognition; The combination of image expansion segmentation algorithm and convex hull algorithm can effectively deal with the repeated presence of concentrate grade foam contour information. The problem of contour defects caused by overlap or brightness difference can be solved to obtain complete and accurate pixel information of concentrate grade foam contour, which provides accurate feature data for further concentrate grade detection; reliable concentrate grade foam counting statistics: the concentrate foam depth-first search algorithm can traverse the processed concentrate grade foam image information pixel by pixel, and comprehensively record the number of pixels occupied by the concentrate foam, so as to accurately count the number of foams and the number of pixels occupied by each concentrate foam, providing accurate data support for subsequent conversion to real size; the scale method uses the conversion relationship between real distance and pixel points to accurately convert the counted number of concentrate grade foam pixels into the corresponding real size, thereby realizing The precise measurement of the size of concentrate grade foam in actual production provides an important basis for concentrate grade control during the production process. A practical concentrate grade prediction model has been developed for pass rate calculation: The threshold setting function allows users to set the pass threshold for concentrate grade foam particle size according to process requirements. This function is highly flexible and adaptable, meeting the needs of concentrate grade testing under different production scenarios and process requirements. The concentrate grade pass rate calculation formula can accurately calculate the pass rate of concentrate grade prediction, providing production managers with an intuitive indicator to help them understand the quality status of concentrate grade in a timely manner, so that they can make timely adjustments and optimizations to the production process to improve production efficiency and product quality.Effective data statistical analysis and management: The statistical analysis module can perform statistical analysis on important data such as concentrate foam identification result images, foam thickness, concentrate foam grade zoning information, and concentrate grade prediction pass rate over a period of time. The module stores the data in a database, allowing users to query historical concentrate grade foam particle size identification statistics in real time by different time dimensions such as "year," "month," and "day." This accumulates a large amount of production data and quality information for the company, helping production managers conduct in-depth analysis and research on the production process, identify potential problems and patterns in the production process, and provide strong data support and decision-making basis for optimizing production processes and improving product quality and production efficiency. Convenient human-computer interaction: The video display unit can display flotation foam video information in real time, allowing operators to intuitively observe the flotation foam status during the production process, promptly identify abnormal situations and take appropriate measures. The threshold input unit allows users to customize the concentration grade foam pass threshold according to actual needs. The operation is simple and convenient, improving the system's usability and user-friendliness.
Claims
1. A concentrate foam image recognition method, characterized in that: Specifically include the following: S1, foam image acquisition; S2, preprocessing the collected foam images; S3. Using a block adaptive threshold segmentation method to distinguish image foreground and background information, and using an image expansion algorithm to obtain the contour information of the foam; using a convex hull algorithm to process the vector information of all concentrate foam contours; 1) Block adaptive threshold segmentation algorithm Each collected foam image is divided into several sub-modules, and each sub-module automatically sets the optimal threshold according to the pixel information of the image to perform threshold segmentation of the foam image into foreground image and background image; 2) Image dilation segmentation algorithm Select the high threshold TH and the low threshold TL; Discard the points smaller than the low threshold TL and mark the points larger than the high threshold TH; The points smaller than the upper threshold TH and larger than the lower threshold TL are determined using connected regions to obtain all identified pixel point information of the concentrate foam contour; 3) Convex Hull Algorithm All the concentrate foam contours after being processed by the image expansion segmentation algorithm are traversed vertex by vertex for each concentrate foam contour, and the adjacent points form vector information.
2. A concentrate foam image recognition method according to claim 1, characterized in that: In the step S2, the collected foam image is preprocessed including image grayscale processing, image sharpening processing, and image median filtering noise reduction processing: 1) Image grayscale processing; According to the relationship between the color spaces of RGB and YUV images, the corresponding relationship between the brightness value Y and the R, G, and B color components is established. The formula is as follows: Y=0.28R+0.55G+0.17B ① In formula ①, brightness Y is used to express the grayscale value of the image, and R, G, and B represent red, green, and blue respectively; 2) Image sharpening Sobel operator is used for sharpening; 3) Image median filtering noise reduction processing A low-pass filter is used to reduce the high-frequency components in the image; Use Gaussian function to perform weighted averaging on image pixels.
3. The method for recognizing concentrate foam images according to claim 1, characterized in that: In step S3, the optimal threshold is as follows: 1) Block adaptive threshold segmentation algorithm, including: a. Let the input image be I, with a size of M×N, and the pixel value of the image be represented as I(x,y), where x and y are the horizontal and vertical coordinates of the image; the image is divided into multiple small blocks, each small block B i,j The size of is w×w, where i and j are the row and column numbers of the small block respectively; The image block formula is as follows: B i,j ={I(x,y):i≤x<i+w,j≤y<j+w} ② In formula ②, B i,j Represents the small block in row i and column j; b. Local threshold calculation; Use the mean method to calculate the small block B i,j The local threshold is as follows: In formula ③, Indicates small block B i,j The local threshold is the average value of all pixel values in the small block; Use the standard deviation method to perform a secondary check to calculate the grayscale mean μ of the small block i,y and standard deviation σ i,j , used to calculate the local threshold The formula is as follows: According to formula ④ and formula ⑤, the local threshold is calculated by the standard deviation and mean. The formula is as follows: In formula ⑥, k represents a constant with a value of 0.5 or 1, which is used to control the sensitivity of the threshold; OTSU is used to select the automatic threshold value. For each small block B i,j , the OTSU method automatically determines the optimal local threshold by calculating the inter-class variance of the grayscale histogram Assume that the grayscale value range of the small block is [0,255][0,255], and its histogram is H i,j (i), where t is the grayscale value; Between-class variance The formula is as follows: In formulas ⑦-⑩, μ1(t) and μ2(t) represent the normalized weights of the two classes with grayscale value t, respectively; μ1(t) and μ2(t) represent the grayscale mean of the two classes, respectively; By maximizing the between-class variance Select the best local threshold c. For each small block B i,j , according to the calculated local threshold T i,j Perform binarization operation, the formula is as follows: formula middle Indicates small block B i,j The binarization result of pixel (x,y) in T i,j It is represented as the local threshold of the small block where the pixel is located; d. All small blocks after local binarization need to be merged into a complete binary image. The merging formula is as follows: formula middle, I bin (x,y) represents the final binary image, Represents the binarization result in the corresponding small block; e. In order to eliminate the block effect and noise caused by blocking, morphological operations are used, including dilation and erosion operations. The dilation operation formula is as follows: formula In the equation, S represents the expansion structure element, which is a 3×3 matrix; The corrosion operation formula is as follows: formula and formula Used to remove small noise and smooth edges.
4. The method for recognizing concentrate foam images according to claim 1, characterized in that: In the step S3, the pixel points are counted by using the concentrate foam depth-first search algorithm; the counting and statistics module of the number of foams in the foam image includes the concentrate foam depth-first search algorithm and the scale method: 1) Concentrate foam depth-first search algorithm The foam image information is traversed pixel by pixel: starting from a starting node, going deep into a branch, then backtracking to the previous node and continuing to explore other branches; Record the number of pixels occupied by the concentrate foam, traverse all pixel information in sequence, and count the number of concentrate foams and the number of pixels occupied by each concentrate foam; 2) Scale method By converting the real distance to the pixel points, the actual size of the pixel points is calculated. Then, the actual size of the concentrate foam is calculated using the number of pixels occupied by the concentrate foam. The area occupied by the concentrate foam is projected onto the flotation cell width in the image, which occupies n1 pixels. The width of the uniform concentrate foam occupies n2 pixels. The scale factor is calculated as follows: formula In , w represents the scale factor.
5. The method for predicting the qualified rate of concentrate grade by using the concentrate foam image recognition method according to claim 1, characterized in that: The method for predicting the qualified rate of concentrate grade includes threshold setting and qualified rate calculation: 1) Threshold setting The user sets the qualified threshold value θ of the concentrate foam particle size; 2) Calculation of pass rate The formula is as follows: formula In, s i represents the size of the i-th identified concentrate foam area, n represents the number of identified concentrate foams, S is the concentrate foam flow area in the image, and Y represents the qualified rate of concentrate grade prediction.
6. The method for predicting the qualified rate of concentrate grade according to claim 5, characterized in that: Statistically analyze the concentrate foam identification result images, concentrate foam zoning information, and concentrate grade prediction pass rate, store the information in the database, and query the historical concentrate foam grade identification statistical results in real time by "year", "month", and "day" through the database.
Citation Information
Patent Citations
Segmentation and extraction method combining dynamic block partitioning threshold value with block searching for insulator
CN106157323A
Infrared weak and small target detection method and device based on local contrast
CN113888428A
Flotation concentrate grade detection method based on multi-parameter feature fusion
CN114383985A
Ore granularity video identification system and method
CN117975340A
Iron ore flotation froth feature extraction method based on deep learning
CN118072035A
Cited By
Wastewater circulation treatment monitoring method and system for sandstone separator
CN121121659A