This project compares Independent Component Analysis (ICA) and Principal Component Analysis (PCA) for decoding cognitive states from fMRI data using the Haxby dataset. We extract brain activation patterns, classify them with SVMs, and visualize the components as brain maps.
- ๐ฏ Goal: Classify cognitive states (e.g., face, house, cat, etc.) from brain activity
- ๐ง Data: Haxby fMRI Dataset
- ๐งฎ Techniques: PCA, ICA, SVM
- ๐ฌ Tools: Nilearn, Scikit-learn, Matplotlib, Seaborn
- ๐งพ Outputs:
- Classification accuracy
- Brain component visualizations
- Confusion matrices for ICA vs PCA
- Preprocessing: Extract time-series data from fMRI volumes using a ventral temporal mask
- Feature Extraction:
- PCA: Reduce to 100 principal components
- ICA: Extract 100 independent components
- Classification:
- Linear SVM to predict stimulus categories
- Evaluate and compare performance
- Visualization:
- Confusion matrix for both methods
- Brain maps of top components (via
nilearn.plotting)
- PCA Accuracy: ~๐ฏ%
- ICA Accuracy: ~๐ฏ%
- Component maps show distinct spatial patterns per method
ICA tends to find more interpretable components, while PCA excels at capturing variance.
pip install nilearn nibabel scikit-learn matplotlib seaborn