Next Article in Journal
Cellular Network Fault Diagnosis Method Based on a Graph Convolutional Neural Network
Previous Article in Journal
Depth-Dependent Control in Vision-Sensor Space for Reconfigurable Parallel Manipulators
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Intelligent Sorting Method of Film in Cotton Combining Hyperspectral Imaging and the AlexNet-PCA Algorithm

College of Mechanical and Automotive Engineering, Liaocheng University, Liaocheng 252000, China
*
Author to whom correspondence should be addressed.
Sensors 2023, 23(16), 7041; https://doi.org/10.3390/s23167041
Submission received: 6 July 2023 / Revised: 2 August 2023 / Accepted: 7 August 2023 / Published: 9 August 2023
(This article belongs to the Topic Applications in Image Analysis and Pattern Recognition)

Abstract

:
Long-staple cotton from Xinjiang is renowned for its exceptional quality. However, it is susceptible to contamination with plastic film during mechanical picking. To address the issue of tricky removal of film in seed cotton, a technique based on hyperspectral images and AlexNet-PCA is proposed to identify the colorless and transparent film of the seed cotton. The method consists of black and white correction of hyperspectral images, dimensionality reduction of hyperspectral data, and training and testing of convolutional neural network (CNN) models. The key technique is to find the optimal way to reduce the dimensionality of the hyperspectral data, thus reducing the computational cost. The biggest innovation of the paper is the combination of CNNs and dimensionality reduction methods to achieve high-precision intelligent recognition of transparent plastic films. Experiments with three dimensionality reduction methods and three CNN architectures are conducted to seek the optimal model for plastic film recognition. The results demonstrate that AlexNet-PCA-12 achieves the highest recognition accuracy and cost performance in dimensionality reduction. In the practical application sorting tests, the method proposed in this paper achieved a 97.02% removal rate of plastic film, which provides a modern theoretical model and effective method for high-precision identification of heteropolymers in seed cotton.

1. Introduction

Cotton plays an irreplaceable part in the livelihood of the general population. Xinjiang is China’s largest major producer of long-staple cotton. However, due to the low rainfall and strong light, drip irrigation under the film is often adopted to boost yield, which is prone to mixing with impurities such as plastic film during mechanical picking. In the spinning and weaving processes, the residual film combined with seed cotton can result in a significant number of flaws, which can impact the strength and coloring effect of the yarn and lead to financial losses for the textile sector [1].
The existing mainstream cotton film removal processes include Mechanical separation, Electrostatic separation, and Optical color separation. Whitelock D. P. et al. investigated major impurity removal equipment in the US cotton industry. A rotating spiked cylinder was utilized to eliminate significant impurities from the seed cotton. These impurities were subsequently gathered in a separate box by means of a grid strip or screen. [2]. Zhang et al. used computational fluid dynamics (CFD) to model the electrostatic separation of mechanical cotton harvesting and residual plastic film by flying the experimental sample into an electric field at different speeds and applying different electric field forces [3]. With the increasing prevalence of machine vision, optical color separation has become a popular method for the intelligent classification of agricultural products. In a study conducted by Li et al., a machine vision system was utilized to gather information on the color, shape, and texture of foreign fibers in cotton. The resulting data were adopted to achieve a classification accuracy of 92.34% through multi-class support vector machine (MSVM) [4].
However, mechanical classification is challenging in the aspect of assuring accuracy and small-size film classification. Electrostatic separation becomes unstable for long-term work because of environmental conditions. Optical color selection relies on color and form characteristics, making it challenging to effectively classify film which is colorless, transparent, or irregularly shaped. Hence, it is imperative to investigate a dependable technique for identifying transparent films in seed cotton.
Hyperspectral imaging combines advanced knowledge from multiple disciplines to achieve a perfect fusion of traditional two-dimensional imaging techniques and spectroscopy. Guo and Ma described the linear relationship between spectra and data by the partial least squares (PLS) method, which could realize the analysis of adulterated rice and the prediction of pork meat fatty acids [5,6]. Zhang, Jiang, et al. employed the support vector machine (SVM) in combination with shortwave infrared hyperspectral techniques for cotton foreign matter classification, which significantly improved the detection rate of plastic films in cotton compared to conventional methods [7,8,9].
The above literature has yielded promising results. However, extracting features from hyperspectral images requires manual intervention and has limitations in feature mining. In addition, manual feature extraction of hyperspectral images requires considerable expertise and has subjectivity in feature mining and selection. Therefore, it is highly significative for hyperspectral image features to probe an automatic feature extraction method.
Deep learning is an advanced technology applied to image processing. It has the capability to automatically detect and analyze complex information, which helps to extract deeper features. The use of hyperspectral data greatly enhances the accuracy and efficiency of image recognition [10,11]. However, it is important to note that hyperspectral data can be affected by elevated latitudes and severe information redundancy issues. To efficiently extract feature information to support the training of deep learning models, data dimensionality reduction is commonly applied to improve the data processing speed [12]. Jia et al. employed a method for dimensionality reduction of hyperspectral images by flexible Gabor-based superpixel-level unsupervised linear discriminant analysis (LDA), which reduced a large amount of flexible Gabor (FG) features and increased the peculiarity of image features [13]. Kang et al. proposed a method based on PCA-EPFs for hyperspectral image (HSI) classification, which used principal component analysis (PCA) to reduce the dimension of the superimposing Edge-preserving features (EPFs). The literature not only represented the EPFs in the mean square sense but also highlighted the divisibility of pixels in EPFs [14]. To reduce the dimension of hyperspectral remote sensing images, Daniela Lupu et al. established an independent component analysis (ICA) method based on a stochastic higher-order Taylor approximation-based algorithm, which could identify local maxima and facilitate minibatching [15]. The previous researchers have utilized LDA, PCA, and ICA techniques for reducing the dimensionality of hyperspectral data. The experimental results have demonstrated excellent outcomes, effectively enhancing the efficiency of image processing.
Convolutional neural network (CNN) is the most frequently employed deep learning model that performs excellent classification effect in feature extraction of hyperspectral data; it can be used to solve the problem of plastic film in seed cotton [16,17]. LeNet, AlexNet, and VGGNet are frequently employed neural network models in CNN which achieve high classification and recognition accuracy with great fusion with hyperspectral images. Hüseyin Fırat et al. proposed a method to effectively classify hyperspectral remote sensing images (HRSIs) based on PCA dimension reduction and LeNet-5 of the 3D-CNN model. The results showed that a 100% recognition and classification effect was obtained in all experimental data [18]. Jiang et al. obtained hyperspectral images of different types of pesticide residues and used the fusion of the AlexNet-CNN deep learning network to detect post-harvest pesticide residues in apples. The test results showed that when the number of training epochs was 10, the detection accuracy was 99.09% [19]. Zhao et al. recorded the waterlogging of cotton after seeding with hyperspectral images. Based on the comparison experiment of GoogLeNet Inception-v3 (GLNI-v3) and VGG-16 conducted by CNN, the classification accuracy of VGG-16 was 97.00% higher than that of GLNI-v3, and the method could provide theoretical support for the evaluation of cotton loss after waterlogging [20]. The aforementioned literature demonstrates that the CNN-based models (LeNet, AlexNet, VGGNet) mentioned above exhibit strong generalization and adaptive capabilities in processing hyperspectral images, resulting in effective application outcomes.
The combination of hyperspectral imaging and CNN techniques is commonly applied to the classification of remote-sensing images. However, there have been few reports of methods to identify the residual film in seed cotton. The academic paper presents a novel approach for removing film in seed cotton, which combines hyperspectral images and deep learning algorithm. The innovations are listed as follows:
(1) The study establishes an optimal method for dimensionality reduction of hyperspectral data, which can reduce redundant hyperspectral characteristic information and reduce the time and cost of subsequent neural network training.
(2) The study integrates hyperspectral imaging technology and deep learning algorithm to obtain the optimal AlexNet-PCA-12 model which can effectively remove the colorless and transparent film in seed cotton in the practical application.
The remainder of the paper is structured as follows. Section 2 describes the hyperspectral sorting system, the theory of dimensionality reduction and CNN. Section 3 illustrates the discussion of the results of dimension reduction and CNN experiments. Conclusions and viewpoints are provided in Section 4.

2. Materials and Methods

2.1. Hyperspectral Sorting System

2.1.1. Experimental Materials

Gaia Sorter-Dual, a full-band hyperspectral Sorter, is used in conjunction with the hyperspectral camera “Image-λ-N25E-SWIR”. A total of 10 kg of machine-picked long-staple cotton from southern Xinjiang and 50 pieces of film of different sizes are picked out by skilled workers.
As shown in Figure 1, the hyperspectral imaging system can obtain the hyperspectral images of seed cotton mixed with the film: the resolution is 384 pixels × 600 pixels, the spectral range is 1000~2500 nm, 288 bands. The hyperspectral camera is positioned directly above the platform, with four halogen lamps symmetrically placed around it. The angle of irradiation of the halogen lamp can be adjusted arbitrarily. All halogen sources are adjusted to the position directly below the camera. The distance regulating mechanism is responsible for controlling the vertical motion of the hyperspectral camera in order to adjust the camera’s image surface. Additionally, the transfer platform can continuously move horizontally to capture continuous one-dimensional images. Since experimental subjects come in different sizes, the electronic control platform allows for vertical movement to create storage space for the subjects. The collected hyperspectral images can be regarded as 230,400 pieces of sample data, including 92,456 seed cotton samples, 63,478 film on cotton samples, 62,897 background samples and 11,569 film on background samples. The specific operation steps are as follows:
(1) The samples are placed on the transfer platform and irradiated uniform light from a halogen lamp. The reflected light is then captured by a hyperspectral camera, which provides one-dimensional spectral information.
(2) The transfer platform moves horizontally to obtain continuous one-dimensional spectral information, which is then transmitted to an industrial computer to generate hyperspectral images containing all the spectral information.

2.1.2. Algorithm Environment

Hardware environment for Intel®Core (TM)i7-6700 CPU by Intel Semiconductor Co., Ltd. in Dalian, China, 16 GB RAM, and NVIDIA GeForce RTX 2080Ti by Taiwan Integrated Circuit Manufacturing Co., Ltd. in Taiwan, China, 11 GB was obtained. Software environment for tensorflow-gpu 2.0.0, spectral 0.22.1, sklearn 0.23.2, matplotib 3.2.2, kears 2.3.1, cuda 10.2.89, cudnn 7.6.5 was used employing the Python 3.6 programming language.

2.1.3. Technical Route

The technical route of the film sorting system is illustrated in Figure 2, where seed cotton mixed with the film is given to the study subject. Firstly, a hyperspectral camera is used to collect 1000–2500 nm hyperspectral images. Secondly, the experimental validation involves nine models, including black and white correction, dimension reduction, and CNN training and testing. The purpose is to determine the best models for hyperspectral data dimension reduction and CNN. The binarization is established to display the recognition outcome of the optimal AlexNet-PCA-12 model, which has an eminent recognition accuracy of 98.07%. Finally, the coordinates of the film are fed into a high-speed spray valve to complete the film removal in the practical application sorting tests.

2.2. Black and White Correction of Hyperspectral Images

The stability of data can be impacted by environmental factors including light intensity and angular variations. In addition, there is a dark current in the camera and noise interference in the acquisition. Therefore, the hyperspectral images need to be corrected, which can remove ambient light interference and most of the noise in the image and effectively improve the classification and recognition accuracy of the subsequent model. The original hyperspectral images can be corrected by [20]
I ref = I r a w I d a r k I w h i t e I d a r k ,
where I r e f represents the corrected image, I r a w is the original image, I w h i t e denotes standard correction image, I d a r k indicates background correction image.

2.3. Dimension Reduction of Hyperspectral Data

Dimension reduction can effectively eliminate noise and irrelevant information while also preventing data redundancy and dimension explosion caused by high-dimensional data during algorithmic processing [21]. At present, the dimension reduction methods of hyperspectral data mainly conclude linear discriminant analysis (LDA), principal component analysis (PCA), independent component analysis (ICA), etc. By extracting and mapping the main feature bands of the original data, these methods can effectively reduce the operating cost of the algorithm while ensuring the recognition accuracy of the algorithm.

2.3.1. Linear Discriminant Analysis

LDA is a linear learning method that employs pattern recognition, machine learning, and other techniques to extract similar features of two objects or events from multiple datasets. These features are then combined to more accurately identify the differences between them [22].
Hyperspectral data contains an LDA multi-classification task, which needs to project the vector x of the D dimension to y of the d (d < D) dimension, and the projection equation can be provided by
y = W T x ,
where W is the projection matrix and the projection direction of each column vector is perovided by w i .
Multi-classification task data sets X can be written as
X = { x 1 ( 1 ) , x 2 ( 2 ) , , x M 1 ( 1 ) , x 1 ( 2 ) , x M N ( N ) } ,
where N represents the number of sample types, i indicates the kind of sample, x j ( i ) denotes the j sample of class i, M i is the number of class i training samples ( i = 1 , 2 , , N ).
The in-class divergence matrix S w is obtained as [22]
S w = i = 1 N j = 1 M i p ( i , j ) ( x j ( i ) μ i ) ( x j ( i ) μ i ) T ,
where μ i presents the mean of training samples of class i, p ( i , j ) is the probability of x j ( i ) .
The overall divergence matrix S t is given by [22]
S t = i = 1 N j = 1 M i p ( i , j ) ( x j ( i ) μ ) ( x j ( i ) μ ) T ,
where μ represents the mean value of all training samples.
Interclass divergence matrix S b [22] is
S b = S t S w = i = 1 N p ( i ) ( μ i μ ) ( μ i μ ) T ,
where p ( i ) denotes the probability of class i.
Then, we obtain the objective function J [22]:
J = W T S b W W T S w W S W 1 S b W = λ W .
The projection matrix W of the d dimension can be obtained by calculating the largest d eigenvalues of S W 1 S b and the corresponding d eigenvectors; d (d < N) is the dimension after dimensionality reduction of hyperspectral data.

2.3.2. Principal Component Analysis

