This repository contains the plotting and analysis tools for visualizing results from autoencoder experiments conducted in the AFQ-Insight-Autoencoder-Experiments repository.
This is a results analysis repository that works in tandem with the experiments repository. After running experiments in the AFQ-Insight-Autoencoder-Experiments repository, you transfer the results (CSV files, model weights, etc.) to this repository for visualization and analysis.
1. Run experiments in AFQ-Insight-Autoencoder-Experiments
2. Copy results to this repository using scp or similar
3. Run Jupyter notebooks in this repository for plotting and analysis
4. Generate visualizations and reconstructions for paper/presentation
Each directory represents a different type of autoencoder experiment:
FA_VAE_AGE_SITE_STAGES/- Fractional Anisotropy VAE with age and site prediction in stagesALTERNATING_VAE_AGE_SITE_STAGES/- Alternating training VAE with age and site predictionVAE_AGE_SITE/- Basic VAE with age and site predictionVAE_AGE_SITE_STAGES/- Staged VAE training with age and site predictionVAE_AGE_SITE_STAGES_ALL/- Extended staged VAE trainingTRACT_RANKING/- Individual tract analysis and ranking experimentsConvAE_Experiments/- Convolutional autoencoder experimentsFC_AE_Experiments/- Fully connected autoencoder experiments
training_averages/- Aggregated training metrics across experimentsresults_summary/- Overall performance summariesplots/- General plotting utilities and outputsExperiment_Utils/- Shared utility functions and model definitions
Each experiment directory typically contains:
experiment_name/
├── csv_files/ # Training metrics, performance data
├── model_weights/ # Saved PyTorch model files (.pth)
├── plots/ # Generated visualization outputs
├── confusion_matrix/ # Classification performance matrices
├── plot.ipynb # Main plotting notebook
├── reconstructions_comb.ipynb # Reconstruction visualization notebook
├── vae_recon.ipynb # VAE-specific reconstruction analysis
└── plot_tracts.py # Python plotting utilities
After completing experiments in the AFQ-Insight-Autoencoder-Experiments repository:
# From your experiments repository location
scp -r path/to/experiment_results/* username@hostname:/path/to/AFQ-Insight-Autoencoder-Plotting/EXPERIMENT_NAME/
# Example for specific file types:
scp path/to/experiments/csv_files/*.csv username@hostname:/path/to/plotting/FA_VAE_AGE_SITE_STAGES/csv_files/
scp path/to/experiments/model_weights/*.pth username@hostname:/path/to/plotting/FA_VAE_AGE_SITE_STAGES/model_weights/# Copy CSV files
cp experiments_repo/experiment_name/csv_files/*.csv plotting_repo/EXPERIMENT_NAME/csv_files/
# Copy model weights
cp experiments_repo/experiment_name/model_weights/*.pth plotting_repo/EXPERIMENT_NAME/model_weights/
# Copy any additional results
cp experiments_repo/experiment_name/results/* plotting_repo/EXPERIMENT_NAME/-
CSV Files (
*.csv) →csv_files/directory- Training histories
- Performance metrics
- Evaluation results
-
Model Weights (
*.pth) →model_weights/directory- Best models
- Epoch checkpoints
- Component models (VAE, age predictor, site predictor)
-
Configuration Files (
*.json) → Experiment root- Experiment parameters
- Model configurations
-
Log Files (
*.out,*.log) → Experiment root (optional)- SLURM outputs
- Training logs
Ensure you have the required dependencies:
pip install -r requirements.txt # If available
# or
pip install jupyter pandas matplotlib seaborn torch numpy scikit-learn-
Navigate to experiment directory:
cd FA_VAE_AGE_SITE_STAGES/ # or your target experiment
-
Launch Jupyter:
jupyter notebook
-
Run notebooks in order:
plot.ipynb- Generate performance plots and training curvesreconstructions_comb.ipynb- Visualize model reconstructionsvae_recon.ipynb- VAE-specific reconstruction analysis
- Training curves - Loss and accuracy over epochs
- Performance metrics - R² scores, classification accuracy
- Reconstruction visualizations - Original vs reconstructed tract profiles
- Confusion matrices - Classification performance breakdown
- Summary statistics - Aggregated model performance
- Contains individual analysis for each of 48 brain tracts
- Each
tract_X_dki_XX/folder contains complete training history for that tract - Use
plotting_averages.pyfor cross-tract comparisons
- Aggregates results across multiple experiment runs
- Useful for understanding training stability and convergence patterns
- High-level performance comparisons across different model architectures
- Good starting point for understanding which experiments performed best
- Create new directory following naming convention
- Create standard subdirectories:
csv_files/,model_weights/,plots/ - Copy and adapt notebooks from existing experiments
- Update this README with experiment description
- Edit Jupyter notebooks for custom visualizations
- Modify
plot_tracts.pyfor programmatic plotting - Add new plotting functions to
Experiment_Utils/utils.py
- Missing dependencies: Install required packages listed in notebooks
- File path errors: Ensure CSV and model files are in correct directories
- CUDA errors: Some model loading may require GPU; use CPU versions if needed
- Memory issues: Large model files may require sufficient RAM
- Keep consistent naming between experiments and plotting directories
- Use descriptive experiment names that match the research phase
- Maintain the standard folder structure for easy navigation
- Document any custom modifications in experiment-specific README files
When passing this repository to another researcher:
- Ensure all experiment results are properly transferred
- Update experiment descriptions in this README
- Document any custom analysis methods
- Include environment/dependency information
- Provide example command lines for common operations
- Experiments Repository: AFQ-Insight-Autoencoder-Experiments
- AFQ-Insight Base: AFQ-Insight
This repository is designed to work alongside the AFQ-Insight-Autoencoder-Experiments repository. Results from experiments should be transferred here for visualization and analysis.
This project is licensed under the MIT License:
MIT License
Copyright (c) 2025 Sam Chou
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.