-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
73 lines (65 loc) · 2.9 KB
/
app.py
File metadata and controls
73 lines (65 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import streamlit as st
import os
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
# -------------------------------
# PAGE CONFIG
# -------------------------------
st.set_page_config(
page_title="GAN-Based MRI Augmentation | AD Detection",
layout="wide"
)
# -------------------------------
# SIDEBAR
# -------------------------------
st.sidebar.title("Navigation")
page = st.sidebar.radio("Go to", ["Home"])
# -------------------------------
# HOME PAGE
# -------------------------------
if page == "Home":
st.title("GAN-Based Synthetic MRI Augmentation")
st.subheader("Early Detection of Alzheimer’s Disease (AD)")
st.markdown("---")
# -------------------------------
# Introduction
# -------------------------------
st.markdown(
"""
Welcome to this research demonstration of **GAN-based MRI augmentation**.
The project aims to explore **synthetic MRI generation** to improve early-stage AD detection, focusing particularly on **Cognitively Normal (CN) vs Early Mild Cognitive Impairment (EMCI)** classification.
Early detection of AD is extremely challenging because structural brain changes are subtle at the EMCI stage.
GANs can help by generating realistic synthetic MRI slices, increasing dataset diversity, and supporting more robust machine learning models.
"""
)
# -------------------------------
# Project Motivation
# -------------------------------
with st.expander("🔍 Motivation"):
st.markdown(
"""
- Detecting EMCI early is crucial for timely interventions.
- Traditional MRI analysis struggles with subtle and spatially distributed brain changes.
- Public datasets are limited and imbalanced, making deep learning models prone to overfitting.
- GAN-based augmentation offers a way to enrich training data while preserving neuroanatomical plausibility.
"""
)
# -------------------------------
# How It Works
# -------------------------------
with st.expander("⚡ How This Demo Works"):
st.markdown(
"""
1. Upload a single MRI slice (PNG/JPG) on the **MRI Operations** page.
2. The system classifies the slice as **CN** or **EMCI** using a pre-trained ResNet18 model.
3. Optionally, generate a GAN-based synthetic MRI slice for visualization and data augmentation.
4. Observe classification confidence and explore potential patterns captured by GANs.
"""
)
# -------------------------------
# Call to Action
# -------------------------------
st.markdown("---")
st.info(
"⚡ Navigate to the **'MRI Operations'** page from the sidebar to upload MRI slices, see classification results, "
"and optionally generate GAN-augmented images. This is a research demo and not intended for clinical use."
)