Feature Fusion Based Orange and Banana Fruit Quality Analysis with Textural Image Processing

A nondestructive approach for fruit quality assessment is outlined. Fruit Quality is determined by external and internal features. Only external features won’t help to determine the overall quality of a fruit. Color images and x-ray image of Orange and Banana fruit are captured. With Image processing tool features like Color histogram, color moments and Gabor filter are extracted for external as well as internal quality assessment. Total 18 color features and 27 textural features are extracted for analysis. Sample color images and x-ray image of Orange and Banana fruit are trained and tested. Fusion algorithm is developed to detect the fruit class. Fruits are divided into three classes’ viz. 50% defected, 90% defected and Normal class. SVM and ANN classifier are elected to determine the fruit quality. This information is used to determine degradation level of a fruit. The experimental result showed that % accuracy with SVM classifier is more than ANN classifier.


Introduction
The quality level of various items such as milk, fruit, vegetables, bread, etc., is observed and inspected via shape, color, texture, hardness and smell. This approach is not reliable and the decision is dependent on the observatory expertise and the mode of sample presentation. In the fruit/vegetable quality analysis, this is typical, as the vendor in most cases present the item in a well packed environment. It gets very difficult in such scenario to exactly detect the quality level of the fruit/vegetable items. This assessment in production side has a greater impact in defining the cost of the product and its durability in terms of usage. Hence, it is a primal need for fruit/vegetable to evaluate the quality externally and internally, both with consumer perspective and production perspective. With the objective of quality analysis, different approaches were made in past.
SVM classifier is applied for Guava grading which gives accuracy of 97.61% and for Mango grading ANN classifier is used which gives accuracy of 95.65%.Featurs are extracted using genetic algorithm to differentiate between various qualities classes of fruits in [1].The fruit based tomato grading system uses feature fusion method with color and texture features. PCA is used to reduce the feature vector obtained after fusion. SVM classifies tomato images into two grades i.e. infected or uninfected. This system achieves 92% accuracy as stated in [2].System proposed for categorizing apples with respect to their diseases. In this clustering technique detects the infected part of fruit and segments it. While color and textural features are extracted and using multiple SVM apples are categorized. Fused combination of GCH(color feature) and LBP(texture feature) gives best average accuracy of 90.80% defined in [3].Fruits like apple, avocado, banana, cherry, grapes and lemon are classified using SVM. To categorize color shape and textural features are considered. These features are clubbed into a single feature fusion. System gives accuracy of 98% to 100 % using color and shape features. While it gives accuracy of 100 % if color shape and textural features are considered explained in [4].Orange fruit quality assessment uses SVM classification to detect the defective and non-defective part The GLCM algorithm is used for feature extraction along with threshold based segmentation is achieved in [5], [6].While system implements a SVM to classify defected and non-defected Indian Mangoes. K Mean Clustering and FCM algorithm are used to detect a surface defect with 92 % classification accuracy in [7]. Multi feature fusion algorithm and SVM classification algorithm are used to recognize variety of fruit and vegetable images. Classification accuracy is different for each one. Average accuracy rate with feature fusion is 97.41% achieved in [8].Machine vision system is used to sort and grade the fruits SVM classifier performs better than other classifiers in review paper [9].The orange surface sorting system classifies oranges into normal and defective category by extracting color and textural features. Genetic algorithm is used to identify the required features for classification. The neural network classifier categorizes orange surface with 94.3% accuracy stated in [10]. While study about different extraction methods and machine learning algorithms like KNN, ANN, SV and CNN showed in review paper [11]. The system takes a two dimensional image of fruit and grades the quality of it. This is done by extracting color and shape analysis methods combined with Artificial Neural Network (ANN) in article [12]. Pomegranate Quality Assessment system first capture the image of fruit using a custom made system. Spatial domain features set and wavelet feature set are then extracted from the image. ANN and SVM both are applied separately using both feature sets. Result shows that system accuracy is 76.48% with SVM and spatial feature set, 80% accuracy with SVM and wavelet features, 81.79% accuracy using ANN and spatial feature set and 92.65% accuracy with ANN and wavelet feature set. Thus ANN performs better as compared to SVM by 12.65% determined in [13]. For tomato gradation RBF-SVM classifier is implemented with 97.09% accuracy. It categorizes tomato into healthy and defective one in [14]. The system grades mozambi and oranges depending on color and textural features. Histogram based thresholding technique is used to segment the image which identifies whether the portion of image is defective or not. Sum of squared distance between textural features of training and testing fruit is calculated and accordingly fruit is graded. This method gives more than 93% accuracy defined in [15]. The fruit recognition system identifies fifteen varieties of fruits based on intensity, color, shape and texture. The system uses fusion of color and textural features. The minimum distance classifier is applied to classify the fruits. The fusion achieves 86% accuracy explained in [16]. The automatic identification of orange varieties system, classifies oranges into three categories. Three classifiers are applied viz. hybrid artificial neural network-artificial bee colony (ANN-ABC), hybrid artificial neural network-Harmony Search (ANN-HS) and K-nearest neighbours. The result show 96.70%, 94.28% and 70.9% accuracy respectively in [17]. Different Classification techniques used for fruit grading and sorting system are studied. Techniques like fuzzy logic, ANN, Adaptive neural fuzzy interference systems and SVM are studied out of which SVM gives highest accuracy stated in [18]. Various methods for feature extraction and classification technique used in fruit grading system are studied. These techniques include linear discriminant classifier, nearest neighbour classifier, SVM, ANN and rule based system. Classification accuracy lies in between 75% to 96%. Combination of SVM and ANN technique gives more accuracy as explained in [19]. Various NDTs such as impact test, electronic nose, time resolved reflectance spectrometry, near infrared spectroscopy, NMR, X-ray, ultrasonic, acoustic impulse response method and electrical conductivity methods are studied for fruit gradation and defect detection explained in [20]. The methods include machine vision system, spectroscopy detection techniques, hyper spectral imaging and acoustic technique and applications of various non-destructive methods for food quality inspection are discussed in [21]. Non-destructive methods to measure quality of fruits or vegetables depending upon their features like color, shape, size and texture. The methods are optical, mechanical techniques, x-ray radiography and tomography, MRI, Mass spectrometry, gas sensors, electronic noises and chemometrics are discussed in review paper [22], [23]. Again review paper involved a fruit quality inspection system having pre-processing, segmentation, feature extraction and classification. Classification can be done using various classifiers. The paper states about the comparison between different classification techniques and their accuracy for quality analysis of fruits and vegetables in [24]. A paper proposes a framework to grade quality and detect defects in fruits and vegetables. This gives comparison between various features such as color, texture, shape and size etc. Similarly comparative study of machine learning algorithms is also done on the same dataset. Amongst all the machine learning algorithms SVM gives the better accuracy in [25]. The system performs grading of apples based on four featuresthe average diameter of maximum cross section, circularity, red area ratio and defects. The classification is done by using weighted K mean clustering algorithm. The system gives 93.3% accuracy is defined in [26].
Different quality analysis systems for fruits and vegetables are studied and presented as mentioned above. The systems are studied mainly for classification, gradation, sorting, quality assessment, disease detection of fruits and vegetables. The experiments are carried on fruits like apple, guava, orange, cherry, grape, avocado, banana, tomato, pomegranate and more. The various imaging methods are used for fruit quality inspection. They define overall accuracy. For this, comparison of different classification techniques and their % accuracy is presented. Different Feature extraction methods and machine learning algorithm like KNN, ANN, SV, and CNN are used. Many Feature extraction and classification techniques are presented like genetic algorithm, feature fusion PCA, color and texture, GLCM algorithm, K-mean clustering FCM, fusion algorithm, machine vision system, spatial features and wavelet features.
Most of the study and experimentation is performed with SVM and ANN classifier. The overall accuracy is achieved above 90%. Combination of ANN and SVM gives more accuracy. Maximum 97.61% accuracy is achieved for grading and classification of guava. In all major study is for gradation and classification of fruits and vegetables. Very few experiments are carried out for overall quality analysis of fruits.
The objective of this study is to present a reliable and more accurate analysis and decision system both external and internal fruit quality analysis. In this paper, color and X ray images of banana and orange fruits are sampled. For an Image pre-processing is done. The system consists of two parts, training and testing phase. The dataset is prepared for the analysis. In training phase segmentation of all images data set is done using watershed algorithm. Feature extraction is done with statistical and textural features. For external and internal quality analysis, features fusion is carried out. In testing phase of sample fruit, the steps followed are pre-processing, segmentation and, feature extraction. After these steps test feature vector is determined. SVM classifier and ANN classifier technique is implemented which analyses the feature vector by taking into account feature database. Both the classifier gives overall fruit quality. Fruits are classified into three different classes like 50 % defective, 90% defective and normal fruit. Total dataset is divided in 70 % and 30 % for training and testing phase. Confusion matrix gives class accuracy. SVM classifier gives 100 % accuracy for both fruits. ANN gives 88 % accuracy for banana and 92 % accuracy for orange.

