CultivaSense is a comprehensive AI-powered agricultural intelligence platform designed specifically for Indian agriculture. Using advanced machine learning algorithms and computer vision, it provides farmers with data-driven insights including crop recommendations, disease detection, and market price predictions to maximize yield and promote sustainable farming practices.
๐ฅ โถ Watch the full demo on YouTube โ See CultivaSense in action: Smart Farming Using AI & Machine Learning
- 95% Accuracy in crop recommendations using Random Forest Classifier
- 22 Different Crops analyzed and supported (Rice, Wheat, Maize, Cotton, and more)
- Real-time soil condition analysis with 7 environmental parameters
- Personalized suggestions based on NPK levels, pH, temperature, humidity, and rainfall
- Instant comparison between your soil values and ideal conditions
- Computer Vision-based disease identification from crop images
- Supports 32 disease classes across major crops (Apple, Corn, Grape, Potato, Rice, Tomato, Wheat)
- Instant diagnosis with confidence scores
- Detailed treatment recommendations for each detected disease
- Image upload with preview (supports JPG, PNG up to 5MB)
- Covers diseases like:
- Rice: Brown Spot, Leaf Blast, Neck Blast
- Wheat: Brown Rust, Yellow Rust
- Tomato: Early Blight, Late Blight, Leaf Mold, Bacterial Spot, and more
- Potato, Corn, Apple, Grape diseases
- AI-powered price forecasting using Random Forest Regressor
- Predictions for 8 major crop categories (Rice, Wheat, Maize, Cotton, Sugarcane, Pulses, Vegetables, Fruits)
- 13 Indian states coverage (Maharashtra, Punjab, Haryana, UP, Bihar, and more)
- Seasonal analysis with month-wise predictions
- Weather-based market trend insights
- Factors considered: Crop type, State, Month, Rainfall, Temperature
- NPK Analysis (Nitrogen, Phosphorus, Potassium)
- pH Level monitoring and recommendations
- Nutrient Deficiency detection with interactive recovery plans
- Environmental factor analysis (temperature, humidity, rainfall)
- Visual comparison charts (Your values vs Ideal values)
- Instant access to detailed recovery plans for each nutrient
- Specific fertilizer recommendations with dosages
- Application schedules and timing guidance
- Separate plans for deficiency and excess conditions
- Covers all parameters: N, P, K, pH, Temperature, Humidity, Rainfall
- Mobile-responsive design with glassmorphism effects
- Dark mode optimized interface
- Interactive animations and smooth transitions
- Real-time validation with helpful error messages
- Sample data loading for quick testing
- Accessibility features with ARIA labels
- Real-time ROI analysis for crop profitability planning
- Input land area, expected yield, selling price, and cost breakdown
- Calculates Total Investment, Revenue, Net Profit, and ROI %
- Break-even yield analysis to understand minimum viable production
- Risk assessment with color-coded indicators (Highly Profitable โ High Risk)
- Smart tips for improving profitability (cost optimization, scaling advice)
- Supports per-acre cost breakdown: Seeds, Fertilizer, Labor, Miscellaneous
- Powered by Google Gemini 2.0 Flash
- Real-time interaction with a specialized agricultural AI
- Personalized advice based on your local weather and soil conditions
- Location-aware responses (using GPS coordinates)
- Conversational interface for natural farming queries
graph TB
subgraph User Interface
A["๐ Web Browser"]
end
subgraph Flask Backend
B["โ๏ธ Flask App (app.py)"]
end
subgraph ML Models
C["๐ง Crop Recommendation<br/>Random Forest Classifier"]
D["๐ฌ Disease Detection<br/>Computer Vision + CSV"]
E["๐ฐ Price Prediction<br/>Random Forest Regressor"]
end
subgraph External APIs
F["๐ค Google Gemini API<br/>AI Chatbot"]
G["๐ค๏ธ OpenWeather API<br/>Weather Data"]
end
subgraph Data Layer
H["๐ Crop_recommendation.csv"]
I["๐ฆ Crop_Disease.csv"]
J["๐ market_price_data.csv"]
end
A -->|HTTP Requests| B
B --> C
B --> D
B --> E
B --> F
B --> G
C --> H
D --> I
E --> J
- Python 3.8 or higher
- pip package manager
- Modern web browser
- (Optional) TensorFlow for disease detection model
-
Clone the repository
git clone https://github.com/dasouvik122005/Cultiva-Sense.git cd Cultiva-Sense -
Create virtual environment
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
cp .env.example .env # Edit .env file with your API keysRequired Keys:
GEMINI_API_KEY: Get from Google AI StudioOPENWEATHER_API_KEY: Get from OpenWeatherMap
-
Run the application
python app.py
-
Open in browser Navigate to
http://127.0.0.1:5000
- Navigate to the "Soil Analyzer" section
- Enter soil nutrient values (N, P, K)
- Input environmental conditions (temperature, humidity, pH, rainfall)
- Click "Analyze Soil" for instant crop recommendations
- View nutrient comparison and recovery plans
- Go to the "Crop Disease Detection" section
- Upload a clear image of the affected crop (JPG/PNG, max 5MB)
- Click "Detect Disease" for instant diagnosis
- View disease name, confidence score, and treatment recommendations
- Navigate to "Market Price Prediction" section
- Select crop type and state
- Choose month and enter weather conditions
- Click "Predict Price" for market forecasts
- View predicted price and market trend analysis
- Scroll to the "Financial Planning & ROI" section
- Enter your land area (acres), expected yield (kg/acre), and selling price (โน/kg)
- Fill in per-acre costs: Seeds, Fertilizer, Labor, Other
- Click "Calculate ROI" to see your full profitability analysis
- Review Net Profit, ROI %, break-even yield, and smart tips
Cultiva-Sense/
โ
โโโ ๐ app.py # Main Flask application with all routes
โโโ ๐ config.py # Configuration management
โโโ ๐ setup.py # Project setup script
โโโ ๐ requirements.txt # Python dependencies
โโโ ๐ .env.example # Environment variables template
โ
โโโ ๐ Models & Data
โ โโโ model.pkl # Trained crop recommendation model
โ โโโ minmaxscaler.pkl # Feature scaling model
โ โโโ Crop_recommendation.csv # Training dataset
โ โโโ Crop_Disease.csv # Disease detection database
โ โโโ market_price_data.csv # Market price historical data
โ โโโ models/
โ โโโ plant_disease_model.h5 # CNN model for disease detection (optional)
โ โโโ market_price_model.pkl # Price prediction model
โ โโโ price_scaler.pkl # Price feature scaler
โ โโโ disease_classes.json # Disease class mappings
โ โโโ price_model_info.json # Price model metadata
โ
โโโ ๐ static/
โ โโโ ๐จ style.css # Modern responsive styling
โ โโโ โก script.js # Interactive functionality
โ โโโ ๐ผ๏ธ logo.png # Brand logo
โ
โโโ ๐ templates/
โ โโโ ๐ index.html # Main web interface
โ
โโโ ๐ uploads/ # Temporary storage for uploaded images
โ
โโโ ๐ ๏ธ Utilities
โ โโโ generate_disease_data.py # Generate disease dataset
โ โโโ generate_market_price_data.py # Generate price dataset
โ
โโโ ๐ Crop Classification...ipynb # Jupyter notebook for model training
โโโ ๐ CONTRIBUTING.md # Contribution guidelines
โโโ ๐ CODE_OF_CONDUCT.md # Code of conduct
โโโ ๐ SECURITY.md # Security policy
โโโ ๐ README.md # Project documentation
- Flask 2.3.3 - Lightweight web framework
- Python 3.8+ - Core programming language
- Scikit-learn 1.3.0 - Machine learning library
- Pandas 2.0.3 - Data manipulation and analysis
- NumPy 1.24.3 - Numerical computing
- Pillow - Image processing for disease detection
- h5py - HDF5 file handling
- Google Gemini API - AI-powered conversational advisor
- Gunicorn - Production WSGI server
- HTML5 - Modern semantic markup
- CSS3 - Responsive design with glassmorphism effects
- JavaScript (Vanilla) - Interactive user experience
- Responsive Design - Mobile-first approach
- Accessibility - ARIA labels and semantic HTML
- Random Forest Classifier - Crop recommendation (95% accuracy)
- Random Forest Regressor - Market price prediction
- Computer Vision - Image-based disease detection
- Min-Max Scaling - Feature normalization
- Cross-validation - Model performance optimization
- TensorFlow/Keras - Deep learning for advanced disease detection
- CNN (Convolutional Neural Network) - Image classification
CultivaSense provides recommendations for 22 major Indian crops:
๐พ Cereals: Rice, Wheat, Maize, Barley
๐ซ Legumes: Chickpea, Kidney Beans, Pigeon Peas, Moth Beans, Mung Bean, Black Gram, Lentil
๐ฅฅ Plantation: Coconut, Coffee
๐ Fruits: Apple, Banana, Grapes, Orange, Papaya, Pomegranate, Watermelon, Muskmelon
๐ฑ Cash Crops: Cotton, Jute
- Accuracy: 95%+ on validation dataset
- Training Data: 2,200+ soil samples
- Features: 7 soil and environmental parameters (N, P, K, Temperature, Humidity, pH, Rainfall)
- Algorithm: Random Forest Classifier
- Validation: K-fold cross-validation
- Optimization: Grid search hyperparameter tuning
- Disease Classes: 32 different diseases
- Supported Crops: 7 major crops (Apple, Corn, Grape, Potato, Rice, Tomato, Wheat)
- Detection Method: Computer Vision + CSV-based matching
- Image Support: JPG, PNG (up to 5MB)
- Features: Color analysis, affected area detection
- Treatment Database: Comprehensive recommendations for each disease
- Crop Categories: 8 major categories
- Geographic Coverage: 13 Indian states
- Algorithm: Random Forest Regressor
- Features: Crop ID, State ID, Month, Rainfall, Temperature
- Feature Importance: Crop type (78.8%), Temperature (7.3%), Month (5.2%), Rainfall (5.3%), State (3.4%)
- Seasonal Analysis: Month-wise trend predictions
- Market Insights: Weather-based trend analysis
- ๐ฟ Promote eco-friendly farming practices
- ๐ง Optimize water usage through smart recommendations
- ๐ฑ Reduce chemical fertilizer dependency
- ๐ Increase crop yield efficiency
- ๐พ Support biodiversity in agricultural systems
CultivaSense is designed with a mobile-first approach:
- โ Fully Responsive - Works on all screen sizes
- โ Touch-Friendly - Optimized for mobile interactions
- โ Fast Loading - Optimized performance
- โ Progressive Web App - App-like experience
We welcome contributions to make CultivaSense even better!
Please read our Contribution Guidelines and Code of Conduct before contributing.
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
- ๐พ Additional crop support
- ๐ง Model accuracy improvements
- ๐จ UI/UX enhancements
- ๐ Localization support
- ๐ฑ Mobile app development
For security concerns, please review our Security Policy.
- Indian Agricultural Research Institute - Dataset and domain expertise
- Scikit-learn Community - Machine learning framework
- Flask Team - Web framework development
- Agricultural Experts - Domain knowledge and validation
- ๐ฐ๏ธ Satellite Imagery - Remote sensing capabilities for field analysis
- ๐ Advanced Analytics Dashboard - Historical tracking and trend analysis
- ๐ Multi-language Support - Hindi, Tamil, Telugu, Bengali, and other regional languages
- ๐ฑ Progressive Web App - Offline capability and app-like experience
- ๐พ User Accounts - Save predictions and track farming history
- ๐ง Email Reports - Automated PDF reports via email
- ๐พ Advanced Disease Detection - Deep learning CNN model with 98%+ accuracy
- ๐ฏ Precision Farming - GPS-guided field-specific recommendations
- ๐ก IoT Integration - Smart sensor connectivity for real-time monitoring
- ๐ Yield Prediction - AI-powered harvest forecasting
- ๐ Community Platform - Farmer forums and knowledge sharing
- ๐ช Marketplace Integration - Direct buyer-seller connections
- ๐ฑ Native Mobile Apps - iOS and Android applications
- โ Crop Disease Detection with 32 disease classes
- โ Market Price Prediction for 8 crop categories across 13 states
- โ Interactive Recovery Plans for all soil parameters
- โ Mobile-responsive modern UI with glassmorphism design
- โ Computer Vision-based disease analysis
- โ Seasonal market trend analysis
- โ Weather API Integration (OpenWeatherMap)
- โ AI Chatbot powered by Google Gemini 2.0 Flash
- โ Financial Planning & ROI Calculator with profitability analysis
- โญ 95% Model Accuracy (Crop Recommendation)
- ๐พ 22 Supported Crops
- ๐ฌ 32 Disease Classes Detected
- ๐ฐ 8 Crop Categories for Price Prediction
- ๐บ๏ธ 13 Indian States Coverage
- ๐ 2,200+ Training Samples
- ๐ฎ๐ณ Pan-India Coverage
- ๐ฑ 100% Mobile Responsive
| Name | GitHub |
|---|---|
| Souvik Das | @dasouvik122005 |
| Soaham Behera | @SoahamBehera |
| Surajit Das | @surajitdas-gif |
| Nandini Verma | @nandiniverma29 |
๐ฑ Empowering Indian Agriculture with AI ๐ค
Built with โค๏ธ for sustainable farming and food security
Five Powerful Features:
๐ง Crop Recommendation | ๐ฌ Disease Detection | ๐ฐ Price Prediction | ๐ ROI Calculator | ๐ค AI Advisor
๐ง Contact: dasouvik122005@gmail.com
ยฉ 2026 CultivaSense. All rights reserved. | Built for Indian Agriculture ๐ฎ๐ณ
