SemiDAVIL: Semi-supervised Domain Adaptation with Vision-Language Guidance
September 15, 2025 · View on GitHub
Overview
SemiDAVIL is a framework for Semi-Supervised Domain Adaptation (SSDA) that improves semantic segmentation performance when adapting from a labeled source domain (e.g., synthetic data) to a target domain with very few labels (e.g., real-world scenes).
Key Features
- Language-Guided SSDA: Leverages pre-trained CLIP models to create a semantic bridge between domains.
- Dense Language Guidance (DLG): A novel fusion module for deep, symmetric integration of visual and textual features.
- Dynamic Cross-Entropy (DyCE) Loss: An adaptive loss function that combats class imbalance by focusing on the hardest examples and re-weighting tail classes.
- Student-Teacher Framework: Employs consistency regularization on unlabeled target data for robust learning.
File Structure
. ├── data/ │ ├── datasets.py \# PyTorch Dataset classes for GTA5 & Cityscapes │ └── loader.py \# Factory function to create DataLoaders ├── models/ │ ├── dlg\_module.py \# Dense Language Guidance (DLG) module │ └── semidavil.py \# Main SemiDAVIL model architecture ├── config.py \# Central configuration for all hyperparameters and paths ├── losses.py \# Custom loss functions (DyCE, Consistency) ├── train.py \# Main training script ├── utils.py \# Helper functions (EMA update) ├── requirements.txt \# Project dependencies └── README.md \# This file
Setup and Installation
-
Clone the Repository:
git clone cd SemiDAVIL -
Create a Conda/Virtual Environment (Recommended):
python -m venv venv # On Linux/macOS source venv/bin/activate # On Windows # venv\Scripts\activate -
Install Dependencies:
pip install -r requirements.txt -
Download Datasets:
- Download the GTA5 dataset (images and labels).
- Download the Cityscapes dataset (leftImg8bit and gtFine).
How to Run
-
Configure Paths: Open
config.pyand update theGTA5_DATA_PATHandCITYSCAPES_DATA_PATHvariables to point to the root directories of your datasets. -
Adjust Hyperparameters (Optional): Modify settings like
BATCH_SIZE,LEARNING_RATE, orNUM_LABELED_TARGET_SAMPLESinconfig.pyto match your desired experimental setup. -
Start Training:
python train.pyThe script will initialize the models, load the datasets, and begin the training loop. Progress will be logged to the console, and the final trained model will be saved in the
./checkpointsdirectory.
Citation
If this implementation is useful for your research, please cite the original paper:
@inproceedings{basak2025semidavil,
title={SemiDAVIL: Semi-supervised Domain Adaptation with Vision-Language Guidance for Semantic Segmentation},
author={Basak, Hritam and Yin, Zhaozheng},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2025}
}