Consumers give a high value on fruits\' freshness, and manual visual grading presents challenges due to labor effort and inconsistent results. This research suggests an effective machine vision system for automating a visual assessment of fruit freshness and attractiveness based on cutting-edge deep learning algorithms and ensemble methodologies. The suggested architecture enables the non-destructive and economical detection of fruit defects by utilizing convolutional neural networks (CNNs). To attain high classification accuracy, which acts as the performance metric, the system utilizes ensemble deep learning models. Fruit photographs are used to train the algorithm, enabling precise fruit quality assessment. This framework revolutionizes the inspection process by using computer vision in real-time for industrial applications in fruit freshness detection.
Machines will be able to interact with the world in the same way that people do by employing computer vision.The pattern recognition algorithms and extensive visual data training, computer vision replicates how the human brain recognizes visual information. Mainly through deep learning, convolutional neural networks (CNNs) have transformed the science of computer vision.. Using deep learning techniques, we attempt to solve the issue of creating an automated ensemble model for classifying fruit images as fresh or rotten
Convolutional neural networks (CNNs) are deep neural networks that are known for their usefulness in computer vision. In comparison with standard neural networks, which have each layer fully connected, a CNN only has the last layer fully connected. CNNs utilize local receptive fields  to connect discrete input neuron regions to hidden layer neurons. For the purpose to produce feature maps, these localized receptive fields are moved all over the image. Incorporating shared weights and biases, allowing for the detection of associated features, permits neurons in a feature map  to utilize the same filter weights and biases. For the purpose of image classification using the SoftMax function ; fully connected layers, connect the final hidden layer to the output layer while activation functions and pooling reduce dimensionality. Every layer in ANNs is fully connected, as illustrated in figure 1, which means that every neuron in each layer is linked to every neuron of next layer.
II. LITERATURE REVIEW
In the paper "Detection of freshness of fruits using electrical method" by Shweta Kammar et al ., the authors introduce a new approach to assess the freshness of fruits. Their method involves measuring the electrical conductivity of fruits to determine their freshness. The paper discusses the experimental setup and methodology used for measuring the electrical conductivity of various fruits. The results demonstrate a significant relationship between electrical conductivity and fruit freshness, highlighting the potential of this technique for non-destructive fruit quality assessment .The paper "A Comparative Analysis on Fruit Freshness Classification" by Diclehan Karakaya  presents a comparative analysis of different methods for fruit freshness classification. The author evaluates and compares the performance of various machine learning techniques and features for accurate classification. The research presented here underlines the vital importance of feature and algorithm selection. The reviewed papers highlight the effectiveness and potential of CNN-based methods for fruit freshness detection. However, limitations such as reliance on visual appearance and the need for specialized equipment are identified. To address these shortcomings, a proposed conclusion is to develop a web app-based ensemble CNN method for fresh fruit detection. This approach would leverage the power of CNNs while incorporating a user-friendly web interface for accessibility. By combining multiple CNN models and providing real-time results, the proposed ensemble CNN method offers a promising solution for accurate and convenient fruit freshness assessment.
CNN is a state of art technique, because of its advantages to extract features from images without complex processing. The paper investigates the ensemble models using pre-trained CNN pre trained models, namely Vgg16 ,Vgg19 Resnet50 ,Resent101 and InceptionResnetv2  models to detect fruit freshness as shown in figure4.The transfer learning uses the knowledge of the pre-trained models
IV. RESULTS AND DISCUSSION
Exploratory Data Analysis (EDA) is performed on the dataset used in the present investigation are 10,342 training images and 2,708 test images entirely, taken from Kaggle, which also include fresh and rotten apples, bananas, and oranges. The EDA is presented using the charts as shown in Figure 5 and 6.
In this paper, Following steps are used implementing transfer learning with VGG16 and VGG19:
Use weights from ImageNet to the pre-trained VGG16 or VGG19 model, except the top layer.
To stop the layers of the already trained model from millions ImageNet dataset, freeze them.
Prepare your dataset by normalizing the pixel values of an input image with a size of (224, 224, 3).
The fresh fruit and rotten image data consist of the 6 classes namely fresh oranges, fresh apples, fresh bananas, rotten oranges, rotten apples, and rotten bananas, and divide the dataset into training and testing sets.
Two dense layers each containing 64 units and ReLU activation are used
To handle multi-class classification, present an output layer with six units (one for each class) and a softmax activation function.
Build the model and train the model using the training dataset for 10 epochs, using a batch size of 32.
Evaluate the model's performance on the test dataset, calculating accuracy.
Save the trained model for future use or deployment.
An ensemble model that combines the predictions of the multiple pre-trained models to obtain greater accuracy in following steps
a. Load the training weights for the pre-trained models separately.
b. Get your test dataset ready.
c. Using both models make predictions on the test dataset and record the probabilities or class labels.
d. Utilise a voting scheme to combine the multiple models' predictions. Each model provides predictions, and the class that receives the highest number of votes is chosen as the final prediction.
Table 1: Summary Of Model Results
Test Accuracy (%)
The transfer learning is implemented using pretrained models namely Vgg16,Vgg19, Resnet50 ,Resent101 and InceptionResnetv2 models .The individual models are trained and tested on same Image dataset and their accuracy values are presented in table1.The prosed work utilize all these models to develop ensemble model using voting schemes . The proposed model produced better results on unseen data .The desktop tool stream lit app results are presented in figure7.
Convolutional neural network (CNN) ensemble techniques enable reliable classification of fruit freshness assessment. They are integrated with a desktop tool like Streamlit and offer real-time monitoring, evaluation, and user-friendly interfaces to enhance business frameworks and client inspection, maximizing productivity and quality assurance in the processing of fruit.
 M. Jogin, Mohana, M. S. Madhulika, G. D. Divya, R. K. Meghana and S. Apoorva, \"Feature Extraction using Convolution Neural Networks (CNN) and Deep Learning,\" 2018 3rd IEEE International Conference on Recent Trends in Electronics, Information & Communication Technology (RTEICT), Bangalore, India, 2018, pp. 2319-2323, doi: 10.1109/RTEICT42901.2018.9012507.
 Alzubaidi, L., Zhang, J., Humaidi, A.J. et al. Review of deep learning: concepts, CNN architectures, challenges, applications, future directions. J Big Data 8, 53 (2021).
 A. Ajit, K. Acharya and A. Samanta, \"A Review of Convolutional Neural Networks,\" 2020 International Conference on Emerging Trends in Information Technology and Engineering (ic-ETITE), Vellore, India, 2020, pp. 1-5, doi: 10.1109/ic-ETITE47903.2020.049.
 Shweta Kammar, S.B.Kulkarni, U.P.Kulkarni, Ramesh.K, Ravindra.Hegadi\"Detection of freshness of fruits using electrical method\", International Journal of Engineering Trends and Technology (IJETT), V23(2),90-92 May 2015. ISSN:2231-5381. www.ijettjournal.org. published by seventh sense research group
 D. Karakaya, O. Ulucan and M. Turkan, \"A Comparative Analysis on Fruit Freshness Classification,\" 2019 Innovations in Intelligent Systems and Applications Conference (ASYU), Izmir, Turkey, 2019, pp. 1-4, doi: 10.1109/ASYU48272.2019.8946385.
 Simonyan, Karen, and Andrew Zisserman. \"Very deep convolutional networks for large-scale image recognition.\" arXiv preprint arXiv:1409.1556 (2014).
 He, Kaiming, et al. \"Deep residual learning for image recognition.\" Proceedings of the IEEE conference on computer vision and pattern recognition. 2016.
 Szegedy, Christian, et al. \"Inception-v4, inception-resnet and the impact of residual connections on learning.\" Proceedings of the AAAI conference on artificial intelligence. Vol. 31. No. 1. 2017.
 Kaggle dataset: https://www.kaggle.com/datasets/sriramr/fruits-fresh-and-rotten-for- classification