Brain encoding with neuroimaging data is an established analysis aimed at predicting human brain activity directly from complex stimuli features such as movie frames. Typically, these features are the latent space representation from an artificial neural network, and the stimuli are image, audio, or text inputs. Ridge regression is a popular prediction model for brain encoding due to its good out-of-sample generalization performance. However, training a ridge regression model can be highly time-consuming when dealing with large-scale deep functional magnetic resonance imaging (fMRI) datasets that include many space-time samples of brain activity. This paper evaluates different parallelization techniques to reduce the training time of brain encoding with ridge regression on the CNeuroMod Friends dataset, one of the largest deep fMRI resource currently available. With multi-threading, our results show that the Intel Math Kernel Library (MKL) significantly outperforms the OpenBLAS library, being 1.9 times faster using 32 threads on a single machine. We then evaluated the Dask multi-CPU implementation of ridge regression readily available in scikit-learn (MultiOutput), and we proposed a new "batch" version of Dask parallelization, motivated by a time complexity analysis. In line with our theoretical analysis, MultiOutput parallelization was found to be impractical, i.e., slower than multi-threading on a single machine. In contrast, the Batch-MultiOutput regression scaled well across compute nodes and threads, providing speed-ups of up to 33 times with 8 compute nodes and 32 threads compared to a single-threaded scikit-learn execution. Batch parallelization using Dask thus emerges as a scalable approach for brain encoding with ridge regression on high-performance computing systems using scikit-learn and large fMRI datasets.
翻译:神经影像数据脑编码是一种成熟的分析方法,旨在直接从电影帧等复杂刺激特征预测人脑活动。通常,这些特征来自人工神经网络的潜在空间表征,刺激形式包括图像、音频或文本输入。岭回归因其良好的样本外泛化性能而成为脑编码的主流预测模型。然而,在处理包含大量脑活动时空样本的大规模深度功能磁共振成像(fMRI)数据集时,训练岭回归模型可能非常耗时。本文评估了多种并行化技术,以缩短在目前最大的深度fMRI资源之一——CNeuroMod Friends数据集上使用岭回归进行脑编码的训练时间。在多线程条件下,我们的结果表明,Intel数学核心库(MKL)显著优于OpenBLAS库,在单机上使用32个线程时速度快1.9倍。随后,我们评估了scikit-learn中现成的岭回归Dask多CPU实现(MultiOutput),并基于时间复杂度分析提出了一种新的Dask并行化"批量"版本。与理论分析一致,MultiOutput并行化被证明不实用,即在单机上速度慢于多线程。相比之下,Batch-MultiOutput回归在计算节点和线程之间具有良好的可扩展性,与单线程scikit-learn执行相比,使用8个计算节点和32个线程时速度提升高达33倍。因此,采用Dask的批量并行化成为在基于scikit-learn和高性能计算系统处理大型fMRI数据集时,使用岭回归进行脑编码的一种可扩展方法。