## 3 Proposed methodology
### Feature Extraction  
Under different working conditions, it is challenging to fully represent the local differences in the froth image texture using the current color texture feature description methods. The size feature extraction method only extracts the single-valued features of the froth size while ignoring the overall distribution of the froth size. The deep neural network can more effectively extract the detailed features of flotation froth images. Therefore, the shallow and deep features of mineral flotation froth images are obtained by nonparametric kernel density estimation and a deep neural network, respectively, which enables us to better identify the working conditions of the flotation process. 1.1 Shallow Feature Extraction Based on Nonparametric Kernel Density Estimation CTD Feature Extraction  
The GLCM and texture spectrum are the most common texture description methods, calculated based on gray-level images. It is difficult to accurately describe the texture features of froth using the GLCM method, and the texture spectrum method oriented to the number of texture units does not consider the color information. Therefore, [PERSON] et al. [40] proposed the number of color texture units (CTUs) to describe CTD, which is defined as the PDF of the CTU number. This paper only improves the defined color variables based on the method proposed by [PERSON]. The froth images in the RGB color space are acquired from industrial field collection, while the HSV space can describe color information more closely to human vision. Therefore, the froth images are converted from the RGB color space to the HSV space, and the calculation formulas of H, S and V are as follows:  
\[V=max \tag{9}\]  
\[S=(max-min)/max \tag{10}\]  
\[H=\left\{ \begin{array}{ll}60(G-B)/(max-min)&if\ S\
eq 0\ and\ R=max\\ 120+60(B-R)/(max-min)&if\ S\
eq 0\ and\ G=max\\ 240+60(R-G)/(max-min)&if\ S\
eq 0\ and\ B=max\\ \end{array} \right. \tag{11}\]  
where \(max=max(R,G,B)\), and \(min=min(R,G,B)\). After converting the froth image to the HSV color space, the value of the color component H is mainly distributed between 0 and 90, and the value of the color component V is mainly distributed between 0 and 0.4. Therefore, the unequal interval quantification method is used to divide the three variables H, S and V into 34 (0-33), 10 (0-9) and 7 (0-6), respectively. Then, a new color variable is constructed:  
\[C=6H+5S+2V \tag{12}\]  
where \(C\) is an integer in [0,255]. Images of mineral flotation froths acquired online in the flotation cell are shown in Figure 4a. The CTD of the flotation froth image is obtained by calculating the frequency of the color texture unit number in the mineral flotation froth image, as shown in Figure 4b. It can be observed that the probability density distribution of the color texture unit number in the froth image is non-normal and multimodal. SD Feature Extraction  
It can be seen from the mineral flotation image that the mineral flotation images are almost entirely occupied by froth; the size, shape and grayscale of the froth are not uniform, and there are high bright spots reflected by light at the top of the froth. According to the characteristics of mineral flotation froth images, if the traditional watershed segmentation algorithm is used, over-segmentation or under-segmentation will occur. Therefore, an improved watershed segmentation algorithm is proposed to segment mineral flotation images. Before segmenting the mineral flotation image, the froth image is preprocessed, and the preprocessing flow chart is shown in Figure 5. The image before preprocessing is shown in Figure 5. Some isolated points in the original image are eliminated, and the processed image also becomes smoother after image preprocessing, which is conducive to the accurate segmentation of the flotation froth image. Figure 5 shows the processed image.