How tejasri19/stressnet works
Project type and purpose
• This is a machine-learning research pipeline for water-stress classification in maize.
• It consists of two main stages: data preparation/segmentation (R script) and model training/evaluation (Python/PyTorch).
File structure
• Top level:
• Data_Preparation/Plot_Segmentation.R & Readme.md
• README.md (project overview)
• StressNet/ (Jupyter notebook, model scripts, model_graph.pdf)
• The directory names imply:
• A standalone R-based segmentation step
• A PyTorch-based modeling step with multiple versions of model code (model.py through model10.py) and a main_code.ipynb notebook.
README for additional insights
• Dependencies: Python 3.8.17, PyTorch 1.8.0, TorchVision 0.9.0, Anaconda.
• The core architecture is a deformable-attention network combining spatial, spectral and temporal branches.
Main components
a. Data sources (multispectral images, time-series data per plot)
b. Data preparation/segmentation
• R script: Plot_Segmentation.R
• Output: segmented plot masks or cropped images
c. Data ingestion & preprocessing
• Python data loader (in main_code.ipynb)
• Steps: channel‐wise extraction, normalization, batching
d. Model architecture (StressNet)
• Spatial branch
• Spectral branch
• Temporal branch
• Deformable attention fusion layer
e. Training & evaluation
• Training loop in PyTorch
• Loss computation, backprop, metrics
f. Outputs
• Water stress classification labels
• Model checkpoints, performance plots (as in model_graph.pdf)
Architectural patterns and design principles
• Pipeline pattern (clear stage separation)
• Modularization (R for segmentation, Python for modeling)
• Reproducibility (conda environment, Jupyter notebook for experiments)
• Versioning of model code for incremental experiments (model.py → model10.py)
Key technologies/frameworks
• R (Plot_Segmentation.R)
• Python 3.8.17, Anaconda
• PyTorch 1.8.0, TorchVision 0.9.0
• Jupyter Notebook (main_code.ipynb)
Detailed capture of essential elements
• Hyperparameters or configs if desired (e.g., batch size, learning rate).
• External dependencies (PyTorch, TorchVision) as annotations near the model component.