VAE / README.md
SreekarB's picture
Upload 18 files
3a90fb6 verified

A newer version of the Gradio SDK is available: 6.14.0

Upgrade
metadata
title: Aphasia Prediction with FC Visualization
emoji: 🧠
colorFrom: indigo
colorTo: red
sdk: gradio
sdk_version: 3.50.0
app_file: app.py
pinned: false

Aphasia Prediction with VAE and FC Visualization

This application predicts aphasia scores based on patient demographics and visualizes functional connectivity (FC) patterns in the brain.

Features

  • Predict aphasia severity (WAB AQ score) based on patient demographic data

  • Option to manually set aphasia scores

  • Display functional connectivity heatmap and matrix values

  • Interactive visualization of brain region connectivity

  • Customizable demographic parameters

Usage

  1. First, if you haven't trained the model, go to the "Train Model" tab and click "Train Model"

  2. When the model is ready, go to the "Predict & Visualize" tab

  3. Adjust the demographic sliders for age, months post onset, education, gender, and handedness

  4. Select an aphasia type and set initial severity and lesion size

  5. Click "Generate Functional Connectivity" to see the predictions and visualization

  6. Optionally override the model's prediction with a custom score

  7. Explore the functional connectivity matrix visualization and detailed values

Technical Details

The application uses:

  • A Variational Autoencoder (VAE) from the DemoVAE package for learning latent representations of brain connectivity

  • Random Forest regression to predict aphasia scores from latent features and demographics

  • Gradio web interface for interactive visualization

  • Analysis of key brain connectivity patterns and their relationship to aphasia

Deployment

The application can be deployed using:


# Install requirements

pip install -r requirements.txt



# Run the Gradio app

python app_gradio.py

Hugging Face Spaces Deployment

This app is designed to be deployed on Hugging Face Spaces:

  1. Create a new Space and select Gradio as the SDK

  2. Upload the files or connect to your GitHub repository

  3. The app will automatically deploy and be available online

Note: The initial model training may take some time when you first run the application.