How kimzed/hiatus_change_detection works
Project Type and Purpose
• This is a research/experimental machine learning project implemented in PyTorch.
• Its goal is to detect landscape changes over time in 3D data through unsupervised domain adaptation.
• The README explains that the code deals with dataset loading, pre-processing raw rasters, training models, and evaluating performance using various visualization techniques as well as ground truth comparisons.
Analysis of the File Structure
• Top-level scripts like main.py, train.py, and evaluation scripts (evaluate.py, model_evaluation.py) indicate the presence of distinct phases (data preparation, training, evaluation).
• The presence of frejus_dataset.py and pre_processing.py clearly defines the data ingestion and transformation layer.
• Files such as model.py, loss.py, metrics.py, and utils.py encapsulate the machine learning logic – from model architecture to loss computation and auxiliary functions.
• The evaluation_models directory contains subdirectories (e.g., AE_Mmodal and AE_Mmodal+DAN+split) which presumably host pre-trained or alternative model architectures to be loaded and compared during evaluation.
Main Components of the System
a. Data Layer:
• Dataset Loader: Represented by frejus_dataset.py which loads the Fréjus dataset.
• Pre-processing: Captured by pre_processing.py to prepare raw rasters.
• Ground Truth Preparation: Provided by ground_truth.py to specify expected outcomes.
b. Model Building and Training:
• Model Definition: model.py holds the network architecture(s).
• Training Loop: train.py and main.py (as the main driver) combine to orchestrate training processes using parameters like epoch count and learning rate.
• Loss and Metrics: loss.py and metrics.py define the optimization objective and performance measures.
• Utility Functions: utils.py is used for various shared helper tasks.
c. Evaluation and Analysis:
• Model Evaluation: model_evaluation.py and evaluate.py drive the testing and visualization routines.
• Evaluation Models: The evaluation_models directory holds different architectural variations available for comparison.
• Visualization and Performance Assessment: Explained in the README as part of the output for exploration and study.
Relationships and Interactions
• Data flows from the raw dataset through frejus_dataset.py and pre_processing.py to produce the input for model training.
• Training scripts (main.py, train.py) consume processed data, call model.py to build the network architecture, use loss and metrics (loss.py and metrics.py) for learning signal, and may use utils.py for support.
• The main script serves as a command-line entry point, with additional configuration (e.g., command-line arguments like epochs, learning rate) that modulate overall behavior.
Architectural Patterns/Design Principles
• Modular Separation: Each phase (data ingestion, processing, training, evaluation) has its own dedicated module/script.
• Configurability: The use of main.py with command-line flags shows an emphasis on configurable execution.
• Extensibility: Storing various models in evaluation_models and having separate components (training versus evaluation) allows easy experimentation with different architectures or change detection algorithms.
• Dependency on External Libraries: The README highlights that the project requires a specific conda environment including geospatial packages and PyTorch.