The Proposed System
The proposed system flow diagram is as shown in figure 1. The total system is divided into two parts. Training Phase and Testing Phase. Before going to the training phase data set is created for fruit banana and orange. Color and X ray images are captured. For color images Samsung A-9 mobile camera is used and for the same fruits X ray images are captured keeping minimum intensity level after few experimentation. In the X ray tray maximum 10 fruit objects can be accommodated. This dataset is prepared for 350 fruit images. It is then classified into three classes. By expert opinion, vision and observation data set is categorized into 50 %, 90 % defective and 100 % normal fruit. Out of this dataset 70 % fruits are used for training purpose and 30 % fruit images used for testing purpose. Tray images are preprocessed and then segmented using watershed algorithm. Features data base is created and features like color moments, gabor filter and HSV are extracted.
In testing phase color as well as X ray test image is selected from the respective dataset. That image is pre-processed. Features are extracted. For the selected test color image of a fruit, respective X ray image is also selected. Fusion is performed. After feature fusion, feature database is created. Then SVM classifier and ANN classifier is applied to know the fruit class.

Database creation
Fruits are bought from local market in Sangli city. While buying with expert fruit seller's vision observation fruits are selected. These fruits are categorized in three different class. 50 % defective, 90% defective and normal. Fruit color images are captured with the help of Samsung A-9 mobile camera. Nomencleature coding is done for the fruits. Different folders are prepared for three classes.  Figure 2 shows sample tray image for color as well as X ray image of banana and orange fruit. Maximum 10 to 12 fruits are arranged in a tray depends on size and shape.

