Rice Identification based on Color

Automating rice variety detection with data mining

Hibatillah's PFP

The API Transition

While I had built full-stack applications using PHP before, this Rice Identification project was my first venture into API-driven architecture.

In my previous projects, the frontend and backend were tightly coupled (Monolithic MVC). This project required a different approach. I had to build a standalone web interface that could talk to a separate Python backend. It was my first time implementing a true API endpoint to bridge the gap between a user's browser and a Deep Learning model.

The Research Problem

In the agricultural industry, manually sorting rice based on quality (often determined by color consistency) is labor-intensive and prone to error.

Data Mining Methodology

This project was part of our Data Mining curriculum, where we applied the standard pipeline:

1. Data Collection & Cleaning

We gathered a dataset of various rice types. Before feeding them into the model, we had to clean the data, standardizing image sizes and removing noise, to ensure our color classification algorithm wouldn't be biased by lighting conditions.

2. Model Training

We used Python to build a model that could differentiate rice types based on RGB color histograms.

Building the Bridge

The hardest part wasn't the UI, but the Integration.

At the time, I was comfortable with HTML and CSS, but connecting them to a running Python script was a mystery.

The Mentorship Factor

I focused heavily on the frontend implementation, ensuring the user could upload an image and see the result without a page reload.

However, the handshake between the frontend and the Flask backend was complex for my skill level at the time. Working closely with our laboratory assistant, I learned how to structure AJAX requests to send image data asynchronously.

This collaboration demystified the concept of API endpoints for me, teaching me that a backend is simply a function waiting to be called by the frontend.

Key Takeaways

This project was simple by industry standards, but it was a massive leap for my understanding of software architecture.