Deep Neural Networks (DNN) have become a central method in ecology. Most current deep learning (DL) applications rely on one of the major deep learning frameworks, in particular Torch or TensorFlow, to build and train DNN. Using these frameworks, however, requires substantially more experience and time than typical regression functions in the R environment. Here, we present 'cito', a user-friendly R package for DL that allows specifying DNNs in the familiar formula syntax used by many R packages. To fit the models, 'cito' uses 'torch', taking advantage of the numerically optimized torch library, including the ability to switch between training models on the CPU or the graphics processing unit (GPU) (which allows to efficiently train large DNN). Moreover, 'cito' includes many user-friendly functions for model plotting and analysis, including optional confidence intervals (CIs) based on bootstraps for predictions and explainable AI (xAI) metrics for effect sizes and variable importance with CIs and p-values. To showcase a typical analysis pipeline using 'cito', including its built-in xAI features to explore the trained DNN, we build a species distribution model of the African elephant. We hope that by providing a user-friendly R framework to specify, deploy and interpret DNN, 'cito' will make this interesting model class more accessible to ecological data analysis. A stable version of 'cito' can be installed from the comprehensive R archive network (CRAN).
翻译:深度神经网络(DNN)已成为生态学中的核心方法。当前多数深度学习(DL)应用依赖主流深度学习框架(尤其是Torch或TensorFlow)构建和训练DNN。然而,使用这些框架所需经验与时间远超R环境中的典型回归函数。本文介绍‘cito’——一个用户友好的R语言DL包,允许用户采用众多R包通用的公式语法来定义DNN。模型拟合时,‘cito’调用‘torch’,受益于数值优化的torch库,支持在CPU或图形处理器(GPU)间切换训练(从而高效训练大型DNN)。此外,‘cito’包含多种模型绘图与分析的用户友好函数,包括基于自助法的预测置信区间(CI),以及提供效应量与变量重要性的可解释人工智能(xAI)指标(含CI与p值)。为展示使用‘cito’的典型分析流程(包括其内置xAI功能探索训练后DNN),我们构建了非洲象的物种分布模型。希望借由提供便捷的R框架来指定、部署和解读DNN,‘cito’能让生态数据分析更易于接触这一有趣模型类。稳定版‘cito’可通过R综合档案网络(CRAN)安装。