Inspiration

I was inspired by the growing challenges farmers face due to unpredictable weather patterns, soil degradation, and inefficient resource use. I noticed that modern agriculture usually lacks accessible, data-driven tools that can help farmers make informed decisions. I wanted to build something practical—an AI-powered assistant that empowers farmers, increases yield, and reduces risk using real agricultural data.

What it does

AgriYield-Pro Predictor is trained model used as decision-support tool designed to help farmers and agricultural planners accurately estimate crop yield before harvest. Using machine learning trained on real agricultural data—including soil type, region, rainfall, temperature, irrigation, fertilizer use, and weather—the system predicts yields instantly and provides actionable recommendations to improve productivity.

Our platform not only forecasts expected yield but also analyzes field conditions, highlights limiting factors, and visualizes before-and-after improvements through interactive charts. AgriYield-Pro gives farmers data-driven insights that reduce uncertainty, optimize resource usage, and ultimately increase profitability. It’s an accessible, intelligent assistant for modern farming.

How we built it

Dataset Preparation Loaded and cleaned agricultural data, separated features (X) and target (Y), handled string variables using one-hot encoding, and split the dataset into training and testing sets.

Model Training Built a Linear Regression model in Python and evaluated it using R², MAE, and RMSE. Once the model performed well, I saved it using Joblib.

FastAPI Backend Created a FastAPI service that loads the trained model and exposes a /predict endpoint. This allows external applications to request yield predictions.

ASP.NET Core Front-End Developed a clean, intuitive UI that collects farm details from the user and sends them to the backend API. Added charts, yield comparison, and dynamic recommendations.

Yield Improvement Logic Implemented recommendation rules and a system to estimate yield improvements if the farmer follows suggested actions.

Challenges we ran into

  1. The ML model initially failed due to string inputs (“North”, “Sandy”, etc.), requiring one-hot encoding.

  2. Integrating FastAPI and ASP.NET took time, especially ensuring the API paths and payloads matched.

  3. FastAPI couldn’t find yield_model.pkl until the correct folder structure and working directory were fixed.

  4. Designing useful, realistic agricultural suggestions required multiple refinement iterations.

What we learned

Through this project, I learned how machine learning models can be applied to real-world agricultural problems. Specifically, I gained experience in preparing datasets and training regression models for yield prediction by using one-hot encoding to handle categorical features. Building and testing a FastAPI-based backend for ML inference. Integrating two different technologies (Python ML + .NET UI) into one unified solution. This project strengthened both my machine learning and full-stack development skills.

What's next for AgriYield - Pro

Add a Farmer Dashboard A beautiful dashboard where farmers can: ✔ Save predictions ✔ Compare fields ✔ See history ✔ See recommended actions over time

Add Pest & Disease Risk Prediction Use environmental data + crop type to estimate risk of: ✔ Blight ✔ Root rot ✔ Aphids ✔ Leaf spot

Replace Linear Regression with Stronger ML Models Upgrade ML pipeline: ✔ RandomForestRegressor ✔ XGBoost ✔ LightGBM ✔ CatBoost

Share this project:

Updates