Classification of Tomato from Coace to Vrot Using Machine Learning Techniques
Kalaivani Rajamoorthi, Alagar. S. Tarun, Vigneshwaran. M, Kavya. S, Saravanaprasath. S
Student, Department of Electronics and Communication Engineering, Coimbatore Institute of Technology, Coimbatore, India.
DOI: https://doi.org/10.51244/IJRSI.2025.120700128
Received: 06 July 2025; Accepted: 13 July 2025; Published: 06 August 2025
Fruit distribution and sales depend heavily on maximizing profits and ensuring customer satisfaction, which emphasizes the significance of determining the fruits’ quality. There are differences in the ripeness stages of tomatoes, and it can be difficult to spot spoiled or unripe ones in a big batch. Significant financial losses may arise from a single spoiled tomato in a batch hastening the spoilage of the entire lot. To solve this problem, a clever system that categorizes tomatoes according to their freshness has been created using image processing technology. With precision, the system classifies tomatoes into ripe, semi-ripe, unripe, and rotten categories by examining visual cues that indicate ripeness and spoilage. By using machine learning techniques, the sorting and grading process is streamlined as the system becomes adept at identifying patterns in tomato images.
Keywords: Fruit Quality Assessment, Image Processing Technology, Machine Learning for Fruit Classification, Ripeness Classification (Ripe, Semi-ripe, Unripe, Rotten)
In developing nations like India, postharvest and processing losses contribute to a significant portion of overall production losses, amounting to approximately 40%, equating to around 37,000 tons annually. Additionally, during export, fresh food spoilage rates range from 25% to 30%. Manual fruit evaluation, commonly practiced, proves time-consuming. Moreover, during storage, the risk of spoilage extends to entire batches if even a single fruit deteriorates. To address these challenges, a proposed system seeks to identify optimal fruit ripeness, ranging from peak freshness (“coace”) to undesirable ripeness (“vrot”). This system integrates advanced technologies like computer vision to automate and enhance the inspection process, offering timely and accurate assessments. By implementing such a system, the aim is to mitigate losses, improve efficiency, and ensure better quality control throughout the supply chain, thereby positively impacting both producers and consumers in the fruit industry.
The primary objective of this project is to design a system that enhances the speed, accuracy, and objectivity of fruit quality inspection. By reducing reliance on manual labour and minimizing human error, this technology promises not only increased efficiency but also ensures consistent and reliable assessment, benefiting both producers and consumers alike. Ultimately, this innovation aims to revolutionize the fruit industry by streamlining operations and enhancing overall quality control standards.
Tools they need for success in today’s changing agricultural landscape [1].The proposed work with capturing an image of a tomato using a camera. This image then undergoes a series of adjustments to ensure it’s ready for analysis. These adjustments include resizing the image, correcting its color if necessary, and ensuring consistent brightness and contrast. Once prepared, the image is fed into a Convolutional Neural Network (CNN), which is like the brain of the system. The CNN has specialized layers that excel at identifying important features in the tomato image, such as its shape, texture, and overall appearance. These features are crucial for determining the tomato’s ripeness. After the CNN extracts these features, the data is simplified through pooling layers. These layers condense the information while retaining its essential characteristics, making it easier for the computer to process. Next, the simplified data flows through dense layers responsible for making the final classification decision. These layers use sophisticated mathematical techniques to determine whether the tomato is ripe, unripe, semi- ripe, or rotten. The outcome of this process is then passed through a final layer with four neurons, each representing a ripeness category. The SoftMax function helps to calculate the probabilities of each category, ultimately determining the tomato’s classification. Tomato is classified into four classes named as Ripe, Unripe, Semi-ripe and Rotten. Totally 5038 images (Ripe (1544), Unripe (998), Semi-ripe (1227) and Rotten (1269)) are used as dataset for training purpose. 80% of dataset is used to validation and 20% of dataset is used for testing. Additionally, the project incorporates the use of the Ubidots IoT cloud platform. This platform allows for real-time tracking of the number of tomatoes classified into each ripeness category. It provides a convenient way to monitor the ripening process and make informed decisions based on the data collected.
In conclusion, implementing a classification system for tomatoes ranging from peak freshness (“coace”) to undesirable ripeness (“vrot”) holds immense potential for revolutionizing the fruit industry. By utilizing advanced technologies such as computer vision, we can automate and enhance the inspection process, ensuring timely and accurate
assessments of tomato quality. This not only reduces postharvest losses but also improves efficiency and quality control throughout the supply chain. With the ability to identify optimal ripeness levels, producers can better manage inventory and minimize spoilage, while consumers can enjoy fresher and higher-quality tomatoes. Ultimately, this classification system represents a significant step towards sustainable agriculture practices, economic efficiency, and enhanced consumer satisfaction in the tomato industry.
This section gives the related literature survey with respect to the “Tomato Classification from Coace to Vrot.”
Mr.Akshay Dhandrave et.al represents a significant endeavor to transform fruit quality assessment within the fruit processing industry by harnessing the power of computer vision and image processing techniques. The overarching objective is to automate the assessment process, thereby enhancing efficiency and reducing dependency on manual labor. Fruit quality holds immense importance for human health, underlining the critical necessity for precise grading systems to ensure consumer safety and satisfaction. However, traditional methods of fruit detection encounter various challenges, including difficulties in accurately recognizing shape, size, and color. These complexities often lead to inaccuracies in quality assessment. To address these challenges, the project proposes the adoption of advanced methodologies such as Support Vector Machine, Color Mapping, HSV model, Fuzzy Logic, and Neural Networks. These sophisticated techniques offer nuanced approaches to detect and evaluate diverse quality parameters of fruits with heightened accuracy and reliability. By integrating these advanced methods into a cohesive computer vision framework, the project aims to develop a robust system capable of efficiently assessing fruit quality. Such a system holds the potential to significantly enhance overall productivity within the fruit processing industry while simultaneously elevating quality standards. With automation, repetitive manual tasks can be streamlined, allowing for greater throughput and efficiency in processing operations. Moreover, the implementation of advanced computer vision techniques ensures a more objective and standardized approach to fruit quality assessment, mitigating the subjective biases often associated with manual inspection methods. This not only enhances the reliability of assessments but also contributes to consumer confidence in the quality of processed fruits. Ultimately, the successful execution of this project has the potential to revolutionize fruit processing practices, leading to improved productivity, higher quality standards, and increased consumer satisfaction. By leveraging cutting-edge technologies, the project aims to drive innovation within the industry, paving the way for more sustainable and efficient fruit processing operations in the future.
Aaron Don M. Africa et.al delves into the transformative capabilities of machine learning and machine vision algorithms in revolutionizing ripe fruit detection and classification, aiming to reduce dependency on manual labor in agricultural practices. By presenting a range of methodologies, it seeks to refine both pre and post-harvest analysis, providing farmers with precise data crucial for effective crop evaluation. The proposed systems aim to address the inherent monotony in repetitive tasks associated with fruit quality assessment, ensuring consistency in both assessment and ripeness determination. By integrating computer applications into agricultural practices, the paper endeavors to empower farmers with indispensable tools for enhancing crop quality assessment. Through this empowerment, the paper anticipates fostering more streamlined and productive agricultural practices. By leveraging advanced technologies, farmers can conduct more accurate and efficient assessments, leading to the cultivation of superior-quality produce. Such advancements not only benefit individual farmers but also have broader implications for agricultural sustainability and economic viability. By reducing the reliance on manual labor and improving the accuracy and efficiency of crop evaluation, these technological advancements contribute to the optimization of resource utilization and the reduction of waste in agricultural production processes. Moreover, by enabling farmers to make more informed decisions based on precise data, these technologies facilitate the implementation of sustainable agricultural practices. Overall, the integration of machine learning and machine vision algorithms into agricultural practices holds significant promise for the future of the agricultural sector. By embracing technological innovation, farmers can enhance productivity, improve crop quality, and contribute to the overall sustainability and resilience of agricultural systems. As such, these advancements underscore the critical role of technology in driving progress towards a more prosperous and sustainable agricultural future.
Phan, Nguyen et.al, meticulously explores the application of four deep learning frameworks tailored for categorizing tomato fruit based on ripeness and condition, marking a significant advancement in agricultural technology. These frameworks, including Yolov5m combined with ResNet50, ResNet-101, and EfficientNet-B0, undergo rigorous training on a substantial dataset comprising 4500 images over 200 epochs. The training parameters, with a batch size of 128 and an image size of 224 × 224 pixels, ensure robust model development. Remarkably, the Yolov5m model paired with ResNet-101 achieves a flawless 100% accuracy rate in classifying ripe and immature tomatoes. Furthermore, when coupled with the EfficientNet-B0 model, Yolov5m demonstrates an impressive 94% accuracy in identifying damaged tomatoes. Testing accuracies for the other frameworks – ResNet-50, EfficientNet-B0, Yolov5m, and ResNet-101 – range between 97% and 98%. These findings underscore the remarkable efficacy of the proposed frameworks in accurately discerning tomato fruit characteristics, highlighting their potential to revolutionize automated tomato fruit harvesting processes in agricultural practices. By streamlining classification tasks, these advancements promise to enhance efficiency, minimize errors, and uphold quality standards within the agricultural industry. Ultimately, these technological innovations hold substantial promise in improving productivity and sustainability across the agricultural sector. By enabling precise and efficient classification of tomato fruits, these frameworks contribute to optimizing resource utilization, reducing waste, and enhancing overall agricultural practices. Moreover, by automating labor-intensive processes, they offer opportunities to increase scalability and profitability for farmers while ensuring consistent and high-quality produce for consumers.
S.R.NageshAppe et.al represents the development of a Deep Convolutional Neural Network (DCNN) model tailored for discerning and classifying tomato ripeness signifies a significant stride in agricultural technology. Through the utilization of this model, the dataset underwent meticulous preprocessing techniques to ensure optimal data quality. Moreover, data augmentation methods were applied, introducing variations in the images and enhancing the model’s capacity to generalize and adapt to diverse scenarios effectively. The results showcased exceptional performance by the proposed DCNN model in accurately detecting and classifying tomato ripeness levels. Crucially, the incorporation of data augmentation techniques played a pivotal role in augmenting the dataset, thereby bolstering the model’s robustness. By subjecting the model to a broader spectrum of data variations, such as changes in lighting conditions, orientations, and backgrounds, the augmentation process facilitated a more comprehensive adaptation to real-world conditions, ultimately elevating its overall performance and reliability. The successful identification of ripeness levels in tomatoes underscores the practical applicability and effectiveness of the DCNN model within agricultural settings. Its capacity to automate and enhance fruit quality assessment processes holds significant promise for streamlining operations and improving efficiency within the agricultural industry. Furthermore, the demonstrated success of the DCNN model underscores its potential to revolutionize agricultural practices by furnishing farmers with accurate and timely insights into crop quality. This, in turn, contributes to heightened productivity and sustainability in food production processes. Overall, the development and implementation of the DCNN model represent a pivotal advancement in agricultural technology, with far-reaching implications for enhancing efficiency, productivity, and sustainability within the agricultural sector.
literature survey on Tomato Classification from Coace to Vrot has provided a comprehensive understanding of the current landscape in this field. The diverse range of studies and perspectives explored highlight the multifaceted nature of the subject. This comprehensive overview not only encapsulates the current state of the field but also propels us forward, inspiring further inquiry and innovation in the ongoing pursuit of classification of Tomato from unripe to ripe stage.
Tomato Classification from Coace to Vrot Model
Figure 3.1 illustrates the block diagram of the proposed tomato classification system, which categorizes tomatoes into four ripeness levels: Ripe, Unripe, Semi-ripe, and Rotten corresponding to the stages from Coace to Vrot. The process begins with the image acquisition stage, where a digital camera captures images of individual tomatoes under consistent lighting. These images are then subjected to preprocessing operations, including resizing, color correction, and brightness/contrast adjustments.
Fig. 3.1 Block Diagram of Tomato Classification from COACE to VROT
This standardization enhances the input quality and supports more accurate feature extraction. The preprocessed images are then input into a Convolutional Neural Network (CNN), which functions as the core of the classification model. The CNN is composed of multiple specialized layers that automatically extract meaningful features from the images, such as shape, surface texture, and color patterns—key indicators of ripeness.CNN has specialized layers that excel at identifying important features in the tomato image, such as its shape, texture, and overall appearance. These features are crucial for determining the tomato’s ripeness.
The system was trained using a dataset of 5,038 labeled images, distributed as follows:
The dataset was divided into 80% for training and 20% for testing to evaluate model performance.
Furthermore, the system is integrated with the Ubidots IoT cloud platform, which allows for real-time tracking of classification outcomes. This integration supports continuous monitoring and enables data-driven decisions in sorting, storage, and supply chain logistics.
The Tomato Classification from Coace to Vrot model integrates advanced computer vision techniques with IoT-based monitoring to provide an accurate and automated assessment of tomato ripeness. By leveraging deep learning for image analysis and real-time data tracking through the Ubidots IoT platform, the system offers a practical solution for enhancing quality control and decision-making in agricultural and food processing industries. This integrated approach not only improves classification accuracy but also supports efficient post-harvest handling, inventory management, and overall supply chain optimization.
The following figures illustrate the results obtained from the Tomato Classification from Coace to Vrot, and discusses the output of the system.
Fig 5.1. Tomato Classification from COACE to VROT System
Fig 5.1 shows the Tomato Classification from COACE to VROT system, using Webcam for capturing the Real-time data and sending the data to Google Colab via USB port. The image processing happens in the google colab and output can be seen in the google colab screen and cloud interface.
Ripe Classification
Fig 5.2 Ripe Classification
Fig 5.2 shows the setup of Ripe classification of tomato, the ripen tomato is placed before the webcam, image is captured which is processed by the system and output is displayed.
Fig 5.3 Ripe Classification
Fig 5.3 shows the output of ripe tomato classification in the Google Colab.
Fig 5.4 Ripe Classification
Fig 5.4 shows the output of ripe tomato classification in the Ubidots Cloud.
Unripe Classification
Fig 5.5 Unripe Classification
Fig 5.5 shows the setup of unripe classification of tomato, the unripen tomato is placed before the webcam, image is captured which is processed by the system and output is displayed.
Fig 5.5 Unripe Classification
Fig 5.6 shows the output of unripe tomato classification in the Google Colab.
Fig 5.7 Unripe Classification
Fig 5.7 shows the output of unripe tomato classification in the Ubidots Cloud.
Semi-Ripen Classification
Fig 5.8 Semi-ripen Classification
Fig 5.8 shows the setup of Semi-Ripe classification of tomato, the semi-ripen tomato is placed before the webcam, image is captured which is processed by the system and output is displayed.
Fig 5.9 Semi-ripen Classification
Fig 5.9 shows the output of semi-ripen tomato classification in the Google Colab.
Fig 5.10 Semi-ripen Classification
Fig 5.10 shows the output of semi-ripen tomato classification in the Ubidots Cloud.
Rotten Classification
Fig 5.11 Rotten Classification
Fig 5.11 shows the setup of Rotten classification of tomato, the rotten tomato is placed before the webcam and processed by the system.
Fig 5.12 Rotten Classification
Fig 5.12 shows the output of rotten tomato classification in the Google Colab.
Fig 5.13 Rotten Classification
Fig 5.13 shows the output of rotten tomato classification in the Ubidots Cloud.
Ubidots Interface
Fig 5.14 Ubidots Interface
Fig 5.14 shows the total number of Ripen, Semi-Ripen, Unripen and Rotten tomatoes that are classified by the system in the Ubidots Cloud.
The results demonstrate that the proposed system effectively classifies tomatoes into distinct ripeness stages using a CNN-based approach. Real-time image capture, processing via Google Colab, and IoT integration through Ubidots collectively provide a reliable platform for agricultural quality assessment. However, the current system lacks error analysis and does not discuss classification challenges such as image blur, occlusion,or lighting variability—these aspects should be explored in future iterations.
The Tomato Classification System marks a significant advancement in agricultural automation, particularly in the domain of ripeness assessment and sorting. By leveraging state-of-the-art deep learning techniques, specifically Convolutional Neural Networks (CNNs), the system effectively addresses the limitations of manual inspection methods in tomato quality control.
A key strength of the system lies in its ability to accurately classify tomatoes into multiple ripeness stages—from Coace (fully ripe) to Vrot (spoiled)—using advanced image processing and neural network models. This ensures consistency and precision in sorting, enabling producers to uphold quality standards and streamline their operations. The integration of cloud computing platforms (e.g., Ubidots) and edge device compatibility further enhances the system’s practicality, allowing for real-time monitoring, data analysis, and informed decision-making regarding harvesting, storage, and distribution. This contributes to improved efficiency and a measurable reduction in postharvest losses.
Moreover, the system is highly scalable and adaptable, making it suitable for broader implementation across diverse agricultural settings. As technological capabilities continue to evolve, the framework can be further refined to incorporate new features, datasets, or classification needs.
In conclusion, the Tomato Classification System represents a transformative solution in precision agriculture. By combining intelligent automation with accessible technologies, it promotes sustainable practices, optimizes resource utilization, and ensures high-quality produce reaches consumers efficiently and reliably.
Limitations And Future Scope
Despite its promising performance and practical applicability, the Tomato Classification System has several limitations that present opportunities for future enhancement:
Limitations
The model was trained and tested using images captured in controlled lighting and background conditions. Its accuracy may degrade when deployed in more variable real- world environments, such as open fields or diverse indoor setups with inconsistent lighting.
Although the dataset contains over 5,000 labeled images, there is a moderate class imbalance (e.g., fewer unripe samples compared to ripe ones), which could affect the model generalization and classification confidence across all categories.
The system is optimized for performance in cloud environments (e.g., Google Colab), but its deployment on edge devices (e.g., mobile or embedded systems) may require further model compression or hardware-specific optimization.
The current system is tailored specifically to tomatoes. Its architecture and classification criteria may not directly generalize to other fruits or vegetables without retraining or redesigning the model for those datasets.
Future work can focus on deploying the model in uncontrolled agricultural environments, incorporating robust preprocessing methods (e.g., illumination normalization) to improve field-level accuracy.
The model can be extended to classify ripeness or quality in other fruits and vegetables (e.g., bananas, apples, or mangoes), with minimal architectural changes and transfer learning approaches.
Optimizing the system for real-time processing on low-power, edge AI devices (like NVIDIA Jetson Nano or Raspberry Pi with Coral USB Accelerator) would enhance its usability in resource-constrained rural settings.
Incorporating a more diverse image dataset, covering various lighting conditions, backgrounds, and camera angles, can improve model robustness and generalization.
Future versions of the system may incorporate additional data sources—such as temperature, humidity, or shelf-life indicators—using sensors to improve overall ripeness prediction accuracy.