Try to extends the original 1D AttnRes (
https://arxiv.org/abs/2603.15031) to 2D spatial feature maps for computer vision.
However it seems not work on Classification :(
ImageNet-100 is a 100-class subset of ImageNet-1K (ILSVRC2012). This study uses the split defined by
Tian et al. (2020).
1import torch
2from attnres_resnet_demo import AttnResNet50
3
4# Load baseline (standard ResNet-50)
5model = AttnResNet50(mode='none', num_classes=100)
6ckpt = torch.load('result/best_none.pth', map_location='cpu')
7model.load_state_dict(ckpt['model_state_dict'])
8model.eval()
9
10# Inference
11from PIL import Image
12import torchvision.transforms as T
13
14transform = T.Compose([
15 T.Resize(256),
16 T.CenterCrop(224),
17 T.ToTensor(),
18 T.Normalize(mean=[0.485, 0.456, 0.406],
19 std=[0.229, 0.224, 0.225]),
20])
21
22img = Image.open('example.jpg')
23x = transform(img).unsqueeze(0)
24with torch.no_grad():
25 logits = model(x)
26 pred = logits.argmax(dim=1)
1{
2 'epoch': int,
3 'mode': str, # 'none' | 'stage' | 'global'
4 'model_state_dict': OrderedDict,
5 'optimizer_state_dict': OrderedDict,
6 'best_acc1': float,
7 'num_classes': int, # 100
8}
1@misc{chen2026attnres,
2 title = {Attention Residuals},
3 author = {Kimi Team and Chen, Guangyu and Zhang, Yu and Su, Jianlin and Xu, Weixin and Pan, Siyuan and Wang, Yaoyu and Wang, Yucheng and Chen, Guanduo and Yin, Bohong and Chen, Yutian and Yan, Junjie and Wei, Ming and Zhang, Y. and Meng, Fanqing and Hong, Chao and Xie, Xiaotong and Liu, Shaowei and Lu, Enzhe and Tai, Yunpeng and Chen, Yanru and Men, Xin and Guo, Haiqing and Charles, Y. and Lu, Haoyu and Sui, Lin and Zhu, Jinguo and Zhou, Zaida and He, Weiran and Huang, Weixiao and Xu, Xinran and Wang, Yuzhi and Lai, Guokun and Du, Yulun and Wu, Yuxin and Yang, Zhilin and Zhou, Xinyu},
4 year = {2026},
5 archiveprefix = {arXiv},
6 eprint = {2603.15031},
7 primaryclass = {cs.CL}
8}