# GPU Adding-Doubling Algorithm for Analysis of Optical Spectral Images
## 1 Introduction  
Building on [PERSON] method to calculate the transmission of light through a pile of plates [1], [PERSON] [2] in 1962 proposed the Adding-Doubling (AD) algorithm, an efficient technique to solve the radiative transfer equation (RTE) within complex media, such as clouds, aerosols, and biological tissues. Numerous studies have adopted the AD algorithm to advance our understanding of atmospheric processes and remote sensing applications [3, 4, 5], luminescence in solar cells [6], biomedical optics [7, 8], and photovoltaic and nuclear reactor research [9, 10, 11]. Briefly, the AD algorithm consists of two essential components: the Doubling method and the Adding method [12, 13]. The Doubling method relies on prior knowledge of the reflection and transmission properties of a single thin homogeneous layer. By combining two identical slabs and summing their individual contributions, the reflection and transmission of a slab that is twice as thick can be determined. This doubling process is then iteratively applied, progressively increasing the slab's thickness until the desired magnitude is achieved. The Adding method extends the Doubling method by allowing for the simulation of media that consist of diverse layers and involve instances of internal reflection at boundaries. By incorporating dissimilar slabs into the calculations, we can achieve a more comprehensive representation of complex media structures. Understanding the interaction of photons with biological tissues holds immense importance in various fields, including medical imaging, diagnostics, and laser therapy. To model this intricate process, two widely used approaches are the Monte Carlo (MC) method [14] and the AD algorithm [13]. The MC method is a statistical technique that simulates photon transport by creating random photon paths within the tissue. It uses probabilistic calculations to model absorption, scattering, and reflection/refraction events based on the tissue's optical properties. Starting from an initial position and direction, photons are randomly sampled and tracked as they interact with the tissue. At each interaction, the path length and probability of scattering or absorption are considered, allowing the simulation to replicate the complex behavior of photons in a stochastic manner. The MC method offers several advantages, including its flexibility to simulate complex geometries and heterogeneous tissue structures. It is particularly adept at capturing intricate molecular and cellular photon interactions, making it valuable for biological and medical research. However, due to its statistical nature, the MC method requires an extremely large number of photons to achieve accurate results, leading to computationally intensive simulations. Our preliminary unpublished research revealed that analyzing a hyperspectral image of dimension 223 \(\times\) 452 using the GPU MC method would entail approximately 9 min per spectrum, or roughly 1.7 years per single image, which would render the MC method impractical. Similar computational times when using the MC method were also reported in the literature [15]. The AD algorithm enables the calculation of light propagation in layered turbid media in a slab geometry. The algorithm breaks down the biological tissue into multiple layers, each with its specific properties, such as absorption and scattering coefficients. Using an iterative process, it determines the reflected and transmitted light at each layer interface. By aggregating the contributions from each layer, the AD algorithm provides an estimation of the overall photon distribution within the tissue. The AD algorithm accounts for both the multiple scattering events within the tissue and the interface effects, yielding accurate predictions of light transport. This capability is particularly valuable in applications such as skin imaging, where the multiple layers of the epidermis and dermis need to be accounted for.