How dineshque/cnn-based-plant-pathology-analysis works
Project type and purpose
• This is a monolithic full-stack web application for CNN-based plant pathology analysis.
• Built in Python, it uses Streamlit to serve a UI, TensorFlow for inference, and common CV libraries for preprocessing.
• In addition, a Jupyter notebook is provided for offline model training and experimentation.
File structure
• Top level:
• README.md – project overview and setup instructions
• app.py – Streamlit application script (serves UI, handles uploads, runs inference)
• plant-pathology-dinesh.ipynb – Jupyter notebook used to train or evaluate the CNN model offline
• requirements.txt – Python dependencies
README for additional insights
• Confirms a single-page Streamlit UI where users upload leaf images.
• Inference is performed on a pre-trained plant_model.keras (placed in the root).
• Key libraries: TensorFlow 2.x, OpenCV, Pillow, NumPy, Plotly.
Main components and their relationships
a. User Browser (UI)
• Uploads images and displays results via HTTP (Streamlit’s embedded server)
b. Streamlit Server (app.py)
• Routes upload events to the inference pipeline
• Hosts all UI widgets (file uploader, charts, images)
c. Image Preprocessing Module
• Uses OpenCV / Pillow to resize, normalize, and batch images
d. CNN Inference Engine
• Loads plant_model.keras via TensorFlow
• Runs model.predict(...) to get disease probabilities
e. Visualization Module
• Uses Plotly to render probability distributions, bar charts, or annotated images
f. Model Training Notebook (Offline)
• Jupyter notebook for training, evaluation, saving plant_model.keras
• Depends on the same libraries but is not part of the live service
g. File System / Storage
• Contains the saved plant_model.keras
Architectural patterns and design principles
• Monolithic single-process architecture: No microservices, everything runs inside a Streamlit app.
• Separation of concerns within the code: UI layer (Streamlit), preprocessing, model loading/inference, and visualization.
• Offline/online separation: Notebook for training vs. app.py for serving.
• A note or callout that the Jupyter notebook is not part of the production server