Maize Seed Variety Classification Using the Integration of Spectral and Image Features Combined with Feature Transformation Based on Hyperspectral Imaging

Hyperspectral imaging (HSI) technology has been extensively studied in the classification of seed variety. A novel procedure for the classification of maize seed varieties based on HSI was proposed in this study. The optimal wavelengths for the classification of maize seed varieties were selected using the successive projections algorithm (SPA) to improve the acquiring and processing speed of HSI. Subsequently, spectral and imaging features were extracted from regions of interest of the hyperspectral images. Principle component analysis and multidimensional scaling were then introduced to transform/reduce the classification features for overcoming the risk of dimension disaster caused by the use of a large number of features. Finally, the integrating features were used to develop a least squares–support vector machines (LS–SVM) model. The LS–SVM model, using the integration of spectral and image features combined with feature transformation methods, achieved more than 90% of test accuracy, which was better than the 83.68% obtained by model using the original spectral and image features, and much higher than the 76.18% obtained by the model only using the spectral features. This procedure provides a possible way to apply the multispectral imaging system to classify seed varieties with high accuracy.


Introduction
Maize (Zea mays), also known as corn, is a major source of food, forages, fuel, and industrial materials [1].In recent years, the number of maize seed varieties has considerably increased because of the extensive application of seed hybrid technology.Moreover, in the process of cultivation, harvesting, storage, and transportation, each production procedure may lead to variety mixing, thereby complicating seed classification and decreasing crop yield.Research indicates that a 1% decrease in the purity of maize seeds can decrease maize yield to 9 kg per 667 m 2 [2].Therefore, variety classification or identification before planting is important for maize seeds.
Several traditional methods for maize seed classification have been developed over the past years and vary from each other, such as in morphology method, protein electrophoresis, and DNA molecular marker technology.Most of these methods require professional staff and specialized instruments, and they are often time consuming [3].Although the traditional method is convenient and economic, its accuracy depends on the experience of the inspectors and is influenced by subjective errors.Therefore, the development of rapid, accurate, and nondestructive methods for classifying and identifying maize seeds is important in the seed industry.Accordingly, optical sensing techniques for the one-time measurement of quality parameters have been the focus of domestic and foreign research on the automated evaluation (classification/sorting) of maize seeds [4,5].
Machine vision and conventional spectroscopy techniques are potential tools for the automatic quality evaluation of seeds [4,[6][7][8][9].However, whether machine vision or the conventional spectroscopy technique is used, some seeds may have similar appearances and differentiating them by image alone is difficult because seed cultivars have been increased.Researchers have studied hyperspectral imaging technology, which integrates the features of spectroscopy and machine vision in one system and provides spectral and spatial data simultaneously [10].This technology has been widely evaluated by research groups in the quality assessment of agricultural products and foodstuffs.
Hyperspectral imaging technology can provide the spectral and image features of measured objects, but the spectral features are the most commonly used in seed variety classification because of their easy calculation [11][12][13][14].The model based on spectral features will have the risk of classification accuracy deterioration if there are many seed varieties to be classified, or only a small amount of spectral information of seeds can be used because the need for rapid detection should be met.Therefore, researchers have attempted to extract more classification information from hyperspectral images to improve model performance.Wang et al. [15] used spectral and textural features (i.e., short-run emphasis, long-run emphasis, gray-level non-uniformity, run-length non-uniformity, and run percentage) extracted from six optimal wavelengths to develop the LS-SVM model for classifying the three variety of waxy maize and achieved classification accuracy of 88.89%.Yang et al. [16] reported a 98.2% prediction accuracy in classifying four varieties of maize seed using the combination of spectra, morphologic features (i.e., area, circularity, aspect ratio, roundness, and solidity) and texture features (i.e., energy, contrast, correlation, entropy, and standard deviations) extracted from the 19 optimal wavelengths for germ side.However, only part of the image features was used to classify a small number of varieties in their experiments.When a large number of varieties are to be classified, more classification features should be extracted from hyperspectral images.The extracted features usually contain irrelevant or even useless information because of the lack of effective knowledge to guide feature extraction, thus resulting in a dimension disaster for the classifier.
This study proposed a new procedure implemented for a large number of varieties.The experimental procedure involves the following: (1) selecting wavelengths using the successive projections algorithm (SPA) to improve the speed of hyperspectral acquisition and processing; (2) extracting spectral and image features from the hyperspectral images to achieve a comprehensive extraction of classification information; (3) using two feature transformation/reduction methods to transform/reduce the classification features for overcoming the risk of dimension disaster; (4) and developing the LS-SVM model for the accurate variety classification of maize seed.
For image acquisition, 32 seeds were placed onto a 20 cm × 20 cm black background board in four rows (Figure 2) for easier background segmentation and were automatically moved with a moving stage.When the seeds entered the view slot of the CCD camera, the image was acquired line-by-line constantly at 300 ms exposure time.A total of 812 scanning lines were obtained for each group of seed (32 seeds).After four spectral binning operations, the hyperspectral images were obtained within the spectral range of 400-1000 nm with 2.56 nm interval among contiguous
For image acquisition, 32 seeds were placed onto a 20 cm ˆ20 cm black background board in four rows (Figure 2) for easier background segmentation and were automatically moved with a moving stage.When the seeds entered the view slot of the CCD camera, the image was acquired line-by-line constantly at 300 ms exposure time.A total of 812 scanning lines were obtained for each group of seed (32 seeds).After four spectral binning operations, the hyperspectral images were obtained within the spectral range of 400-1000 nm with 2.56 nm interval among contiguous wavelengths (a total of 233 wavelengths).Thus, a hypercube with a size of 1392 ˆ812 ˆ233 was generated, and the images were saved in a band-interleaved-by-line format.The entire acquisition was conducted in a closed black box to prevent any possible interference with external light sources.
wavelengths (a total of 233 wavelengths).Thus, a hypercube with a size of 1392 × 812 × 233 was generated, and the images were saved in a band-interleaved-by-line format.The entire acquisition was conducted in a closed black box to prevent any possible interference with external light sources.After every four hyperspectral images of seeds were collected, spectral calibration were performed for image correction of the light source variation effect using the following equation [17]: where I is the relative reflectance intensity of each wavelength slice of hyperspectral imaging, O I is the original reflectance intensity of the hyperspectral image, B I is the intensity of the dark current acquired by covering the lens with its cap and turning off the light source, and W I is the reflectance intensity of the standard white panel (i.e., Teflon).Thus, all the corrected images were used in the following analyses.

Image Segmentation and Spectral Feature Extraction
Image preprocessing, segmentation, and feature extraction are illustrated in Figure 2, which shows a series of steps to acquire data and develop the mathematical model.Initially, every image was calibrated with the dark current and white reference image with Equation (1).For extracting classification features for model building and testing, segmentation of the true seed images from the hyperspectral image background is a key step.In this study, adaptive threshold segmentation was selected because of its simplicity and high efficiency [18].Adaptive segmentation and feature extraction were performed for each hypercube as follows.(1) The relative reflectance image at 782.6 nm was selected to identify the regions of interest (ROIs) because of its superior contrast outline in this image.(2) Pre-processing operations, such as image filtering and enhancement, were applied to remove noise on the obtained gray image.(3) Threshold segmentation was then performed to After every four hyperspectral images of seeds were collected, spectral calibration were performed for image correction of the light source variation effect using the following equation [17]: where I is the relative reflectance intensity of each wavelength slice of hyperspectral imaging, I O is the original reflectance intensity of the hyperspectral image, I B is the intensity of the dark current acquired by covering the lens with its cap and turning off the light source, and I W is the reflectance intensity of the standard white panel (i.e., Teflon).Thus, all the corrected images were used in the following analyses.

Image Segmentation and Spectral Feature Extraction
Image preprocessing, segmentation, and feature extraction are illustrated in Figure 2, which shows a series of steps to acquire data and develop the mathematical model.Initially, every image was calibrated with the dark current and white reference image with Equation (1).For extracting classification features for model building and testing, segmentation of the true seed images from the hyperspectral image background is a key step.In this study, adaptive threshold segmentation was selected because of its simplicity and high efficiency [18].Adaptive segmentation and feature extraction were performed for each hypercube as follows.(1) The relative reflectance image at 782.6 nm was selected to identify the regions of interest (ROIs) because of its superior contrast outline in this image.
(2) Pre-processing operations, such as image filtering and enhancement, were applied to remove noise on the obtained gray image.(3) Threshold segmentation was then performed to produce a binary mask.(4) The obtained binary mask was applied to segment the true regions of maize seeds from the 233 wavelengths in the hypercube.(5) The mean spectral features were calculated by averaging the intensity values of all pixels in the ROIs of the 233 wavelengths obtained from each maize seed.

Optimal Wavelength Selection
Each of the extracted spectra consisted of 233 wavelengths and suffered from multicollinearity.Selecting a few important wavelengths for developing more robust classification models and for implementation in a multispectral imaging system for high-speed sorting applications is desirable.SPA is a forward selection method and is proposed for optimal wavelength selection.It can minimize the collinearity among wavelengths and has been used in previous research [19][20][21].SPA was used for optimal wavelength selection in this study.
Several studies [22,23] reported that the number of selected wavelengths would affect the classification accuracy.To determine the best wavelength number for the following analysis, the selected wavelength number from 5 to 15 was changed.Then, the classification accuracies for different numbers of wavelengths were evaluated to determine the final optimal wavelength number.

Image Feature Extraction
Morphologic features were employed for variety classification in pioneer research [24,25].According to these previous study results, five morphologic features of each kernel, including area, circularity, aspect ratio, roundness, and solidity, were extracted from an image of 782.6 nm.
Image texture, defined as a function of the spatial variation in pixel intensities, has been widely applied in the quality evaluation and safety inspection of food and agricultural products.Thus, image texture analyses based on first-order and second-order statistics were also extracted from hyperspectral images under selected wavelengths to improve classification accuracy.The first-order statistics provide information on the gray-level distribution of the image while ignoring the spatial interaction between pixels.The five first-order statistics parameters, namely, energy, entropy, skew, standard deviation, and moment, were extracted in this study.The second-order statistics, namely, contrast, correlation, energy, and homogenous derived from the co-occurrence matrix (GLCM), were calculated from the four directions (0 ˝, 45 ˝, 90 ˝, and 135 ˝) with displacement of d = 1.The average value and the standard deviation for each second-order static (contrast, correlation, energy, and homogenous, respectively), were finally obtained.Therefore, 13 texture features, including 5 first-order statistics and 8 second-order statistics, were extracted from each hyperspectral image, and finally 13 ˆNw (Nw is the wavelength number selected by SPA) texture features and 5 morphologic features were used as the images features in the following analysis.

Feature Integration and Transformation/Reduction
Integrating the spectral and image features for each seed is needed to achieve the accurate classification of maize seed.In this study, the integrating features from each seed were created by connecting the spectral features and image features together in a vector.As the features were greatly different in their scales of value, an autoscaling method was used to overcome the problem of large disparity in values among the features.Autoscaling is essentially a normalization procedure expressed as follows [26]: where Y ij and Y ij denote the j-th rescaled and original features for sample i, respectively, Y j is the mean value of all the samples, and SD j is the corresponding standard deviation.This preprocessing procedure rescales each feature to zero means and unit variance.
After integrating the spectral and image features, the number of features for classification greatly increased.Many classification features provide useful information for the accurate classification of maize seeds, but they also bring the risk of dimension disaster resulting from feature redundancy.Therefore, the two feature transformation/reduction methods, including principle component analysis (PCA) and multidimensional scaling (MDS), were used to overcome the dimension disaster in this study.PCA [27] is a linear dimension transformation/reduction method that aims to convert multiple variables to a small number of integrated variables, namely, the principal component, based on the internal structure of the correlation matrix or the covariance matrix of the original variables.The goals of PCA are to maximize the internal information of the data after transformation/reduction and to measure the importance of the direction by measuring the variance of the data in the direction of the projection.Therefore, PCA is a linear dimension reduction method with the least loss of original data information.MDS [28] is a nonlinear dimensionality reduction method used to maintain the similarity or distance between data points.The purpose of MDS is to transfer a set of dissimilarity data among individualities into space composition through the MDS, thus retaining the relative relationship among the original data.That is, we can visually show the relative relationship among the original data by MDS.
PCA is used mainly to determine the features that can best embody the characteristics of data.Conversely, MDS is more concerned with the relative relation among the original data.

Developing Classification Models Based on LS-SVM
Support vector machine (SVM) is one of most used nonlinear classification algorithms for pattern recognition and machine learning techniques [29].In this study, an improved SVM algorithm, namely, least squares-support vector machine (LS-SVM), was utilized to develop the classification models for maize seeds.The LS-SVM model can be trained efficiently and can yield accurate results because it employs equality constraints in solving a set of linear equations instead of inequality constraints in solving the quadratic programming problem of SVM.Furthermore, the radial basis function [30] was selected as the LS-SVM kernel function.The optimal values of the hyper-parameter and kernel parameters were obtained using gradient optimization combined with 10-fold cross validation.
Prior to the model development, the 96 seeds for each variety were randomly divided into two groups: 75% of the seeds were used for training and the remaining 25% were used for independent test.The performance of the classifier may vary depending on the training and test samples, and thus the above training and test procedures were run 10 times.The average results and their distribution over the 10 runs are reported in the following section.

Characteristics of the Spectral Features of Maize Seeds
Figure 3 shows the mean reflectance spectra for 17 maize seed varieties within the wavelength range of 400-1000 nm.The general trends of the spectral curves are similar.In the wavelength range of 500-700 nm, the average spectral curve shows an upward trend for all of the 17 varieties.Moreover, the average spectral curve becomes flat within the wavelength range of 700-900 nm.A main absorption band observed nearby 1000 nm probably arises from the second overtone of O-H stretching of water interacting with protein [31].The 400-500 nm absorbance of the spectral proves to be proportional to the protein content of the maize seeds [32].Higher reflectance spectra are found in the near infrared region, except for the region of water absorption.These spectral differences are effective measures of the specific characteristics of each variety.Thus, these differences provide a basis for the use of hyperspectral imaging data for seed classification.

Classification Results Using the Integration of Spectral and Image Features Based on the Optimal Wavelengths
Figures 4a and b summarize the performance of models developed using the spectral features and the integration of spectral and image features for 10 random runs.The average training and test accuracies of the model using the spectral features are highly correlated with the number of selected optimal wavelengths, and the average accuracies increase significantly with the increase in the number of selected wavelengths.When the number of selected wavelengths varies between 5 and 15, the average classification accuracies of the model using the spectral features are between 68% and 94% for the training set and between 54% and 78% for the test set.For the model using the integration of the spectral features and image features, the effect of wavelength number on classification accuracy is less than that of the model using the spectral features.The model using the integration of the spectral features and image features achieves above 97% of the average training accuracy and between 75% and 85% of the average test accuracy under different wavelength numbers (varying between 5 and 15).The classification accuracies using the integration of the spectral and image features are always better than those using spectral features alone.This result further proves that the integration of the spectral and image features extracted from hyperspectral images can improve the classification accuracy of seeds reported by Wang et al. [15].Moreover, for the same number of optimal wavelengths, the variation of accuracies of the model using the integration of the spectral and image features is smaller than that of the model using the spectral features in 10 runs.Therefore, the model using the integration of the spectral and image features is more stable than that using the spectral features in the classification accuracy.

Classification Results Using the Integration of Spectral and Image Features Based on the Optimal Wavelengths
Figure 4a,b summarize the performance of models developed using the spectral features and the integration of spectral and image features for 10 random runs.The average training and test accuracies of the model using the spectral features are highly correlated with the number of selected optimal wavelengths, and the average accuracies increase significantly with the increase in the number of selected wavelengths.When the number of selected wavelengths varies between 5 and 15, the average classification accuracies of the model using the spectral features are between 68% and 94% for the training set and between 54% and 78% for the test set.For the model using the integration of the spectral features and image features, the effect of wavelength number on classification accuracy is less than that of the model using the spectral features.The model using the integration of the spectral features and image features achieves above 97% of the average training accuracy and between 75% and 85% of the average test accuracy under different wavelength numbers (varying between 5 and 15).The classification accuracies using the integration of the spectral and image features are always better than those using spectral features alone.This result further proves that the integration of the spectral and image features extracted from hyperspectral images can improve the classification accuracy of seeds reported by Wang et al. [15].Moreover, for the same number of optimal wavelengths, the variation of accuracies of the model using the integration of the spectral and image features is smaller than that of the model using the spectral features in 10 runs.Therefore, the model using the integration of the spectral and image features is more stable than that using the spectral features in the classification accuracy.To consider comprehensively the speed of data acquisition and processing as well as classification accuracy, the number of optimal wavelengths was set to 11 in this study.The optimal wavelengths selected by SPA were not exactly the same for the 10 random runs.However, several wavelengths, such as 550.7, 555.8, 610.0, 640.9, 669.2, and 743.9 nm, or their adjacent wavelengths were repeatedly selected by SPA.The 11 optimal wavelengths selected by SPA for one random run are shown in Figure 5.The most selected wavelengths for maize seed classification were located in the region of 500-750 nm, and they mainly reflected the absorption of starch and oil contained in seed [16].To consider comprehensively the speed of data acquisition and processing as well as classification accuracy, the number of optimal wavelengths was set to 11 in this study.The optimal wavelengths selected by SPA were not exactly the same for the 10 random runs.However, several wavelengths, such as 550.7, 555.8, 610.0, 640.9, 669.2, and 743.9 nm, or their adjacent wavelengths were repeatedly selected by SPA.The 11 optimal wavelengths selected by SPA for one random run are shown in Figure 5.The most selected wavelengths for maize seed classification were located in the region of 500-750 nm, and they mainly reflected the absorption of starch and oil contained in seed [16].

Classification Results Using the Integration of Spectral and Image Features Combined with the Feature Transformation/Reduction Method
After the 11 optimal wavelengths were selected by SPA, a total of 159 features, including 11 spectral, 55 first-order statistics (5 × 11), 88 second-order statistics (8 × 11), and 5 morphologic features, were finally obtained.When these 159 features were used as the input of the LS-SVM, the classifier had the risk of classification accuracy reduction resulting from the dimension disaster caused by feature redundancy and noise contained in the features.Therefore, PCA and MDS were used to achieve feature transformation and eliminate feature redundancy.The 60 principal components obtained by PCA or MDS were employed for developing the LS-SVM classification model.The classification results for the two feature transformation/reduction methods are presented in Table 1.The LS-SVM models using PCA achieved 99.87% and 92.65% average classification accuracies for the training set and test set, respectively, while the LS-SVM model using MDS obtained 99.85% average training accuracy and 92.19% average test accuracy.The test accuracies for both PCA and MDS were significantly better than that of the non-transformed/reduced model with 83.68% although their average training accuracies were almost the same.The non-transformed/reduced model yielded above 90% test accuracy for 4 varieties (Gumang178, Jizaojinxiangnuo, Yudan998, and Zhendan958), between 80% and 90% for 7 varieties (BNA07, Jinnuowang, Jinsaitian, Jingketian195, Lianyu16, Nongda108, and Sida205), and between 70% and 80% for 6 varieties (SNN12, Bositian8, Huayu11, Wannuo11, Xiangtiannianyumi, and Zhongnongdatian413).The model using PCA achieved between 80% and 90% test accuracy for 3 varieties (Bositian8, Jingketian195, and Sida205) and above 90% for the remaining 14 varieties.The model using MDS obtained between 80% and 90% test accuracy for 4 varieties (Bositian8, Jingketian195, Sida205, and Zhongnongdatian413) and above 90% for the other varieties.The model using PCA and MDS significantly improved the classification accuracies for 12 varieties, with improvements of 7.43%-26.09%and 6.09%-27.38%over those of the non-transformed/reduced model.

Classification Results Using the Integration of Spectral and Image Features Combined with the Feature Transformation/Reduction Method
After the 11 optimal wavelengths were selected by SPA, a total of 159 features, including 11 spectral, 55 first-order statistics (5 ˆ11), 88 second-order statistics (8 ˆ11), and 5 morphologic features, were finally obtained.When these 159 features were used as the input of the LS-SVM, the classifier had the risk of classification accuracy reduction resulting from the dimension disaster caused by feature redundancy and noise contained in the features.Therefore, PCA and MDS were used to achieve feature transformation and eliminate feature redundancy.The 60 principal components obtained by PCA or MDS were employed for developing the LS-SVM classification model.The classification results for the two feature transformation/reduction methods are presented in Table 1.The LS-SVM models using PCA achieved 99.87% and 92.65% average classification accuracies for the training set and test set, respectively, while the LS-SVM model using MDS obtained 99.85% average training accuracy and 92.19% average test accuracy.The test accuracies for both PCA and MDS were significantly better than that of the non-transformed/reduced model with 83.68% although their average training accuracies were almost the same.The non-transformed/reduced model yielded above 90% test accuracy for 4 varieties (Gumang178, Jizaojinxiangnuo, Yudan998, and Zhendan958), between 80% and 90% for 7 varieties (BNA07, Jinnuowang, Jinsaitian, Jingketian195, Lianyu16, Nongda108, and Sida205), and between 70% and 80% for 6 varieties (SNN12, Bositian8, Huayu11, Wannuo11, Xiangtiannianyumi, and Zhongnongdatian413).The model using PCA achieved between 80% and 90% test accuracy for 3 varieties (Bositian8, Jingketian195, and Sida205) and above 90% for the remaining 14 varieties.The model using MDS obtained between 80% and 90% test accuracy for 4 varieties (Bositian8, Jingketian195, Sida205, and Zhongnongdatian413) and above 90% for the other varieties.The model using PCA and MDS significantly improved the classification accuracies for 12 varieties, with improvements of 7.43%-26.09%and 6.09%-27.38%over those of the non-transformed/reduced model.Table 1.The classification results using integration of the spectral and image features extracted from the 11 optimal wavebands combined with principle component analysis (PCA) and multidimensional scaling (MDS).

Variety
The

Conclusions
In this study, the classification model using the integration of spectral and image features combined with feature transformation/reduction was employed for maize seed classification based on hyperspectral imaging.The classification results showed that the integration of the spectral and image features combined with feature transformation/reduction can provide much useful information for seed classification and reduce the occurrence of a dimension disaster.The LS-SVM model using the integration of spectral and image features extracted from 11 optimal wavelengths selected by SPA combined with feature transformation/reduction achieved more than 92% classification results for the test set.This percentage was significantly better than the 83.68% obtained when using the integration of spectral and image features alone.This procedure provides a possible way to apply the multispectral imaging system to classify seeds varieties with high accuracy.

Figure 2 .
Figure 2. Image segmentation procedure and feature extraction.(a) representative spectral hypercube with 233 band images of maize seeds within the wavelength region of 400-1000 nm; (b) raw hyperspectral image at 782.6 nm used for segmentation of the maize seeds; (c) image after filtering and enhancement; (d) image after threshold segmentation; (e) the obtained mask is applied to segment the true regions of maize seeds from the 233 wavebands in the hypercube; and (f) extraction of the average reflectance spectra from region of interest (ROI) images.

Figure 2 .
Figure 2. Image segmentation procedure and feature extraction.(a) representative spectral hypercube with 233 band images of maize seeds within the wavelength region of 400-1000 nm; (b) raw hyperspectral image at 782.6 nm used for segmentation of the maize seeds; (c) image after filtering and enhancement; (d) image after threshold segmentation; (e) the obtained mask is applied to segment the true regions of maize seeds from the 233 wavebands in the hypercube; and (f) extraction of the average reflectance spectra from region of interest (ROI) images.

Figure 3 .
Figure 3. Mean reflectance spectra for the 17 varieties of maize seeds within the wavelength range of 400-1000 nm.

Figure 3 .
Figure 3. Mean reflectance spectra for the 17 varieties of maize seeds within the wavelength range of 400-1000 nm.

Figure 4 .
Figure 4. (a) The training accuracies of model developed only using the spectral feature and model developed using integration of the spectral and image features; (b) The test accuracies of model developed only using the spectral feature and model developed using the integration of the spectral and image features.

Figure 4 .
Figure 4. (a) The training accuracies of model developed only using the spectral feature and model developed using integration of the spectral and image features; (b) The test accuracies of model developed only using the spectral feature and model developed using the integration of the spectral and image features.

Figure 5 .
Figure 5.The 11 optimal wavebands selected by the successive projections algorithm (SPA) for one random run.

Figure 5 .
Figure 5.The 11 optimal wavebands selected by the successive projections algorithm (SPA) for one random run.