# Automatic Fruits Freshness Classification Using CNN and Transfer Learning
###### Abstract  
Fruit Freshness categorization is crucial in the agriculture industry. A system, which precisely assess the fruits' freshness, is required to save labor costs related to to lossing out rotten fruits during the manufacturing stage. A subset of modern machine learning techniques, which are known as Deep Convolution Neural Networks (DCNN), have been used to classify images with success. There have recently been many changed CNN designs that gradually added more layers to achieve better classification accuracy. This study proposes an efficient and accurate fruit freshness classification method. The proposed method has several interconnected steps. After the fruits data is gathered, data is preprocessed using color uniforming, image resizing, augmentation, and image labelling. Later, the AlexNet model is loaded in which we use eight layers, including five convolutional layers and three fully connected layers. Meanwhile, the transfer learning and fine tuning of the CNN is performed. In the final stage, the softmax classifier is used for final classification. Detailed simulations are performed on three publicly available datasets. Our proposed model achieved highly favorable results on all three datasets in which 98.2%, 99.8%, and 99.3%, accuracy is achieved on aforesaid datasets, respectively. In addition, our developed method is also computationally efficient and consumes 8 ms on average to yield the final classification result. classification; deep learning; object detection +
Footnote †: journal:  
architectures, computer vision-based approaches are thought to be the most intelligent and cost-effective solutions. Studies on object classification use various approaches, for example, Support Vector Machines (SVMs), linear discriminant analysis, or k-nearest neighbors (k-NN) to improve accuracy or speed [2]. Fruit freshness is a major factor in determining the quality of fruits as it can affect their shelf life and overall nutritious value. Figure 1 shows an example of conditions of fruit from fresh to rotten stage of apples and bananas, respectively. Therefore, to determine the proper price, the customer must be able to identify the variety of the fruits that are intended to be purchased. Fruit freshness classification is also crucial for consumers, as it can help them make knowledgeable decisions about the worth of the fruit item they are purchasing. It is also important for producers and retailers as it can help them to accomplish inventory and ensure that their products are meeting quality standards. Recently, several machine learning-based methods for fruit freshness classification have appeared in the literature [3]. Few of them use CNNs, Deep CNNs, and Faster-RCNN to accomplish the fruits classification task [4]. The CNN models are also implemented in a number of tasks, for instance, object detection, classification, and recognition [3]. Over the past few years, various CNN architectures have been developed, and they have demonstrated excellent performance for image classification. Transfer learning is one of the techniques that uses previously developed architectures on various problems to produce more accurate results. Deep learning and machine learning techniques integrated with transfer learning could also be used for image classification. This study investigates the possibility of transfer learning with regard to CNN models for the quality assessment of fruits instead of using CNN architectures from starch. In real-life, classification of fruits is normally carried out by people that we believe is ineffective for fruit farmers and fruit sellers. Therefore, the development of an accurate classification method is desired, which will significantly reduce human efforts and costs. A robust fruit freshness classification method will also reduce the industry's production time in the agriculture domain by correctly identifying fruit defects. Therefore, this study proposes a novel and automatic fruit freshness classification method using fine tuning and transfer learning of the AlexNet.