Skip to content

Conversation

@simarrwadhawan
Copy link

Author: Simar Wadhawan • Course: COMP3710 • Branch: topic-recognition

Summary

This PR adds a complete ConvNeXt-Small pipeline to classify ADNI MRI slices into AD vs NC.
Includes dataloader, training, TTA evaluation, and auto-generated plots.
Slice-level test accuracy: 78.18% (with TTA + threshold 0.55).

What’s in this PR

  • dataset.py – AD/NC slice dataset + transforms
  • train.py – training (AdamW, cosine LR, label smoothing, class weights)
  • predict.py – evaluation with TTA + threshold tuning, saves metrics/plots
  • modules.py – ConvNeXt build + selective unfreeze
  • utils.py – helpers
  • images/ – generated figures (confusion matrix, ROC, samples, metrics)

Environment

  • Python 3.10+, PyTorch 2.x, CUDA 11.8+
  • pip install -r recognition/adni-convnext-simar/requirements.txt

Data (ADNI)

  • Not included. Requires ADNI access.
  • Expected layout: /home/groups/comp3710/ADNI/AD_NC/{train,test}/{AD,NC}/*.jpeg

Reproducibility

  • Seeds fixed in train.py (torch, numpy, python) — results vary ±1%.
  • Single-GPU A100 40GB; ~25–40 min for 20 epochs (your mileage may vary).

Quick Run

# Train
python recognition/adni-convnext-simar/train.py --img_size 384 --batch_size 32

# Evaluate (slice-level)
python recognition/adni-convnext-simar/predict.py \
  --checkpoint runs/adni_384_ls01_nomix_last/best.pt \
  --tta --threshold 0.55 \
  --save_dir recognition/adni-convnext-simar/images
performance_metrics

Reviewer quick check

# 1) Install
pip install -r recognition/adni-convnext-simar/requirements.txt

# 2) Evaluate with my checkpoint path (adjust if different)
python recognition/adni-convnext-simar/predict.py \
  --checkpoint runs/adni_384_ls01_nomix_last/best.pt \
  --tta --threshold 0.55 \
  --save_dir recognition/adni-convnext-simar/images
  
  

@yexincheng
Copy link
Collaborator

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

Recognition Problem : total : 11

  1. Solves problem: The solution is appropriate for the problem, achieving an accuracy of 78.18% on the test set.
    The dataset was properly split.
    No loss and metrics plots for training set, but reasonable metrics plots for testing set. (2/5)
  2. Implementation functions: Good (3/3)
  3. Good design: Well-designed (1/1)
  4. Commenting: Insufficient and minimal comments; should include input and output. (0/1)
  5. Difficulty: Hard, but imported pre-defined model architecture and used pre-trained checkpoint (5/10)

Note:

  • Nice and detailed pull request message.
  • Some commits happened after the deadline. (Friday, 31 Oct)
  • Almost no model description.
  • Nice comparison between slice-level and subject-level.

@gayanku
Copy link
Collaborator

gayanku commented Nov 24, 2025

Marking

Good/OK/Fair Practice (Design/Commenting, TF/Torch Usage)
No design and implementation. -2
Spacing and comments.
No Header blocks. -1
Recognition Problem
OK solution to problem. -3
Driver Script present.
File structure present.
Good Usage & Demo & Visualisation & Data usage.
Module present.
Commenting present.
No Data leakage found.
Difficulty : Normal. Hard. ConvNeXt. Imported pre-trained-5
Commit Log
Good Meaningful commit messages.
Good Progressive commits.
Documentation
Readme :Acceptable. -2
Model/technical explanation :Good.
Description and Comments :Good.
Markdown used and PDF submitted.
Pull Request
Successful Pull Request (Working Algorithm Delivered on Time in Correct Branch).
No Feedback required.
Request Description is good.
TOTAL-13

Marked as per the due date and changes after which aren't necessarily allowed to contribute to grade for fairness.
Subject to approval from Shakes

@wangzhaomxy
Copy link
Collaborator

Simar Wadhawan s4977354

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.

6 participants