HDPNet: Hourglass Vision Transformer with Dual-Path Feature Pyramid for Camouflaged Object Detection (WACV2025)

April 19, 2025 · View on GitHub

Usage

The training and testing experiments are conducted using PyTorch with an NVIDIA A100-SXM of 40 GB Memory.

1. Prerequisites

Note that HDPNet is only tested on Ubuntu OS with the following environments.

  • Creating a virtual environment in terminal: conda create -n HDPNet python=3.8.
  • Installing necessary packages: pip install -r requirements.txt

2. Downloading Training and Testing Datasets

  • Download the training set (COD-TrainDataset) used for training
  • Download the testing sets (COD10K-test + CAMO-test + CHAMELEON + NC4K ) used for testing

3. Training Configuration

  • The pretrained model(PVT2) is stored in Google Drive and Baidu Drive (g3ea). After downloading, please change the file path in the corresponding code.
  • Run train.sh to train.

4. Testing Configuration

Our well-trained model is stored in Google Drive and Baidu Drive (gv9n). After downloading, please change the file path in the corresponding code.

5. Evaluation

  • Evaluate HDPNet: After configuring the test dataset path, run hpvt_eval.sh in the run_slurm folder for evaluation.
  • PR-Curves: We provide the code for obtaining PR-Curves through detection results. Please refer to 'PR_Curve.py'.
  • Super- and Sub-Classes: To evaluate the performance of each method on COD10K superclasses and subclasses through detection results, please refer to 'class_eval.py'.

6. Results download

The prediction results of our HDPNet are stored on Google Drive. Please check.

7. Quantitative Results

Our final results, which perform very well on the COD10K dataset (contains a lot of small objects and detailed labeling of the objects' fine boundaries).

we adopt five kinds of evaluation metrics: S-measure(SmS_m), weighted F-measure(FβωF_\beta^\omega), adaptive F-measure(FβadpF_\beta^{adp}), mean F-measure(FβmeanF_\beta^{mean}),max F-measure(FβmaxF_\beta^{max}), adaptive E-measure(EϕapdE_\phi^{apd}), mean E-measure(EϕmeanE_\phi^{mean}), max E-measure (EϕmaxE_\phi^{max}), and mean absolute error(M\mathcal{M})

DatasetSmS_m \uparrowFβωF_\beta^\omega \uparrowFβadpF_\beta^{adp} \uparrowFβmeanF_\beta^{mean} \uparrowFβmaxF_\beta^{max} \uparrowEϕadpE_\phi^{adp} \uparrowEϕmeanE_\phi^{mean} \uparrowEϕmaxE_\phi^{max} \uparrowM\mathcal{M} \downarrow
CAMO0.8930.8510.8480.8700.8900.9320.9340.9480.040
CHAMELEON0.9210.8610.8490.8740.9020.9430.9470.9700.021
COD10K0.8880.7940.7700.8200.8520.9150.9250.9510.020
NC4K0.9020.8500.8450.8710.8910.9310.9340.9500.029

8. Qualitative Results

Quantitative results in several typical complex situations, including occlusion, small objects, multiple objects, and object boundaries.

Qualitative Result

Citation

@inproceedings{he2025hdpnet,
  title={HDPNet: Hourglass Vision Transformer with Dual-Path Feature Pyramid for Camouflaged Object Detection},
  author={He, Jinpeng and Liu, Biyuan and Chen, Huaixin},
  booktitle={2025 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
  pages={8638--8647},
  year={2025},
  organization={IEEE}
}