PCA is a dimension reduction algorithm based on the discrete Karhunen–Loeve transform for extracting the main feature components of multivariate data information [23]. Although the majority of the noise in the image can be removed using PCA, it has greater advantages in terms of time complexity.
Data conversion. While reading is performed in the hyperspectral image data, each band data is converted into a one-dimensional vector. The hyperspectral image data are assumed to have a total of N bands with a w × h resolution, which can be represented as a matrix of ( w × h ) × N . Here, the band i can be expressed as
x i = [ x 1 i , x 2 i , , x w × h i ] , ( i = 1 , 2 N ) .
For the eigenspace. The mean vector of all bands is calculated as [24]
x ¯ = 1 N i N x i .
The distance vector between each band and the average band can be obtained as
d i = x i x ¯ .
We set the matrix B as
B = [ d 1 , d 2 , , d N ] .
Then, the covariance matrix can be obtained as follows [24]:
1 N B B T = 1 N i N d i d i T .
The transpose matrix in Formula (12) can be written as
( B B T ) T = B T B .
Since Formula (12) is a high-dimensional vector of ( w × h ) × ( w × h ) , the calculation of eigenvectors of the first Z ( Z N ) large eigenvalues of the covariance matrix is too large, while Formula (13) is a low-dimensional vector of N × N , and therefore its eigenvalue can be calculated first [25]:
v j = B u j λ j 1 2 ,     ( j = 1 , 2 , , Z ) ,
where λ j presents the eigenvalue of Formula (12) and u j is the eigenvector of Formula (13). The eigenspace v j can be formed by the eigenvalues of Formula (13):
W = { v 1 , v 2 , , v Z } .
Projection and similarity detection. The difference vector between each band and the average band is projected into the eigenspace, and the eigenvector i is expressed as
P i = W T d i ,     ( i = 1 , 2 , , N ) .
The Euclidean distance is written as [25]
ε i = P i P k 2 ,     ( i , k = 1 , 2 , N ) .
When using PCA dimension reduction, similarity between images is determined by the Euclidean distance. A smaller Euclidean distance indicates a greater similarity and better results. After this operation, n eigenvector P with minimum Euclidean distance is tested to form a fresh hyperspectral data set, where n < N is the dimension of hyperspectral data after dimensionality reduction.

2.3.3. Independent Component Analysis

ICA is a method to find data intrinsic components from multi-dimensional statistical data which focuses on data analysis from independent sources, decomposing multivariate signals into different non-Gaussian signals [26]. Hyperspectral image data X can be regarded as a two-dimensional matrix with N rows and L columns ( L = w × h ). Hyperspectral data with band n (n < N) can be obtained through ICA to achieve the purpose of dimension reduction.
ICA of X can be expressed as [15]
X = A S = d = 1 N a d s d ,
where N is the number of bands. d denotes band index number ( d = 1 , 2 , , N ), A = ( a 1 , a 2 , , a d , , a N ) presents a mixing matrix, a d = ( a 1 d , a 2 d , , a N d ) T denotes the column vector of A, S = ( s 1 , s 2 , , s d , s N ) T indicates an independent component matrix, s d = ( s d 1 , s d 2 , , a d N ) T is the row vector of S.
We set W = A 1 according to Formula (18) [15]:
S = A 1 X = W X ,
where ( w 1 , w 2 , w d , , w N ) is defined as the transformation matrix W, ( w 1 d , w 2 d , , w N d ) T presents the column vector of W. The independent component S is obtained by finding the appropriate transformation matrix W for the independent statistical and non-Gaussian properties of each component according to the principle of the central limit theorem.
Depending on the choice of the objective function, ICA includes FastICA, Projection pursuit, and Infomax, which mainly extract independent components by increasing non-Gaussian properties, reducing mutual information, and performing maximum likelihood estimation [15]. The FastICA approach which adopts batch processing to incorporate a huge quantity of sample data into the iterative process is utilized to optimize independent components. It also establishes negative entropy as a non-Gaussian measure of random variables. The steps of solving independent components by the FastICA algorithm can be described as follows:
(1) Bleaching data. We set the average value of hyperspectral image data X as X ¯ and perform decentralized processing on the data to obtain
P = X X ¯ .
The covariance matrix for P can be written as [27]
C = cov ( P , P T ) .
The eigenvalue λ and eigenvalue diagonal matrix D are calculated through | λ I C | = 0 where I denotes the unit vector; the eigenvector E can be found by ( λ I C ) E = 0 .
There is a bleaching transformation matrix U = D 2 1 E T , and the data after bleaching are obtained as [27]
Z = U × P .
(2) Finding the matrix W. We let k be the number of iterations, and the iterative computation of w ( k ) can be expressed as [27]
w ( k ) = E { Z G ( w d ( k 1 ) T Z ) } E { Z g ( w d ( k 1 ) T Z ) } × w d ( k 1 ) ,
where G ( t ) = tanh ( t ) = ( e t e t ) / ( e t + e t ) denotes a hyperbolic tangent function, g ( t ) is the first derivative of G ( t ) , E ( ) indicates mean function.
We orthogonalize and standardize the matrix W [27]:
j = 1 d 1 ( w d ( k ) T w j ) w j w d ( k ) w d ( k ) w d ( k ) w d ( k ) .
For any real number ε greater than 0, if | w d ( k ) T w d ( k 1 ) 1 | < ε , the w d converges; otherwise, k = k + 1 takes Formula (23) to continue the iteration. The column vector w d of W can be obtained from Formula (24), and d ( d = 1 , 2 , , N ) is the index number of each band.
When d = N , the matrix W is calculated as follows:
W = ( w 1 , w 2 , w d , , w N ) .
By taking the matrix W into Formula (19), the independent component S can be solved.
(3) Selecting band. The matrix W is defined as ( w 1 , w 2 , w j , , w N ) , the column vector d of W is defined as ( w 1 j , w 2 j , w i j , , w N j ) T ( i , j = 1 , 2 , N ) , where w i j indicates the capacity of the j band containing i independent component information. By calculating the average absolute weight factor, it can assess how much of each band contains independent component information:
w j ¯ = 1 N i = 1 N | w i j | .
The gained n bands with the largest average weight coefficient w j ¯ are formed into a new low-dimensional image to achieve the dimensionality reduction of the hyperspectral image; n (n < N) is the number of bands after the dimensionality reduction of the hyperspectral data.

2.4. Construction of the Convolutional Neural Network

The convolutional neural network mainly concludes with an input layer, convolution layer, pooling layer, fully connected layer, and output layer, which can effectively solve the over-fitting problem [28]. The research illustrates a 2D-CNN-based method for hyperspectral image classification which can reduce the training cost while ensuring high classification and recognition accuracy.
Convolution layer. The convolution layer applies a convolution kernel to transform the input matrix into a unit matrix for the next layer. During forward propagation, the convolution kernel computes the nodes in the right unit matrix by using the nodes in the left input matrix [29]. Multiple convolution kernels are used to convolve with input image data, and a series of feature graphs are obtained through an activation function after biasing [30]. In the paper, the ReLU activation function is utilized to map the input of neurons to the output; its nonlinear characteristics are introduced into the neural network, enabling its application to various nonlinear models. The convolution formula is expressed as follows [29]:
X j l = f ( i M j X i l 1 w i j l + b j l ) ,
where X j l denotes the j element of the l layer, M j stands for j convolution area of the l 1 layer feature map, X i l 1 presents the elements, w i j l is the weight of the corresponding convolutional kernel matrix, b j l is the offset item, f ( ) indicates the activation function, i M j X i l 1 w i j l is the convolution formula.
Pooling layer. If all the features obtained through convolution are inputted into the classifier, a significant amount of computation is required to handle it. In this case, the Pooling function is required to process the feature maps obtained by convolution, and the Max pooling method is utilized in this paper. The pooled element matrix can reduce the dimension of the feature information obtained from the convolution layer and reduce the size of the matrix in the direction of height and width while ensuring the invariance of the feature scale. Meanwhile, the number of parameters of the whole neural network can be reduced, thus improving the generalization ability of the model [31].
Fully connected layer. With multi-layer convolution and pooling processing, images are gradually extracted with higher-level and more abstract feature information, which is classified by fully connected layers [32]. After unrolling the input feature vector into one dimension, the fully connected layer outputs the result via weighted summation and activation functions. The output formula is [29]
y k = f ( w k x k 1 + b k ) ,
where k is the serial number of the network layer, y k is the output, x k 1 represents the expanded one-dimensional eigenvector, w k stands for the weight coefficient, b k is the offset item. f ( ) is a model for probabilistic computation and an activation function suitable for classification tasks, which can be formulated as follows:
y = softmax ( w i j x j + b ) .
The softmax loss function is structured in the fully connected layer to measure the solving accuracy of the problem, and loss function is adopted to describe the degree of dissatisfaction with the classification result. The effect of the neural network model is defined by the loss function. The tinier the loss value, the tinier the deviation between the result obtained by the model and the real value [33].
The purpose of neural network optimization is to accurately and timely update the parameters. Two optimization methods are employed for neural networks in the paper: the first step is the Gradient descent algorithm, and the second is the Back propagation algorithm. The optimization method of Gradient descent is to randomly select a function on the training data during the iteration process, which ensures the rapid update of parameters in each iteration. The back propagation algorithm based on the gradient descent algorithm can not only calculate vector gradients, but also calculate multidimensional tensors [34].
To avoid training overfitting, the Dropout function is used in the fully connected layers to make the output of neurons in the hidden layer drop to zero with a certain percentage probability. Dropout disables some hidden layer nodes that do not participate in the forward propagation process of the CNN. Due to the stochastic nature of the Dropout, each sample input to the network corresponds to a different network structure, but all these structures share weight. Since a neuron cannot depend on additional specific neurons, it reduces the complexity of inter-neuron adaptation and enables them to learn deeper features [35].

2.5. Design of Intelligent Recognition Algorithm for Film in Seed Cotton

In this section, three CNN models based on LeNet, AlexNet, and VGGNet are constructed for hyperspectral image recognition. The CNN schematic is shown in Figure 3. The schematic involves two steps. Firstly, the hyperspectral data are used to train the model and extract useful image features. Secondly, the trained features are applied to the testing set for verification, and the resulting recognition accuracy is outputted. Additionally, the network parameters are regulated through gradient descent and back propagation algorithms, which ascertain network parameters in time.
To achieve optimal recognition results for hyperspectral image recognition, LeNet, AlexNet, and VGGNet models are altered accordingly. The specific parameters for each model are outlined in Table 1, Table 2 and Table 3. For facilitating CNN to input hyperspectral data and output recognition accuracy, CNN is set corresponding to the input layer and output layer, specifically as follows: In the input layer, 5 × 5 indicates the data size of the input convolutional network by manual division and D denotes the data dimension obtained after adopting different dimensionality reduction algorithms. In the output layer, the Softmax loss function outputs the probabilities of four units, which include “cotton”, “film on cotton”, “background”, and “film on background”.

3. Results and Discussion

3.1. Design of Intelligent Recognition Algorithm for Film in Seed Cotton

To verify the generalization of the dimensional reduction, scatter plots are presented in Figure 4. The plots depict the application of different dimensional reduction methods on the same hyperspectral data from the three-dimensional reduction experiments. The scatter plots of dimensionality reduction for different batches of the same data under the same experimental conditions can be concluded as follows:
(1) Considering only the first two samples, LDA data have obvious clustering and separability, but LDA data cannot classify sample “background” accurately.
(2) ICA data classified the four types of samples differently in different batches, so it is not general to data from different batches of dimensionality reduction, and the trained model cannot achieve ideal results on the test.
(3) Considering only the first two samples, PCA dimension reduction has distinct aggregation and separability on “background” and “film on background”, while the data coincidence of the two samples “cotton” and “film on cotton” has no classification.
(4) The result shows that LDA has outstanding classification results with a dimensionality reduction of two for hyperspectral data. However, LDA can only reduce the data to three dimensions. Therefore, when the computer performance is satisfied, PCA obtains higher recognition accuracy when it is used to retain more dimensions.

3.2. CNN Model Training

Comparing three different dimension reduction methods (LDA, PCA, and ICA) after the hyperspectral data to a three-dimensional effect, three different structures are adopted CNN (LeNet, AlexNet, and VGGNet) for training and testing accuracy.
LeNet model training. Variations of training and testing accuracy of LeNet with the number of training epochs, training and testing loss curves are shown in Figure 5.
In Figure 5a, LDA recognition accuracy on the test set is about 92%, and the loss value is 0.15~0.2. In Figure 5b, PCA recognition accuracy on the test set is about 89%, and the loss value is 0.25~0.3. In Figure 5c, ICA recognition accuracy on the test set is about 85%, and the loss value is 0.3~0.35.
Despite the fact that LDA and PCA are relatively stable to changes throughout the training phase, PCA slightly underperforms the LeNet model with LDA hyperspectral data reduction. However, the LeNet model with ICA hyperspectral data reduction has the worst stability of the three.
AlexNet model training. Variations of training and testing accuracy of AlexNet with the number of training epochs, training and testing loss curves are shown in Figure 6.
In Figure 6a, LDA recognition accuracy on the test set is about 93%, and the loss value is 0.15~0.2. In Figure 6b, PCA recognition accuracy on the test set is about 90%, and the loss value is 0.25~0.3. In Figure 6c, ICA recognition accuracy on the test set is about 88%, and the loss value is 0.3~0.35.
Despite the fact that LDA and PCA are relatively stable to changes throughout the training phase, PCA slightly underperforms the AlexNet model with LDA hyperspectral data reduction. However, the AlexNet model with ICA hyperspectral data reduction has the worst stability of the three.
VGGNet model training. Variation of training and testing accuracy of VGGNet with the number of training epochs, training and testing loss curves are shown in Figure 7.
In Figure 7a, LDA recognition accuracy on the test set is about 90%, and the loss value is 0.2~0.25. The LDA model is relatively stable to changes throughout the training process and has excellent model stability.
In Figure 7b, PCA recognition accuracy on the test set is about 84%, and the loss value is about 0.4. In Figure 7c, ICA recognition accuracy on the test set is about 80%, and the loss value fluctuates widely. Both models have minor stability during the training phase. The ICA results are inferior than the VGGNet model with PCA hyperspectral data reduction.

3.3. CNN Model Testing

