百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

ResNet-50-CBAM-PyTorch

> 编程语言
开源

在 PyTorch v1.8 中实现带有 CBAM 和不带 CBAM 的 Resnet-50。实验在 https://www.kaggle.com/punee 提供的 Intel 图像分类数据集上进行。

100 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

在 PyTorch v1.8 中实现带有 CBAM 和不带 CBAM 的 Resnet-50。实验在 https://www.kaggle.com/punee 提供的 Intel 图像分类数据集上进行。

ResNet-50 with CBAM using PyTorch 1.8

Introduction

This repository contains the implementation of ResNet-50 with and without CBAM. Note that some parameters of the architecture may vary such as the kernel size or strides of convolutional layers. The implementation was tested on Intel's Image Classification dataset that can be found here.

Pretrained Weights

The trained models' weights are provided here.

How to Use

In order to train your own custom dataset with this implementation, place your dataset folder at the root directory. Make sure that your dataset is split into two subfolder. train and test where the former contains your training dataset and the latter contains your validation set. Refer to the folder named intel_dataset in the repo as an example.

If you wish to train the model without CBAM, you can do so with

bash
python train.py --data_folder [YOUR DATASET FOLDER NAME] --gpus [NUMBER OF GPU]

To train the model with CBAM, run

bash
python train.py --data_folder [YOUR DATASET FOLDER NAME] --gpus [NUMBER OF GPU] --use_cbam

There are more arguments that can be supplied to the command. Run

bash
python train.py -h

for more information.

If you wish to visualize the final layer of feature maps produced by the trained model, create a folder in the root directory and simply place your images inside it and run

bash
python visualize.py --data_folder [FOLDER NAME] 

Additionally, if the model was trained on CBAM architecture, then add --use_cbam at the end of the command above.

Performance

ResNet-50 with CBAM achieved an accuracy of 86.6% on the validation set while ResNet-50 without CBAM achieved an accuracy of 84.34% on the same validation set. The figures below show the improvement of the models over the epochs.


Visualization

The figures below are the feature maps of the final convolutional layer of both ResNet-50 without CBAM and ResNet-50 with CBAM.


Issues· 7 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythoncbam-resnetdeep-learningimage-classificationpytorch-implementation

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言