Machine Learning Project 1
Group: mrilab
- author
This Python package can be used for predicting patient age from given MRI images. The module :pybrain
contains the class MultiBrain
which reads Niftii MRI images into one single object, stacking the individual brains in the 4th dimension. The module :pypreprocessing
adds some simplification to read file names, modules :pyconvolve
and :pyedge
can be used for image processing. The module :pygridsearch
gives the possibility to search the best parameters for a specified model.
The training and prediction workflow is located in predict_final.py
.
A brief explanation of the steps in the applied workflow:
- loading data from Nifti image files and combine them into one
MultiBrain
instance - averaging over 2x2x2 voxel boxes for 8-fold dimensionality reduction
- calculating the correlation of every voxel to the age of the brain
- picking only voxels that have a higher absolute correlation than mean + 2 * std
5) training of a pipeline with: 5.1) Standard scaler (zero mean and unit variance) 5.2) Linear support vector regressor with C=2. regularization 6) predicting ages of test images with trained pipeline
The main objective of this task turned out to be dimensionality reduction while keeping the most informative voxels. We tackled this problem by smoothing the images through averaging over small boxes of 8 voxels first, followed by calculation of the correlation of these averaged resulting voxels with the brain age. We were then able to select the most correlated brain voxels for training with an arbitrary threshold of correlations over mean + 2 * std
. These voxels were then standard scaled to zero mean and unit variance before being fed to a linear Support Vector Regressor (SVR). The C parameter of the SVR was obtained through a grid search workflow in gridsearch.py
.