The confusion matrix for the test samples for the different algorithmic models are illustrated in Table 4, Table 5 and Table 6. It can be seen that 1 is the cotton, 2 represents the film on cotton, 3 indicates the background, and 4 denotes the film on background, the diagonal expresses the probability of correct classification. The experimental data analysis is as follows:
(1) Using LDA and PCA dimensionality reduction hyperspectral data, it can be determined that the three kinds of CNN models have higher recognition accuracy for test samples. However, there are some errors in the classification of film samples on cotton and film samples on background, which is consistent with the conclusion of the scatter plots above.
(2) Since the hyperspectral data for ICA dimension reduction is not the same batch as the data during training, the extracted dimension information is unstable and the recognition effect is confused. Therefore, it cannot be applied to hyperspectral image recognition, which is consistent with the conclusion of the scatter plots above.
The Overall Accuracy (OA) of the test samples is illustrated in Table 7, representing the percentage of all samples that are accurately predicted. The results can be summarized as follows:
(1) When the hyperspectral data are reduced to three dimensions, the average OA of LDA is 91.68%, while PCA has an average OA of 87.08%; on the other hand, ICA has a lower average OA of 40.35%. Based on these results, it can be concluded that LDA demonstrates superior performance in terms of dimensionality reduction.
(2) The data in the table show that the CNN-based AlexNet model can achieve excellent recognition effects when the data are dimensionally reduced.
(3) When the dimension reduction of ICA is 3, it exhibits poor performance in terms of average OA compared to the other two dimensionality reduction methods. However, PCA can retain more dimension information to improve the recognition accuracy, which has more potential in practical applications.
To distinguish the classification effects more intuitively, three bands are selected to display the hyperspectral data as pseudocolor images. Additionally, the spectral toolkit is used in the model tests to plot the predictions in the form of a two-dimensional image. The pseudocolor and manually labeled images are shown in Figure 8.
Considering the actual sorting system only needed to locate the spatial coordinate position of the film, the classification results are combined from four categories into two categories: “film on cotton” and “film on background” are classified as film, and “cotton” and “background” are classified as non-film. The binarized images are shown in Figure 9, Figure 10 and Figure 11. It can be seen that the combination of the AlexNet neural network structure and the LDA algorithm indicate the best recognition results, while the VGGNet neural network structure and the ICA algorithm denote the worst recognition results.
Regarding the reduction to three dimensions, the above experiments validate the classification effect of different dimensionality reduction methods on hyperspectral data. The results show that LDA achieves the highest performance in terms of aggregation and separability of features preserved by dimensionality reduction of hyperspectral data. With limited device conditions for hyperspectral images, it is advisable to opt for LDA dimension reduction. However, due to the limitations of the LDA algorithm, the data can only be reduced to three dimensions. Therefore, when the computer performance meets the requirements, PCA achieves higher recognition accuracy when more dimensions are retained. In summary, the AlexNet-PCA multi-dimensional algorithm is experimented with to obtain the highest recognition accuracy for seed cotton mixed with the film.

3.4. AlexNet-PCA Multi-Dimensional Algorithm Experiment

3.4.1. AlexNet-PCA Model Training

In Figure 12, the accuracy and loss value curves of the AlexNet model are shown when PCA is used to reduce the dimensionality by 6, 9, 12, and 15. The accuracy curve of the test set starts to converge at the training process of up to 40 iterations and mostly peaks at the training process of up to 60 iterations. The variation is stable throughout the training process and the model has great stability.

3.4.2. AlexNet-PCA Model Testing

As shown in Table 8, the experimental data analysis can be summarized as follows:
(1) The AlexNet-PCA algorithm for “cotton” and “background” has a minor number of errors in sample recognition classification. It can be attributed to the edge junction containing the reflection spectrum of both the cotton and the background.
(2) Misclassification is observed when using the AlexNet-PCA algorithm to identify the samples of “cotton” and “film on cotton”, “background” and “film on background”. It can be attributed to the weak reflection nature of the film, which leads to an indistinct discrimination of features.
Especially for the PCA dimension selection, a set of linearly increasing dimensions 3, 6, 9 and 12 is chosen for the AlexNet-PCA multi-dimensional algorithm experiment. The linearly increasing dimensions are conducive to the smooth change in the image curve between overall accuracy and dimension; hence, the experimental results are more intuitive.
The Overall Accuracy (OA) of the test sample is shown in Table 9, representing the percentage of all samples that are accurately predicted. As the number of dimensions retained by PCA increases, the OA of the samples keep increasing. Figure 13 illustrates the OA of the samples as a function of the dimensionality reduction of PCA. The data in Table 9 and Figure 13 show teh following:
(1) The increase in PCA dimensionality has an inverse relationship with the increase in accuracy.
(2) When the PCA dimension is set to 12, the proposed algorithm achieves a recognition accuracy of over 98%. Additionally, the overall classification accuracy of the samples begins to converge.
With the increase in PCA dimensionality reduction, the complexity of the neural network model also increases. However, the complexity of the model can lead to overfitting, which in turn can decrease the generalization ability of the model. In the study, we primarily utilize the Dropout method to avoid the overfitting problem. Dropout effectively weakens the connections between neuronal nodes, which reduces the network’s reliance on individual neurons and thereby enhances model generalization ability.
The binarized images are shown in Figure 14a. As demonstrated in Figure 14b, the morphological method is utilized to perform an open operation on the binary image, which effectively minimizes the noise caused by light, dust, and artificial marks. As a result, the binary image contains the eliminated artifacts of identified small areas and image edges. The Figure 14 results show that:
(1) Despite reducing the dimensionality to six utilizing PCA, the post-processing results still exhibit significant imperfections. However, when the dimension reduction is increased to 12, the post-processed image results successfully meet the requirement of providing coordinates. With a dimension reduction of 15, there is no significant difference between the post-processed image results compared to those obtained with a dimension reduction of 12.
(2) Considering the relationship between speed of accuracy improvement, computer performance, image processing results, dimension reduction, and training cost, PCA with a dimension reduction of 12 is the optimal solution for computer performance.

3.4.3. Practical Application Testing of Model AlexNet-PCA-12

As can be seen from the above, the AlexNet-PCA-12 model with the optimal recognition accuracy is obtained experimentally. To verify the feasibility of the research, an application sorting test of the algorithm is conducted in a cotton factory in Aksu, Xinjiang. As depicted in Figure 15, the computer platform running the algorithm obtains the actual coordinates of the film and inserts them into the industrial control center, which controls the response time of the high-speed spray valve to complete the film removal.
Table 10 shows the data of several sorting experiments: the overall removal rate of film is 97.02%, and the cotton sorting amount can reach 3.0 t/h, which meets the requirements of practical application.

3.5. Summary of Discussions and Results

This chapter focuses on three main tasks: collecting laboratory data, conducting tests on the algorithm, and comparing the visualized recognition results with the experimental results. The recognition effects of LeNet, AlexNet, and VGGNet neural networks combined with LDA, PCA, and ICA dimension reductions are compared and analyzed. Finally, the feasibility of the proposed optimal model is verified for practical applications.

4. Conclusions

Based on hyperspectral images and the deep learning intelligent recognition algorithm, a novel intelligent recognition method for seed cotton mixed with colorless and transparent film is proposed in this paper. The main research topics include the construction of hyperspectral classification systems, dimensionality reduction for hyperspectral data processing, construction of algorithmic recognition models, and the practical application sorting tests.
(1) The basic principles of hyperspectral imaging are studied and a hyperspectral classification system is designed for the intelligent classification of seed cotton mixed with the film. The system can obtain 288 hyperspectral data bands with a resolution of 384 pixels × 600 pixels and a spectral range of 1000~2500 nm, which provides an excellent data basis for the recognition of film in seed cotton.
(2) LDA, PCA, and ICA are utilized to reduce the dimension of hyperspectral data to settle the problems of high latitude, large amounts of data, and redundant information of hyperspectral data. Experimental results suggest that LDA and PCA generalized better than ICA. LDA is the best method when the dimensionality reduction is the same as the that of the three. PCA dimensionality reduction is more advantageous when computer performance is satisfied.
(3) An algorithm is successfully completed for hyperspectral image recognition of film in seed cotton. Based on the convolutional neural network architectures of LeNet, AlexNet, and VGGNet, the network model is constructed for hyperspectral image recognition applications in the seed cotton film domain.
(4) The combination test of the hyperspectral data dimension reduction algorithm (LDA, PCA, ICA) and the CNN model (LeNet, AlexNet, VGGNet) is completed. The experimental results illustrate that when the computer performance is satisfied, AlexNet-PCA-12 can achieve the best cost-to-performance ratio for both recognition and dimensionality reduction, and the recognition accuracy of the algorithm can reach 98.07%; the overall removal rate of film is 97.02% with the data of several sorting experiments in Aksu, Xinjiang.
On the whole, considering the influence of environmental factors such as light, humidity and dust in the practical application sorting tests, data under different environmental variables should be collected to further improve the generalization of the model. However, the research has potential applications in various fields, including but not limited to tea stalks removal, fruit and vegetable flaw separation, and pesticide residue detection in agricultural products. Further research can explore the use of photoelectric separation technology to enhance agricultural development.

Author Contributions

Conceptualization, Y.Z. and Q.L.; methodology, Q.L. and X.Y.; software, Q.L.; validation, Q.L. and X.Y.; formal analysis, Y.Z., Q.L. and X.Y.; investigation, Z.L. and Q.L.; resources, Q.L.; data curation, Q.L.; writing—original draft preparation, Q.L.; writing—review and editing, Q.L., Y.Z. and L.Z.; visualization, Q.L.; supervision, X.Y. and Z.L.; project administration, Z.L.; funding acquisition, L.Z. and Y.Z. All authors have read and agreed to the published version of the manuscript.

Funding

The research is supported by the Key Research and Development Projects of the Xinjiang Uygur Autonomous Region: Research on Key Technologies of Automatic Recognition of Foreign Fibers in Machine-picked Long-Staple Cotton (project number: 2022397193).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Yang, W.; Li, D.; Zhu, L.; Kang, Y.; Li, F. A new approach for image processing in foreign fiber detection. Comput. Electron. Agric. 2009, 2, 68–77. [Google Scholar] [CrossRef]
  2. Whitelock, D.P.; Armijo, C.B.; Gamble, G.R.; Hughs, S.E. Survey of seed-cotton and lint cleaning equipment in US roller gins. Eng. Ginning 2007, 11, 128–140. [Google Scholar]
  3. Zhang, H.; Wang, Q.; Li, Y.; Liu, Y.; Jia, D. Electrostatic separation motion analysis of machine-harvested cotton and residual film based on CFD. J. Comput. Methods Sci. Eng. 2020, 2, 771–783. [Google Scholar] [CrossRef]
  4. Li, D.; Yang, W.; Wang, S. Classification of foreign fibers in cotton lint using machine vision and multi-class support vector machine. Comput. Electron. Agric. 2010, 2, 274–279. [Google Scholar] [CrossRef]
  5. Guo, L.; Yu, Y.; Yu, H.; Tang, Y.; Li, J.; Du, Y.; Chu, Y.; Ma, S.; Ma, Y.; Zeng, X. Rapid quantitative analysis of adulterated rice with partial least squares regression using hyperspectral imaging system. J. Sci. Food Agric. 2019, 2, 5558–5564. [Google Scholar] [CrossRef]
  6. Ma, J.; Sun, D.W. Prediction of monounsaturated and polyunsaturated fatty acids of various processed pork meats using improved hyperspectral imaging technique. Food Chem. 2020, 2, 126695. [Google Scholar] [CrossRef] [PubMed]
  7. Zhang, M.; Li, C.; Yang, F. Classification of foreign matter embedded inside cotton lint using short wave infrared (SWIR) hyperspectral transmittance imaging. Comput. Electron. Agric. 2017, 2, 75–90. [Google Scholar] [CrossRef]
  8. Jiang, Y.; Li, C. mRMR-based feature selection for classification of cotton foreign matter using hyperspectral imaging. Comput. Electron. Agric. 2015, 2, 191–200. [Google Scholar] [CrossRef]
  9. Zhang, R.; Li, C.; Zhang, M.; Rodgers, J. Shortwave infrared hyperspectral reflectance imaging for cotton foreign matter classification. Comput. Electron. Agric. 2016, 2, 260–270. [Google Scholar] [CrossRef]
  10. Zhao, Z.Q.; Zheng, P.; Xu, S.; Wu, X. Object detection with deep learning: A review. IEEE Trans. Neural Netw. Learn. Syst. 2019, 2, 3212–3232. [Google Scholar] [CrossRef] [Green Version]
  11. Voulodimos, A.; Doulamis, N.; Doulamis, A.; Protopapadakis, E. Deep learning for computer vision: A brief review. Comput. Intell. Neurosci. 2018, 2018, 7068349. [Google Scholar] [CrossRef] [PubMed]
  12. Morales, G.; Sheppard, J.W.; Logan, R.D.; Shaw, J.A. Hyperspectral dimensionality reduction based on inter-band redundancy analysis and greedy spectral selection. Remote Sens. 2021, 2, 3649. [Google Scholar] [CrossRef]
  13. Jia, S.; Zhao, Q.; Zhuang, J.; Tang, D.; Long, Y.; Xu, M.; Zhou, J.; Li, Q. Flexible Gabor-based superpixel-level unsupervised LDA for hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2021, 2, 10394–10409. [Google Scholar] [CrossRef]
  14. Kang, X.; Xiang, X.; Li, S.; Benediktsson, J.A. PCA-based edge-preserving features for hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2017, 2, 7140–7151. [Google Scholar] [CrossRef]
  15. Lupu, D.; Necoara, I.; Garrett, J.L.; Johansen, T.A. Stochastic Higher-Order Independent Component Analysis for Hyperspectral Dimensionality Reduction. IEEE Trans. Comput. Imaging 2022, 2, 1184–1194. [Google Scholar] [CrossRef]
  16. Paoletti, M.E.; Haut, J.M.; Plaza, J.; Plaza, A. Deep learning classifiers for hyperspectral imaging: A review. ISPRS J. Photogramm. Remote Sens. 2019, 2, 279–317. [Google Scholar] [CrossRef]
  17. Ni, C.; Li, Z.; Zhang, X.; Zhao, L.; Zhu, T.; Wang, D. Online sorting of the film on cotton based on deep learning and hyperspectral imaging. IEEE Access 2020, 2, 93028–93038. [Google Scholar] [CrossRef]
  18. Fırat, H.; Asker, M.E.; Bayindir, M.İ.; Hanbay, D. Spatial-spectral classification of hyperspectral remote sensing images using 3D CNN based LeNet-5 architecture. Infrared Phys. Technol. 2022, 2, 104470. [Google Scholar] [CrossRef]
  19. Jiang, B.; He, J.; Yang, S.; Fu, H.; Li, T.; Song, H.; He, D. Fusion of machine vision technology and AlexNet-CNNs deep learning network for the detection of postharvest apple pesticide residues. Artif. Intell. Agric. 2019, 2, 1–8. [Google Scholar] [CrossRef]
  20. Zhao, J.; Pan, F.; Li, Z.; Lan, Y.; Lu, L.; Yang, D.; Wen, Y. Detection of cotton waterlogging stress based on hyperspectral images and convolutional neural network. Int. J. Agric. Biol. Eng. 2021, 2, 167–174. [Google Scholar] [CrossRef]
  21. Zebari, R.; Abdulazeez, A.; Zeebaree, D.; Zebari, D.; Saeed, J. A comprehensive review of dimensionality reduction techniques for feature selection and feature extraction. J. Appl. Sci. Technol. Trends 2020, 2, 56–70. [Google Scholar] [CrossRef]
  22. Qin, X.; Wang, S.; Chen, B.; Zhang, K. Robust Fisher Linear Discriminant Analysis with Generalized Correntropic Loss Function. In Proceedings of the 2020 Chinese Automation Congress (CAC), Shanghai, China, 6–8 November 2020; IEEE: Piscataway, NJ, USA, 2020; pp. 7117–7121. [Google Scholar]
  23. Wu, S.X.; Wai, H.T.; Li, L.; Scaglione, A. A review of distributed algorithms for principal component analysis. Proc. IEEE 2018, 2, 1321–1340. [Google Scholar] [CrossRef]
  24. Ye, M.; Ji, C.; Chen, H.; Lu, H.; Qian, Y. Residual deep PCA-based feature extraction for hyperspectral image classification. Neural Comput. Appl. 2020, 2, 14287–14300. [Google Scholar] [CrossRef]
  25. Ghosh, A.; Barman, S. Application of Euclidean distance measurement and principal component analysis for gene identification. Gene 2016, 2, 112–120. [Google Scholar] [CrossRef] [PubMed]
  26. Luo, Z. Independent Vector Analysis: Model, Applications, Challenges. Pattern Recognit. 2023, 138, 109376. [Google Scholar] [CrossRef]
  27. Sajjad, M.; Yusoff, M.Z.; Yahya, N.; Haider, A.S. An efficient VLSI architecture for FastICA by using the algebraic Jacobi method for EVD. IEEE Access 2021, 2, 58287–58305. [Google Scholar] [CrossRef]
  28. Huang, J.T.; Li, J.; Gong, Y. An analysis of convolutional neural networks for speech recognition. In Proceedings of the 2015 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), South Brisbane, Australia, 19–24 April 2015; IEEE: Piscataway, NJ, USA, 2015; pp. 4989–4993. [Google Scholar]
  29. Chen, Z.Q.; Li, C.; Sanchez, R.V. Gearbox fault identification and classification with convolutional neural networks. Shock. Vib. 2015, 2015, 390134. [Google Scholar] [CrossRef] [Green Version]
  30. Ranjbarzadeh, R.; Jafarzadeh, G.S.; Bendechache, M.; Amirabadi, A.; Ab, R.M.N.; Baseri, S.S.; Aghamohammadi, A.; Kooshki, F.M. Lung Infection Segmentation for COVID-19 Pneumonia Based on a Cascade Convolutional Network from CT Images. BioMed Res. Int. 2021, 2021, 5544742. [Google Scholar] [CrossRef] [PubMed]
  31. Sun, M.; Song, Z.; Jiang, X.; Pan, J.; Pang, Y. Learning pooling for convolutional neural network. Neurocomputing 2017, 2, 96–104. [Google Scholar] [CrossRef]
  32. Basha, S.H.S.; Dubey, S.R.; Pulabaigari, V.; Mukherjee, S. Impact of fully connected layers on performance of convolutional neural networks for image classification. Neurocomputing 2020, 2, 112–119. [Google Scholar] [CrossRef] [Green Version]
  33. Janocha, K.; Czarnecki, W.M. On loss functions for deep neural networks in classification. arXiv 2017, arXiv:1702.05659. [Google Scholar] [CrossRef]
  34. Kanezaki, A. Unsupervised image segmentation by backpropagation. In Proceedings of the 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Calgary, AB, Canada, 15–20 April 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 1543–1547. [Google Scholar]
  35. Alzubaidi, L.; Zhang, J.; Humaidi, A.J.; Al-Dujaili, A.; Duan, Y.; Al-Shamma, O.; Santamaría, J.; Fadhel, M.A.; Al-Amidie, M.; Farhan, L. Review of deep learning: Concepts, CNN architectures, challenges, applications, future directions. J. Big Data 2021, 2, 1–74. [Google Scholar]
