Optimized deep learning model for mango grading: Hybridizing lion plus ﬁreﬂy algorithm

This paper intends to present an automated mango grading system under four stages (1) pre-processing, (2) feature extraction, (3) optimal feature selection and (4) classiﬁcation. Initially, the input image is subjected to the pre-processing phase, where the reading, sizing, noise removal and segmentation process happens. Subsequently, the features are extracted from the pre-processed image. To make the system more effective, from the extracted features, the optimal features are selected using a new hybrid optimization algorithm termed the lion assisted ﬁreﬂy algorithm (LA-FF), which is the combination of LA and FF, respectively. Then, the optimal features are given for the classiﬁcation process, where the optimized deep convolutional neural network (CNN) is deployed. As a major contribution, the conﬁguration of CNN is ﬁne-tuned via selecting the optimal count of convolutional layers. This obviously enhances the classiﬁcation accuracy in grading system. For ﬁne-tuning the convolutional layers in the deep CNN, the LA-FF algorithm is used so that the classiﬁer is optimized. The grading is evaluated on the basis of healthydiseased, ripe-unripe and bigmediumvery big cases with respect to type I and type II measures and the performance of the proposed grading model is compared over the other state-of-the-art models.

The fruit size is considered as the major core quality parameter to export that satisfies the particular needs of further packaging demands, processing, and to satisfy consumer preferences. The sorting process [11] consists of three stages such as parameter detection, classification and analysis. The Classified sizing models [12][13][14][15] is divided on the basis of two models named the mass sizing model and the dimensional sizing model. Quality of the fruits are analysed at all level in the supply chain to find the fruit quality loss at every stage [16,17]. Generally, the dimensional sizing model is on the basis of length, diameter, circumference, volume, and projected area. The categorization of the mass sizing model is made as direct and indirect models. An electronic or mechanical weight sizer, like an electronic balance, is used in the direct mass sizing model, while the indirect mass sizing model is comprised of the computation of fruit mass on the basis of dimensional calculation by any of the approaches.
Various methods are used for grading the mango based on colour, size and skin features in the literature. They are non-destructive near-infrared spectroscopy based on multiple linear regression and partial least square regression model; Infrared camera that are utilized with Fourier based shape separation model; Fuzzy system [18]; Dominant density methods for disease and maturity prediction and area calculation for size; and further by using the machine learning methods like ANN, support vector machine and so on. These individual models were resulted in higher accuracy on mango grading, though these conventional works do not yet match with the needs on fruit grading. Hence the need for the introduction of a more efficient technique or model is a requirement in the near future. To overcome the slow convergence and high probability of being trapped in local optima LL-FF is proposed. Also, this algorithm is used in various applications like WSN, VANET and clustering [19]. Optimized Deep CNN is designed to automatically and adaptively learn spatial hierarchies of features through back propagation by multiple building blocks such as convolution layers, pooling layers, and fully connected layers. The shape, colour and texture of the mangoes are taken as feature parameters for grading them into healthy-diseased, ripe-unripe and big-medium-very big cases.
The literature has been reported with high-efficiency models by either selecting optimal features (which can also be sometimes referred to as dimensionality reduction while handling homogenous features) or tuning classifiers or designing classifiers. However, it requires a concurrent selection of optimal features and classifier design. While the literature lags in reporting such parallel consideration of features and classifier design, this paper has one among the few that tunes both the features list and the classifier parameters. As a result, the selected features can cope well with the classifier's learning ability to enhance the labelling of testing (unknown) data. Succinctly, the major contribution of the proposed grading model is as follows: • The proposed system model concentrates on the "maximization of grading accuracy" through the selection of optimal features from the image. • An optimized CNN is proposed, where the configuration setup is fine-tuned by selecting the optimal count of convolutional layers. • Proposes a solution encoding process to consider both the feature selection and the classifier tuning concurrently with a limited scale of solution variables. • To solve the above-mentioned optimization issues, a hybrid optimization algorithm termed the lion assisted firefly algorithm (LA-FF) is introduced.
The composition of this paper is explicated as follows: Section 2 explains the literature review on the papers related to the mango grading system. Section 3 defines the short description on the proposed mango grading system. Section 4 delineates the proposed feature extraction strategy and classification. Section 5 discusses the proposed hybrid algorithm for solving the defined optimization problem. Section 6 signifies the results and their discussions and finally ends the paper in Section 7.

Related works
In 2019, Utai et al. [20] have presented advanced algorithms that transform the mango cultivar images "Nam Dokmai" for simplifying succeeding object recognition tasks, and for extracting the features such as width, length, area and thickness. These parameters were further given as the inputs in the ANN method to compute the mass of the fruit. For this purpose, seven diverse techniques were introduced for gaining the dimension of fruit and also for computing the mass of fruit. From the performance of diverse image processing techniques, it was obtained that the entire treatments offered reasonable outcome with the greatest efficiency coefficient as 0.99. This was based on the area and thickness input parameters. In 2015, Naik et al. [21] have addressed the problem of determining the agricultural produce on the basis of size, shape, and maturity. Here, the decision-making process was handled by means of fuzzy inference system. The implemented approach has been categorized with three stages: In the initial stage, the classification of mangoes was made as deformed or wellformed by using extent, eccentricity, and cross-ratio properties of shape. Secondly, size and maturity classification has been discussed on the basis of medium, small, or big size and on the basis of partially ripe, unripe or ripe maturity. Finally, the grading of mango was made using decision-making theory as class I, class II or class III. The entire system has resulted in average accuracy as 90% and takes 2.1 s for grading a mango.
In 2015, Saad et al. [22] have introduced the tool with visible imaging for mango grading. The grading of fruits by their shape has been made by applying the Fourier-descriptor model over mango images captured by a CCD camera. This method has classified the images precisely by deploying SVM and DA. Further, the weight estimation of mangoes was also possible by adopting the cylinder approximation analysis model. The analysis thus proved that the proposed tool has achieved a higher correlation and higher prediction accuracy of 95% than the other models.
In 2015, Schulze et al. [23] have introduced three diverse methods of comparison for mango fruit's mass estimation that computed by SLR, MLR and ANN. On considering SLR, the adjusted coefficient was calculated by modifying the existing equation for mass estimation. The intercept, the three parameters slope length, maximum thickness and maximum width and as well as the random error was obtained by introducing the MLR model. Additionally, an ANN method was deployed for learning the linear and nonlinear correlations among inputs and outputs within the network. The evaluation outcome has shown the betterment of the ANN model than other traditional methods.
In 2019, Fashi et al. [24] have introduced a model to grade the pomegranate fruit on the basis of the size and colour of arils by deploying artificial intelligence and image processing. Three artificial intelligence algorithms have been  [25] have reported about the growth of automatic adjustable segmentation algorithm of colour images by means of linear SVM and Otsu's thresholding model for apple grading and sorting. The classification hyperplane computed by linear SVM was adjusted by this method robotically and it needs minimum time and training. This can further prevent the issues impacted by variations in the fruit colour and the lighting condition. The implemented model thus offered a robust and effective segmentation means for grading and sorting apples within a multi-channel colour space, and further, it was simply adaptable for other imaging-based agricultural applications.
In 2019, Gurubelli et al. [26] have proposed the FF2DLDA, which was the extension of F2DLDA. This was applied for grading the pomegranate fruit as 2D images. In order to address the issues of non-destructive pomegranate fruit grading and classification, three existing and one new arithmetical feature extraction simulation approach was used. The features extracted were classified by using the KSVM along with entire 2DLDA variants. The results thus explained the efficiency of this proposed work in terms of fruit grading.
In 2019, Nyalala et al. [27] have developed a prediction model on the basis of machine learning algorithms and a computer vision system for estimating the volume and mass of cherry tomatoes. The acquirement of depth images of tomatoes at diverse orientations was made and the features were extracted by means of image processing approaches. Further, five regression prediction methods on the basis of 2D and 3D image features have been presented. The model with the calculated volume or mass was then adopted over the developed mass-volume power function.
In 2019, Liu et al. [28] have proposed the image clustering tool LRR to capture the intrinsic representation of the observed samples. A novel DLRPP was introduced for dimensionality reduction by incorporating the discriminant analysis and the original samples into the LRR. In DLRPP, the global structure information can be captured by LRR, and the local geometric information was preserved by the manifold regularization term. The numerous experiments on six public image datasets prove that the proposed DLRPP can obtain better recognition accuracy compared to traditional methods. Table 1 symbolizes the features and challenges of the stateof-the-art models in the fruit grading system using machine learning techniques. As fruit grading is an important process before exporting them, many research processes are undergoing for this purpose. Some of the issues still existed in the literature and are summarized as follows: ANN [20] has low input parameter requirements and high-performance accuracy. But, it is hardware dependent and reduces trust in the network. Fuzzy system [21] poses improved accuracy and reduced grading time. Still, the result is greatly on the basis of segmentation and lightning condition. DA and SVM [22] have enhanced classification and the accuracy is better. However, needs several key parameters and choosing a "good" kernel function is not easy. ANN [23] has better prediction with high accuracy, low input data requirement, and high flexibility due to self-parameterization. Yet, more issues are existed related to real-time image processing. ANN [24] has better accuracy and higher correlation coefficient and has reduced MSE. But, the duration of the network is unknown and is difficult to show the problem to the network. Linear SVM and Otsu's method [25] achieves a better process of colour grading and better detection of the defect in real-time applications. However, may result in segmentation error and long training time on large data sets. Fuzzy 2DLDA [26] attains a better recognition rate and the effect of edge class problem is weakened. Still, needs horizontal and vertical image feature extraction and further needs better visualization result. SVM [27] improves the packaging process and obtains acceptable accuracy. Yet, not applicable to all fruit types and more extensive data sources will be needed. Succinctly, the review has disclosed that the literature has been reported with few prominent classifiers such as ANN [20], Fuzzy Classifier [21] and SVM [22] with required amendments. However, they need to be well analysed for performance in reallife cases. They still suffer from open-ended gaps such as lack of generalization, lack of flexibility, kernel selection issue, biased to the limited number of class labels and requirement of detailed previous knowledge. These issues necessitate appropriate classifiers with reduced limitations. In addition, the methodology must cope up with the characteristics of the classifier. The literature has not been reported adequately about the concurrent processing of tuning the feature selection process and classifier design problem. This paper attempts to address the aforesaid problem. Figure 1 represents the diagrammatic flow of the proposed mango grading model. This proposed work mainly intended to introduce a novel automatic mango grading model with four phases such as (1) pre-processing (2) feature extraction (3) optimal feature selection and (4) classification. In the preprocessing phase, the following process like image resizing, noise removal and segmentation happens. Image resizing is necessary to increase or decrease the total number of pixels. Noise removal algorithm is the process of removing or reducing the noise from the image. [29,30]. In segmentation, the image Noise removal defined in equation (1) is the form of:

