Instructions to use keras-io/attention_mil with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TF-Keras
How to use keras-io/attention_mil with TF-Keras:
# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy) # See https://github.com/keras-team/tf-keras for more details. from huggingface_hub import from_pretrained_keras model = from_pretrained_keras("keras-io/attention_mil") - Notebooks
- Google Colab
- Kaggle
Model Description
Keras Implementation of Classification using Attention-based Deep Multiple Instance Learning (MIL)
This repo contains the trained model of Classification using Attention-based Deep Multiple Instance Learning (MIL).
The full credit goes to: Mohamad Jaber
Intended uses & limitations
- The trained model can be used to classify a bag of image instances (the bag of image instances can be generated from an original image) with the motivation of knowing which patterns in the original image is actually causing it to belong to that class.
Training and evaluation data
- Original MNIST train & test dataset were loaded from tensorflow datasets and the images were randomly chosen to create different bags of instance with number of instances per bag is 3
- Number 8 is selected to be the Positive class (i.e. the bag that contains image of 8 belongs to Positive class and others are Negative class)
Training procedure
Training hyperparameter
The following hyperparameters were used during training:
- optimizer: 'adam'
- loss: 'sparse_categorical_crossentropy'
- epochs: 50
- batch_size: 8
Model Plot
- Downloads last month
- 1
