PhysAug: A Physical-guided and Frequency-based Data Augmentation for Single-Domain Generalized Object Detection
This repository contains the official implementation of our AAAI 2025 accepted paper:
"PhysAug: A Physical-guided and Frequency-based Data Augmentation for Single-Domain Generalized Object Detection"
PhysAug is a novel data augmentation technique designed for single-domain generalized object detection. By leveraging physical priors and frequency-based operations, PhysAug enhances the robustness of detection models under various challenging conditions, such as low-light or motion blur, while maintaining computational efficiency. Extensive experiments demonstrate the superior performance of PhysAug over existing methods, particularly in adverse real-world scenarios.
- Physical-guided Augmentation: Simulates real-world conditions using physical priors.
- Frequency-based Feature Simulation: Operates in the frequency domain for precise and computationally efficient augmentation.
- Improved Robustness: Enhances model performance in challenging conditions like diverse weather.
- Single-Domain Generalization: Outperforms traditional methods without requiring domain adaptation techniques.
git clone https://github.com/startracker0/PhysAug.git
cd PhysAug
conda create -n physaug python=3.8 -y
pip install torch==1.13.0+cu116 torchvision==0.14.0+cu116 torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu116
pip install -U openmim
mim install mmengine
mim install "mmcv==2.1.0"
pip install -v -e .
pip install -r requirements.txt
To ensure reproducibility, the detailed environment dependencies are provided in requirements.txt and environment.yaml
Follow the steps below to reproduce the results reported in our AAAI 2025 paper.
Download and prepare the dataset required for the experiments. Update the dataset path in the configuration file.
You can download the DWD dataset from the following link: Download DWD Dataset
The Cityscapes dataset can be downloaded from the official website: Download Cityscapes Dataset
We generate the Cityscapes-C validation set based on the cityscapes/leftImg8bit/val portion of the dataset. You can create this dataset using the imagecorruptions library, which provides various corruption functions to simulate adverse conditions such as noise, blur, weather, and digital artifacts.
git clone https://github.com/bethgelab/imagecorruptions.git
cd imagecorruptions
pip install -v -e .
python gen_cityscapes_c.py
The datasets should be organized as follows:
datasets/
├── DWD/
│ ├── daytime_clear/
│ ├── daytime_foggy/
│ ├── dusk_rainy/
│ ├── night_rainy/
│ └── night_sunny/
├── Cityscapes-c/
│ ├── brightness/
│ ├── contrast/
│ ├── defocus_blur/
........
│ └── zoom_blur/
To train the model using PhysAug, follow these steps:
- Ensure the dataset paths are correctly configured in
configs/_base_/datasets/dwd.py
andconfigs/_base_/datasets/cityscapes_detection.py
. - Run the following command to start training:
bash train_dwd.sh
bash train_cityscapes_c.sh
To evaluate the trained model, follow these steps:
- Specify the dataset to evaluate (e.g., DWD, Cityscapes, or Cityscapes-C).
- Run the evaluation script with the following command:
bash test.sh
You can download the pre-trained models including Physaug_DWD and Physaug_Cityscapes from here
If the link is no longer accessible, please feel free to contact me.