Figure 1. Hyperspectral imaging system. (1) Hyperspectral camera, (2) Halogen lamp, (3) Electronic control platform, (4) Distance regulating mechanism, (5) Transfer platform, (6) Industrial computer.
Figure 1. Hyperspectral imaging system. (1) Hyperspectral camera, (2) Halogen lamp, (3) Electronic control platform, (4) Distance regulating mechanism, (5) Transfer platform, (6) Industrial computer.
Sensors 23 07041 g001
Figure 2. The technical route of the film sorting system.
Figure 2. The technical route of the film sorting system.
Sensors 23 07041 g002
Figure 3. CNN schematic chart.
Figure 3. CNN schematic chart.
Sensors 23 07041 g003
Figure 4. The scatter plot of three-dimensional reduction experiments.
Figure 4. The scatter plot of three-dimensional reduction experiments.
Sensors 23 07041 g004
Figure 5. Accuracy curve and loss curve of LeNet model.
Figure 5. Accuracy curve and loss curve of LeNet model.
Sensors 23 07041 g005
Figure 6. Accuracy curve and loss curve of AlexNet model.
Figure 6. Accuracy curve and loss curve of AlexNet model.
Sensors 23 07041 g006
Figure 7. Accuracy curve and loss curve of VGGNet model.
Figure 7. Accuracy curve and loss curve of VGGNet model.
Sensors 23 07041 g007
Figure 8. Pseudocolor and manually labeled images.
Figure 8. Pseudocolor and manually labeled images.
Sensors 23 07041 g008
Figure 9. LeNet binarization images.
Figure 9. LeNet binarization images.
Sensors 23 07041 g009
Figure 10. AlexNet binarization images.
Figure 10. AlexNet binarization images.
Sensors 23 07041 g010
Figure 11. VGGNet binarization images.
Figure 11. VGGNet binarization images.
Sensors 23 07041 g011
Figure 12. Accuracy curve and loss curve of AlexNet-PCA-X model.
Figure 12. Accuracy curve and loss curve of AlexNet-PCA-X model.
Sensors 23 07041 g012
Figure 13. Relationship between OA and PCA.
Figure 13. Relationship between OA and PCA.
Sensors 23 07041 g013
Figure 14. AlexNet-PCA-X binarization images.
Figure 14. AlexNet-PCA-X binarization images.
Sensors 23 07041 g014
Figure 15. Hyperspectral sorting experiment.
Figure 15. Hyperspectral sorting experiment.
Sensors 23 07041 g015
Table 1. LeNet structural parameter.
Table 1. LeNet structural parameter.
TypeVariablesKernel ParameterData Output
Input layer5 × 5 × D hyperspectral data set
1-Conv3 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
2-PoolMax poolingSize: 3 × 3. All zero-filling. Step: 2
3-Conv9 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
4-PoolMax poolingSize: 3 × 3. All zero-filling. Step: 2Dropout drops 25% weight
Flatten layerConvert multi-dimensional input into one dimension
FCInput neuron number: 108. Output neuron number: 18
Output layerSoftmax loss function outputs the probabilities of four units.
LeNet structure mainly consists of 2 Convs, 2 Pools, and 1 FC. “Conv” is convolution layer, “Pool” denotes pooling layer, “FC” indicates fully connected layer.
Table 2. AlexNet structural parameter.
Table 2. AlexNet structural parameter.
TypeVariablesKernel ParameterData Output
Input layer5 × 5 × D hyperspectral data set
1-Conv3 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
1-PoolMax poolingSize: 3 × 3. All zero-filling. Step: 2
2-Conv9 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
2-PoolMax poolingSize: 3 × 3. All zero-filling. Step: 2
3-Conv12 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
4-Conv12 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
5-Conv9 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
5-PoolMax poolingSize: 3 × 3. All zero-filling. Step: 2
Flatten layerConvert multi-dimensional input into one dimension
FCInput neuron number: 27. Output neuron number: 60
Output layerDropout drops 50% weight, Softmax loss function outputs the probabilities of four units.
AlexNet structure mainly consists of 3 convolution groups (including 1 Conv and 1 Pool), 2 Convs, and 1 FC. “Conv” is convolution layer, “Pool” denotes pooling layer, “FC” indicates fully connected layer.
Table 3. VGGNet structural parameter.
Table 3. VGGNet structural parameter.
TypeVariablesKernel ParameterData Output
Input layer5 × 5 × D hyperspectral data set
1-Conv3 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
1-Conv3 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
2-PoolMax poolingSize: 2 × 2. All zero-filling. Step: 2Dropout drops 20% weight
3-Conv6 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
3-Conv6 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
4-PoolMax poolingSize: 2 × 2. All zero-filling. Step: 2Dropout drops 20% weight
5-Conv12 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
5-Conv12 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
5-Conv12 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
6-PoolMax poolingSize: 2 × 2. All zero-filling. Step: 2Dropout drops 20% weight
7-Conv24 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
7-Conv24 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
7-Conv24 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
8-PoolMax poolingSize: 2 × 2. All zero-filling. Step: 2Dropout drops 20% weight
9-Conv24 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
9-Conv24 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
9-Conv24 convolution kernelsSize: 3 × 3. All zero-filling. Step: 1ReLU activation function
10-PoolMax poolingSize: 2 × 2. All zero-filling. Step: 2Dropout drops 20% weight
Flatten layerConvert multi-dimensional input into one dimension
FCInput neuron number: 72. Output neuron number: 24
Output layerDropout drops 20% weight, Softmax loss function outputs the probabilities of four units.
VGGNet structure mainly consists of 5 convolution groups (including 2 or 3 Convs), 5 Pools, and 1 FC. “Conv” is convolution layer, “Pool” denotes pooling layer, “FC” indicates fully connected layer.
Table 4. LDA sample confusion matrix (%).
Table 4. LDA sample confusion matrix (%).
Model Predictive1234
Actual
LeNet191.895.722.220.17
24.7893.260.121.83
33.990.0590.495.47
40.090.862.0796.97
AlexNet193.104.602.080.22
25.1792.870.181.77
33.600.0390.036.34
40.000.811.2497.95
VGGNet190.446.842.480.23
24.0695.130.040.77
34.400.0784.5510.98
40.031.900.9597.12
Table 5. PCA sample confusion matrix (%).
Table 5. PCA sample confusion matrix (%).
Model Predictive1234
Actual
LeNet189.138.861.570.44
215.3183.880.080.72
33.830.0891.154.94
40.231.331.8296.63
AlexNet191.806.721.180.30
214.9884.410.080.53
33.970.1087.818.11
40.091.350.1798.39
VGGNet187.958.752.111.19
216.4382.050.081.44
34.110.0272.4023.47
40.400.810.0098.79
Table 6. ICA sample confusion matrix (%).
Table 6. ICA sample confusion matrix (%).
Model Predictive1234
Actual
LeNet175.240.0723.071.62
269.722.8014.2813.20
390.510.758.620.12
474.9023.220.131.75
AlexNet170.055.8716.417.67
232.7832.7215.8418.65
378.950.4019.750.90
465.0824.495.195.25
VGGNet148.6518.6821.2311.44
229.4638.768.6423.14
328.1010.3751.1410.39
418.1058.869.0114.03
Table 7. Overall accuracy of the test samples (%).
Table 7. Overall accuracy of the test samples (%).
LDAPCAICA
LeNet92.1488.6133.41
AlexNet92.4589.0042.78
VGGNet90.4683.6344.86
Average91.6887.0840.35
Table 8. AlexNet-PCA-X sample confusion matrix (%).
Table 8. AlexNet-PCA-X sample confusion matrix (%).
Model Predictive1234
Actual
AlexNet-PCA-6194.534.121.270.08
23.1896.210.110.49
32.300.0194.443.25
40.030.950.2998.73
AlexNet-PCA-9196.881.671.370.07
21.9597.710.050.29
31.060.0397.681.23
40.030.810.4398.73
AlexNet-PCA-12198.041.200.730.04
21.0098.750.020.23
31.550.0497.341.07
40.030.920.4398.62
AlexNet-PCA-15198.380.501.110.01
21.3598.450.040.16
30.960.0198.380.66
40.000.631.2798.10
Table 9. Overall accuracy of AlexNet-PCA-X test samples (%).
Table 9. Overall accuracy of AlexNet-PCA-X test samples (%).
DimensionPCA-3PCA-6PCA-9PCA-12PCA-15
AlexNet89.0095.1797.4298.0798.38
Table 10. Application of test results.
Table 10. Application of test results.
Quantity of TrialsQuantity of Films in CottonQuantity of Removal FilmsRemoval Accuracy
113212896.97%
211210997.32%
3989596.94%
414614297.26%
515715296.82%
610410096.15%
712812597.66%
816816397.02%
9848297.62%
1011310996.46%
Sum1242120597.02%
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Li, Q.; Zhao, L.; Yu, X.; Liu, Z.; Zhang, Y. An Intelligent Sorting Method of Film in Cotton Combining Hyperspectral Imaging and the AlexNet-PCA Algorithm. Sensors 2023, 23, 7041. https://doi.org/10.3390/s23167041

AMA Style

Li Q, Zhao L, Yu X, Liu Z, Zhang Y. An Intelligent Sorting Method of Film in Cotton Combining Hyperspectral Imaging and the AlexNet-PCA Algorithm. Sensors. 2023; 23(16):7041. https://doi.org/10.3390/s23167041

Chicago/Turabian Style

Li, Quang, Ling Zhao, Xin Yu, Zongbin Liu, and Yiqing Zhang. 2023. "An Intelligent Sorting Method of Film in Cotton Combining Hyperspectral Imaging and the AlexNet-PCA Algorithm" Sensors 23, no. 16: 7041. https://doi.org/10.3390/s23167041

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop