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.9
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, soilDB, aqp, mpspline2, ggridges
Published: 2026-11-29
DOI: 10.32614/CRAN.package.soilFlux
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
In views: Agriculture
CRAN checks: soilFlux results

Documentation:

Reference manual: soilFlux.html , soilFlux.pdf
Vignettes: Introduction to soilFlux (source, R code)
Pedometric Workflow: KSSL Data, Spline Harmonisation, and SWRC Fitting (source, R code)

Downloads:

Package source: soilFlux_0.1.9.tar.gz
Windows binaries: r-devel: soilFlux_0.1.5.zip, r-release: soilFlux_0.1.5.zip, r-oldrel: soilFlux_0.1.5.zip
macOS binaries: r-release (arm64): soilFlux_0.1.9.tgz, r-oldrel (arm64): soilFlux_0.1.9.tgz, r-release (x86_64): soilFlux_0.1.9.tgz, r-oldrel (x86_64): soilFlux_0.1.9.tgz
Old sources: soilFlux archive

Linking:

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