TorchRTM: A high-performance vegetation RTM package for deep learning integration

preprint OA: closed
Full text JSON View at publisher
Full text 49,390 characters · extracted from preprint-html · click to expand
TorchRTM: A high-performance vegetation RTM package for deep learning integration | Authorea try { document.documentElement.classList.add('js'); } catch (e) { } var _gaq = _gaq || []; _gaq.push(['_setAccount', 'G-8VDV14Y67G']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); Skip to main content Preprints Collections Wiley Open Research IET Open Research Ecological Society of Japan All Collections About About Authorea FAQs Contact Us Quick Search anywhere Search for preprint articles, keywords, etc. Search Search ADVANCED SEARCH SCROLL This is a preprint and has not been peer reviewed. Data may be preliminary. 15 January 2026 V1 Latest version Share on TorchRTM: A high-performance vegetation RTM package for deep learning integration Authors : Peng Sun 0000-0003-3137-4681 [email protected] , Peter van Bodegom , and Marco Visser Authors Info & Affiliations https://doi.org/10.22541/au.176849838.80131044/v1 176 views 142 downloads Contents Abstract Information & Authors Metrics & Citations View Options References Figures Tables Media Share Abstract The surge in earth observation data availability has exponentially enhanced the potential for monitoring, analysis, and modelling of biodiversity, habitat degradation, and climate impacts. However, to effectively drive conservation efforts, this data deluge requires computationally-efficient advanced interpretation methods. Deep learning is a popular tool, that excels in predictive tasks, yet its interpretability and usefulness for mechanistic ecological and environmental modelling could be further improved by integration with mechanistic radiative-transfer models (RTMs). However, processing such hybrid models is computationally intensive and requires robust software frameworks for efficient implementation of both deep learning and RTMs. Here, we present TorchRTM, a GPU-supported multi-level vegetation RTM with highly parallelized computation supporting inverse and forward modes. TorchRTM is fully compatible with the deep learning frameworks PyTorch, as it leverages both data-level and instruction-level parallelism to enhance computational efficiency. All biophysical modules in TorchRTM support GPU acceleration, it can be scaled to integrate with additional ecological system models, combined with ecological remote sensing observations. Its modular architecture allows seamless integration into deep learning models, facilitating accurate radiative transfer parameter estimation and improving the understanding of underlying physical processes. TorchRTM is demonstrated its high-speed simulation capabilities through two model inversion examples including, 1) a classical look-up table, and 2) an inverse deep learning framework supporting hybrid prediction. Our software offers a promising solution for remote sensing data retrieval via hybrid modelling, combining the interpretability of mechanistic models with the computational power of deep learning. We believe this makes it a powerful tool for the scientific community. Introduction Recent advances in earth observation technology have dramatically increased the volume and resolution of spatiotemporal data, creating new opportunities for ecosystem monitoring and modelling while imposing higher demands on analytical frameworks (Reichstein et al. 2019). The increasing availability of ground measurements, combined with advances in multi- and hyperspectral remote sensing, has enabled data-driven mapping of the relationship between plant traits and variations in vegetation reflectance (Verhoef and Bach 2007, Pham et al. 2019, Liu et al. 2023, Cheng et al. 2024). Yet, conventional machine learning models are often seen as ”black box” (Coveney et al. 2016), with limited interpretability and scientific transparency (Raissi et al. 2019, Todman et al. 2023). In contrast, mechanistic process-based models, grounded in physical laws, offer interpretability (Visser et al. 2025), but are frequently constrained by computational cost, sensitivity to parameterization, and limited scalability, making them less suitable for large datasets (Battiston et al. 2021). To overcome these trade-offs, recent research has focused on hybrid or physics-informed learning approaches that integrate mechanistic understanding with data-driven flexibility (Dehghan-Shoar et al. 2024, Zérah et al. 2024, García-Soria et al. 2024, Sun et al. 2025). Such domain-aware models combine the interpretability of mechanistic process models with the predictive power, computational efficiency, and scalability of deep learning, enhancing both accuracy and efficiency in prediction (Raissi et al. 2019, Reichstein et al. 2019, Han et al. 2023). In ecosystem remote sensing, for instance, integrating Radiative Transfer Model (RTM)-based physical constraints within deep-learning frameworks allows for more reliable mapping of plant traits and vegetation reflectance, as these signals are fundamentally influenced by biochemical composition, structure, and health (Verrelst et al. 2016, García-Soria et al. 2024). Therefore, integrating RTMs into a neural networks framework offers a means to test the accuracy of biophysical modules and advance mechanism meaningful and generalizable hybrid models (Sun et al. 2025). However, the broad adoption of such hybrid frameworks remains limited by software constraints. Most RTM software lack seamless integration with GPU-based deep learning frameworks such as TensorFlow and PyTorch. Moreover, many widely used RTM implementations are often decades old, rely on serial, step-by-step computations with minimal matrix parallelisation, significantly limiting computational efficiency. As the volume and complexity of remote sensing data continue to accelerate, legacy computational architectures have become a critical impediment: traditional RTMs simply cannot keep pace with the throughput and scale demanded by modern deep-learning workflows. Computational and programming challenges should not “limit research scope, depth, and quality” in science (Visser et al. 2015). Consequently, there is an urgent need for RTMs designed for GPU acceleration and neural network integration, ensuring that hybrid modelling can scale with the increasing demands of modern remote sensing (Reichstein et al. 2019). To address these challenges, we developed TorchRTM, a GPU-supported Python package implementing a multi-level (leaf-to-atmosphere) vegetation RTM with highly parallelized computation designed for both forward and inverse modelling. We implemented two forms of parallel acceleration: (A) data-level parallelism, which divides computation tasks across multiple processors to be executed simultaneously, especially on GPUs with multiple cores; and (B) instruction-level parallelism, which optimizes the execution of instructions to achieve fast parallel computation. Furthermore, our package features a modular architecture, allowing users to selectively import specific modules. These modules integrate seamlessly into deep learning models to simulate physical mechanistic while enabling error gradient transmission. Fully compatible with PyTorch (Paszke et al. 2019), our package accelerates parameter estimation and improves the understanding of light transformation across multiple layers of natural/biological conditions. We demonstrate its implementation with two simple use-case estimation. Design of TorchRTM Radiative Transfer Models (RTMs) describe the interactions of light—absorption, emission, and scattering—within the atmosphere and vegetation, providing the quantitative basis for linking biological traits to measured reflectance spectra (Clough et al. 2005, Yang et al. 2020). RTMs are inherently forward mode that predict reflectance from known vegetation and atmospheric parameters. In practical applications, RTMs can also be used in backward (inverse) mode to retrieve model parameters (traits) from observed reflectance using additional inversion techniques (Berger et al. 2018). TorchRTM includes both forward and backward modes of radiative transfer modelling. In this framework, the forward mode simulates the user-selected RTM process within leaf, canopy, and atmospheric layers, providing physically consistent reflectance outputs based on specified biochemical and structural parameters. As the core computational component, the forward mode serves as the foundation for backward modelling tasks, generating synthetic spectra that support inversion and sensitivity analyses (Figure 1). To enable inverse applications, TorchRTM incorporates two complementary backward approaches. The Look-Up-Table (LUT) module utilizes the forward mode to generate large ensembles of simulated spectra under varying trait configurations. These synthetic datasets can then be used for efficient trait retrieval through nearest-neighbour searches, following established methods in ecological remote sensing (Féret et al. 2021) In parallel, the Inverse-Neural-Net module provides a physics-informed neural-network approach for estimating plant functional traits directly from reflectance data. It can be used in two ways. First, it can operate as a standalone supervised model trained on synthetic spectra generated by the RTMs. Second, it can be coupled with the RTMs in a user-defined physics-informed neural-network (PINN) configuration. In this integrated setup, the Inverse-Net serves as an encoder that predicts traits from observed spectra, while the RTM acts as a differentiable decoder that reconstructs the spectra from those traits. This end-to-end structure enforces physical consistency during training, improving both interpretability and predictive robustness (see Sun et al. 2025, Zérah et al. 2024). Figure1. Graphic overview of the TorchRTM python package. TorchRTM consists of three radiative transfer models, Prospect, Prosail and SMAC, which model leaf, canopy and atmospheric radiative transfer, respectively. The user has the option of two operational modes: a forward mode and a backward (inverse) mode. The forward mode implements the RTMs at each scale of choice (leaf, canopy, and atmosphere) or any combination of these to predict spectra (see “example spectra” upper right corner). The backward mode enables parameter inversion through either a standard lookup table (LUT) which the user can construct, or a physics informed neural network (PINN) approach which the user may fit with available data and adapt (see Sun et al 2025 for details). As the forward mode is fully integrated within a GPU-supported deep learning framework, this architecture allows efficient generation of customizable LUTs and supports hybrid approaches when combine with neural network such as physics-informed neural networks. Building on these modelling capabilities, TorchRTM supplies a modern python interface that integrates with PyTorch, providing a user-friendly interface for both individual and batch processing, with compatibility across CPU and GPU environments. Model outputs are stored as PyTorch tensors, which can be directly accessed in memory or converted into NumPy arrays or Pandas Data Frame for further analysis. Forward mode: RTMs included in TorchRTM In forward mode, TorchRTM enables flexible module integration, allowing users to combine PROSPECT5B/D/PRO, 4SAIL, and SMAC at different levels to models radiative transfer hierarchically: PROSPECT5B/D/PRO at the leaf level, PROSAIL (PROSPECT + 4SAIL) at the canopy level, and PROSPECT + 4SAIL + SMAC for atmospheric correction (Table 1). Validation results confirm consistency with established RTM software. We offer leaf-level (e.g., PROSPECT) and canopy-level (e.g., SAIL) RTMs, along with an atmospheric RTM (SMAC, (Kattenborn and Schmidtlein 2019), leaf- and canopy-level RTMs account for the biophysical and biochemical properties of vegetation that influence interactions with incoming radiation (Kattenborn and Schmidtlein 2019). In contrast, atmospheric RTMs simulate radiation interactions with atmospheric components, including scattering, absorption, and emission, which affect signal transmission. These models enable the correction of atmospheric effects when estimating top-of-atmosphere reflectance from top-of-canopy reflectance, or vice versa, ensuring accurate retrieval of vegetation properties (Yang et al. 2020). TorchRTM allows for the individual or combined use of PROSPECT, 4SAIL, and SMAC to quantify radiation interactions across leaf, canopy, and atmospheric components. The combined model accounts for aerosol conditions, water vapor, canopy structural attributes, and optical properties while incorporating key physical parameters governing radiation absorption, scattering, and transmission (overview in Table 2). PROSPECT5B, PROSPECTD and PROSPECTPRO (Féret et al. 2008, 2017, 2021) : PROSPECT models leaf radiative transfer by representing leaves as semi-transparent stacked plates, simulating absorption, transmittance, and reflectance. Wavelength-dependent transmissivity is determined based partly on Fresnel equations and empirical absorption coefficients and leaf biochemical properties, including equivalent water thickness (Cw), dry matter content (Cm), carotenoid concentration (Car), and chlorophyll a and b content (Cab), as well as the number of leaf layers. By incorporating these parameters, PROSPECT simulates how leaves interact with incident radiation, shaping the spectral characteristics of reflected and transmitted light used by the 4SAIL model. We embedded three versions of the PROSPECT models in TorchRTM: PROSPECT5B, a widely used model within the Prospect family; PROSPECTD, an updated version including increased biochemical diversity by incorporating anthocyanins as a parameter (Canth), and; PROSPECT-PRO, a newer and more flexible version by decomposing dry matter content (Cm) into protein- and cellulose/lignin-related components, enabling a more explicit representation of leaf biochemical composition. 4SAIL (Verhoef 1984, Verhoef and Bach 2007): 4SAIL models radiation transfer at the canopy level, using PROSPECT-derived leaf reflectance and transmittance as inputs. However, unlike PROSPECT, 4SAIL accounts for whole-canopy interactions, including leaf inclination distribution, leaf area index, and multiple scattering effects. It represents the canopy as infinite horizontal layers with randomly distributed leaves, solving four “light streams” (direct solar, upward, downward, and towards observer) as differential equations to compute direct and hemispherical radiance. Canopy optical thickness is determined by sensor-sun geometry, influencing radiance flux length and the angular projection of leaf area. The model also incorporates soil reflectance, a moisture parameter, and the hotspot effect, where equal observer and solar zenith angles enhance reflectance. SMAC (Rahman and Dedieu 1994): SMAC models solar radiation transfer through the atmosphere, using four radiative components derived: RSOT (Reflectance for Solar Outgoing Transmission), RDOT (Reflectance for Diffuse Outgoing Transmission), RDDT (Reflectance for Diffuse-Downward Transmission), and RSDT (Reflectance for Solar-Downward Transmission). The four components are compatible with the outputs from 4SAIL. It operates within the wavelength bands relevant to a given satellite sensor, applying spectral band-dependent equations with coefficients from semi-empirical formulations based on the 5S model (Tanré et al. 1990). By accounting for interactions between solar radiation and atmospheric constituents—such as ozone, aerosols, and water vapor—SMAC enables atmospheric correction and retrieval of surface reflectance from top-of-atmosphere measurements (Rahman & Dedieu, 1994). In TorchRTM, we employ the SMAC emulator developed by Yang et al. (2020) as the retrieval process that corrects canopy spectra for atmospheric effects, producing surface reflectance comparable across different atmospheric conditions (Yang et al. 2020). The final output of this module generates simulated remote sensing bands that incorporate atmospheric transmission effects on canopy reflectance. The SMAC emulator in TorchRTM targets specific wavelength bands used by key satellite platforms, including Landsat-4, Landsat-5, Landsat-7, Landsat-8, Sentinel-2A, and Sentinel-2B. Table 1. The output from each module in TorchRTM. PROSPECT rho Leaf reflectance input for 4sail tau Leaf transmittance input for 4sail 4SAIL RDDT Reflectance for Diffuse-Downward Transmission input for SMAC RSDT Reflectance for Solar-Downward Transmission input for SMAC RDOT Reflectance for Diffuse Outgoing Transmission input for SMAC RSOT Reflectance for Solar Outgoing Transmission input for SMAC TSD Total Solar Downward Transmission TDD Total Diffuse Downward Transmission RDD Reflectance for Diffuse-Downward Irradiance R_TOC Reflectance at Top of Canopy SMAC R_TOA Reflectance at Top of Atmosphere Table 2. Biochemical and biophysical parameters (inputs) for each module from TorchRTM. PROSPECT Cab Chlorophyll content of green leaves µg/cm² Car Carotenoid content of green leaves µg/cm² Canth Anthocyanin content of leaves µg/cm² Cbrown Brown pigment content in leaves - Cw Equivalent water thickness of leaves g/cm² Cm Dry matter content of leaves g/cm² N Leaf structure/ Layers number n alpha Angle of incidence degrees 4SAIL LIDFa Leaf Inclination Distribution Function parameter a - LIDFb Leaf Inclination Distribution Function parameter b - LAI Leaf Area Index m²/m-² q Leaf angle distribution parameter degrees tts Solar zenith angle degrees tto Observer zenith angle degrees psi Relative azimuth angle degrees psoil Soil factor influencing reflectance - SMAC aot550 Aerosol Optical Thickness at 550 nm uo3 Ozone content in the atmosphere cm-atm uh2o Water vapor content in the atmosphere g/cm² Pa Atmospheric pressure hPa Retrieval models for model inversion In the backward mode, TorchRTM compares observed spectra (from e.g. satellites) with RTM-generated spectra to infer key functional traits (e.g., Cw, Cm). It offers two retrieval approaches: a lookup table (LUT) method and a deep learning neural network model. Look-Up-Table The TorchRTM package includes a high-speed Look-Up-Table (LUT) function for simple inversion tasks, optimized for GPU computing. The LUT technique is a classical and widely-used method for RTM inversion, generating spectral reflectance for various input combinations. This simplifies inversion by identifying traits linked to spectra that match the measured data. The LUT queries are optimized using a cost function to minimize the difference between simulated and measured reflectance across all wavelengths. The TorchRTM LUT function aims to balance accuracy, efficiency, and user customizability in RTM inversion through several features (Verrelst et al. 2015): LUT construction : Parameters are constrained based on prior biological knowledge, allowing users to define a table with specific parameter ranges, and Latin hypercube sampling ensures uniform sampling across the entire parameter space (McKay et al. 1979). Multiple solutions : Instead of relying on a single optimal solution, the LUT retrieves multiple candidates sets close to the input spectra. The final output is the average of these candidates, improving prediction robustness. • Cost function tuning : Users can adjust the distance metric with the “ distance_order ” parameter to avoid focusing on observation noise. In general, the optimal value is larger than 2, which is the commonly used Manhattan distance (order = 2) – buy the user may optimize this for their system and data. • Noise regularization : Gaussian noise can be added to simulated spectra using the “std” parameter to prevent overfitting. • Custom wavelength selection : The “ interest_wavelength ” parameter allows users to exclude irrelevant wavelengths. • LUT capacity : The “ table_size ” parameter defines how many data entries the LUT can hold. Inverse model with deep learning: RTM Inversion Supporting Physics-Informed Neural Networks (PINN) The TorchRTM package gives users access to trainable physics-informed neural network (PINN) following methods that have been successfully implemented earlier (Sun et al. 2025). This Inverse-Neural Net (INN) is designed for RTM inversion based on an auto-encoder design with RTM components optimized for GPU computation. The proposed framework can be implemented as a conventional hybrid model, where the ”TorchLUT” module generates a trait–spectra lookup table and the INN retrieves functional traits from reflectance data. Beyond this standard workflow, the Inverse-Net can be further embedded into a PINN-style architecture. In this configuration, INN takes in observed spectra and acts as an encoder, followed by a forward-process RTM which serves as the decoder. This architecture allows the encoder to predict vegetative traits from spectral data, while the decoder reconstructs spectra from these traits. We provide a simple example code which shows the user how TorchRTM allows integration of RTMs directly into architecture of the autoencoder, and how it enabled error back-propagation within PyTorch frame to ensure training. Some hyperparameters users can work in Inverse-Net with include: • INN framework Construction : Users can easily specify the size of each layer using in the encoder using a Python list, allowing for flexible network architecture. • Dropout ratio control : The “ Dropout_ratio ” parameter lets users manage dropout during training, which randomly deactivates neuron connections to prevent overfitting and enhance generalizability. • Activator type selection : Users can select different types of activation functions to introduce non-linearity to the model, capturing more complex patterns. Options include ReLU , which passes positive values while blocking negative ones, and sigmoid, which normalizes output to a range between 0 and 1. • Integration with forward module : For effective training, INN pairs with the encapsulated forward module to create an autoencoder. This setup ensures that both modules work synergistically for improved predictive performance. Performance of TorchRTM in forward and backward modes TorchRTM is designed to leverage GPU-supported parallel processing to overcome computational bottlenecks in both forward and backward modelling. In classical RTM inversion, computational time is primarily dictated by the speed of the forward modelling process. This applies across various inversion techniques, including Look-Up Table (LUT) generation, direct inversion via Markov Chain Monte Carlo (MCMC ) (Féret et al. 2008, Shiklomanov et al. 2016, Visser et al. 2025), hybrid modelling-based inversion (Verrelst et al. 2016), and neural network training. Here we use GPU-parallelism to tackle this speed bottleneck. Parallelism in Forward mode To embed RTMs within a deep learning framework, TorchRTM is fully implemented in PyTorch, ensuring seamless integration with neural networks while leveraging robust parallelisation for both multi-core CPUs and CUDA-accelerated GPUs (Luebke 2008). This architecture enables efficient implementation of two parallel processing methods: Batching and Fundamental Matrix Parallel Computation PyTorch inherently supports direct parallel matrix computations and TorchRTM utilizes batch processing, allowing multiple spectra to be computed simultaneously using sets of input parameters. Here, stacked spectra are computed in parallel, reducing computation time by up to an order of magnitude on GPUs for large-scale RTM inversion, training neural networks, or building LUTs (depending on epochs, batch size and hardware constraints; see Figure 1). Users optimize performance by manually defining batch sizes based on hardware constraints (see Figure S2). Additionally, TorchRTM takes advantage of PyTorch’s built-in support for parallel matrix operations, including functions such as torch.pow, torch.sqrt , and torch.sin , as well as tensor-based linear algebra operations like torch.mv and torch.dot , enabling batch-level computations. Mask parallel operation to replace if & for loops So-called ”masking operations“ avoid conditional branching of data and element-wise iteration, by replacing explicit if and for loops in original RTM code. Instead, they apply conditions directly to entire arrays or tensors. This streamlines complex computations and enables efficient vectorized execution: leveraging hardware-optimized parallelism for faster execution (see Figure S3). Parallelism in backward mode After the LUT is built and autoencoders trained, retrieval/inference speed becomes the primary computational bottleneck. CUDA-accelerated algorithm Optimizing LUT queries at this stage, leverages GPU-based data-level parallelism and instruction-level parallelism. For LUT-based inversion, our query function utilizes a CUDA-accelerated k-Nearest Neighbours (KNN) algorithm, efficiently retrieving the most similar spectral candidates. Unlike conventional LUT searches this approach scale much better with data size, allowing us to maintain high retrieval speeds even for large LUTs without sacrificing accuracy (see Example section for running cost). Note that NNs implemented in PyTorch, are optimized through GPU-parallelized tensor computations, hence, once the autoencoder is trained, the encoder is used for predictions is already highly efficient. Calculation benchmarks for the RTMs in TorchRTM To evaluate model consistency in forward mode, with using identical PROSAIL inputs (PROSPECT5B + 4SAIL), we compared key radiative transfer outputs—RHO, TAU, RDDT, RSDT, RDOT, and RSOT (Table 1)—against the reference by Fortran-based RTM (Féret et al. 2022). All metrics aligned perfectly on the 1:1 line with R² = 1.00 across the full spectrum (Supporting information FigureS1), confirming TorchRTM’s computational fidelity with legacy code. To evaluate computational performance in forward mode, we compared TorchRTM (both CPU and GPU implementations) against established alternatives, including a Fortran-based RTM (Féret et al. 2022), a Python-based PROSPECT and PROSAIL package (Domenzain et al. 2019), and a MATLAB-based SMAC implementation in the SPART package (Yang et al. 2020, Yang 2021). We see that the TorchRTM GPU implementation achieves significant speed-ups, resulting in lower runtimes where it is needed particularly for large-scale spectral computations (Figure 2a). Figure 2. TorchRTM Performance Evaluation, in (a) computational speed benchmarks compare TorchRTM (CPU and GPU) with previous code implementations. In (b) a comparison of predicted vs. actual trait values using LUT-based inversion on simulated test sets is given. In (c) a comparison of predicted vs. actual trait values using the deep learning autoencoder (Inverse-Net + forward RTM) on simulated test sets is given. Overall, the TorchRTM_GPU implementation surpasses all others in the forward mode (orange line), especially for large-scale tensor operations. For PROSPECT, the Fortran (green) and TorchRTM CPU implementations (blue) exhibit similar speeds, with the pure Python version (red) being the slowest. For PROSAIL, TorchRTM_GPU was followed by Fortran, while the TorchRTM_CPU and Python versions are comparable in performance. For the SMAC model, TorchRTM_CPU was comparable to the Octave-based version, further demonstrating TorchRTM’s efficiency in computationally intensive tasks. Overall, this suggests that GPU architectures are better suited for large-scale tensor computations, largely due to their ability to leverage a greater number of processing cores. Examples: Leaf Trait Prediction with TorchRTM We give two short examples of a typical leaf trait prediction study as a tutorial demonstration. Normally, the goal is to predict traits from measured spectra, employing a LUT or using TorchRTM’s embedded physics-informed neural network. To assist users in getting started quickly, all example codes can be found in the appendix, including examples of running all models in forward mode. We used a simulated dataset based on prospect5 to generate both training and test sets. Ex 1: Look-Up-Table This example demonstrates how to construct a LUT and use the query function for trait inversion. Step 1. Make up the LUT We generate simulated spectra based on random trait values to represent “synthetic” field or lab-measured data. The LUT is created using a single function, where key parameters include table size, number of candidate-sets, and Gaussian noise standard deviation. The LUT can be created with a single line of code. We select PROSPECT5B model for simulation. The key parameters are table size, the number of candidate sets, and noise level (while we set it as 0 in the demonstration), which takes 25s on Google Colab: simulated_spectra, initial_traits = Torchlut (prospect5b, table_size = 500000, std = 0) test_spectra, test_traits = Torchlut (prospect5b, table_size = 1000, std = 0) Step 2. Set the query machine We use test spectra as a query and set the number of candidates for trait prediction Figure 2b), which takes 38s on Google Colab. Torchlut_pred(xb = simulated_spectra, xq=test_spectra, k=5,y=initial_traits,distance_order=9) Ex 2. PINNs: An Autoencoder with an RTM decoder This example illustrates how RTM and Inverse-Net are coupled to support PINN-based workflows. Specifically, we use PROSPECT5b from TorchRTM as the decoder and a simple multi-layer NN (Inverse-Net) as the encoder. Note that this does assume some familiarity with deep learning pipelines in PyTorch. Step 1. Setting up the encoder We define a three-layer neural network using Inverse_Net(), specifying the number of neurons per layer. layer_sizes = [2101, 444, 6] # Specify the number of neurons in each layer encoder = Inverse_Net(layer_sizes, dropout_rate=0).to (device) # Initialize the encoder and move it to the device (e.g., GPU) Step 2. Setting up the decoder The decoder is based on PROSPECT5B and is implemented as a PyTorch class. class ProspectDecoder(nn.Module): def __init__(self): super(ProspectDecoder, self).__init__() def forward(self, many_paras): real_paras = normalize_parameters(many_paras, fitting = False, param_type=’prospect5b’,\ use_torch = True,para_addr= new_range) refs = prospect5b(real_paras[:, 1:], real_paras[:, 0]) # Apply the prospect5 model return refs[0] # Return the processed output decoder = ProspectDecoder().to(device) # Initialize the decoder and move it to the device Step 3. Generating a synthetic dataset We generate the dataset using the Torchlut function, similar to the LUT example. Users with field or lab observation would load their data here instead. simulated_spectra, initial_traits = Torchlut (prospect5b, table_size = 500000, std = 0) test_spectra, test_traits = Torchlut (prospect5b, table_size = 1000, std = 0) dataset = SpectraDataset (test_spectra, initial_traits) In general, for real-world applications, TorchRTM enables hybrid modelling by incorporating ground truth data (here that would be leaf functional trait records) and accounting for observational errors in the loss function: loss_t += criterion (Encoder (obs_spectra), obs_traits) As TorchRTM is embedded within pyTorch’s framework, it also further supports custom loss functions, allowing flexibility to meet any specific modelling objectives. Step 4. Preparing the DataLoader To streamline training, we prepare a DataLoader with a specified batch size. In pyTorch, the data loader serves as an efficient way to load and preprocess data in batches, facilitating the training of models. train_loader = DataLoader (dataset, batch_size=32) Step 5. Training the Encoder The encoder is trained using PyTorch’s deep learning framework. We define multiple loss functions, set the optimizer, and run the training loop. as the clear example (but see Sun et al. (2025) for more complex design) criterion = torch.nn.MSELoss() # Mean Squared Error loss function optimizer = torch.optim.Adam(encoder.parameters(), lr=0.0001) # Set learning rate at 0.001 num_epochs = 30 # Number of training epochs for epoch in range(num_epochs): for batch_spectra, batch_traits in train_loader: batch_traits = normalize_parameters(to_cuda(batch_traits),fitting =False,\ param_type=’prospect5b’,use_torch = True) batch_spectra = to_cuda(batch_spectra) pred_traits = encoder(batch_spectra) # Predict the trats through the encoder simu_spectra = decoder(pred_traits) # Reconstruct the spectra by predicted traits inversion_loss1 = criterion(simu_spectra, batch_spectra) # Calculate the loss inversion_loss2 = criterion(pred_traits, batch_traits) optimizer.zero_grad() # Reset gradients loss_t = inversion_loss1 + inversion_loss2 # Include additional custom loss terms if necessary loss_t.backward() # Backpropagate the loss optimizer.step() # Update the model parameters print(’%s \’s epoch’%epoch) This process optimizes the encoder to reconstruct input spectra using the decoder, demonstrating how RTM embedding can be applied to inversion problems. After training, we predict the test set in a single line of code (Fig. 2c). Predict_traits = encoder (test_spectra) Future directions The GPU-accelerated implementation presented here demonstrates substantial gains in computational efficiency, while the integration within PyTorch establishes a foundation for scalable, hybrid modelling workflows. Building on this flexibility, TorchRTM’s modular structure allows custom development in inversion strategies. Instead of leveraging only the (popular) pre-encapsulated RTMs, users can define a custom decoder. Any other physical models can be used constrain the training process of the encoder. Building on this foundation, several avenues for future research can be identified. First, the parallelisation strategies developed in TorchRTM - including data-level and instruction-level parallelism - can be generalized to other mechanistic process models to enhance their performance in large-scale simulations. This approach could substantially broaden the applicability of GPU acceleration across biophysical and ecological modelling. Second, TorchRTM’s modular architecture allows users to design custom decoders and inversion strategies, rather than relying solely on pre-packaged RTMs. This flexibility creates opportunities to integrate additional physical models as constraints on the learning process, advancing the development of more interpretable and physically consistent hybrid models. For instance, in Sun et al. (2025), we replace component modules of RTMs with neural networks to pinpoints areas with the greatest potential for improvement. Third, the framework can be extended to incorporate empirical trait observations directly into the hybrid training process. For example, observed spectra and functional trait datasets can be introduced into the loss function: loss_t += criterion (Encoder (obs_spectra), obs_traits) This allows the model to account for observational uncertainty and to calibrate predictions against real-world measurements. Finally, future work should explore domain-specific loss functions and model architectures tailored to different ecological or biogeophysical contexts (see Sun et al. 2025 for early examples). Such developments would further enhance the generalizability and interpretability of hybrid models for ecosystem monitoring and trait-based remote sensing. Implementation and availability The ‘TorchRTM’ package (ver. 1.4.3, https://pypi.org/project/torchrtm/1.4.3) is available for Python and can be directly installed via PyPI using ” pip install torchrtm “. The package and example notebooks were tested and found to runs seamlessly with GPU acceleration on Google Colab. Demonstrations and source code are available on GitHub: https://github.com/Schimasuperbra/torchrtm. We will continue to maintain and update TorchRTM to support more functions. Conclusions TorchRTM is a GPU-accelerated framework for modelling multi-scale radiative transfer processes at the leaf, canopy, and atmospheric levels, tools considered essential for ecological monitoring and remote sensing (Verrelst et al. 2015). It implements widely used RTMs and supports both forward and inverse simulations with batch processing capabilities. TorchRTM demonstrates how radiative transfer models can be efficiently parallelized using CUDA-based GPU acceleration, significantly improving computational performance over previous implementation , this making these classical RTMs deep learning ready. This is why we ensured that our framework seamlessly integrates with existing deep learning architectures, enabling the incorporation of neural networks (NNs) and hybrid data-driven approaches such as physics-informed NN in ecological modelling (Zérah et al. 2024, Sun et al. 2025). Finally, as an installable Python package, TorchRTM provides a user-friendly and extensible interface that integrates seamlessly with Jupyter Notebooks and deep learning workflows. Its modular design supports custom model components and inversion strategies, enabling reproducible and scalable applications in ecological and biogeophysical research. Data archiving statement In accordance with the data sharing policy of Ecography , all software and demonstration code supporting this article are openly accessible in public repositories, with full citation details provided in the main text. Declaration of competing interest The authors declare that they have no known competing financial interests or personal relationships that could have influenced the work reported in this paper. Acknowledgments [Redacted for peer-review] Author contributions [Redacted for peer-review] References: Battiston, F., Amico, E., Barrat, A., Bianconi, G., Ferraz de Arruda, G., Franceschiello, B., Iacopini, I., Kéfi, S., Latora, V., Moreno, Y., Murray, M. M., Peixoto, T. P., Vaccarino, F. and Petri, G. 2021. The physics of higher-order interactions in complex systems. - Nat. Phys. 17: 1093–1098.Berger, K., Atzberger, C., Danner, M., D’Urso, G., Mauser, W., Vuolo, F. and Hank, T. 2018. Evaluation of the PROSAIL Model Capabilities for Future Hyperspectral Model Environments: A Review Study. - Remote Sens. in press.Cheng, K. H., Sun, Z., Zhong, W., Wang, Z., Visser, M., Liu, S., Yan, Z., Zhao, Y., Zhang, R., Zang, J., Jin, S. and Wu, J. 2024. Enhancing wheat crop physiology monitoring through spectroscopic analysis of stomatal conductance dynamics. - Remote Sens. Environ. 312: 114325.Clough, S. A., Shephard, M. W., Mlawer, E. J., Delamere, J. S., Iacono, M. J., Cady-Pereira, K., Boukabara, S. and Brown, P. D. 2005. Atmospheric radiative transfer modeling: A summary of the AER codes. - J. Quant. Spectrosc. Radiat. Transf. 91: 233–244.Coveney, P. V., Dougherty, E. R. and Highfeld, R. R. 2016. Big data need big theory too. - Philos. Trans. R. Soc. A Math. Phys. Eng. Sci. 374: 20160153.Dehghan-Shoar, M. H., Kereszturi, G., Pullanagari, R. R., Orsi, A. A., Yule, I. J. and Hanly, J. 2024. A physically informed multi-scale deep neural network for estimating foliar nitrogen concentration in vegetation. - Int. J. Appl. Earth Obs. Geoinf. 130: 103917.Domenzain, L. M., Gómez-Dans, J. and Lewis2, P. 2019. prosail. in press.Féret, J. B., François, C., Asner, G. P., Gitelson, A. A., Martin, R. E., Bidel, L. P. R., Ustin, S. L., le Maire, G. and Jacquemoud, S. 2008. PROSPECT-4 and 5: Advances in the leaf optical properties model separating photosynthetic pigments. - Remote Sens. Environ. 112: 3030–3043.Féret, J. B., Gitelson, A. A., Noble, S. D. and Jacquemoud, S. 2017. PROSPECT-D: Towards modeling leaf optical properties through a complete lifecycle. - Remote Sens. Environ. 193: 204–215.Féret, J.-B., Berger, K., de Boissieu, F. and Malenovský, Z. 2021. PROSPECT-PRO for estimating content of nitrogen-containing leaf proteins and other carbon-based constituents. - Remote Sens. Environ. 252: 112173.Féret, J.-B., Jacquemoud, S., Baret, F. and Verhoef, W. 2022. PROSPECT, SAIL, and other RT models. in press.García-Soria, J. L., Morata, M., Berger, K., Pascual-Venteo, A. B., Rivera-Caicedo, J. P. and Verrelst, J. 2024. Evaluating epistemic uncertainty estimation strategies in vegetation trait retrieval using hybrid models and imaging spectroscopy data. - Remote Sens. Environ. 310: 114228.Han, B. A., Varshney, K. R., LaDeau, S., Subramaniam, A., Weathers, K. C. and Zwart, J. 2023. A synergistic future for AI and ecology. - Proc. Natl. Acad. Sci. U. S. A. 120: 1–7.Kattenborn, T. and Schmidtlein, S. 2019. Radiative transfer modelling reveals why canopy reflectance follows function. - Sci. Rep. 9: 6541.Liu, S., Yan, Z., Wang, Z., Serbin, S., Visser, M., Zeng, Y., Ryu, Y., Su, Y., Guo, Z., Song, G., Wu, Q., Zhang, H., Cheng, K. H., Dong, J., Hau, B. C. H., Zhao, P., Yang, X., Liu, L., Rogers, A. and Wu, J. 2023. Mapping foliar photosynthetic capacity in sub-tropical and tropical forests with UAS-based imaging spectroscopy: Scaling from leaf to canopy. - Remote Sens. Environ. 293: 113612.Luebke, D. 2008. CUDA: Scalable parallel programming for high-performance scientific computing. - 2008 5th IEEE Int. Symp. Biomed. Imaging From Nano to Macro, Proceedings, ISBI: 836–838.McKay, M. D., Beckman, R. J. and Conover, W. J. 1979. Comparison of three methods for selecting values of input variables in the analysis of output from a computer code. - Technometrics 21: 239–245.Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Köpf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J. and Chintala, S. 2019. PyTorch: An Imperative Style, High-Performance Deep Learning Library. in press.Pham, T., Yokoya, N., Bui, D., Yoshino, K. and Friess, D. 2019. Remote Sensing Approaches for Monitoring Mangrove Species, Structure, and Biomass: Opportunities and Challenges. - Remote Sens. 11: 230.Rahman, H. and Dedieu, G. 1994. SMAC: A simplified method for the atmospheric correction of satellite measurements in the solar spectrum. - Int. J. Remote Sens. 15: 123–143.Raissi, M., Perdikaris, P. and Karniadakis, G. E. 2019. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. - J. Comput. Phys. 378: 686–707.Reichstein, M., Camps-Valls, G., Stevens, B., Jung, M., Denzler, J., Carvalhais, N. and Prabhat 2019. Deep learning and process understanding for data-driven Earth system science. - Nature 566: 195–204.Shiklomanov, A. N., Dietze, M. C., Viskari, T., Townsend, P. A. and Serbin, S. P. 2016. Quantifying the influences of spectral resolution on uncertainty in leaf trait estimates through a Bayesian approach to RTM inversion. - Remote Sens. Environ. 183: 226–238.Sun, P., van Bodegom, P. M., Timmermans, J., Liu, S., Wu, J. and Visser, M. D. 2025. Hybrid modelling of leaf traits: Integrating neural networks with radiative transfer theory. - Remote Sens. Environ. 329: 114958.TANRÉ, D., DEROO, C., DUHAUT, P., HERMAN, M., MORCRETTE, J. J., PERBOS, J. and DESCHAMPS, P. Y. 1990. Technical note Description of a computer code to simulate the satellite signal in the solar spectrum: the 5S code. - Int. J. Remote Sens. 11: 659–668.Todman, L. C., Bush, A. and Hood, A. S. C. 2023. ‘Small Data’ for big insights in ecology. - Trends Ecol. Evol. 38: 615–622.Verhoef, W. 1984. Light scattering by leaf layers with application to canopy reflectance modeling: The SAIL model. - Remote Sens. Environ. 16: 125–141.Verhoef, W. and Bach, H. 2007. Coupled soil-leaf-canopy and atmosphere radiative transfer modeling to simulate hyperspectral multi-angular surface reflectance and TOA radiance data. - Remote Sens. Environ. 109: 166–182.Verrelst, J., Camps-Valls, G., Muñoz-Marí, J., Rivera, J. P., Veroustraete, F., Clevers, J. G. P. W. and Moreno, J. 2015. Optical remote sensing and the retrieval of terrestrial vegetation bio-geophysical properties - A review. - ISPRS J. Photogramm. Remote Sens. 108: 273–290.Verrelst, J., Dethier, S., Rivera, J. P., Munoz-Mari, J., Camps-Valls, G. and Moreno, J. 2016. Active Learning Methods for Efficient Hybrid Biophysical Variable Retrieval. - IEEE Geosci. Remote Sens. Lett. 13: 1012–1016.Visser, M. D., McMahon, S. M., Merow, C., Dixon, P. M., Record, S. and Jongejans, E. 2015. Speeding Up Ecological and Evolutionary Computations in R; Essentials of High Performance Computing for Biologists. - PLOS Comput. Biol. 11: e1004140.Visser, M. D., Detto, M., Meunier, F., Wu, J., Foster, J. R., Marvin, D. C., van Bodegom, P. M., Bongalov, B., Nunes, M. H., Coomes, D., Verbeeck, H., Guzmán Q, J. A., Sanchez-Azofeifa, A., Chandler, C. J., van der Heijden, G. M. F., Boyd, D. S., Foody, G. M., Cutler, M. E. J., Broadbent, E. N., Serbin, S. P., Schnitzer, S., Rodríguez-Ronderos, M. E., Sterck, F., Medina-Vega, J. A. and Pacala, S. W. 2025. When can we detect lianas from space? Toward a mechanistic understanding of liana-infested forest optics. - Ecology 106: e70082.Yang, P. 2021. SPART. in press.Yang, P., van der Tol, C., Yin, T. and Verhoef, W. 2020. The SPART model: A soil-plant-atmosphere radiative transfer model for satellite measurements in the solar spectrum. - Remote Sens. Environ. 247: 111870.Zérah, Y., Valero, S. and Inglada, J. 2024. Physics-constrained deep learning for biophysical parameter retrieval from Sentinel-2 images: Inversion of the PROSAIL model. - Remote Sens. Environ. 312: 114309. Information & Authors Information Version history V1 Version 1 15 January 2026 Copyright This work is licensed under a Non Exclusive No Reuse License. Keywords biodiversity monitoring gpu acceleration hybrid ecological models radiative transfer models remote sensing trait-based ecology Authors Affiliations Peng Sun 0000-0003-3137-4681 [email protected] Leiden University View all articles by this author Peter van Bodegom Leiden University View all articles by this author Marco Visser Leiden University View all articles by this author Metrics & Citations Metrics Article Usage 176 views 142 downloads .FvxKWukQNSOunydq8rnd { width: 100px; } Citations Download citation Peng Sun, Peter van Bodegom, Marco Visser. TorchRTM: A high-performance vegetation RTM package for deep learning integration. Authorea . 15 January 2026. DOI: https://doi.org/10.22541/au.176849838.80131044/v1 If you have the appropriate software installed, you can download article citation data to the citation manager of your choice. Simply select your manager software from the list below and click Download. For more information or tips please see 'Downloading to a citation manager' in the Help menu . Format Please select one from the list RIS (ProCite, Reference Manager) EndNote BibTex Medlars RefWorks Direct import Tips for downloading citations document.getElementById('citMgrHelpLink').addEventListener('click', function() { popupHelp(this.href); return false; }); $(".js__slcInclude").on("change", function(e){ if ($(this).val() == 'refworks') $('#direct').prop("checked", false); $('#direct').prop("disabled", ($(this).val() == 'refworks')); }); View Options View options PDF View PDF Figures Tables Media Share Share Share article link Copy Link Copied! Copying failed. Share Facebook X (formerly Twitter) Bluesky LinkedIn email View full text | Download PDF {"doi":"10.22541/au.176849838.80131044/v1","type":"Article"} Now Reading: Share Figures Tables Close figure viewer Back to article Figure title goes here Change zoom level Go to figure location within the article Download figure Toggle share panel Toggle share panel Share Toggle information panel Toggle information panel Go to previous graphic Go to next graphic Go to previous table Go to next table All figures All tables View all material View all material xrefBack.goTo xrefBack.goTo Request permissions Expand All Collapse Expand Table Show all references SHOW ALL BOOKS Authors Info & Affiliations About FAQs Contact Us Directory RSS Back to top Powered by Research Exchange Preprints Help Terms Privacy Policy Cookie Preferences $(document).ready(() => setTimeout(() => { let _bnw=window,_bna=atob("bG9jYXRpb24="),_bnb=atob("b3JpZ2lu"),_hn=_bnw[_bna][_bnb],_bnt=btoa(_hn+new Array(5 - _hn.length % 4).join(" ")); $.get("/resource/lodash?t="+_bnt); },4000)); (function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'9fe065f6a94458d3',t:'MTc3OTE2NTM2MQ=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2026) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00