Skip to main content
QUICK REVIEW

[论文解读] CIRA Guide to Custom Loss Functions for Neural Networks in Environmental Sciences -- Version 1

Imme Ebert‐Uphoff, Ryan Lagerquist|arXiv (Cornell University)|Jun 17, 2021
Computational Physics and Python ApplicationsComputer Science被引用 22
一句话总结

本指南为环境科学家提供了在神经网络中开发自定义损失函数的全面框架,重点聚焦于领域特定的性能度量标准,如分数技巧评分和物理约束。通过教授如何在 Keras/TensorFlow 中实现可微分、高效的损失函数,该指南使气象学和环境科学中的建模更加准确且符合物理规律,示例展示了预测可靠性与技能的提升。

ABSTRACT

Neural networks are increasingly used in environmental science applications. Furthermore, neural network models are trained by minimizing a loss function, and it is crucial to choose the loss function very carefully for environmental science applications, as it determines what exactly is being optimized. Standard loss functions do not cover all the needs of the environmental sciences, which makes it important for scientists to be able to develop their own custom loss functions so that they can implement many of the classic performance measures already developed in environmental science, including measures developed for spatial model verification. However, there are very few resources available that cover the basics of custom loss function development comprehensively, and to the best of our knowledge none that focus on the needs of environmental scientists. This document seeks to fill this gap by providing a guide on how to write custom loss functions targeted toward environmental science applications. Topics include the basics of writing custom loss functions, common pitfalls, functions to use in loss functions, examples such as fractions skill score as loss function, how to incorporate physical constraints, discrete and soft discretization, and concepts such as focal, robust, and adaptive loss. While examples are currently provided in this guide for Python with Keras and the TensorFlow backend, the basic concepts also apply to other environments, such as Python with PyTorch. Similarly, while the sample loss functions provided here are from meteorology, these are just examples of how to create custom loss functions. Other fields in the environmental sciences have very similar needs for custom loss functions, e.g., for evaluating spatial forecasts effectively, and the concepts discussed here can be applied there as well. All code samples are provided in a GitHub repository.

研究动机与目标

  • 解决环境科学家缺乏全面资源来实现针对其独特性能度量标准的自定义损失函数的问题。
  • 克服标准损失函数(如均方误差、交叉熵)与环境科学验证标准不一致的局限性。
  • 使研究人员能够实现复杂、可微分的性能度量,如分数技巧评分和空间验证度量,应用于深度学习模型。
  • 引入高级损失函数概念——如物理约束、焦点损失和鲁棒损失——以提升环境应用中模型的可靠性与泛化能力。
  • 提供一种可迁移的框架,不仅适用于气象学,还可推广至其他需要空间、概率性或物理一致性预测的环境科学领域。

提出的方法

  • 开发分步指南,使用 Keras 和 TensorFlow 在 Python 中编写可微分、计算高效的自定义损失函数。
  • 演示如何将分数技巧评分实现为可微分损失函数,用于空间预报验证。
  • 通过整合基于物理的项(如辐射通量平衡)将物理约束融入损失函数,以提升模型一致性。
  • 在损失函数中利用神经网络层(如池化、卷积)和信号/图像处理函数(如 Sobel、FFT)来编码空间和结构先验。
  • 应用自适应和鲁棒损失函数以处理环境数据中的类别不平衡和异常值。
  • 采用感知和软离散化技术,以提升分割和分类任务中的泛化能力。

实验结果

研究问题

  • RQ1环境科学家如何在神经网络中实现领域特定的性能度量(如分数技巧评分)作为可微分损失函数?
  • RQ2在开发用于环境应用的自定义损失函数时,面临的关键技术挑战和常见陷阱是什么?
  • RQ3如何将物理约束(如能量平衡、辐射传输)直接编码到损失函数中,以提升模型可靠性?
  • RQ4焦点损失、鲁棒损失或自适应损失等高级损失函数在空间和概率性环境预报中如何提升神经网络性能?
  • RQ5与标准损失函数相比,自定义损失函数在辐射通量和降水预测中在多大程度上提升了模型技能和物理一致性?

主要发现

  • 使用物理约束损失函数显著提高了净辐射通量预测的可靠性,尤其减少了净通量分量的偏差。
  • 属性图显示,物理约束模型在所有云型态下均实现了更好的可靠性,其可靠性曲线紧密跟随对角线。
  • 分数技巧评分成功实现为可微分损失函数,使雷达反射率和降水应用中的空间预报技能得以直接优化。
  • 基于损失函数优化权重训练的模型在性能图上表现优于未加权和气候学基线,性能得到提升。
  • 引入物理约束后,可靠性曲线左尾的误差减少,尤其在低层云条件下表现更优,表明对极端或罕见事件的处理能力增强。
  • 本指南的框架使研究人员能够实现广泛的自定义损失函数,包括基于信号处理(如 FFT)和图像处理(如边缘检测)的损失函数,从而提升模型可解释性与性能。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。