AgriSeg is a pipeline for semantic segmentation of rice crops using SAR imagery. It preprocesses SAR data and applies state-of-the-art Semantic Segmentation models for precise rice field segmentation. Scalable and customizable, AgriSeg supports agricultural monitoring, enabling data-driven decisions for sustainable crop management.
# AgriSeg
**AgriSeg** is a pipeline for semantic segmentation of rice crops using SAR imagery. It preprocesses SAR data and applies state-of-the-art Semantic Segmentation models for precise rice field segmentation. Scalable and customizable, AgriSeg supports agricultural monitoring, enabling data-driven decisions for sustainable crop management.
# **Pipeline**
## **Introduction**
The pipeline offers a robust solution for handling image data of arbitrary sizes by employing a systematic approach of patching images into fixed-size patches. This not only enables efficient data augmentation but also facilitates training models on very high-resolution data that would otherwise exceed GPU memory limitations.
The process of training begins with the `train.py` script, where paths are created and essential utilities from `utils.py` are invoked. The data loading and preparation steps are handled in `dataset.py`, where the dataset is generated, split, and train, valid and test CSV files are saved. The image patching process, including saving co-ordinate of patches to train, valid, and json files is executed, followed by data augmentation and transformation through the `Augment` class. The dataset is then prepared using `MyDataset` class, which handles data fetching and transformation.
Metrics calculation, focal loss computation, and model initialization are handled in separate modules respectively `metrics.py`, `loss.py`, `model.py`, ensuring modularity and ease of management. Callback selection, including learning rate scheduling and validation visualization, is orchestrated through `SelectCallbacks` class.
For evaluation, two distinct scenario are provided in `test.py`. In the first scenario (evaluation = False), the evaluation dataset is prepared similarly to the training dataset, and predictions are made and displayed for analysis. In the second scenario (evaluation = True), additional steps for generating evaluation CSVs named eval_csv_gen is called
Throughout th …