Skip to main content

A library for implementing Gated Residual Attention CNN for image classification problems.

Project description

# resattention

A python library for implementing a Residual Attention Convolutional Neural Network and training it for image classification problems. This model supports multi-class classification and is easy to use both for training and testing purposes.

The code is Python 2 and 3 compatible.

# Installation

Fast install:

pip install resattention

For a manual install get this package:

$wget https://github.com/garain/resattention/archive/master.zip
$unzip master.zip
$rm master.zip
$cd resattention-master

Install the package:

python setup.py install

# Example

from resattention import models
import tensorflow as tf

model = models.AttentionResNetCifar10(shape=(32,32,3),n_classes=2,n_channels=3)#RGB images
model = models.AttentionResNetCifar10(shape=(32,32,1),n_classes=6,n_channels=1)#GrayScale images

model.compile(tf.keras.optimizers.Adam(lr=0.0001), loss='categorical_crossentropy', metrics=['accuracy'])
model.summary()

# Models supported

  • AttentionResNetCifar10

  • AttentionResNet92

  • AttentionResNet56

# Please cite this publication if this library comes to any use:

  1. Garain, B. Ray, P. K. Singh, A. Ahmadian, N. Senu and R. Sarkar, “GRANet: A Deep Learning Model for Classification of Age and Gender from Facial Images,” in IEEE Access, doi: 10.1109/ACCESS.2021.3085971.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

resattention-0.0.4.tar.gz (3.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page