Skip to content

CP-Security/CP-Guard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

CP-Guard: Malicious Agent Detection and Defense in Collaborative Bird's Eye View Perception

AAAI'25 Oral Python 3.7 PyTorch

👥 Authors

Name Profile
Senkang Hu* Google Scholar
Yihang Tao* Google Scholar
Guowen Xu Google Scholar
Yiqing Deng Google Scholar
Xianhao Chen Google Scholar
Yuguang Fang Google Scholar
Sam Kwong Google Scholar

📝 Abstract

Collaborative Perception (CP) has shown a promising technique for autonomous driving, where multiple connected and autonomous vehicles (CAVs) share their perception information to enhance the overall perception performance and expand the perception range. However, in CP, ego CAV needs to receive messages from the collaborators, which makes it easy to be attacked by malicious agents. For example, a malicious agent can send harmful information to the ego CAV to mislead it. To address this critical issue, we propose a novel method, CP-Guard, a tailored defense mechanism for CP that can be deployed by each agent to accurately detect and eliminate malicious agents in its collaboration network. Our key idea is that CP will lead to a consensus rather than a conflict against the ego CAV's perception results. Based on this idea:

  • We develop a probability-agnostic sample consensus (PASAC) method that can effectively sample a subset of the collaborators and verify the consensus without prior probabilities of malicious agents
  • We design a collaborative consistency loss (CCLoss) to calculate the discrepancy between the ego CAV and the collaborators
  • We conduct extensive experiments in collaborative bird's eye view (BEV) tasks

🛠️ Installation

System Requirements

Requirement Version/Specification
OS Linux (tested on Ubuntu 22.04)
Python 3.7
Package Manager Miniconda
Deep Learning Framework PyTorch
CUDA 11.7

Setup Steps

  1. Create and Activate Conda Environment
cd coperception
conda env create -f env.yml
conda activate coperception
  1. Install CUDA Dependencies
conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
  1. Install CoPerception Library
pip install -e .

📊 Dataset Preparation

  1. Download and unzip the parsed segmentation dataset of V2X-Sim 2.0

  2. Link the test split of V2X-Sim dataset in the default value of argument "data":

/{Your_location}/V2X-Sim-seg/test

Dataset Structure

test
├──agent_0
├──agent_1
├──agent_2
├──agent_3
├──agent_4
├──agent_5
      ├──5_0
      ├──0.npy
      ...

Model Checkpoint

  1. Download pre-trained weights
  2. Save them in CP-Guard/coperception/ckpt/meanfusion folder

🚀 Running CP-Guard

Basic Usage

cd coperception/tools/seg/
python cp_guard.py [options]

Note: Due to data syncing issues, CP-Guard cannot be performed under multi-GPU environment. For multiple GPUs, use: CUDA_VISIBLE_DEVICES=0 python cp_guard.py [options]

Parameters

General Parameters

Parameter Description Default
-d, --data Path to preprocessed sparse BEV training data ./datasets/V2X-Sim-seg/test
--batch Number of scene 1
--th CCLoss threshold 0.08
--com Communication method (disco/when2com/v2v/sum/mean/max/cat/agent) v2v
--num_agent Total number of agents 6

Adversarial Attack Parameters

Parameter Description Default
--pert_alpha Scale of the perturbation 0.1
--adv_method Attack method (pgd/bim/cw-l2/fgsm) pgd
--eps Epsilon of adv attack 0.5
--adv_iter Adv iterations of computing perturbation 15

Scene Settings

Parameter Description Default
--scene_id Target evaluation scene (Scene 8, 96, 97 has 6 agents) [8]
--sample_id Target evaluation sample None

CP-Guard Specific Parameters

Parameter Description Default
--cpguard Mode (upperbound/lowerbound/no_defense/pasac/robosac) no_defense
--ego_agent ID of ego agent 1
--ego_loss_only Only use ego loss to compute adv perturbation False
--number_of_attackers Number of malicious attackers 1
--fix_attackers Fix attackers across frames False

ROBOSAC Specific Parameters

Parameter Description Default
--robosac_k Consensus set size None
--step_budget Sampling budget per frame 5
--use_history_frame Use history frame for consensus False

🙏 Acknowledgment

CP-Guard is modified from:

📚 Citation

If you find this project useful in your research, please cite:

@article{CP_Guard_2025, 
    title={CP-Guard: Malicious Agent Detection and Defense in Collaborative Bird's Eye View Perception}, 
    volume={39},
    number={22},
    journal={Proceedings of the AAAI Conference on Artificial Intelligence}, 
    author={Hu, Senkang and Tao, Yihang and Xu, Guowen and Deng, Yiqin and Chen, Xianhao and Fang, Yuguang and Kwong, Sam}, 
    year={2025},
    month={Apr.},
    pages={23203-23211} 
}

About

[AAAI 2025 Oral] This is the official implenmentation of "CP-Guard: Malicious agent detection and defense in collaborative bird's eye view segmentation"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages