How vib06hav/mlpr_vib_rej_rish works
Purpose and Entry Points
This repository studies BDD100K vehicle-crop classification across day-to-night domain shift for bus, car, and truck. It measures source-only degradation, supervised target fine-tuning, and DANN adaptation. The primary experiment entry point is main.py; preprocessing begins in Preprocessdata.py. run_direction1.bat is a Windows execution wrapper.
Experiment Orchestration
main.py coordinates configured experiment modes, seeds, model creation, dataset construction, training, checkpointing, and result aggregation. Global paths, hyperparameters, random seeds, and run switches are centralized in config.py. Outputs include repository-local aggregate CSVs such as all_results_summary.csv and direction1_results_summary.csv.
Data Preparation and Dataset Boundary
Preprocessdata.py extracts vehicle crops from raw BDD100K images and annotations, organizes domain-specific processed data, and balances the dataset. Raw images and labels are external to the repo, expected beneath C:\Users\vibha\Downloads\archive\.... dataset.py is the boundary between processed crop storage and PyTorch-style training inputs: it loads crops, applies transforms, assigns class/domain metadata, and supports target-label masking for Direction 1 experiments.
Domain-Adaptation Directions
The core setting is daytime source crops versus nighttime target crops. Direction-specific experiment logic is represented by main.py, dataset.py, and the specialized direction2_env_only.py / direction2_idd.py scripts. Direction 1 includes target-label availability/masking sweeps; Direction 2-related scripts appear to be adjacent variants rather than the primary BDD pipeline.
Model and Adaptation Stack
models.py defines the vehicle classifier backbone/head used for standard supervised training. dann.py adds DANN-specific architecture pieces: gradient reversal and a domain classifier attached to learned features. This separates label prediction from domain discrimination so training can jointly optimize vehicle classification and domain-invariant representations.
Training and Evaluation Flow
train.py implements standard supervised and DANN training loops. Standard runs train on labeled source data and optionally supervised target data; DANN runs additionally consume domain labels for source and target batches through dann.py. evaluate.py computes classification metrics, per-seed aggregation, and analysis helpers, producing comparable source/target and adaptation results.
Visualization and Adjacent Work
run_tsne_bdd.py provides standalone feature-space t-SNE visualization for the BDD study. visualise.py supports visualization utilities. IDD scripts—including PreprocessIDD.py, FinalizeIDD.py, eval_idd_perclass.py, and CullPool.py—are adjacent work and not the central BDD day-to-night architecture.
Main entry points: main.py Experiment orchestrator · dataset.py Training dataset boundary · train.py Training loops · models.py Vehicle classifier
Components 17
BDD Day-to-Night Study
Primary vehicle-crop domain-adaptation pipeline.
- Raw BDD100K images & labels · External source data and annotations.
- BDD crop preprocessing · Extracts, organizes, and balances vehicle crops.
Preprocessdata.py - Processed domain crops · Daytime source and nighttime target vehicle crops.
- Training dataset boundary · Loads crops, transforms them, and supplies class/domain metadata.
dataset.py - Experiment configuration · Centralizes paths, seeds, hyperparameters, and run switches.
config.py - Experiment orchestrator · Builds runs, models, datasets, checkpoints, and summaries.
main.py - Windows run wrapper
run_direction1.bat - Vehicle classifier · Backbone and classification head for bus, car, and truck.
models.py - DANN adaptation model · Adds gradient reversal and a domain classifier over learned features.
dann.py - Training loops · Runs source-only, target fine-tuning, and DANN optimization.
train.py - Metrics & aggregation · Computes classification metrics and per-seed results.
evaluate.py - CSV result summaries · Aggregate comparable source, target, and adaptation results.
all_results_summary.csv - BDD feature t-SNE · Standalone feature-space visualization for the BDD study.
run_tsne_bdd.py - Visualization utilities
visualise.py - Direction 2 environment variant · Adjacent direction-specific variant, not the primary BDD flow.
direction2_env_only.py - Direction 2 IDD variant · Adjacent direction-specific variant, not the primary BDD flow.
direction2_idd.py
Adjacent IDD Work
Separate supporting experiments outside the core BDD flow.
- IDD preprocessing & analysis · Includes IDD preparation, finalization, curation, and per-class evaluation.
PreprocessIDD.py
Connections 18
- Raw BDD100K images & labels → BDD crop preprocessing: images and annotations
- BDD crop preprocessing → Processed domain crops: vehicle crops
- Processed domain crops → Training dataset boundary: loads crops
- Experiment configuration → Experiment orchestrator: run settings
- Windows run wrapper → Experiment orchestrator: launches Direction 1
- Experiment orchestrator → Training dataset boundary: constructs datasets
- Experiment orchestrator → Vehicle classifier: creates standard model
- Experiment orchestrator → DANN adaptation model: creates adaptation model
- Training dataset boundary → Training loops: labeled crops and domains
- Vehicle classifier → Training loops: supervised model
- DANN adaptation model → Training loops: label and domain heads
- Training loops → Metrics & aggregation: predictions and checkpoints
- Metrics & aggregation → CSV result summaries: aggregate CSVs
- Experiment orchestrator → CSV result summaries: coordinates outputs
- Vehicle classifier → BDD feature t-SNE: feature extractor
- BDD feature t-SNE → Visualization utilities: uses utilities
- Direction 2 environment variant → Training dataset boundary: related dataset experiments
- Direction 2 IDD variant → IDD preprocessing & analysis: related IDD work