# Jongchan/attention-module

Official PyTorch code for "BAM: Bottleneck Attention Module (BMVC2018)" and "CBAM: Convolutional Block Attention Module (ECCV2018)"

Repository: https://github.com/Jongchan/attention-module
Canonical: https://ross.abutalabs.com/products/attention-module
Language: Python
License: MIT
License Family: permissive
Last push: 2023-03-09T03:46:12+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 2887, "days_push": 1273, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2230, forks 405 (observed 2026-08-28T04:06:29.050415+00:00)

## What it is
Official PyTorch implementation of two attention modules for convolutional neural networks: BAM (Bottleneck Attention Module) and CBAM (Convolutional Block Attention Module). It includes ImageNet training/validation scripts, ResNet50 examples, and pretrained checkpoints.

## Use cases
- add attention modules to a CNN in PyTorch
- reproduce CBAM ImageNet training results
- get pretrained ResNet50+CBAM weights
- compare BAM vs CBAM attention blocks
- plug attention into ResNet for image classification

## When to choose
- you need the official reference implementation of BAM or CBAM
- you want pretrained checkpoints to validate an attention-augmented ResNet
- you're doing computer vision research on attention mechanisms

## When to avoid
- you need a maintained library with recent PyTorch support
- you want plug-and-play attention for non-ResNet architectures without adaptation
- you need production training pipelines rather than research code

## Facets
- artifact type: library
- maturity: maintenance
- function: machine-learning, deep-learning
- domain: computer-vision, deep-learning, image-processing
- platform: python
- tags: pytorch, attention-mechanism, cbam, bam, image-classification, research-code, resnet, linux, gpu

## Member repositories
- Jongchan/attention-module (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:29.050415+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:44:37.567112+00:00, confidence not recorded.
  - readme: https://github.com/Jongchan/attention-module (fetched 2026-08-28T04:06:29.050415+00:00, sha 76f8fde009d8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