PROPOSED MANGO GRADING SYSTEM: SHORT DESCRIPTION
Where the size of the image is M x N is an input image, I t ( ) is the intensity at the pixel , is the window centred at pixel, N is a normalization factor, c d is the standard deviation of Gaussian used for spatial filtering, I( n )is the intensity at a neighbour pixel. Image resizing is necessary to increase or decrease the total number of pixels.
Image resizing is given in Eq.
(2) and Eq. (3). Let I R ( )be the aspect ratio of the image, in which the original height I Y divided by I X original width .
Let I y be the fixed height to re-size then the resulting width of the image is Here the morphology and segmented images are obtained by using the methods like erosion, dilation, closing and opening. Dilation and erosion are two fundamental morphological operations. Dilation adds pixels to the boundaries of objects in an image, while erosion removes pixels on object boundaries. Erosion is represented by Θ. Erosion I t R is given in Equation (5).
Equation (4) represents that erosion of I t by E m is the set of all point zsuch that E m , translated by z is contained in I t , where zis the erosion set for I t and E m is the erosion mask, Dilation is represented by the symbol ⊕. Dilation I t D is given in Equation (6) and Equation (7).
∧ E m is the reflection of E m about its origin and followed by z.Opening removes the small objects from the foreground (usually taken as the bright pixels) of an image, placing them in the background, while closing removes small holes in the foreground E m , changing small islands of background into the foreground E m . Opening and closing is expressed in Equation (8) and Equation (9). Opening is denoted by the symbol• Closing is denoted by the symbol• Pre-processing improves the quality of the image by reducing artefacts. Opening and closing yield sets with borders close to those of the original set I t o and I t C .
Here the morphology and segmented images are obtained by using the methods like erosion, dilation, closing and opening. Dilation and erosion are two fundamental morphological operations. Dilation adds pixels to the boundaries of objects in an image, while erosion removes pixels on object boundaries. Opening removes small objects from the foreground (usually taken as the bright pixels) of an image, placing them in the background, while closing removes small holes in the foreground, changing small islands of background into foreground. Pre-processing improves the quality of the image by reducing artefacts.
The second phase is the feature extraction, where the shape, colour and texture features are extracted. Some of the shape features that used in this work are moments, contour area, contour perimeter, contour approximation, convex hull, checking convexity, bounding rectangle (with straight bound and rotated bound), minimum enclosing circle, fitting an ellipse and fitting a line. Before extracting the shape features, the input image is converted to grey scale image. Similarly, the colour features like histogram, mean, median, standard deviation, maximum colour frequency and minimal colour frequency are extracted. Before these feature extraction, the RGB image is converted to LAB image. Moreover, the texture features like energy, contrast, homogeneity, correlation and dissimilarity (GLCM features) and LBP features as well are extracted. As the extracted feature size is huge, it may suffer from the issue of "curse of dimensionality". Therefore, it is planned to select the appropriate or optimal features from the total features, which also helps in maximization of accuracy. For the optimal selection, a new hybrid algorithm called LA-FF is introduced in this paper. Subsequently, the selected features are then subjected to the classification process, where the Optimized Deep CNN model is deployed. In the proposed classifier, the count of convolutional layers will be fine-tuned using the LA-FF algorithm.

PROPOSED FEATURE EXTRACTION STRATEGY AND CLASSIFICATION
Let us consider the input imageI , where some of the processes like image resizing, noise removal and segmentation process takes place and the pre-processed image is termed asI P . FromI P , the shape, colour and texture features are extracted.
The shape descriptors that are considered in this paper are defined as follows. Eq. (10)-Eq. (12) states the moment, contour area and convexity.
• Moments are used to calculate the centre of mass and area of the object.
Wherep, q = {0, 1, 2 … … , ∞}, M is the shape • Contour approximation approximates a contour shape to another shape with less number of vertices depending upon the precision. • Contour area is given by (11) f (x, y)is the total area of the image.
• Convexity is given by • The straight bound is not drawn with minimum area, so it does not consider the rotation of the object whereas the rotated bound is drawn with minimum area, so it considers the rotation. • Minimum enclosing circle which completely covers the object with minimum area. • Fitting an ellipse returns the rotated rectangle in which the ellipse is inscribed. • Fitting a line is defined as the fit a line to a set of points.
The shape descriptors: • Histogram are used to show the frequency variation, • Mean is the average value of the data • Median is the middle value when data is arranged in ascending or descending order. • Standard deviation is a measure of how far each observed value is from the mean. They are given in Equations (13)- The shape descriptors: • Energy is the sum of squared elements in the GLCM.
• Contrast is the measure of the intensity contrast between a pixel and its neighbour over the whole image. • Homogeneity measures the closeness of the distribution of elements in the GLCM to the GLCM diagonal. Correlation measures the joint probability occurrence of the specified pixel pairs. • Dissimilarity is a measure of the distance between pairs of pixels in the region of interest. They are given in Equations (16)- (19).  The features obtained in the feature extraction phase is merely vast in quantity, hence the optimal selection of the needed features are made essential. This process makes the system model faster and accurate. Moreover, the selection of optimal features considers the objective given in Equation (20), where accindicates the grading accuracy.
A new hybrid algorithm is introduced in this work for selecting the optimal features. The input solution given to the algorithm is illustrated in Figure 2. Moreover, for the classification process, an optimized Deep CNN is used in this work, where the count of convolutional layers is tuned optimally. This input representation is also illustrated in Figure 2(a). Here, C n N indicates the total count of convolutional layers. Figure 2(b) represents the decoding procedure of the solution encoding. In fact, the optimal features are selected based on the boundary values given (Lower bound (LB)and Upper bound(UB)). Table 2 defines the boundary values of the extracted features. The values inside the bracket of upper bound column represent the decimal equivalent to the respective upper bound. Here the lower bound value is 0 and the upper bound value is an exponent of2 F 1 . The values obtained between these two boundaries are then given in the binary form, (0's and 1's). From that, the features that fall with 1's are selected, and the remaining features are neglected. For example, in the shape feature, the upper bound value is 1024, then the value is reduced by 1 and calculates the binary value for 1023 that is(1111111111) 2 . So for the shape features, the corresponding features like moments, This values obtained between these boundaries are then given in the binary form, (0's and 1's). From that, the features falls with 1's are selected, and the remaining features are neglected. The exemplary representation of optimal feature selection is illustrated in Figure 3.

