Chinese Optics Letters, 2016, 14 (7): 071701, Published Online: Aug. 3, 2018  

GPU accelerated simplified harmonic spherical approximation equations for three-dimensional optical imaging Download: 799次

Author Affiliations
Engineering Research Center of Molecular and Neuro Imaging of Ministry of Education & School of Life Science and Technology, Xidian University, Xi’an 710071, China
Abstract
Simplified spherical harmonics approximation (SPN) equations are widely used in modeling light propagation in biological tissues. However, with the increase of order N, its computational burden will severely aggravate. We propose a graphics processing unit (GPU) accelerated framework for SPN equations. Compared with the conventional central processing unit implementation, an increased performance of the GPU framework is obtained with an increase in mesh size, with the best speed-up ratio of 25 among the studied cases. The influence of thread distribution on the performance of the GPU framework is also investigated.

Three-dimensional (3D) optical imaging technology has been widely used in the field of biomedical imaging because of its significant advantages of noninvasive detection, high temporal resolution, and low cost[13" target="_self" style="display: inline;">–3]. The major application of 3D optical imaging is to study the propagation of light in biological tissues. This can be accurately described by the radiative transport equation (RTE) and the Monte Carlo (MC) method[46" target="_self" style="display: inline;">–6]. However, the RTE is difficult to solve analytically, especially for complex structures. The MC method is time consuming, as it requires a large number of photons for reliable simulation results[7]. To facilitate the development of 3D optical imaging, the diffusion equation (DE)[8,9], the first order of the simplified spherical harmonics approximation (SPN) of the RTE, has been widely used in modeling the light propagation in biological tissues because of its high computational efficiency. With the assumption of light propagating diffusively, the DE is not accurate when the observed regions are high absorption or low scattering tissues[10]. In the past decades, the SPN equations, the high order approximations for the RTE, have been studied by many groups[1113" target="_self" style="display: inline;">–13]. Compared to DE, these equations provide much more accurate and reliable results for tissues with a larger variation of optical parameters, especially for high absorption and low scattering regions. The accuracy of the SPN equations for describing light propagation increases with its order N. However, with the increase of the order N, the computational burden would severely aggravate, which limits the applications of high order SPN equations in 3D optical imaging.

To reduce the computational burden of SPN equations, Li et al. proposed an extended finite element method (FEM) for acceleration[14]. Lu et al. proposed a parallel adaptive mesh evolution strategy to improve both the modeling precision and simulation speed[12]. However, they were implemented on a central processing unit (CPU) based on moderately parallel systems. Compared with the parallel system based on multi-core CPUs or multi-core clusters, the graphics processing unit’s (GPU) based acceleration technique has a much higher raw processing power as well as a relatively lower cost. With the rapid development of the GPU hardware, the GPU-based acceleration technique has been applied to accelerate the MC simulations[15], making it a powerful tool for the simulation of light propagation in tissues. Taking the advantages of the GPU technique, a GPU-accelerated finite element solver for the DE was implemented[16], which was used for calculating the forward model of diffusion optical tomography. However, because of the inherent characteristics of the DE, the acceleration performance was not significant, and the applicability was limited, especially when the tissues are of high absorption or low scattering.

In this Letter, to facilitate the application of the SPN equations to be more efficient, a GPU-accelerated framework is proposed for the SPN equations (referred hereafter as the GPU-based method). The accelerated framework is implemented by using a compute unified device architecture (CUDA)[17]. In this framework, the SPN equations are solved with the FEM whose matrices are stored in a compressed sparse row (CSR) format that makes good use of the computing potential of the GPU hardware. The solution of the SPN equations is converted into the problem of a sparse linear system, which is then solved by the parallel conjugate gradient (CG) algorithm implemented on a GPU kernel.

The accuracy of the GPU-based method was first evaluated by comparing it with the MC simulation. Then, the speed-up ratio between the GPU-based method and the conventional CPU computation (CPU-based method) was evaluated. The influence of the mesh size and mesh structure on the acceleration performance was also investigated. Finally, the performance of a parallel CG solver was evaluated with different thread organizations in the kernel function.

Based on the RTE, the SPN equations and the boundary conditions can be detailed as follows[11]: {·ζi,φiφi+j=1(N+1)/2ζi,φjφj=ζi,SSij=1(N+1)/2ζi,φjbv·φj=j=1(N+1)/2ζi,φjbφji[1,(N+1)/2],where v is the unit outer normal vector, Si is the ith composite moment of the light source in the scattering regions, N is the order of the equation, φi is the ith composite moment of the radiance of the light source, ζi,S is the coefficient of the illumination source, ζi,φi, and ζi,φi, ζi,φjb, and ζi,φjb are the coefficients which can be calculated from Ref. [11]. The SPN equations are solved using the FEM[18]. Assume that the domain of object Ω is discretized as a tetrahedral grid δ. The composite moments φi(r) and the original light source Si(r) at a discrete point k can be given by the interpolation of the nodal coefficients φi,k and Si,k using the piecewise polynomial shape function vk(r): φi(r)=k=1Nδφi,kvk(r),Si(r)=k=1NδSi,kvk(r),where Nδ is the total number of nodes on the entire discretized domain δ. When using the FEM for the SPN equations, they can be reformulated into the matrix equation: [M1φ1M1φ(N+1)/2M(N+1)/2φ1M(N+1)/2φ(N+1)/2][φ1φ(N+1)/2]=[b1φ1b(N+1)/2φ(N+1)/2][S1S(N+1)/2],Miφj={δ{ζi,φivk·vl+ζi,φivkvl}drδζi,φifv·φi(vk)vldrifi=jδζi,φivkvldrδζi,φifv·φi(vk)vldrifij,biφj=δζi,Svkvldr,where ζi,S is the coefficient of the illumination source. vk, vl are the piecewise polynomial shape functions. fv·φi(·) can be obtained by solving a set of first-order equations. Thus, the linear relationship that links the unknown source distribution S and the boundary measurements φ could be obtained.

Incorporating the boundary conditions, the exiting partial current J on the boundary can be calculated as J=j=1(N+1)/2(βj,φjbv·φj+βj,φjbφj)j[1,(N+1)/2],where βj,φjb and βj,φjb are the boundary coefficients and can be calculated according to Ref. [11].

From the above derivation of the finite element solver for SPN equations, the main procedure includes assembling the system matrix and solving the linear equations, which can be parallelized with the GPU technique.

The flowchart of the proposed GPU-based accelerated SPN equations is shown in Fig. 1. The main concerns of the GPU-based method are the parallelization of assembling the system matrices M, B, and S, and solving the linear relationship of Eq. (4) with the parallel CG solver. In Fig. 1, the mesh data of objects and optical properties of tissues are prepared in the host memory on the CPU, and then copied to the device memory on the GPU. Because programs run on the GPU are highly influenced by the storage allocation and memory access, the mesh and optical properties data are loaded into the texture cache for frequent access. Then, the element of system matrices M, B, and S are assembled in each thread using CUDA. The size of the system matrices would become extremely large if the order of SPN equation is too high. Consequently, the storage of the system matrices in the normal format will take a large amount of memory. Thus, the CSR format is adopted for the storage of system matrices. There are also some other formats for matrix storage, such as the ELLPACK (ELL)[19] or Hybrid[20]. However, these formats usually require a large amount of memory for storage. After the system matrices are constructed, a GPU-based CG solver is applied to calculate the radiance of the light source φ. Finally, the exiting partial current J is calculated via the coping φ from the device to the host memory.

Fig. 1. Flowchart of the GPU-accelerated framework for the SPN equations.

下载图片 查看所有图片

The major feature of the CG iterative solver is the fast calculation of the product and addition of vectors, which is heavily influenced by the memory access and data distribution on the GPU. The kernel function for calculating the product of the sparse matrix and vector is optimized by using the shared memory of each block in this study. To accelerate the process, each row of the sparse matrix is set in a warp to calculate the product and addition[20]. Thus, the block size (blockSize) should be a multiple of the warp size (currently 32 of NVIDIA device). The kernel function of matrix-vector multiplication for the CSR format is shown in Fig. 2. When performing the multiplication with the elements of vector x, the elements are grouped by cooperating threads which access adjacent elements of the row. From here on, the number of cooperating threads assigned to each row is indicated by coopSize. Each group of cooperating threads is multiplied by the vector and added up into the shared memory. All of the elements on the shared memory are then summed up to obtain the multiplication result. For the additional step of shared memory, a conflict-free implementation of parallel reduction is adopted in our work to improve the performance.

Fig. 2. Kernel function of matrix-vector multiplication for the CSR sparse matrix format using 32 thread warp per matrix row.

下载图片 查看所有图片

We evaluated the performance of the proposed GPU-based method with the CPU-based method on a computer with an Intel Xenon 5440 processor of 2.4 GHz and an NVIDIA Tesla C2050 GPU. Both the CPU and GPU implementations made use of a double-precision floating-point format.

Firstly, the accuracy of the GPU-accelerated SPN equations was validated on two kinds of phantoms by comparing it with the MC simulation[18,21], which was considered as the gold standard for describing light propagation in tissues. For all of the simulations, the photon number of the light source was set to be 1×107 to get reliable simulation results. The average relative error (ARE) was used to estimate the discrepancy quantitatively between the calculated results dSPni of the GPU-accelerated SPN equations and the simulated results dmci of the MC method: ARE=1Ndi=1Ndabs(dmcidSPni)/max(dmci),where Nd is the dimension of the results.

As shown in Figs. 3(a) and 3(b), we selected a homogeneous cylindrical phantom and a digital mouse for validation. The cylindrical phantom had a radius of 5 mm and a height of 10 mm in which a spherical light source was located near the center of the phantom (0, 1.5, and 0 mm). The phantom was discretized into 56664 tetrahedral elements and 11161 nodes. The optical parameters of the phantom, described by the absorption coefficient (μa), scattering coefficient (μs), anisotropy coefficient (g), and refractive index (n) of the phantom, were 0.3mm1, 5mm1, 0.9, and 1.37, respectively. The comparison between the GPU-based method and the MC method was observed and the curve at the position of z=0mm was extracted, as shown in Fig. 3(c). The ARE between the transmittance results of the GPU-accelerated SPN equations and the MC method were 0.0539, 0.0114, 0.0113, and 0.0108 for N=1, 3, 5, and 7, respectively.

Fig. 3. Phantoms used in accuracy validation: (a) homogeneous cylindrical phantom. (b) Digital mouse model based phantom. (c) and (d) comparative results between the GPU-accelerated SPN equations (N=1, 3, 5, and 7) and the MC method of the homogeneous cylindrical phantom and digital mouse, respectively.

下载图片 查看所有图片

The digital mouse model was used to demonstrate the capability of the proposed method in handling light propagation in the tissues with a complex structure. The organs included in the digital mouse were shown in Fig. 3(b), and the related optical properties at the wavelength of 650 nm were listed in Table 1. A spherical light source with a radius of 1.7 mm was located in the liver of the digital mouse. The transmittance results at a height of z=22mm were extracted for the comparison. The comparative result plotted versus the observed points was shown in Fig. 3(d).

Table 1. Optical Properties of Digital Mouse Phantom at the Wavelength of 650 nm, including Absorption Coefficient (μa), Scattering Coefficient (μs), Anisotropy Coefficient (g), and Refractive Index (n)

Tissueμa (mm1)μs (mm1)gn
Muscle0.116364.67350.91.37
Liver0.470786.9990.91.37
Lung0.2629636.8180.941.37
Heart0.078596.71040.851.37
Kidney0.0881116.8460.861.37
Stomach0.0150418.4970.921.37

查看所有表

Secondly, the acceleration performance of the GPU-based method was investigated by comparing it with the CPU-based method. The phantom used in this investigation had the same size and optical properties as that used in the first phantom of accuracy validation. The influence of the size of system matrix on the acceleration performance was evaluated by discretizing the phantom into different numbers of tetrahedrons from 3421 to 94528. The ratio between the total time cost of the CPU-based SPN method and that of the GPU-based one was shown in Fig. 4(a). The speed-up ratio increased with the number of tetrahedral meshes, and a best speed-up ratio could be up to 25 in the observed cases.

Fig. 4. (a) Speed-up ratio of the total processing time using the GPU-accelerated SPN method over the CPU-based one. (b) Speed-up ratio of the GPU-accelerated CG solver over the CPU one for solving the system matrix of SP7 equations.

下载图片 查看所有图片

The acceleration performance of the GPU-accelerated CG solver with a different coopSize and blockSize in kernel function was also investigated. A cylindrical phantom with the same size and optical properties as that used in the above validation was adopted in this investigation, which consisted of 79626 tetrahedrons. The speed-up ratio of the GPU-accelerated CG solver over the CPU one for solving the system matrix of SP7 equations was shown in Fig. 4(b), where the blockSize was from 32 to 256, and the blockSize was the integer times the warp size. The result showed that the best speed-up ratio (13.867) was obtained when the coopSize and blockSize were set to be 8 and 192, respectively. The speed-up ratio increased with the number of the blockSize when it was smaller than 96. However, the speed-up ratio remained steady when the blockSize was bigger than 96. The coopSize of 8 or 16 provided a better performance.

During the experiments, there were some other findings about the GPU-accelerated CG solver. Although the CG solver for solving the linear problem is efficient and stable in most cases, it could become divergent for the case of a large scale system matrix, especially for high order SPN equations. The acceleration is highly influenced by the filling fraction or the sparsity of the system matrix for different order SPN equations. We find that the non-zero elements of the system matrix for the SP1 equation gather closer to the diagonal line compared with the SP3, SP5, and SP7 equations. The non-zero elements of the system matrix for the SP7 equations have the most decentralized distribution, and the size of the sparse system matrix for SP7 is 15 times larger than that of SP1. As a result, the CG solver may be divergent for the large scale matrix and high order SPN equations.

The kernel function of the CG solver is highly influenced by coopSize. The coopSize of 8 or 16 provides a better performance in this study. This may be attributed to the sparsity of the system matrix. Each row of the system matrix is processed in a warp on the GPU. However, when the number of non-zero elements in each row is less than warp size (32) or even smaller, the threads will be idle. So, we defined the coopSize to avoid thread idling when the non-zero elements were less than the warp size.

In conclusion, a GPU-based acceleration framework for SPN equations is proposed to study the light propagation of 3D optical imaging. The accuracy validation experiments demonstrate that the proposed GPU-accelerated method has a good agreement with the MC simulation. Furthermore, the acceleration performance investigation experiments illustrate that the proposed GPU-accelerated method has an excellent acceleration performance over the CPU-based method, with a best speed-up ratio of 25 for the observed cases. The performance of the proposed GPU-accelerated method proved that it is a powerful tool for 3D optical imaging.

References

[1] NtziachristosV.RipollJ.WangL. H. V.WeisslederR., Nat. Biotechnol.23, 313 (2005).NABIF91087-0156

[2] GravesE. E.RipollJ.WeisslederR.NtziachristosV., Med. Phys.30, 901 (2003).MPHYA60094-2405

[3] WillmannJ. K.van BruggenN.DinkelborgL. M.GambhirS. S., Nat. Rev. Drug Discovery7, 591 (2008).NRDDAG1474-1776

[4] PattersonM. S.WilsonB. C.WymanD. R., Lasers Med. Sci.6, 155 (1991).

[5] FangQ., Biomed. Opt. Express1, 165 (2010).

[6] JiaM.CuiS.ChenX.LiuM.ZhouX.ZhaoH.GaoF., Chin. Opt. Lett.12, 031702 (2014).CJOEE31671-7694

[7] ShenH.WangG., Phys. Med. Biol.55, 947 (2010).PHMBA70031-9155

[8] ZhangJ.ShiJ.ZuoS.LiuF.BaiJ.LuoJ., Chin. Opt. Lett.13, 071002 (2015).CJOEE31671-7694

[9] LiW.ZhaoH.QuX.HouY.ChenX.ChenD.HeX.ZhangQ.LiangJ., Chin. Opt. Lett.10, 021701 (2012).CJOEE31671-7694

[10] YuanZ.ZhangQ. Z.SobelE.JiangH. B., J. Biomed. Opt.14, 054013 (2009).JBOPFO1083-3668

[11] KloseA. D.LarsenE. W., J. Comput. Phys.220, 441 (2006).JCTPAH0021-9991

[12] LuY. J.ZhuB. H.ShenH. O.RasmussenJ. C.WangG.Sevick-MuracaE. M., Proc. SPIE7892, 78920F (2011).

[13] LiuK.LuY. J.TianJ.QinC. H.YangX.ZhuS. P.YangX. A.GaoQ. S.HanD., Opt. Express18, 20988 (2010).OPEXFF1094-4087

[14] LiW.YiH. J.ZhangQ. T.ChenD. F.LiangJ. M., Comput. Math. Methods Med.2012, 394374 (2012).

[15] RenN.LiangJ.QuX.LiJ.LuB.TianJ., Opt. Express18, 6811 (2010).OPEXFF1094-4087

[16] SchweigerM., J. Biomed. Imaging2011, 10 (2011).

[17] NvidiaC., Compute Unified Device Architecture Programming Guide (2007).

[18] LuY. J.MachadoH. B.DouraghyA.StoutD.HerschmanH.ChatziioannouA. F., Opt. Express17, 16681 (2009).OPEXFF1094-4087

[19] RibbensC. J.PittsG. G.WatsonL. T., Comput. Syst. Eng.4, 531 (1993).

[20] BellN.GarlandM., “Efficient sparse matrix-vector multiplication on CUDA,” NVIDIA Technical Report NVR-2008-004, NVIDIA Corporation (2008).

[21] RenS.ChenX.WangH.QuX.WangG.LiangJ.TianJ., Plos One8, e61304 (2013).

Shenghan Ren, Xueli Chen, Xu Cao, Shouping Zhu, Jimin Liang. GPU accelerated simplified harmonic spherical approximation equations for three-dimensional optical imaging[J]. Chinese Optics Letters, 2016, 14(7): 071701.

引用该论文: TXT   |   EndNote

相关论文

加载中...

关于本站 Cookie 的使用提示

中国光学期刊网使用基于 cookie 的技术来更好地为您提供各项服务,点击此处了解我们的隐私策略。 如您需继续使用本网站,请您授权我们使用本地 cookie 来保存部分信息。
全站搜索
您最值得信赖的光电行业旗舰网络服务平台!