Abstract
The purpose of this study is the statistical analysis and discrimination of maize seed using a machine vision (MV) approach. The foundation of the digital image dataset holds six maize seed varieties named as Kargal K-9803, Gujjar Khan, Desi White, Pioner 30Y87, Syngenta ST-6142, and Pioner 31R88. The digital image dataset acquired via a digital imaging laboratory. For preprocessing, we crop the image into a size of 600×600 pixels, and convert it into a gray level image format. After that, line and edge detection are performed by using a Prewitt filter, and five non-overlapping areas of interest (AOIs) size of (200×200), and (250×250) are drawn. A total of 56 statistical features, containing texture features, histogram features, and spectral features, is extracted from each AOI. The 11 optimized statistical features have been selected by deploying “Correlation-based Feature Selection” (CFS) with the Greedy algorithm. For the discrimination analysis, four MV classifiers named as “Support Vector Machine” (SVM), “Logistic” (Lg), “Bagging” (B), and “LogitBoost” (LB) have been deployed on optimized statistical features dataset. After analysis, the SVM classifier has shown a promising accuracy of 99.93% on AOIs size (250×250). The obtained accuracy by SVM classifier on six maize seed varieties, namely Kargal K-9803, Gujjar Khan, Desi White, Pioner 30Y87, Syngenta ST-6142, and Pioner 31R88, were 99.9%, 99.8%, 100%, 100%, 99.9%, and 99.8%, respectively.
Introduction
Maize is a tropical herbaceous plant of the Poaceae family, widely cultivated as a cereal for its grains rich in starch, but also as a fodder plant, it is used like a vegetable [1]. The term maize also refers to the maize kernel itself. Maize is native to Mexico and was the staple food of Native Americans before Christopher Columbus arrived in America [2]. It was introduced in Europe in the sixteenth century, it is today the first cereal cultivated in the world, ahead of rice and wheat. Harvesting can begin when the grains are large, still flexible, and release a milky liquid when pierced with a fingernail [1]. Appreciated in all its forms, on the cob, in grains or in popcorn, maize is a cereal rich in nutrients and antioxidants essential to protect the body. Also, it is a source of vitamin B3 which participates in many metabolic reactions. Its high fiber content also helps you stay in shape and promotes good digestive health. However, it is poor in two essential amino acids [3]. Countless forms of maize are cultivated and many approaches have been developed to allow its classification. In the nineteenth century an American botanist, Sturtevant, established a classification into groups, based mainly on the characteristics of the grain [4]. Therefore, seven groups are proposed, such as Zea mays amylacea, corresponding to floury maize, little cultivated, Zea mays everta, popcorn, pearl maize, and others. Nowadays, classification into groups is considered artificial. It was then replaced by multicriteria classifications using many other data including botanical, protein, and DNA characteristics [5]. Various categories have emerged: forms (little used), races, racial complexes, and more recently branches. After analysis, four distinct populations were formed: maize from the Andes (Bolivia, Peru, Ecuador), maize from the tropical plains (Haiti, Cuba, Guatemala, Colombia, Brazil, Venezuela, plains of Mexico), maize from the Mexican mountains, maize from North America, even divided into two large groups: the “Northern flints": maize which was in the North of the current United States and Canada and seems to have migrated to northern Europe, and “Southern teeth”: “Southern dent” maize, a variety developed in the southeastern United States. Robert Bird and Major Goodman [6], recognize fourteen racial complexes, combining morphological characters and statistical data, identified from twenty thousand populations of American maize, such as Southern Popmaize, Chapalote Group, Cuzco Group, and others.
Basically, there are around 50 varieties of maize in the world and they come in different colors, textures, and grain shapes and sizes. White, yellow, and red are the most common types. Most people prefer white and yellow varieties depending on the region. Maize is the fourth most important food grain in Pakistan after wheat, cotton and rice. It is considered an important crop along with cotton, sugar cane, rice, and wheat [7]. It is almost sown 1 million hectares with a production of 3.3 million metric tons of the total maize production, about 60% is used in poultry feed, 25% in industry, and the remaining percentage is used as feed for humans and animals. Due to the use of biofuels and silage, the demand for maize production increases day by day [2]. Agricultural workers in Pakistan are taking advantage of the truly favorable environmental conditions and harvest two successful maize crops per year. There are two maize seasons in one year, namely autumn (subtropical/subtropical genetics) and spring (tropical genetics). Growing maize has proven to be a better and more profitable option for farmers. Using hybrid seeds with better management of inputs into the crop contributes to yield [8].
About 65% of the maize in Pakistan has access to irrigation. The rest is tough under the pitch. Rain conditions 84% of Pakistan’s maize production is concentrated in two main areas divided into several districts: 11 districts in Khyber Pakhtunkhwa / North Punjab and 9 districts in Central Punjab [9]. In Pakistan, maize is grown as a multi-purpose food and forage, usually with resources from poor farmers. Using marginal lands, buy some goods, consume with most of the harvest for the house and farm [10].
The downgrading of the purity of the variety can lead to a loss of yield, and will ultimately reduce the economic benefits for farmers. Therefore, it is crucial to strengthen the purity valuation of maize seeds to ensure quality, illustrating the great importance of grading maize seed varieties before sowing. Many researchers work for quality and purity assessment of maize seed, For instance, Reference [11] proposed breeding of maize seed program. By using the image processing (IP) technique, they proposed to classify maize seed into two classes, diploid and haploid. They extracted five average texture features and deployed support vector machines (SVM) classifiers using a cross-validation 10 approach and obtained 94.25% classification accuracy. Reference [12] described maize seeds discrimination based on HIS. They extracted wavelengths features using hyper-spectral (HS) maize seeds images. Principle component analysis (PCA) integrated SVM deployed for classification and obtained 90% accuracy. Reference [13] classified maize seeds using HS images. They used spectral and texture features for maize seed identification. Machine learning-based linear discriminant analysis (LDA) employed and obtained 99.13% accuracy. Reference [14] proposed an automatic maize seed classification framework based on morphological features using convolutional neural networks (CNNs) and obtain 94.22% overall accuracy. Reference [15] classified silage and common maize seed utilizing HSI with chemometrics. To build a classification model, SVM classifier deployed of spectral features dataset and achieved 98% and 97% accuracy for silage maize seeds and common maize seeds, respectively. Reference [16] proposed machine learning-based maize seed classification by using a digital image dataset. They extracted 55 hybrid features, optimized these features, and selected nine features for the classification process. Multilayer Perceptron (MLP) classifier used to build classification modal and achieved 98.93% accuracy. Reference [17] describes the classification of various varieties of maize through the use of hyperspectral image techniques. The possibility of combining spectral data and texture characteristics was evaluated to get better accuracy for maize seed categorization. Mean and pretreated spectra by DE trends were taken out from AOI of hyperspectral-images in the wavelength zone of 400–1000 nm, and six best spectral-wavelengths were chosen from SPA (subsequent projection algorithm). Meanwhile, 5 variables of textural characteristics were extracting using a gray-matrix-length analysis. The LSSVM (vector machine of least squares support) was created for the classification of different varieties of maize seeds (based on spectral, structure, or fusion data). Vector machine with less square support that used complete pretreated spectral data (91.667%) obtained superior results compared to the complete spectral data (90.741%) and the optimal spectral data (87.037%). Accuracy of 88.889% was achieved with the use of data fusion. That was higher than the results of the spectra used (87.037%) and the plot (85.185%). The operating method improved the accuracy of the classification of maize varieties. It was observed that machine vision systems had already been implemented successfully not only in crop seed image analysis but also for crop disease classification [18, 19] and medical image analysis classification [20–23].
The main goal of this study is to propose a statistical analysis and discrimination of maize seeds varieties using a machine vision approach. This study is based on six procedural steps. Get a digital image dataset using the digital vision laboratory step. Perform a noise removal process adopted for data standardization, in this step crop exact portion of the image where maize seed placed, the resized (600×600) all the images. Perform a pixel intensity-based line and edge detection using the Prewitt filter. Select five non-overlapping area of interest (AOIs). Extract statistical features and adopt a feature selection process for obtaining best statistical features dataset Deploy machine vision-based classifier for obtaining maize seed varieties discrimination result.
Materials and methods
The maize seed was collected from Municipal Department Agriculture Food Supply, Bahawalpur, Pakistan. Foundation of collected dataset holds six varieties of maize seed named as Kargal K-9803, Gujjar Khan, Desi White, Pioner 30Y87, Syngenta ST-6142, and Pioner 31R88. They can be seen in Fig. 1.

Collected maize seeds dataset.
For data standardization, we used maize seeds of equal weight (30 Grams) for each variety. For a digital image, acquisition used a digital vision laboratory step which is briefly described in Fig. 2.

Digital vision laboratory step for maize seed digital image acquisition.
A total of 300 images per each variety were acquired using a digital vision laboratory step, that has the same size (600×600) pixels in height and width. Due to complex laboratory steps, all acquired images free from freckled noise. For preprocessing, all the maize seeds images that are 1800 (6×300) are explored in the LabView image processing tool [24] and converted into gray-level (8bit) format. After that, the Prewitt filter [25] was employed for line and edge detection as shown in Fig. 3.

RGB to GL Line and edge detection conversion of six maize seed varieties image dataset.
The two-phase process will be adopted, for selecting a non-overlapping area of interests (AOI’s). Five AOI’s are generated on each image having pixel dimensions (200×200) and (250×250), respectively. A total of 1500 (5×300) AOI’s has been acquired for each maize seed variety as shown in Fig. 4. In this way, a total of 9000 (6×1500) AOI’s has been acquired form 6 maize seed varieties.

Non-overlapping AOIs on GL line and edge detection based maize seed varieties dataset.
The methodology adopted in this study is now described. Firstly, maize seed digital image dataset preprocessed a line and edge detection approach employed using Prewitt filter [25]. This approach is based on the pixel intensity of all neighboring pixels of an image; if the gray level value in higher the eight then it highlights the area called area of interest (AOIs). The detailed description of the algorithm is given in Algorithm 1.
The proposed framework for the statistical feature’s analysis and discrimination of maize seeds using machine vision are shown in Fig. 5.

