Skip to content

carbonsir/FCHNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

55 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Frequency-Guided Cross-Domain Learning for Lightweight Camouflaged Object Detection

Manuscript DOI License

Recommended Citation

If you use the code or models from this repository in your research, please cite the following manuscript:

Article Title: Frequency-Guided Cross-Domain Learning for Lightweight Camouflaged Object Detection

Journal: The Visual Computer

BibTeX entry:

@article{tan2026fchnet,
  title={Frequency-Guided Cross-Domain Learning for Lightweight Camouflaged Object Detection},
  author={Tan, Song and Jinbao, Li and Yahong, Guo},
  journal={The Visual Computer},
  year={2026},
  note={Manuscript submitted to The Visual Computer. Code available at https://doi.org/10.5281/zenodo.20192879}
}

πŸ“Œ Abstract

Camouflaged object detection (COD) faces challenges in preserving subtle structural cues due to weak boundaries and high background similarity. Existing methods often rely on loosely coupled fusion between frequency priors and spatial features, leading to unstable prior-feature interaction. This work presents a Frequency-aware Cross-domain Hierarchical Network (FCHNet) for efficient COD. The model integrates Wavelet Feature Refinement and Cross-domain Frequency Alignment to stabilize prior-feature coordination, while a boundary-aware decoder further refines object contours. Experiments on CAMO, COD10K, and NC4K show that FCHNet consistently outperforms representative lightweight COD models in weighted F-measure. In particular, FCHNet-S achieves a favorable accuracy-efficiency trade-off with 4.69M parameters, while FCHNet-L remains competitive with heavyweight models. The code is publicly available at https://github.com/carbonsir/FCHNet.


This repository provides the full source code of the proposed FCHNet algorithm, including the model implementation, training script, inference script, evaluation script, dependency requirements, key algorithm modules, trained weights, and prediction maps.

The raw images of CAMO, COD10K, and NC4K are not redistributed due to dataset license restrictions. We provide dataset organization instructions, preprocessing instructions, edge-map preparation details, trained weights, prediction maps, and evaluation scripts to facilitate reproducible research.


πŸ”— Paper and Code Relationship

This repository contains the official implementation of the manuscript:

Frequency-Guided Cross-Domain Learning for Lightweight Camouflaged Object Detection

This code is directly related to a manuscript submitted to The Visual Computer.

If you use this code, trained weights, prediction maps, or experimental results in your research, please cite the related manuscript. The official citation information will be updated after the paper is accepted or published.


🌐 Permanent Resources

To improve transparency and reproducibility, this repository provides source code, trained models, prediction maps, and dataset preparation instructions.

Resource Link Extraction Code
FCHNet prediction maps https://pan.baidu.com/s/1esOes8En-lfgAugIYQvs4A?pwd=wpe7 wpe7
FCHNet trained weights https://pan.baidu.com/s/1Iz02YaItxvPlpAuICyeblg?pwd=e4x4 e4x4
Archived repository DOI https://doi.org/10.5281/zenodo.20192879 -

Google Drive mirrors are also provided:

Resource Link
FCHNet trained weights Google Drive
FCHNet prediction maps Google Drive

🧠 Overall Architecture

FCHNet consists of the following key components:

  • EfficientNet-based Backbone
    Extracts lightweight multi-level visual features.

  • Wavelet Feature Refinement (WFR) Module
    Refines features through frequency-aware wavelet decomposition and attention.

  • Cross-domain Frequency Alignment (CFA) Module
    Aligns spatial-domain features and frequency-domain representations.

  • Boundary Feature Extraction (BFE) Module
    Extracts boundary-aware cues to enhance contour perception.

  • Boundary-guided Decoder (BGD)
    Progressively integrates semantic, frequency, and boundary information to generate accurate prediction maps.


🧩 Key Algorithms and Implementation Details

1. Wavelet Feature Refinement Module

The Wavelet Feature Refinement module decomposes feature maps into low-frequency and high-frequency components. The low-frequency component helps capture global semantic context, while the high-frequency component preserves texture, contour, and structural details.

This design is useful for camouflaged object detection because camouflaged targets usually have weak object boundaries and high similarity with their surroundings.

Related implementation files:

Model/HTLBlock.py
Model/WHAtt.py
Model/WLAtt.py

2. Cross-domain Frequency Alignment Module

The Cross-domain Frequency Alignment module coordinates spatial-domain features and frequency-domain representations. It reduces unstable feature fusion caused by weak boundaries and complex background interference.

Related implementation file:

Model/CFA.py

3. Boundary Feature Extraction Module

The Boundary Feature Extraction module introduces edge-aware information to enhance the perception of object contours. It provides additional boundary guidance for the decoder and helps generate sharper prediction maps.

Related implementation file:

Model/EdgeFT.py

4. Boundary-guided Decoder

The Boundary-guided Decoder progressively fuses multi-level encoder features, refined frequency features, and boundary cues. It is designed to improve localization accuracy and recover fine object structures.

Related implementation file:

Model/DeBlock.py

πŸ“‚ Project Structure

FCHNet/
β”œβ”€β”€ Model/
β”‚   β”œβ”€β”€ FCHNet.py          # Main model framework
β”‚   β”œβ”€β”€ CFA.py             # Cross-domain Frequency Alignment module
β”‚   β”œβ”€β”€ CoordAtt.py        # Coordinate Attention module
β”‚   β”œβ”€β”€ DeBlock.py         # Boundary-guided Decoder module
β”‚   β”œβ”€β”€ EdgeFT.py          # Boundary Feature Extraction module
β”‚   β”œβ”€β”€ EfficientNet.py    # EfficientNet backbone
β”‚   β”œβ”€β”€ GlobalAtt.py       # Global Attention module
β”‚   β”œβ”€β”€ HTLBlock.py        # Wavelet refinement module
β”‚   β”œβ”€β”€ Module.py          # Basic convolution modules
β”‚   β”œβ”€β”€ RefineFM.py        # Transformer refinement module
β”‚   β”œβ”€β”€ WHAtt.py           # High-frequency wavelet attention module
β”‚   └── WLAtt.py           # Low-frequency wavelet attention module
β”‚
β”œβ”€β”€ dataset/
β”‚   └── README.md          # Dataset preparation instructions
β”‚
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ dataloader_freq.py
β”‚   β”œβ”€β”€ data_augmentation.py
β”‚   β”œβ”€β”€ dct.py
β”‚   └── metrics.py
β”‚
β”œβ”€β”€ train.py
β”œβ”€β”€ inference.py
β”œβ”€β”€ evaluate.py
β”œβ”€β”€ config.py
β”œβ”€β”€ requirements.txt
└── README.md

βš™οΈ Requirements

The experiments were conducted under the following environment:

Ubuntu 20.04
Python 3.8
PyTorch 2.5.1
CUDA 12.1
torchvision
numpy
opencv-python
Pillow
tqdm
scipy
matplotlib

Install dependencies:

conda create -n fchnet python=3.8
conda activate fchnet
pip install -r requirements.txt

Example requirements.txt:

torch>=2.0.0
torchvision
numpy
opencv-python
Pillow
tqdm
scipy
matplotlib

Please make sure that the installed PyTorch version is compatible with your CUDA version.


πŸ“ Dataset Preparation

FCHNet is trained and evaluated on three public COD benchmark datasets:

  • CAMO
  • COD10K
  • NC4K

Due to dataset license restrictions, the raw images are not redistributed in this repository. Please download the original datasets from their official sources or publicly available benchmark collections.

Please refer to the dataset preparation file for detailed instructions:

dataset/README.md

Expected dataset structure:

dataset/
β”œβ”€β”€ TrainDataset/
β”‚   β”œβ”€β”€ Imgs/
β”‚   β”œβ”€β”€ GT/
β”‚   └── Edge/
└── TestDataset/
    β”œβ”€β”€ CAMO/
    β”‚   β”œβ”€β”€ Imgs/
    β”‚   └── GT/
    β”œβ”€β”€ COD10K/
    β”‚   β”œβ”€β”€ Imgs/
    β”‚   └── GT/
    └── NC4K/
        β”œβ”€β”€ Imgs/
        └── GT/

The Edge/ folder contains edge or boundary maps generated from the ground-truth masks for boundary supervision.


πŸš€ Training

Before training, please check and modify the following settings:

  • Training dataset path
  • Batch size
  • Learning rate
  • Number of epochs
  • Checkpoint save path
  • GPU device ID

Run:

python train.py

Recommended training settings:

Input size: 384 Γ— 384
Batch size: 32
Learning rate: 2.6e-4
Epochs: 200
Optimizer: Adam

The trained checkpoints will be saved in:

checkpoints/FCHNet/

Example checkpoint path:

checkpoints/FCHNet/FCHNet.pth

πŸ” Inference

Run the following command to generate prediction maps:

python inference.py

Before inference, please make sure that the trained model path and testing dataset path are correctly configured.

The prediction maps will be saved in:

prediction_maps/

Expected output structure:

prediction_maps/
β”œβ”€β”€ CAMO/
β”œβ”€β”€ COD10K/
└── NC4K/

πŸ“ˆ Evaluation

Run the following command to evaluate the prediction maps:

python evaluate.py

The evaluation metrics include:

  • S-measure
  • E-measure
  • Weighted F-measure
  • MAE

πŸ† Overview

Figure 2. Overall pipeline of FCHNet.


πŸ† Quantitative Results

The following table reports the performance of FCHNet-S on three COD benchmark datasets.

Dataset S-measure ↑ E-measure ↑ Weighted F-measure ↑ MAE ↓
CAMO 0.840 0.898 0.781 0.059
COD10K 0.835 0.910 0.727 0.029
NC4K 0.862 0.916 0.802 0.041

πŸ–ΌοΈ Experimental Visualization and Analysis

To provide a more comprehensive understanding of the proposed FCHNet, we include qualitative comparisons, ablation studies, visualization results, and failure cases.

Qualitative Comparison

The following figure shows qualitative comparison results between FCHNet and other representative camouflaged object detection methods.

Figure 7. Qualitative comparison of FCHNet with other COD methods.


Ablation Study

The following figure presents the ablation study of the main components in FCHNet. The results demonstrate the effectiveness of the proposed modules.

Figure 8. Ablation analysis of the proposed components.


Feature Visualization

The following figure visualizes the feature activation and heatmap responses of FCHNet. The visualization results show that FCHNet can focus more accurately on camouflaged objects and suppress background interference.

Figure 9. Overview of heatmap visualization results.


πŸ” Reproducibility Notes

To reproduce the reported results, please follow these steps:

  1. Install the required environment.
  2. Download and organize the training and testing datasets.
  3. Prepare edge maps for boundary supervision.
  4. Update dataset paths in the configuration file or training script.
  5. Train FCHNet using train.py, or download the released trained model.
  6. Run inference.py to generate prediction maps.
  7. Run evaluate.py to calculate quantitative metrics.

For dataset organization and edge-map preparation, please refer to:

dataset/README.md

πŸ“– Citation

If you find this work useful for your research, please cite our related manuscript:

@article{tan2026fchnet,
  title={Frequency-Guided Cross-Domain Learning for Lightweight Camouflaged Object Detection},
  author={Tan, Song and Jinbao, Li and Yahong, Guo},
  journal={The Visual Computer},
  year={2026},
  note={Manuscript submitted to The Visual Computer. Code available at https://doi.org/10.5281/zenodo.20192879}
}

The citation information will be updated after the manuscript is officially accepted or published.


πŸ“œ License

This repository is released for academic research purposes only.

Commercial use is not permitted without permission from the authors.

For other usage, please contact the authors.


✨ Acknowledgements

We sincerely thank the authors of previous camouflaged object detection works and publicly available datasets, including:

  • CAMO
  • COD10K
  • NC4K
  • SINet
  • SINet-V2

This project also benefits from previous studies on camouflaged object detection, frequency-domain learning, wavelet-based feature refinement, and boundary-aware segmentation.


πŸ“¬ Contact

For any questions, please contact:

carbonsir@126.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages