YOLO Models for Fresh Fruit Classification From Digital Videos

YOLO Models for Fresh Fruit Classification From Digital Videos

DOI: 10.4018/978-1-6684-9999-3.ch017
OnDemand:
(Individual Chapters)
Available
$37.50
No Current Special Offers
TOTAL SAVINGS: $37.50

Abstract

Identifying food freshness is a very important; it is a part of a long historical actions by humans, because fruit freshness can tell us the information about the quality of foods. With the advancement of machine learning and computer science, which will be broadly employed in factories and markets, instead of manual classification. Recognition of the freshness of food is rapidly being replaced by computers or robots. In this book chapter, the authors conduct the research work on fruit freshness detection, we make use of YOLOv6, YOLOv7, and YOLOv8 in this project to implement fruit classifications based on a variety of digital images, which can improve the efficiency and accuracy of the classification incredibly; after the classification, the output will showcase the result of fruit fresheness classification, namely, fresh, or rotten, etc. They also compare the results of different deep learning models to discover which architecture is the best one in terms of speed and accuracy. At the end of this book chapter, the authors made use of the majority vote method to combine the results of different models to get better accuracy and recall scores. To generate the final result, the authors trained the three models individually, and also propose a majority vote to get a better performance for fresh fruit detection. Compared with the previous work, this method has higher accuracy and a much faster speed. Because this one uses the clustering method to generate the final result, it will be easy for researchers to change the backbone and get a better result in the future.
Chapter Preview
Top

Introduction

Fruit freshness detection is a very interesting topic in machine vision that is also a very important task for human ordinary lives, because every day we need to know which food is safe to be eaten, which will cause illness or diseases, rotten foods may lead to poisoning, hence, we develop a number of ways to classify fruits and detect as well as predict the freshness.

In this book chapter, we use deep neural networks for freshness and rotten fruit classification, YOLO is a very famous architecture that can be employed for almost all types of fruit classification and freshness detection, meanwhile, we also introduce the potential methods such as Transformers in this project. This project will mainly make use of deep learning methods (like YOLO) to classify the digital images for fresh or rotten fruits, we take advantage of three YOLO models and compare the results.

The focus of this book chapter is to detect fruit freshness or classify fresh and rotten fruits from the input digital images. According to the most advanced YOLO architecture, it will be easy for us to get a high precision and recall for fruit freshness detection compared with the human labor method. Our contributions to this book chapter include: (1) Collecting a large dataset for three classes of fruits (i.e., apple, banana, and orange) (2) Classifying each image with YOLOv6, YOLOv7 or YOLOv8 models (3) Detecting the freshness of the given fruits (4) Proving machine learning methods to detect the freshness of the fruit (5) Seeking an ensemble method to combine the detection result from different architecture, and finding the best clustering weights for different architecture.

The structure of this book chapter is that we show our literature review and discuss the relevant studies of visual object detection and classification in Section 2. Meanwhile, we also introduce the details related to Transformer in deep learning. In Section 3, we introduce our research methods and dataset. In Section 4, we implement the proposed algorithms, collect experimental data and demonstrate our outcomes. Additionally, the limitations of these proposed methods will be detailed. In Section 5, we summarize and analyze the experimental results. We draw the conclusion and state our future work in Section 6.

We collected our dataset through the Kaggle website. In this dataset, we totally have six different types of fruits, there are images for fresh and rotten apples, bananas and oranges, and the number for each group is different. To give more information about the dataset, we will show the distribution of the dataset for this project.

Figure 1.

Our dataset: (a) Training dataset; (b)Test dataset

978-1-6684-9999-3.ch017.f01

We take advantage of around 2% samples as the test set and the rest of samples will be used as our training set, Fig. 1. Shows the distribution of the samples in our training set and test set. We see that the training and test dataset almost have the same distributions of the samples. We also show the pie chart for the training and testing dataset to offer a more intuitive reflection of the dataset for this project.

Figure 2.

Pie charts for training and test dataset

978-1-6684-9999-3.ch017.f02
Top

YOLO (Fang, 2019; Fang, 2021; Redmon, 2021; Parico, 2021) is the abbreviation of “You Only Look Once”, which is a very famous and widely employed in computer vision. There are a lot of advantages of YOLO models, firstly, YOLO is a “lightweight” architecture, which means it will be trained in a very fast way. The trained weights will not consume a large space. Secondly, YOLO can provide visual object detection in real time. The real-time is the network which can make detections on the input image much faster than human reaction, so it feels like the network “promptly” generates the result without delay. Compared to Faster R-CNN or Transformer model, the accuracy of YOLO is not high, the differences of the performance between YOLO and other models are pretty minor.

Complete Chapter List

Search this Book:
Reset