Figure 2.
Color and X ray sample a tray image for banana and orange fruit respectively.
For same fruits data set color images as well as X ray images are captured. Complete database of nearly 350 images is created. These images are divided into two sections as 70% and 30 %. 70% fruit data set is used for training purpose and 30 % for testing. Database creation flow is shown in figure 3. Image is pre-processed and converted into grey scale image. Each tray image is segmented using watershed algorithm. Figure 4 shows Orange fruit segmented image sample.

Training Phase
In this phase color image of fruit is taken from fruit dataset for training purpose. This image is preprocessed. And features are extracted. Color moments, gabor filter and HSV features are extracted. Similarly respective X ray image of a fruit is taken from database. Same process of pre-processing is done on X ray image and features are extracted. Features fusion algorithm is developed.

Result
Fruit image from testing set is selected. The algorithm will access the respective x ray image of the fruit. The color images and X ray images are given to SVM classifier. It gives % degradation of fruit with external and internal features. Dominant features algorithm is developed. As per the dominant features quality of fruit is evaluated. Figure 6a and 6b shows confusion metrics for Banana and Orange. In this for three different classes, class accuracy is 100%. With SVM classifier 100% accuracy is received. Figure 7a and 7b shows confusion matrix with ANN classifier for banana and orange. The overall class accuracy is 90% for banana and for orange accuracy is 94.1%.So if we compare class accuracy of both classifier then SVM gives more accuracy than ANN classifier.

Conclusion
With this algorithm we can detect fruit quality and classify fruit degradation level. Same algorithm can be applied to similar fruits. Only color image or only x ray image can't give exact knowledge about fruit quality. But the fusion of these images classify the fruit into respective class.

Future Scope
Technique to capture the internal images of fruits is to be developed other than X ray. The method of capturing images should be economical and easy to work with. X ray imaging technique have some limitations. Once the images are captured one can develop a technique to detect defects in a fruit by using image processing tool box. Using SVM classifier 100 % accuracy is achievable.