# Classification of Mineral Foam Flotation Conditions Based on Multi-Modality Image Fusion
## 2 Methods
### Image Classification Based on CNN-PCA-SVM  
A complete CNN consists of an input layer, convolution layers, pooling layers, full connection layers, and an output layer. The input layer is mainly used for image data reception. The image data is directly transferred to subsequent hidden layers for forward propagation and error back-propagation training. The convolution layer is mainly used for feature extraction of input image data, which will output a feature map of input image data and transfer it to the next hidden layer. The pooling layer is usually used to solve the case of excessive computation and low-computational efficiency of the feature maps. The fully connected layer converts the pooled feature graph into a one-dimensional vector [31].  
PCA is one of the most widely used data dimensionality reduction algorithms. The main idea of PCA is to map n-dimensional features to k-dimensional. By calculating the covariance matrix of the data, the eigenvalues and eigenvectors of the covariance matrix are obtained, and the matrix consisting of eigenvectors corresponding to k features with the largest eigenvalue is selected, thus realizing the dimensionality reduction of feature data [32].  
SVM is a statistical-based machine learning method [33] for non-linear separable problems, where the non-linear problem is transformed into a linear separable problem in a high-dimensional space. The approach used is to introduce a kernel function \(K(x_{i},x_{j})\), which must satisfy the Mercer condition, and the Mercer kernel approximately corresponds to a nonlinear mapping \(\psi:R^{n}\to H\) from the input space to the high-dimensional Hilbert space.  
\[K(x_{i},x_{j})=(\psi(x_{i})\cdot\psi(x_{j})) \tag{11}\]  
Nonlinear mathematical formula of SVM:  
\[\begin{array}{l}W(\alpha)=\sum\limits_{i=1}^{n}\alpha_{i}-\frac{1}{2}\sum \limits_{i,j=1}^{n}\alpha_{i}\alpha_{j}y_{i}y_{j}(\psi(x_{i})\cdot\psi(x_{j})) \\ \\ =\sum\limits_{i=1}^{n}\alpha_{i}-\frac{1}{2}\sum\limits_{i,j=1}^{n}\alpha_{i} \alpha_{j}y_{i}y_{j}K(x_{i},x_{j})\end{array} \tag{12}\]  
The classification function is:  
\[\begin{array}{l}f(x)\\ \\ \\ =\text{sgn}(\sum\limits_{i=1}^{n}\alpha^{*}_{i}y_{i}K(x_{i},x)+b^{*})\end{array} \tag{13}\]  
Figure 5: Schematic of the foam image fusion method.  
In this paper, CNN is used to extract the feature vectors of flotation froth images using a VGG16 network [34] and a Sigmoid activation function. Although a large amount of sample data provides rich information for training, it also increases redundant information, so PCA is used to reduce the feature dimension and extract the key features of the image, which can greatly preserve the data features while reducing the correlation between adjacent pixels of the image. The SoftMax classifier in CNN can only make the output data of the fully connected layer conform to the probability distribution, which cannot improve the classification effect, so the SoftMax classifier of CNN is changed to SVM for classification, and the reduced-dimensional data is used as the input of SVM for image classification. The CNN model for feature extraction is shown in Figure 6. The structure of the CNN-PCA-SVM model is shown in Figure 7. Due to the limitation of the number of datasets, training CNN from scratch does not achieve the desired effect. Using transfer learning can solve this issue [35]. VGG16 is adopted as our starting point, which is pre-trained on ImageNet.