Home

Awesome

Bridging the Domain Gap for Multi-Agent Perception [ICRA2023]

paper supplement video

This is the official implementation of ICRA2023 paper "Bridging the Domain Gap for Multi-Agent Perception". Runsheng Xu, Jinlong Li, Xiaoyu Dong, Honkai Yu, Jiaqi Ma

teaser

Installation

This repo is mainly based on the cooperative detection framework OpenCOOD. Therefore, the installations are the same.

# Clone repo
git clone https://github.com/DerrickXuNu/MPDA.git

cd MPDA

# Setup conda environment
conda create -y --name mpda python=3.7

conda activate mpda
# pytorch >= 1.8.1, newest version can work well
conda install pytorch==1.12.1 torchvision==0.13.1 cudatoolkit=11.6 -c pytorch -c conda-forge
# spconv 2.0 install, choose the correct cuda version for you
pip install spconv-cu116

# Install dependencies
pip install -r requirements.txt
# Install bbx nms calculation cuda version
python opencood/utils/setup.py build_ext --inplace

# install opencood into the environment
python setup.py develop

Data

Download

The V2XSet data can be found from google url. Since the data for train/validate/test is very large, we split each data set into small chunks, which can be found in the directory ending with _chunks, such as train_chunks. After downloading, please run the following command to each set to merge those chunks together:

cat train.zip.parta* > train.zip
unzip train.zip

Structure

After downloading is finished, please make the file structured as following:

MPDA # root of your v2xvit
├── v2xset # the downloaded v2xset data
│   ├── train
│   ├── validate
│   ├── test
├── opencood # the core codebase

Details

Our data label format is very similar with the one in OPV2V. For more details, please refer to the data tutorial.

Getting Started

Step1. Train your model under homogenous setting

We will first need to train several sperate models under homogenous setting (i.e., all cavs use the same backbone) OpenCOOD uses yaml file to configure all the parameters for training. To train your own model from scratch or a continued checkpoint, run the following commonds:

python opencood/tools/train.py --hypes_yaml ${CONFIG_FILE} [--model_dir  ${CHECKPOINT_FOLDER} --half]

Arguments Explanation:

Step2. Generate the offline intermediate features

After obtaining the models trained on homo setting, we need to save the intermediate features that each model generate to study later domain gap issue. To do this:

After finishing changing the configuration yaml files in your trained model directory, run the testing command:

python opencood/tools/inference.py --model_dir ${CHECKPOINT_FOLDER} --fusion_method ${FUSION_STRATEGY} [--show_vis] [--show_sequence]

Arguments Explanation:

This will automatically generate the intermeidate features npy files under your pointed path.

Step3. Run V2XViT training with domain adaption.

python opencood/tools/train.py --hypes_yaml None --model_dir opencood/logs/v2xvit_da

Step4. Run test under heterogeneous setting

Please change the validate_dir_s and validate_dir_t in the yaml to test set of the generated intermediate feature data from different models. Then run the following command:

python opencood/tools/inference.py --model_dir opencood/logs/v2xvit_da --fusion_method intermediate

Citation

If you are using our V2X-ViT model or V2XSet dataset for your research, please cite the following paper:

@inproceedings{xu2023mpda,
 author = {Runsheng Xu, Jinlong Li, Xiaoyu Dong, Hongkai Yu Jiaqi Ma},
 title = {Bridging the Domain Gap for Multi-Agent Perception},
 booktitle={2023 IEEE International Conference on Robotics and Automation (ICRA)},
 year = {2023}}

Acknowledgement

MPDA is build upon OpenCOOD, which is the first Open Cooperative Detection framework for autonomous driving.

V2XSet is collected using OpenCDA, which is the first open co-simulation-based research/engineering framework integrated with prototype cooperative driving automation pipelines as well as regular automated driving components (e.g., perception, localization, planning, control).