Proposed framework for statistical features analysis and discrimination of maize seeds using machine vision.
The Lab View image processing tool [24] is used for the image analysis process and the extraction of statistical features based on texture, histogram, and spectral features. A total of 56 statistical features have been extracted from each AOI, which are clustered as 26 texture features, 18 histogram features, and 12 spectral features. It has been observed the input dataset with large features vector space (FVS) size of 504,000 (9000×56) for maize seed varieties.
Texture feature
The second-order statistical features are also known texture feature, which is based on the GL co-occurrence matrix [25]. Texture features calculated using four dimensions 0°, 45°, 90°, and 135° and distance between pixels. The five average texture features used for this study are named as, entropy (ψ), inertia (τ), correlation (φ), inverse difference (IDE), and energy (ξ). The mathematical foundation of these features described below. First, energy is defined by
Also, the formula of the entropy is the following:
The IDE can be defined as
Finally, the inertia is obtained as
Spectral features based on the frequency domain is useful in texture analysis. Spectral features calculated as a power of different regions (R) also called rings [27]. The generic formula is given as
First-order statistical features are also known as histogram features, calculated by using the intensity of pixel-based on histogram [28]. They select objects on the bases of rows and columns. The first order histogram probability ω (k) is described in Equation 7.
The Skewness can be defined as
Also, the formula of the Energy is the following:
Finally, the Entropy is obtained as
It has been observed that a total of 56 statistical features has been extracted from each AOI with large features vector space (FVS) size of 504,000 (9000×56) for maize seed varieties. On the other hand, feature is not equally worthful and very difficult to deal with large FVS. So, it is mandatory to reduce FVS for this purpose a supervised correlation-based feature selection (CFS) with the Greedy algorithm approach [16] deployed on maize seed statistical dataset. Mathematical formula of CFS is described in below.
Here, HMe F represents the “Heuristic-Merit” of a feature substitute F with the properties of J, while it represents the class relation (J € F) related to the property, and the correlation of the average property. Equations (13) describes how predictions are made in the class feature while showing the denominator of the distinguishing feature. CFS approach employed on maize seed statistical dataset they reduced the FVS, and provided 11 optimized features with FVS size of 99,000 (9000×11) for maize seed varieties. Optimized features described in Table 1.
CFS Based optimized feature dataset for maize seed discrimination
Four machine vision classifiers, named as Support Vector Machine (SVM), Logistic (Lg), Bagging (B), and LogitBoost (LB), have been deployed for statistical features analysis and discrimination of maize seeds. Discriminative analysis of six maize seed varieties was performed by using statistical features dataset with cross validation-10 method. Different testing parameters such as “Kappa Statistics” (KS), “Recall” (R), “True Positive” (TP), “False Positive (FP), “Receiver Operating Characteristic” (ROC), “Mean Absolute Error” (MAE), “Root Mean Squared Error” (RMSE), and “F-Measure” (FM) have been observed. As a first step, for discrimination analysis of maize seed, experiments were performed on AOI’s size (200×200) and it is observed an efficient accuracy of 97.40%, 96.86%, 96.53%, and 94.20% using SVM, Lg, B, and LB, respectively. Thus, the SVM classifier performed better among all the implemented classifiers as shown in Table 2.
Discrimination results of maize seeds using four MV classifiers where AOIs size of (200×200)
Discrimination results of maize seeds using four MV classifiers where AOIs size of (200×200)
The “Confusion Matrix” (CM) of SVM classifier on statistical maize seed dataset using AOIs size 200×200. Diagonal shaded values represent the correctly predict class, other represent wrong predicted class as described in Table 3.
CM showing maize seed discrimination on AOIs size (200×200) using SVM
The separate discrimination results of six maize seeds named as Kargal K-9803, Gujjar Khan, Desi White, Pioner 30Y87, Syngenta ST-6142, and Pioner 31R88 were 97%, 97.8%, 98.8%, 99.5%, 95.3%, and 96%, respectively, as shown in Fig. 6.

