Tensor Notes 5: From Brain Scans to Streaming Data

Tensor Notes 5: From Brain Scans to Streaming Data

Benchmarks are useful, but they are tidy. Real data is messier: fewer samples, more noise, and it keeps arriving. This last note in the series covers the two parts of my thesis that deal with that. The first is detecting early mild cognitive impairment, an early warning stage of Alzheimer's disease, in brain scans. The second is keeping a tensor decomposition up to date when new data streams in, without starting over every time.

A tensor for every brain

The data came from ADNI, the Alzheimer's Disease Neuroimaging Initiative, a long-running public research programme that shares brain imaging data with researchers. The starting point was 196 resting-state fMRI scans. Nine were corrupted, and scans with too much head motion were removed. The classification uses two groups: 44 people with early mild cognitive impairment (eMCI) and 38 healthy controls, 82 subjects in all.

That pair was chosen on purpose. Spotting full-blown Alzheimer's disease is comparatively easy. Spotting the early stage is much harder, because at that point the brain still looks a lot like a healthy one, and it is also the distinction that matters most if you care about catching the disease early.

Each scan is a 3D volume of the brain (64×64×48 voxels) recorded 140 times. The preprocessing followed the usual pipeline, with SPM12 and DPARSFA: drop the first ten volumes while the signal settles, correct slice timing and head motion, and normalize every brain to a common template. Then the AAL atlas splits the brain into 116 regions. Following common practice in Alzheimer's connectivity studies, I left out the 26 cerebellar regions, which leaves 90.

The result is one small matrix per person: 130 time points by 90 brain regions. Each matrix becomes a lateral slice of a tensor, exactly as the images did in part four, and the classification uses the per-class residual method (approach II) from that note.

A small trick: let the test sample help

With so few subjects, every class basis is built from very little data. The thesis uses a simple idea to squeeze more out of it: before classifying a new, unlabelled scan, add it temporarily to every class and recompute each class basis. If the scan really belongs to a class, it fits that class's structure and strengthens its basis. If it does not, it adds little. No prior assumption about the label is needed.

Results

The evaluation was leave-one-out: each subject in turn is held out as the test case, and the model is built from everyone else. The table shows the accuracies for eMCI against healthy controls. The tc-SVD and t-SVD rows are the best accuracy over k on this evaluation; the other three rows are established methods from the literature, named with their original papers:

MethodAccuracy
tc-SVD (k = 44)86.5%
SICE + KPCA (Zhang et al., 2015)73.2%
t-SVD (k = 13)70.7%
HON (Chen et al., 2016)70.7%
SLR (Wee et al., 2012)65.9%

This was the largest gap between the two tensor methods in the whole thesis: 15.8 points above the FFT-based t-SVD. It needs a caveat, though. Both figures are the best value over k, chosen on the same leave-one-out results, and the tc-SVD accuracy was very sensitive to k (the peak sits at a single value), so I read it as a promising signal rather than a settled margin. The thesis does not pin down why the mirror boundary helped on this data.

A word of caution, because this is medical data. This is a small study (82 subjects), and these are research results on one data set, not a diagnostic tool. What they do suggest is that the structure-preserving approach is worth exploring further for this kind of data.

Running time on the fMRI data against k for tc-SVD and t-SVD, approaches I and II
Running time on the fMRI data for different k. The tc-SVD curves stay below their t-SVD counterparts, and approach II (per-class residuals) is the cheapest.

When data keeps arriving

The other practical problem is that big data rarely sits still. New samples arrive, and recomputing a full decomposition every time is wasteful. It also shifts the basis each time, so features computed yesterday no longer line up with today's.

For matrices there is a well-known fix, Brand's incremental SVD (2002). Given an existing SVD and a new block of columns C, you:

  1. project C onto the current basis, L = UTC;
  2. take what is left over, H = C − UL, and find an orthonormal basis J for it;
  3. compute the SVD of a small matrix built from the old singular values, L, and JTH;
  4. rotate the old bases by the result to get the new U, S and V.

The only SVD in the update is of that small matrix, so its cost depends only on the rank and the size of the new block. Projecting onto the existing bases and rotating them costs time linear in their length, far less than recomputing the whole decomposition.

In the thesis I carried this over to tc-SVD. Because the DCT turns the tensor problem into independent matrix problems, you can transform the new slices, run the incremental update on every frontal slice, and transform back. I also wrote the same steps in fully tensor form, with the tc-product in place of ordinary multiplication.

New slices being appended to an existing tensor
Streaming data: new slices join the tensor, and the decomposition is updated instead of recomputed.

Looking back

Put together, the thesis describes a small pipeline. Represent the data as a tensor instead of flattening it. Decompose it with a product whose boundary makes sense for the data. Keep only a reduced feature space, not the full data. Learn on that space, and update it as new data comes in. The open directions I listed at the end still interest me: online and multi-layer versions of these methods, and applying the same idea to other decompositions such as NMF.

These days most of my time goes into building backend systems, not writing papers. The habit I picked up in this research has stayed useful, though: respect the shape of your data, and avoid recomputing what you can update.

This is the final part of a series based on my M.Sc. thesis, “Big Data Learning with Tensor Representation”, supervised by Dr. Mansoor Rezghi at Tarbiat Modares University. The fMRI data came from the Alzheimer's Disease Neuroimaging Initiative (ADNI).

This note is also available in Persian: read the Persian version.

Back to all notes