← Latest papers
💻 computer science

Banana Ripeness Stage Identification Using Transformers

This study proposes an automated banana ripeness classification system using deep learning models, specifically demonstrating that the Swin Transformer Tiny architecture achieves high accuracy (86.78%) in categorizing Moira bananas into five stages while utilizing Explainable AI techniques to ensure prediction interpretability.

Original authors: Rudresh Arabekar Rudresh Arabekar, Sahil Goes Sahil Goes, Anant Sawant Anant Sawant, Vollny Coelho Vollny Coelho, Tanvi Dharwadkar Tanvi Dharwadkar

Published 2026-11-10
📖 5 min read🧠 Deep dive

Original authors: Rudresh Arabekar Rudresh Arabekar, Sahil Goes Sahil Goes, Anant Sawant Anant Sawant, Vollny Coelho Vollny Coelho, Tanvi Dharwadkar Tanvi Dharwadkar

Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). ✨ This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Every day, millions of bananas travel from tropical farms to grocery shelves, a journey governed by a delicate biological clock. As the fruit matures, it undergoes a visible transformation: the skin shifts from green to yellow, then develops brown spots, and finally turns dark as the fruit softens and begins to decay. This process is not merely aesthetic; it dictates the fruit's value, its shelf life, and whether it is ready to eat. For decades, farmers and distributors have relied on human workers to inspect these fruits, judging ripeness by eye and touch. While experienced, this method is slow, subjective, and prone to error, often leading to significant waste when perfectly good fruit is discarded or when overripe fruit reaches the market. To solve this, researchers have turned to computers, teaching them to see what humans see. The challenge lies in teaching a machine to distinguish between subtle stages of change, such as the difference between a banana that is just beginning to ripen and one that is fully ready, or a fruit that is slightly overripe and one that is rotting. This requires a system that can analyze color, texture, and patterns with a consistency that human eyes cannot match.

A team of researchers from the Agnel Institute of Technology and Design in India has developed a new system to automate this grading process, moving beyond traditional methods to test a cutting-edge approach known as the Vision Transformer. Unlike older computer vision systems that scan an image in small, local patches, looking for specific edges or shapes, this new approach looks at the entire image at once, understanding how different parts of the fruit relate to one another. The researchers focused specifically on the Moira variety of banana, a common type in their region, and created a massive library of 4,500 high-resolution photographs. They organized these images into five distinct categories: unripe, mid-ripe, ripe, overripe, and rotten, ensuring an equal number of examples for each stage to prevent the computer from favoring one type over another. Before the computer could learn, the researchers cleaned the images, removing the backgrounds so the system focused only on the fruit itself, and adjusted the size and lighting to ensure every picture was treated the same way.

To find the best way to teach the computer, the team tested five different digital architectures, including established models and newer, more complex designs. They did not simply train the models once and declare a winner; instead, they used a rigorous testing method where the data was split into five groups, and the models were trained and tested on different combinations of these groups repeatedly. This ensured that the results were not a lucky fluke but a reliable measure of performance. The study found that a specific architecture called the Swin Transformer outperformed all others. This model achieved an average accuracy of nearly 87.4 percent across the various tests, correctly identifying the ripeness stage of a banana in the vast majority of cases. It proved to be more stable and consistent than the other models, including older, well-known systems that rely on simpler scanning methods. The researchers confirmed that this success held true even when the model was tested on a completely new set of images it had never seen before, where it maintained an accuracy of 86.8 percent.

What makes this discovery particularly valuable is not just the high score, but the nature of the mistakes the computer made. When the system did get it wrong, it almost always confused a banana with its immediate neighbor in the ripening process, such as mistaking a ripe fruit for an overripe one, rather than confusing a green banana with a rotten one. This is a crucial distinction for quality control, as a small error in judgment is far less damaging than a major one. To ensure the computer was not just guessing based on random patterns, the researchers used a technique to visualize exactly what the model was looking at when it made a decision. These visual maps showed that the system was correctly focusing on the actual fruit, specifically the color of the peel and the presence of brown spots, rather than being distracted by the background or shadows. The computer was effectively learning the same biological signs that a human expert would use, but with a level of precision and speed that humans cannot sustain.

The researchers did not stop at the laboratory results; they built a working web application to demonstrate how this technology could be used in the real world. In this system, a user can upload a photo of a banana, and the application first checks to ensure the image actually contains a banana, removing the background and then running the image through the trained model. The system then provides a clear answer about the ripeness stage, along with a confidence score and a visual highlight showing which parts of the fruit influenced the decision. This end-to-end solution proves that the technology is ready to move from a research experiment to a practical tool for farmers and vendors. By automating the grading process, this system offers a way to reduce waste, improve the efficiency of the supply chain, and ensure that consumers receive fruit at the perfect stage of ripeness, all while providing a transparent and reliable method for making these critical decisions.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →