# 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](https://www.kaggle.com/puneet6060/intel-image-classification).
## Pretrained Weights
The trained models' weights are provided [here](https://drive.google.com/drive/folders/1Bp6FkNEcxdUNt4M6K43F6v0dEEwL-64a?usp=sharing).
## 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
```
python train.py --data_folder [YOUR DATASET FOLDER NAME] --gpus [NUMBER OF GPU]
```
To train the model with CBAM, run
```
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
```
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
```
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.
<div align="center">
<b>ResNet-50 Without CBAM</b>
</div>
<figure class="image">
<img src="readme_images/no_cbam_results/accuracy.png" >
<div align="center"><figcaption>Accuracy over 30 epochs</figcaption></div>
</figure>
<figure class="image">
<img src="readme_images/no_cbam_results/loss.png" >
<div align="center"><figcaption>Loss over 30 epochs</figcaption></div>
</figure>
------------------------------------------------------------
<div align="center">
<b>ResNet-50 with CBAM</b>
</div>
<figure class="image">
<img src="readme_images/cbam_results/accuracy.png" >
<div align="center"><figcaption>Accuracy over 30 epochs</figcaption></div>
</figure>
<figure class="image">
<img src="readme_images/cbam_results/loss.png" >
<div align="center"><figcaption>Loss over 30 epochs</figcaption></div>
</figure>
## Visualization
The figures below are the feature maps of the final convolutional layer of both ResNet-50 without CBAM and ResNet-50 with CBAM.
<div align="center">
<b>ResNet-50 With CBAM</b>
</div>
<figure class="image">
<img src="readme_images/cbam_viz/2.png" >
</figure>
<figure class="image">
<img src="readme_images/cbam_viz/3.png" >
</figure>
<figure class="image">
<img src="readme_images/cbam_viz/10.png" >
</figure>
------------------------------------------------------------
<div align="center">
<b>ResNet-50 Without CBAM</b>
</div>
<figure class="image">
<img src="readme_images/no_cbam_viz/2.png" >
</figure>
<figure class="image">
<img src="readme_images/no_cbam_viz/3.png" >
</figure>
<figure class="image">
<img src="readme_images/no_cbam_viz/10.png" >
</figure>
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Res-net分类.zip (13个子文件)
video-classification-3d-cnn-pytorch-master
class_names_list 6KB
LICENSE 1KB
dataset.py 4KB
.gitignore 1KB
generate_result_video
SourceSansPro-Regular.ttf 113KB
README.md 885B
README.md 2KB
classify.py 2KB
ResNet-50-CBAM-PyTorch-main
helpers.py 344B
LICENSE 1KB
intel_dataset
test
buildings
20057.jpg 15KB
.gitignore 2KB
README.md 4KB
共 13 条
- 1
资源评论
yc1111yc
- 粉丝: 22
- 资源: 164
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 农村信用社联合社计算机信息系统投产与变更管理办.docx
- 农村信用社联合社计算机信息系统数据管理办法.docx
- 利用SPSS作临床效度分析线上计算网站介绍-医学研究部统计谘.(医学PPT课件).ppt
- 利用Zabbix监控mysqldump定时备份数据库状态.docx
- 利用计算机解决问题的基本过程.doc
- 化工铁路通信工程总结.doc
- 北京大学网络教育软件工程作业.docx
- 医药公司(连锁店)计算机操作规程未新系统的自行按照旧制修改-新系统过制的编号加修模版.doc
- 医药公司(连锁店)计算机系统操作规程模版.doc
- 医药连锁门店计算机系统的操作和管理程序未新系统的自行按照旧制修改-新系统过制的编号加修模版.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功