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

Jinpeng He, Biyuan Liu, Huaixin ChenWACV 2025

TL;DR

This paper introduces HDPNet, a novel Hourglass Vision Transformer with a Dual-Path Feature Pyramid, designed to tackle the challenging task of detecting camouflaged objects, especially small ones with fine boundaries. By combining an hourglass-shaped Transformer encoder for multi-scale feature extraction with a dual-path decoder and a feature interaction module, HDPNet achieves state-of-the-art performance on several benchmark datasets.

What Problem Does This Paper Address?

Camouflaged object detection (COD) is a critical but difficult problem in computer vision. Organisms and military tactics use camouflage to blend objects seamlessly with their surroundings, making them hard to distinguish. Existing methods, even recent deep learning approaches, struggle with accurately detecting small objects and precisely delineating their boundaries, especially in complex scenes. This is often due to limitations in capturing both global context and fine-grained local details simultaneously. Convolutional Neural Networks (CNNs) are good at local feature extraction but struggle with long-range dependencies, while standard Vision Transformers (ViTs) excel at global context but can lose fine spatial details due to their patch-based processing and tendency to focus on low-resolution outputs.

Methods

The proposed HDPNet addresses these challenges with three main components:

  • Hourglass Vision Transformer (HVT) Encoder: This novel encoder uses an hourglass structure to capture global semantic cues while simultaneously extracting detailed feature maps at various scales. It employs a patch embedding layer to control feature map scales and a series of transformer layers with multi-head self-attention (MSA) and multi-layer perceptrons (MLP) to process information. The hourglass topology allows for gradual recovery of spatial information lost during downsampling.
  • Dual-Path Feature Pyramid Decoder (DFPD): To effectively fuse features from different levels of the HVT encoder, the DFPD uses a dual-path approach. It performs coarse-to-fine feature fusion laterally, aggregating low-level edge features and high-level semantic features separately. This "dual-path" strategy mitigates the dilution of essential feature cues that can occur when directly fusing features from different semantic levels, thus preserving crucial details. A Grouped Fusion Module (GFM) is used for multi-level feature fusion.
  • Feature Interaction Enhancement Module (FIEM): This module is designed to bridge the semantic gap between detailed appearance features and global semantic cues. It uses a symmetric structure with self-attention and Graph Convolutional Networks (GCNs). The FIEM allows high-level features to be refined by low-level features and vice-versa, enabling better complementarity and more accurate detection results.

Datasets

The paper evaluates HDPNet on three widely-used Camouflaged Object Detection (COD) benchmark datasets:

  • CAMO: Contains 1000 training images and 250 test images.
  • COD10K: A larger dataset with 3040 training images and 2026 test images, featuring 10 superclasses and 78 subclasses.
  • NC4K: A dataset specifically designed for testing, containing 4121 images focusing on natural and artificial camouflage.

The training set for HDPNet was constructed using images from CAMO and COD10K, while the test set comprised images from all three datasets.

Key Insights and Ideas

  • Hourglass Structure for Transformers: Applying an hourglass architecture to a Vision Transformer encoder is a novel way to balance global context modeling with the preservation of fine-grained spatial details across multiple scales.
  • Dual-Path Decoding for Feature Fusion: Separating the fusion of low-level and high-level features in the decoder prevents the loss of critical information and reduces noise introduced by direct, undifferentiated fusion.
  • Symmetric FIEM for Feature Complementarity: The FIEM's symmetric design, incorporating both self-attention and GCNs, effectively allows different feature modalities (appearance vs. semantic, low-level vs. high-level) to mutually enhance each other, leading to more robust predictions.
  • Addressing the "Semantic Gap": The FIEM specifically targets the semantic gap between features extracted at different network depths, a common issue in deep learning models.

Key Results

HDPNet demonstrates significant improvements over existing methods:

  • Quantitative Performance: HDPNet outperforms 25 state-of-the-art CNN- and Transformer-based methods on the CAMO, COD10K, and NC4K datasets across six evaluation metrics (S-measure, weighted F-measure, mean F-measure, mean E-measure, max E-measure, and mean absolute error). For instance, it shows substantial gains over strong baselines like DGNet and FSPNet.
  • Qualitative Performance: Visual comparisons highlight HDPNet's superiority in accurately detecting small objects and precisely segmenting fine object boundaries, even in challenging scenarios like occlusion and complex backgrounds. The model produces more complete, vivid, and accurate segmentation maps.
  • Ablation Studies: The paper includes comprehensive ablation studies confirming the effectiveness of each proposed component (HVT encoder, DFPD decoder, and FIEM). The hourglass structure, dual-path decoder, and feature interaction module all contribute significantly to the overall performance gains.

Limitations and Future Work

  • Computational Cost: While achieving superior performance, the paper notes that the proposed HDPNet has a higher parameter count and GFLOPS compared to some baseline models, particularly when using the ViT backbone. Future work could focus on optimizing the architecture for efficiency.
  • Generalization: While tested on three diverse datasets, further evaluation on a wider range of camouflaged object scenarios and environments could be beneficial.
  • Real-time Applications: The current model might not be optimized for real-time applications due to its complexity. Future research could explore lightweight versions or specialized hardware implementations.

Summary updated

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