SVM based discrimination results of six maize seed varieties on AOI size (200×200).
For obtaining more promising accuracy, the above mention same approach deployed on maize seeds dataset where size of AOIs is 250×250. With this approach, we have observed improvement in discrimination results of 99.93%, 99.26%, 98.20%, and 97.13% using SVM, Lg, B, and LB, respectively, as shown in Table 4.
Discrimination results of maize seeds using four MV classifiers where AOIs size of (250×250)
The “Confusion Matrix” (CM) of SVM classifier on statistical maize seed dataset using AOIs size 250×250 is shown in Table 5.
CM showing maize seed discrimination on AOIs size (250×250) using SVM
The separate discrimination results of six maize seeds, named as Kargal K-9803, Gujjar Khan, Desi White, Pioner 30Y87, Syngenta ST-6142, and Pioner 31R88, were 99.9%, 99.8%, 100%, 100%, 99.9%, and 99.8%, respectively, on AOIs size 250×250 as shown in Fig. 7.

SVM based discrimination results of six maize seed varieties on AOI size (250×250).
Finally, comparative analysis of discrimination results of maize seed varieties using SVM classifier, where size of AOIs is 200×200, 250×250, respectively as shown in Fig. 8.

Comparative analysis of maize seed varieties discrimination using SVM classifier where AOIs Size (200×200) and (250×250).
The proposed method reveals to be better than those described earlier [11–17]. Furthermore, our method is consistent, satisfactory, and best from the existing maize seed discrimination. A comparative analysis of the proposed method with an earlier method was shown in Table 6.
Comparison of proposed methodology with existing methodologies
In this study, statistical analysis performed for the discrimination of six maize seeds varieties using machine vision (MV). The objective is the collection of high-resolution maize digital image dataset, line, and edge detection, extraction of statistical features which are more worthful, and selection of the best MV classifier. The foundation of the digital image dataset holds six maize seed varieties named as Kargal K-9803, Gujjar Khan, Desi White, Pioner 30Y87, Syngenta ST-6142, and Pioner 31R88 acquired using digital imaging laboratory. It has been observed that digital imaging laboratories play a very important role in providing a noise-free image dataset that will open a new horizon to these problems. We also deal with the feature optimization process; a total of 56 statistical features will obtain in the feature extraction process, but the technical difficulties do not allow them to be considered in their totality. So, we deployed the CFS approach with the Greedy algorithm and select 11 optimize features that save a lot of time in the discrimination process. For discrimination analysis, four MV classifiers named as “Support Vector Machine” (SVM), “Logistic” (Lg), “Bagging” (B), and “LogitBoost” (LB) have been deployed on optimized statistical features dataset on AOI size (250×250) and they obtained very promising accuracy of 99.93%, 99.26%, 98.20%, and 97.13%, respectively. It has been observed that SVM performs better than other implemented classifiers. We hope that this study will help the farmer to identify the real maize seed, and thus improving the maize crop yield.
Author contributions
All author contributes equally and all authors have read and agreed to the published version of the manuscript.
Conflicts of interest
The authors declare no conflicts of interest.
Footnotes
Acknowledgments
The authors would like to thanks the eight referees for their careful reading and for their comments, which significantly improved the paper. Additionally, thanks to Dr. Salman Qadri for his motivational support.
