How gladiator07/harvestify works
Project Overview & Main Components
• Harvestify is a full-stack web application that leverages ML and DL models to provide three core functionalities:
– Crop Recommendation (predicts which crop to grow based on soil inputs and environmental data)
– Fertilizer Suggestion (analyzes soil nutrient data to suggest fertilizer improvements)
– Plant Disease Detection (uses a deep learning-based image classifier to detect plant diseases)
• The architecture consists of a frontend user interface, a Flask-based backend, ML/DL model integrations, and data resources.
Breaking Down the File Structure & Its Impact
• App Layer (app folder):
– app.py: The main Flask application that handles web requests.
– config.py and Procfile/Runtime.txt: Configuration and deployment specifics (Heroku).
– Templates and Static folders: Hold the HTML, CSS, and JavaScript assets for user interface presentation.
– Utils folder: Contains helper modules (e.g., disease.py, fertilizer.py, model.py) to process input data and interface with ML models.
– Data and Models: The ML model files (e.g., RandomForest.pkl, plant_disease_model.pth) used for predictions.
• Models folder (outside the app subdirectory): Contains additional pre-trained ML models (e.g., DecisionTree, NBClassifier, SVMClassifier, XGBoost) which may support experimental or alternative prediction strategies.
• Data Folders (Data-raw and Data-processed):
– Provide the CSV inputs for training models and possibly reference datasets.
• Notebooks folder:
– Holds the experiments/notebooks used for model training and data preparation (not part of the production deployment but informative of the development process).
• Frontend (User Interface):
– Represented by the HTML templates, CSS, JavaScript, and static resources.
– Responsible for capturing user inputs (e.g., soil data, crop selection, uploaded image) and displaying results.
• Backend (Flask Application):
– Acts as the central orchestrator.
– Handles HTTP requests (routing for crop, fertilizer, and disease functionalities).
– Invokes utility functions (in app/utils) that pre-process inputs, call ML models, and format the outputs.
• ML/DL Models:
– Represent different pipelines:
º The Crop Recommendation and Fertilizer Suggestion pipelines use models like RandomForest (from app/models & models folder).
º Disease Detection uses a deep learning model (plant_disease_model.pth) to process image inputs.
– These components reside either within the app folder or in the models folder.
• Data Sources:
– CSV datasets stored in the Data-raw, Data-processed, and app/Data directories.
– These are used to feed inputs to training pipelines (as shown in the notebooks) and act as reference data at runtime.
• External Services:
– For instance, a Weather API is mentioned to fetch temperature and humidity data based on city names provided by users.
• Deployment Infrastructure:
– The presence of files like Procfile, Runtime.txt, and guidelines in the README indicate Heroku deployment.