GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - finallyupper/beyond-softmax: Official repository for "Beyond Softmax: Dual-Branch Sigmoid Architecture for Accurate Class Activation Maps" (BMVC2025)

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
asset
asset
 
 
metadata
metadata
 
 
pytorch_grad_cam
pytorch_grad_cam
 
 
release
release
 
 
scripts
scripts
 
 
wsol
wsol
 
 
wsol_cam
wsol_cam
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
config.py
config.py
 
 
criterion.py
criterion.py
 
 
data_loaders.py
data_loaders.py
 
 
evaluation.py
evaluation.py
 
 
evaluation_test.py
evaluation_test.py
 
 
inference.py
inference.py
 
 
main.py
main.py
 
 
requirements.txt
requirements.txt
 
 
util.py
util.py
 
 

Repository files navigation

🌉 Beyond Softmax: Dual-Branch Sigmoid Architecture for Accurate Class Activation Maps (BMVC2025)

Beyond Softmax arXiv
This repository contains official code implementation of "Beyond Softmax: Dual-Branch Sigmoid Architecture for Accurate Class Activation Maps". We provide PyTorch training, inference code and hyperparameter settings reported in the paper.


Abstract

In this work, we address two fundamental distortions in Class Activation Mapping (CAM) and its variants—additive logit shifts and sign collapse—both arising from reliance on a final softmax classifier. We propose a simple, architecture-agnostic dual-branch sigmoid head that decouples localization from classification. Our method fine-tunes a sigmoid branch in parallel with the frozen softmax head, enabling class evidence maps that preserve both magnitude and sign of feature contributions, while retaining original recognition accuracy. Experiments on fine-grained and WSOL benchmarks demonstrate improved explanation fidelity and consistent Top-1 Localization gains without sacrificing classification performance.


Getting started

This code is heavily borrowed from Evaluating Weakly Supervised Object Localization Methods Right and pytorch-grad-cam. The training settings for the backbones follow the shared setting spreadsheet provided from wsolevaluation.

1) Clone the repository

git clone beyond-softmax
cd beyond-softmax

2) Download datasets (ImageNet1K, CUB-200-2011, OpenImages30K, Stanford_Cars) then align with metadata/.

mkdir dataset
mv {DOWNLOADED_DATASET} ./dataset/

{DOWNLOADED_DATASET} is the path of folder that you downloaded dataset to.

3) Environment setup - CUDA 12.2 with RTX A6000 GPU

conda create -n dbs python=3.12 -y
conda activate dbs
pip install -r requirements.txt

4) Train

$CKPT_PATH should point to a checkpoint of the vanilla backbone model (e.g. Vanilla VGG-16) and available values for $METHOD are [cam, gradcam].

An example command line for the train:

python main.py \
  --experiment_name ${EXPERIMENT}$ \
  --dataset_name ILSVRC \
  --architecture vgg16 \
  --method ${METHOD} \
  --root ${ROOT} \
  --large_feature_map FALSE \
  --epoch 3 \
  --batch_size 32 \
  --lr_decay_frequency 3 \
  --workers 4 \
  --gpus 0 \
  --lr 0.003 \
  --weight_decay 5.00E-04 \
  --model_structure b2 \
  --unfreeze_layer fc2 \
  --ft_ckpt $CKPT_PATH 

5) Eval

Here, $METHOD can be [cam, gradcam, gradcam++, xgradcam, layercam].
An example command line for the test:

python main.py \
  --experiment_name ${EXPERIMENT}$ \
  --dataset_name ILSVRC \
  --architecture vgg16 \
  --method ${METHOD} \
  --root ${ROOT} \
  --large_feature_map FALSE \
  --batch_size 32 \
  --workers 4 \
  --gpus 0 \
  --model_structure b2 \
  --ft_ckpt $CKPT_PATH \
  --eval_only \
  --eval_checkpoint_type last 

Citations

If you find our work interesting, please consider citing

@inproceedings{Oh_2025_BMVC,
author    = {Yoojin Oh and Junhyug Noh},
title     = {Beyond Softmax: Dual-Branch Sigmoid Architecture for Accurate Class Activation Maps},
booktitle = {36th British Machine Vision Conference 2025, {BMVC} 2025, Sheffield, UK, November 24-27, 2025},
publisher = {BMVA},
year      = {2025},
url       = {https://bmva-archive.org.uk/bmvc/2025/assets/papers/Paper_416/paper.pdf}
}

About

Official repository for "Beyond Softmax: Dual-Branch Sigmoid Architecture for Accurate Class Activation Maps" (BMVC2025)

finallyupper.github.io/beyond-softmax/

Topics

camgradcamwsolxai

Resources

Readme
License
Activity

Stars

3 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.