Proposed optimized convolutional neural network
The classification of the proposed model is made through optimized deep CNN [31], where the optimal features are given as the input. The classification is made under three categories like healthy, ripe/unripe and shape. The process is described below: Though the computer vision tasks are adopted over NNs, the incorporation of prior knowledge within the network architecture is considered as a valuable one for good generalization performance. In an image, the spatial information usage among the pixels is the core intention of CNN [31] and therefore it depends on discrete convolution.
Layers: Several layer kinds are formulated within CNN. Complicated architectures were designed by means of stacking multiple layers, and the classification process is exploited depending on these layers. In this work, the count of convolutional layers is tuned optimally using LA-FF algorithm.
Convolutional layer: Let us consider the Convolutional layer ascn. Subsequently, the feature maps p In which, bias matrix is expressed asE (cn) i and the filter of size 2u cn 1 + 1 × 2u cn 2 + 1associating the j th feature map in a layer cn − 1along with the feature map in the layer cnis expressed as J (cn) i. j . The border effects influence p cn 2 andp cn 3 . The output feature map has given the size using Equation (22).
Eventually, the filters that utilized for the computation of fixed feature mapY cn i are similar, i.e. J (cn) i.k for j ≠ k. In layercn, every feature map Y cn i includes p cn 2 . p cn 3 units organized in the form of the 2D array. The output is computed as per the unit at the position (m, n)and is evaluated as per Equations (23) and (24). i . The skipping factors s cn 1 and s cn 2 is formulated by deploying the subsampling. Once before the application of the filter, the fundamental notation is on fixing the count of pixels in the vertical and horizontal directions. The size of the output feature maps based on skipping factor is expressed in Equation (25). , this is explained using Equation (26).
In which, the activation function utilized in the layer cnis given as f and operate on point wise. The additional gain coefficient is given in Equation (27).
Rectification: Let us consider the rectification layer ascn. The absolute value for every component of the feature maps is evaluated using Equation (28) and the input is comprised of p In which, the evaluation of absolute value is made point wise so that the output involves the p cn 1 = p (cn−1) 1 feature maps not modified in size.
Local contrast normalization layer: Let us consider the contrast normalization layer ascn. The local contrast normalization layer's core intention is to impose local competitiveness among the adjacent units in the feature maps and units over a similar spatial location in diverse feature maps. Consider the feature maps of size p (cn−1) 2 × p (cn−1) 3 asp (cn−1) 1 the p cn 1 = p (cn−1) 1 feature maps is comprised within the output layer cnwith unmodification in size. The computation of the subtractive normalization operation is given using the Equation (29). The output of the layer cnis stated as per the Equation (30), in which, L and are the hyper-parameters.
Feature pooling and subsampling layer: Let us consider cl as the pooling layer and their outputs include p cn 1 = p (cn−1) 1 feature maps of minimized size. Generally, in every feature map, the pooling evaluates by locating the windows at non-overlapping positions and maintains one value for every window, so that the subsampling of feature maps is made. In this, two kinds of pooling are differentiated as follows: Average Pooling: The operation is named as Average Pooling when the boxcar filter is used and is indicated asQ Ag . Max Pooling: The maximum value of every window is assumed in max pooling and is expressed byQ Max .
Fully connected layer: Assume the fully connected layer withcn. If the layer cn − 1is not fully connected, then the layer cn other than p is taken as input and the j thlayer with ithunit is evaluated as per the Equation (31).
In which, the weight associating the unit at the position (m, n)in the j thfeature map of the layer cn − 1and the ithunit in the layer cn is denoted byWt cn i, j ,m,n . The resultant output after the CNN process is the classified image and based on the outcome, the automatic grading of mangoes is performed.
The grading of mangoes is carried out using the following factors explained in Table 3.

PROPOSED HYBRID ALGORITHM FOR SOLVING DEFINED OPTIMIZATION PROBLEM
The FF algorithm aids in increasing global search mobility for robust global optimization. But one of the main disadvantages of FF is less convergence rate. On the other hand, LA is more

LA-FF algorithm
This paper introduces a new hybrid algorithm termed the LA-FF algorithm, the concept of LA [32] [ [33][34][35][36][37] and FF [19,38,39] algorithm. More particularly, the conceptual factors of lion algorithm are incorporated with the FF algorithm and henceforth the new algorithm is termed as the LA-FF algorithm. The procedure of the proposed algorithm is as follows: 1. The whole fireflies are unisex and can draw towards others with no regards of sex. 2. Brightness and attractiveness are proportional and is decreased in accordance to the distance between the fireflies. 3. The fireflies' brightness is adopted depending on the cost function. The cost function value and the brightness are proportional in the view of the maximization problem.
The identification of the initial agent's position is done in a random manner over the search area and is exploited in Equation (32), Two noteworthy problems are insisted over the FA which is the attractiveness formulation and light intensity variation. The attractiveness and light intensity gets reduced with the maximization in source distance, as they seemed to be a uniformly decreasing function. The light intensity of fireflies is depicted depends on the Gaussian form and is expressed in Equation (33), the original light intensity isI 0 , in which the light intensity is expressed asI , and the coefficient of light absorption that is constant and is delineated as . The attractiveness of firefly is explained based on Equation (34), in which 0 is constant at attractivenessr = 0. The Cartesian distance is referred to the distance among any two fireflies iand j atz i andz j , correspondingly. The ithfireflies' movement towards other attractive firefly j is established as per the Equation (35). The attraction is expressed by the first term and randomization by the second factor, in which the arbitrary number extracted from Gaussian distribution, is given as a vector i and is the randomization parameter. Moreover, a geometric annealing scheduling function is deployed from the initial 0 , which is evaluated using Equation (36), in which randomness reduction constant is expressed by0 < < 1. The pseudo code of the presented LA-FF framework is highlighted in Algorithm 1 and the flowchart is given by Figure 4.
A new update evaluation is portrayed in this work, which is based on the evaluation score of the lion algorithm. Thereby the proposed update evaluation is given in Equation (37).
In Equation (37), z t +1 i is evaluated as per Equation (32), wherein = 1, = 1, = 0.3and i is the random solution and ⃗ d i j is evaluated as per Equation (38) In Equation (37), w i and w j is the weight that is defined based on the condition given below. (1) w i and w j is evaluated as per Equations (39) and (42), respectively else w i and w j is evaluated as per Equations (40) and (43), respectively In which, the evolution scores E i is calculated as per Equation (41) In which, the evolution scores E j is calculated as per Equation (44)

RESULTS AND DISCUSSIONS
This section presents the simulation results of the proposed optimized deep CNN model. The experimentation of the Compute the firefly update as per Equation (35)  proposed model is carried out by considering optimal features over other conventional models with all traditional feature sets.

Simulation setup
The implemented mango grading model is evaluated using python. The dataset used in this work is downloaded fromhttps://data.mendeley.com/datasets/fmfncxjz3v/ 1#folder-2283e5f3-1ee9-44cc-a200-aaa079161167. Though the dataset consists of the images of overlapped class labels, we have organized to acquire 748 images of mangoes of different class labels. Among them, 169 images belong to healthy mangoes, 34 diseased mangoes, 192 ripe mangoes, 164 unripe mangoes, 97 big mangoes, 41 medium-sized mangoes and 49 The architecture of the optimized deep CNN very big mangoes. The analysis is performed for the implemented optimized deep CNN model with optimal features over other conventional models and conventional features, and the results are plotted. Furthermore, the convergence analysis was exploited in this work using box plot analysis. Additionally, the selected features with their lengths are also determined. The sample image results of the three category images after morphology and segmentation operation is illustrated in Figure 5. Type I features are accuracy, sensitivity, specificity, precision, recall, F-measure, TS, and NPV, while the type II measures are FOR, FPR, FNR and FDR. Figure 6 represents the architecture of the optimized deep CNN.

6.2
Impact of proposed mango grading system Figure 7 explicates the impact of grading with the proposed model. The grading is done in the mentioned categories: healthy-diseased, ripe-unripe and big-medium-very big cases. Figure 7 shows how much the influence of grading relies on the performance of healthy-diseased (HD) classification, ripeunripe classification, and big-medium-very big classification. The graphical representation shows the performance of the proposed Optimized Deep CNN with optimal features over the other features. It is observed that the performance of the proposed work with optimal features is more effective in terms of   Figure 7(a), the proposed work shows a great impact on grading with respect to HD, where the performance of the proposed classifier with conventional features has the least impact on this. Similarly, the betterment of the proposed system model is proved for all the other grading scenarios as well (Figure 7(b), (c)).

6.3
Impact of grading: Proposed versus conventional classifiers Figure 8 symbolizes the impact of grading of the proposed model over conventional models. Apparently, the grading is evaluated regarding certain categories like healthy-diseased, ripe-unripe and big-medium-very big cases. Figure 8 demonstrates the impact of grading as per the performance of healthydiseased (HD) classification, ripe-unripe classification, and bigmedium-very big classification. The graph explained below represents the performance of implemented optimized deep CNN with optimal features over the conventional classifiers with all features. The graph thus referred to the proposed work with optimal features with more effective performance regarding the mango grading in every case. In Figure 8(a), the proposed work shows a great impact on grading regarding HD, in which the performance of conventional classifiers with all features has the least impact on this. Like the same, for all other grading scenarios in Figure 8(b), (c), the superiority of the proposed system model is validated Figure 9 shows the box plot representation of the converging statistics of the proposed model and conventional models, Figure 9(a) the graphs prove that "how the proposed model converges with the defined objective or fitness for each iteration". In iteration1, the minimum fitness reached is about 0.81 and the maximum fitness is about 0.96. Similarly, in all the iterations the maximum fitness reached is above 0.94. At each iteration, the maximization of accuracy is attained with certain variations. Mostly, the accuracy of the proposed model reaches above 92%. From, Figure 9 F-measure: It provides a single score that balances both the concerns of precision and recall in one number. Thus the F score is defined as the weighted harmonic mean of the precision and recall.

Convergence analysis
Negative predictive value: NPV is the likelihood that a negative test result reflects the absence of a disease. Table 4 depicts the performance analysis of proposed CNN with proposed features regarding the type I measures. The analysis is made over conventional CNN with all features and the relevant features in [21], auto encoder + all features [40] and features RNN + all features [41]. Typically, three test case analyses are exploited for this comparison healthy-diseased, ripe-unripe, and big-medium-very big. The overall analysis explains the betterment of the implemented grading model with optimal features. It can be explained as: for the healthydiseased category, the proposed model with optimal features has attained betterment in terms of accuracy (maximization measure), which is 55.88%, 10.42%, 11.05% and 24.45% superior to conventional CNN with all features and conventional CNN with features in [21], auto encoder + all features [40] and RNN + all features [41] respectively. The overall analysis is formulated regarding the other maximization measures as well and demonstrates the superiority of this work with better prediction.

6.6
Analysis on proposed classifier with proposed 6.6.1 Features: Type II measures The type II measures considered are FOR, FPR, FNR and FDR. False omission rate: FOR is the proportion of the individuals with a negative test result for which the true condition is positive.
False positive rate: FPR is defined as the number of incorrect positive results occurred among all negative samples available during the test.
False negative rate: The FNR is the proportion of positives which yield negative test outcomes i.e., the conditional probability of a negative test results given that the condition being looked for is present.
False discovery rate: FDR is the proportion of the individuals with a positive test result for which the true condition is negative. Table 5 explains the performance analysis of implemented CNN against the conventional CNN model with all features and the relevant features in [21], auto encoder + all features [40] RNN + all features [41]. Moreover, healthydiseased, ripe-unripe, and big-medium-very big are the three test cases under where the analysis is formulated. The analysis thus exploited as follows: for the ripe-unripe category, the proposed model with optimal features has attained betterment for FDR (minimization measure), which is 35.21% and 75.68% better from conventional CNN with all features and conventional CNN with features in [21], auto encoder + all features [41] and features RNN+ all features [41] respectively. The analysis thus explained the superior performance of the  proposed CNN model with optimal features against conventional CNN. Table 6 delineates the comparative analysis of the proposed CNN model with the conventional ANN and SVM models regarding three categories. The analysis thus exploited based on the maximization measure, by comparing the proposed CNN model with optimized features over the conventional ANN model with all features and conventional SVM model with all features. On considering the HD category, the proposed CNN model with optimal features are obtained with greater accuracy, and that is 6% and 3.92% improved than conventional ANN and SVM models, respectively. In all the test cases, the proposed model proves its higher grading accuracy that is in the range of above 92%.  Optimized CNN + optimal features 55.6462445259 Table 7 represents the comparative analysis of the implemented CNN approach with the traditional ANN and SVM methods with regard to three categories. The analysis was thus executed as per the type II measure, by differentiating the proposed CNN model with optimized features over the conventional ANN model with all features and conventional SVM model with all features. On considering the RU category, the proposed CNN model with optimal features gains the least FPR and that is 87.5% improved than conventional ANN models. The least FOR of the proposed model is 0.135, whereas the remaining models obtain high FOR when compared to this.

Time complexity
The time complexity of the proposed CNN model over the existing models like ANN, SVM and CNN is presented in Table 8. The comparison is made by considering all features for ANN and SVM, FIS features for CNN and optimal features for optimized CNN. However, the accuracy in selection of the optimal features in the proposed CNN is found to be surpassing the traditional models like ANN [20], SVM [22] and CNN [21].

6.10
Analysis on feature length Table 9 shows the selected features with their feature-length for three test cases.

Discussion
An automated grading system is designed to speed up the process of classifying the mango images that facilitate quality evaluation process in the industrial sector. To overcome the slow convergence, a new hybrid optimization algorithm LA-FF is introduced. The grading is evaluated on the basis of HD, RU, and BMV categories and in all test cases our proposed methodology achieves higher accuracy than conventional methods. Similarly, the proposed Optimized CNN achieves the least FOR, FPR, FNR and FDR value than conventional methods. However, the realization of such system may experience practical challenges such as noisy data, performance uncertainty, acquisition uncertainty, imaging quality, etc. In order to evaluate the proposed system under such diverse challenging conditions, it is necessary to generate a large datasets. Under such circumstances, learning complexity may increase due to the handling of large data. The proposed system may suffer from computing complexity, but it can be solved when exploiting sophisticated computing systems.

CONCLUSION
This paper has presented a new mango grading model under four stages like pre-processing, feature extraction, optimal feature selection, and classification. At first, the input image was passed on to the pre-processing phase, in which the reading, sizing, noise removal and segmentation process was initiated. Later, the features were extracted from the pre-processed image.
For relatively attaining a more effective system, the features were selected optimally from the extracted features using a novel hybrid optimization algorithm named LA-FF, which was the hybridization of LA and FF, respectively. Subsequently, the optimal features were offered for the classification process, in which the optimized deep CNN was employed. As a major contribution, the configuration of CNN was fine-tuned through selecting the optimal count of convolutional layers. The convergence analysis of the LA-FF has shown its superiority by maximizing the fitness function within a short duration relatively. The comparative analysis of the conventional CNN with all features, auto encoder + all features and RNN + all features were compared with optimized deep CNN for the three test cases like healthydiseased, ripe-unripe, and big-medium-very big with respect to type I and type II measures. For example on considering the RU category the accuracy of the proposed method is 9.6%,