### Jacket & GPUs applied to Biomedical Infrared Spectroscopy

In the field of biomedical infrared spectroscopy it is often desirable to obtain spectra at the cellular level. Samples consisting of isolated single biological cells are particularly unsuited to such analysis since cells are strong scatterers of infrared radiation. Thus measured spectra consist of an absorption component often highly distorted by scattering effects. It is now known that the predominant contribution to the scattering is Resonant Mie Scattering (RMieS), and recently we have shown that this can be corrected for using an iterative algorithm based on Extended Multiplicative Signal Correction (EMSC) and a Mie approximation formula. The authors present an iterative algorithm in this paper that applies full Mie scattering theory. In order to avoid noise accumulation in the iterative algorithm a curve-fitting step is implemented on the new reference spectrum. The new algorithm increases the computational time when run on an equivalent processor. Therefore, the Jacket GPU computing software platform was used to implement parallel processing with a Graphics Processing Unit (GPU) to reduce computation time. The optimised RMieS-EMSC algorithm is applied to an IR spectroscopy data set of cultured single isolated prostate cancer (PC-3) cells, where it is shown that spectral distortions from RMieS are removed.

The figure above illustrates Resonant Mie Scattering (RMieS) distortion of infrared spectra from single cells that can now be corrected for using an algorithm incorporating full Mie theory.

## The Hardware, Software & Results

Modern GPUs contain many processing cores, each of which can be used in a
similar manner to conventional central processing units (CPUs). The
computer system used here is an Intel 2.4 GHz Quad Core Xeon with 12 GB of
RAM and an** NVIDIA Tesla 1060c GPU**. This GPU has 240 processing
cores which operate at 1.3 GHz each and is ideally suited to parallel
processing such as the simultaneous calculation of multiple Bessel
functions. To calculate a 1000 curve Qsca database using MATLAB 2009a on
this computer takes **89.91 seconds** for a spectrum of 1601 intensity
values. The only way this calculation can be sped up on the CPU is by
having a higher frequency CPU, i.e., greater than 2.4 GHz. The computation
time of the Qsca database using the van de Hulst approximation for the
same example is 0.324 seconds. However, due to heat production issues, CPU
speeds typically are not increased above about 3.33 GHz. Instead,
multiple cores (such as Quad core processors) are used, which does not
necessarily help certain types of computations. In the case of the
spherical Bessel and Hankel functions within MATLAB, these functions are
not able to access multiple cores meaning that multiple core machines
produce no further speed gains.

Jacket, the GPU computing platform for MATLAB, delivers a language
processing system, just-in-time compiler, and run-time system that acts as
an abstraction layer between MATLAB and the GPU allowing parallel
processing of spherical Bessel and Hankel functions. The equivalent
computation of the Qsca database mentioned above can be completed
in **35.94 seconds**, a speed gain of 2.48 seconds for each spectrum.
When using the RMieS-EMSC algorithm for correcting IR images with many
pixels, __this speed gain saves many hours of computation time__. The
version of Jacket used in this work was v1.2.2. In the future more
sections of the algorithm will be transferred to the GPU to take advantage
of its computational potential.

The above figure is a schematic of the optimized RMieS-EMSC algorithm with modifications highlighted. The graph can be found online, in color, at: Journal of Biophotonics

With the help of these new GPU-based data types and a function library mirroring the important functions provided by MATLAB, Jacket enables MATLAB code to run on the GPU. It provides a full runtime system which optimizes GPU specific programming aspects for the user such as memory transfers, kernel configurations, and execution launches. Jacket allows data to remain on the GPU between successive function calls rather than resorting to round trip memory transfer for each call. It also provides an open interface to write custom CUDA code and links the CUDA functions into the optimized Jacket runtime to alleviate the overhead of repeated memory transfers between the CPU and GPU. This interface is Jacket SDK.

## The Authors

**University of Manchester and Nofima Mat, Norway**- Paul Bassan, Achim Kohler, Harald Martens, Joe Lee, Edward Jackson, Nicholas Lockyer, Paul Dumas, Michael Brown, Noel Clarke, and Peter Gardner
- Peter Gardner Lab

« Back to Case Studies