Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(43909856) ViT (Visual Transformer) for image classification of ADNI dataset #172

Open
wants to merge 58 commits into
base: topic-recognition
Choose a base branch
from

Conversation

retinotopyproject
Copy link

Hi there,

This fork of the 'topic-recognition' branch contains code for a ViT (a Visual Transformer) model. This is based on the ViT-S/16
model, from the IEEE conference paper "Scaling Vision Transformers" (Zhai et al., 2022).

This model was used to perform binary classification of images from the Alzheimer's Disease Neuroimaging Initiative (ADNI) MRI dataset. The ViT attempts to classify 2D MRI slices as belonging to either Cognitive Normal (NC) or Alzheimer's Detected (AD) patients.

For more detailed information about the model, its performance, and any dependencies/requirements for training or testing it, please see the README file. All files related to the ViT model, including the README, are in the directory location 'recognition/TRANSFORMER_43909856'.

The files added include:

  • dataset.py: Loads the ADNI dataset images and their corresponding image labels, and performs the required train/validation/test set splits. Also applies any required pre-processing or transforms to the data. A basic plot of the input images (after pre-processing transforms) can be generated from a method in this file.

  • modules.py: Contains the modules required to create the ViT model network and its sub-components.

  • train.py: Trains the model on the ADNI dataset over the specified number of epochs. Evaluates the model on the validation set during the training process, at the end of every epoch. Also contains methods for plotting training and validation loss (and validation accuracy) throughout training.

  • predict.py: Used to run inference (make predictions of classes) on the model. Also contains a method for generating a confusion matrix, based on the test set's predicted classes and empirical/observed classes.

  • Additional plots can be found in the 'plots' subdirectory.

@LinfengLiu98
Copy link
Collaborator

This is an initial inspection, no action is required at this point

Difficulty: Hard

Readme:
Excellent

Commit messages: Excellent, detailed.

Code:

  • Uses Vision transformer
  • Well commented
  • Good model design

Functionality/Performance:

  • Test accuracy is 60.37%
  • Did patient-level split
  • Preprocssing data correctly
  • Performed data augmentation
  • Well done

@shakes76 shakes76 added the Extension Extension approved label Nov 20, 2023
@shakes76
Copy link
Owner

Marking

Good Practice (Design/Commenting, TF/Torch Usage)

Adequate design and implementation
Good spacing and comments
Header blocks missing -1

Recognition Problem

Solves problem
Driver Script present
File structure present
Shows Usage & Demo & Visualisation & Data usage
Module present
Commenting
No Data leakage
Difficulty: Hard

Commit Log

Meaningful commit messages
Progressive commits used

Documentation

ReadMe acceptable/good
Model/technical explanation
Good Description and Comments
Markdown used and PDF submitted

Pull Request

Successful Pull Request (Working Algorithm Delivered on Time in Correct Branch)
No Feedback required
Request Description good

@shakes76
Copy link
Owner

Please remove gitignore file for merge, does not affect grade only merge.

@shakes76 shakes76 added the question Further information is requested label Nov 20, 2023
@retinotopyproject
Copy link
Author

Hi @shakes76, I have resolved the merge conflict related to the .gitignore file. Thanks

@wangzhaomxy
Copy link
Collaborator

Feedback attempt and no feedback marks lost.

@wangzhaomxy wangzhaomxy added Question_attempt and removed question Further information is requested labels Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants