This repository implements a framework for unsupervised incremental learning using visual DNA (vDNA). The main goal is to adapt the DeepLabV3Plus_resnet101 architecture, initially trained on the Cityscapes dataset, to the KITTI-360 dataset. The project leverages self-training using weak label generation and knowledge distillation to incrementally fine-tune the model on new datasets.
Source Dataset and Model: Cityscapes trained on DeepLabV3Plus-ResNet101 Architecture.
Target Dataset: KITTI-360
git clone https://github.com/DLL-Project-Incremental-Learning/Unsupervised-Incremental-Learning-vDNA.git
pip install -r requirements.txt
datasets/data/cityscapes
/datasets
/data
/cityscapes
/gtFine
/leftImg8bit
datasets/data/KITTI-360
/datasets
/data
/KITTI-360
/data_2d_raw
/data_2d_semantics
/checkpoints
folderRun the run_train_test.py
script to execute the training and testing pipeline, process the results, and log the mIoU metrics for both the Cityscapes and KITTI datasets.
python run_train_test.py
The main training and fine-tuning pipeline is implemented in pipeline_ordered_buckets.py
. This script processes data in ordered buckets, generates weak labels, and fine-tunes the model iteratively.
python src/pipeline_ordered_buckets.py ./configs/training_pipeline.json
The weaklabelgenerator.py
script generates weak labels for a set of images using a pre-trained model.
The finetune_bucket.py
script fine-tunes the model on each data bucket using knowledge distillation.
Refer to the repository for implementation and usage : Github vDNA
The configuration files for training, testing, and weak label generation are located in the configs
directory. These JSON files specify various parameters and options for the pipeline.
Example configuration file for training pipeline (configs/training_pipeline.json
):
{
"random_seed": 42,
"data_processor": {
"json_file": "path/to/data_processor_config.json",
"num_buckets": 5,
"train_ratio": 0.8
},
"buckets_order": "asc",
"model": "DeepLabV3Plus",
"ckpt": "path/to/checkpoint.pth",
"teacher_ckpt": "path/to/teacher_checkpoint.pth",
"num_classes": 19,
"output_stride": 16,
"labelgenerator": {
"num_samples": 100
}
}
You can train DeepLab models on your own datasets. Your torch.utils.data.Dataset
should provide a decoding method that transforms your predictions to colorized images.
class MyDataset(data.Dataset):
...
@classmethod
def decode_target(cls, mask):
"""decode semantic mask to RGB image"""
return cls.cmap[mask]