Skip to content

This repository is the official implementation of our AAAI 2025 accepted paper: "PhysAug: A Physical-guided and Frequency-based Data Augmentation for Single-Domain Generalized Object Detection"

License

Notifications You must be signed in to change notification settings

startracker0/PhysAug

Repository files navigation

PhysAug: A Physical-guided and Frequency-based Data Augmentation for Single-Domain Generalized Object Detection

PWC PWC

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"

Paper

🎯 Abstract

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.

📜 Highlights

  • 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.

🚀 Installation

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

📊 Reproducing Results

Follow the steps below to reproduce the results reported in our AAAI 2025 paper.

1. Prepare the Dataset

Download and prepare the dataset required for the experiments. Update the dataset path in the configuration file.

DWD Dataset

You can download the DWD dataset from the following link: Download DWD Dataset

Cityscapes-C 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/

2. Training the Model

To train the model using PhysAug, follow these steps:

  1. Ensure the dataset paths are correctly configured in configs/_base_/datasets/dwd.py and configs/_base_/datasets/cityscapes_detection.py.
  2. Run the following command to start training:
bash train_dwd.sh
bash train_cityscapes_c.sh

3. Evaluating the Model

To evaluate the trained model, follow these steps:

  1. Specify the dataset to evaluate (e.g., DWD, Cityscapes, or Cityscapes-C).
  2. Run the evaluation script with the following command:
bash test.sh

4. Pre-trained Models

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.

About

This repository is the official implementation of our AAAI 2025 accepted paper: "PhysAug: A Physical-guided and Frequency-based Data Augmentation for Single-Domain Generalized Object Detection"

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published