soilFlux: Physics-Informed Neural Networks for Soil Water Retention Curves

Implements a physics-informed one-dimensional convolutional neural network (CNN1D-PINN) for estimating the complete soil water retention curve (SWRC) as a continuous function of matric potential, from soil texture, organic carbon, bulk density, and depth. The network architecture ensures strict monotonic decrease of volumetric water content with increasing suction by construction, through cumulative integration of non-negative slope outputs (monotone integral architecture). Four physics-based residual constraints adapted from Norouzi et al. (2025) <doi:10.1029/2024WR038149> are embedded in the loss function: (S1) linearity at the dry end (pF in [5, 7.6]); (S2) non-negativity at pF = 6.2; (S3) non-positivity at pF = 7.6; and (S4) a near-zero derivative in the saturated plateau region (pF in [-2, -0.3]). Includes tools for data preparation, model training, dense prediction, performance metrics, texture classification, and publication-quality visualisation.

Version: 0.1.5
Depends: R (≥ 4.1.0)
Imports: dplyr (≥ 1.1.0), tidyr (≥ 1.3.0), ggplot2 (≥ 3.4.0), purrr (≥ 1.0.0), tibble (≥ 3.2.0), stringr (≥ 1.5.0), reticulate (≥ 1.34.0), tensorflow (≥ 2.14.0), rlang (≥ 1.1.0)
Suggests: keras3 (≥ 1.0.0), ggtern, readxl (≥ 1.4.0), scales (≥ 1.2.0), knitr, rmarkdown, testthat (≥ 3.0.0), withr
Published: 2026-03-26
DOI: 10.32614/CRAN.package.soilFlux (may not be active yet)
Author: Hugo Rodrigues ORCID iD [aut, cre]
Maintainer: Hugo Rodrigues <rodrigues.machado.hugo at gmail.com>
BugReports: https://github.com/HugoMachadoRodrigues/soilFlux/issues
License: MIT + file LICENSE
URL: https://github.com/HugoMachadoRodrigues/soilFlux, https://hugomachadorodrigues.github.io/soilFlux/
NeedsCompilation: no
SystemRequirements: Python (>= 3.8), TensorFlow (>= 2.14), Keras (>= 3.0)
Citation: soilFlux citation info
Materials: README
CRAN checks: soilFlux results

Documentation:

Reference manual: soilFlux.html , soilFlux.pdf
Vignettes: Introduction to soilFlux (source, R code)

Downloads:

Package source: soilFlux_0.1.5.tar.gz
Windows binaries: r-devel: not available, r-release: not available, r-oldrel: not available
macOS binaries: r-release (arm64): not available, r-oldrel (arm64): not available, r-release (x86_64): not available, r-oldrel (x86_64): not available

Linking:

Please use the canonical form https://CRAN.R-project.org/package=soilFlux to link to this page.