A Stability Analysis of Neural Networks and Its Application to Tsunami Early Warning

Donsub Rim, Sanah Suri, Sanghyun Hong, Kookjin Lee, Randall J. LeVeque

Abstract

Neural networks (NNs) enable precise modeling of complicated geophysical phenomena but are sensitive to small input changes. In this work, we present a new method for analyzing this instability in NNs. We focus our analysis on adversarial examples, test-time inputs with carefully-crafted human-imperceptible perturbations that expose the worst-case instability in a model's predictions. Our stability analysis is based on a low-rank expansion of NNs on a fixed input, and we apply our analysis to a NN model for tsunami early warning which takes geodetic measurements as the input and forecasts tsunami waveforms. The result is an improved description of local stability that explains adversarial examples generated by a standard gradient-based algorithm, and allows the generation of even worse examples. Our analysis can predict whether noise in the geodetic input will produce an unstable output, and identifies a simple approach to filtering the input that enables more robust forecasting from noisy input.

Introduction

Neural networks have become powerful tools for modeling complex physical phenomena, yet they suffer from a notorious "black box" problem: instability. Small, human-imperceptible perturbations to an input—known as adversarial examples—can lead to wildly incorrect predictions. In safety-critical fields like geophysics, this is a significant barrier. A tsunami early warning system using Global Navigation Satellite System (GNSS) data to forecast wave heights cannot afford to "hallucinate" a massive wave due to sensor noise or specific measurement errors. Existing stability metrics, such as Lipschitz constants, are often too broad and fail to distinguish between a model's stable linear behavior and the chaotic nonlinear triggers causing adversarial failures.

Theoretical Framework: Low-Rank Expansion

The authors introduce a novel framework for feedforward NNs (specifically those using ReLU activations) by decomposing the network's function into two components: $$f(x) = [F_0 + F_\sigma(x)] \cdot x$$ where $F_0$ represents the constant linear map (the "average" stable behavior) and $F_\sigma(x)$ is the input-dependent map capturing the nonlinearities.

A key theoretical insight is that $F_\sigma$ is inherently low-rank. Its rank is bounded by the number of layers in the network, which is typically much smaller than the number of input features. This implies that the instabilities of a neural network are confined to a very small, specific set of directions (subspaces) in the input data. By applying Singular Value Decomposition (SVD) to this low-rank map, the specific input patterns that trigger worst-case errors can be identified.

The low-rank nature of the nonlinear map $F_\sigma$ is evidenced by the sharp drop in singular values compared to the stable linear map $F_0$.

Methods and Datasets

The study validates this theory using two primary setups:

  1. Toy Model: A 7-layer fully connected network with random weights to demonstrate the mathematical properties of the low-rank expansion.
  2. Tsunami Early Warning Model: A 1D Convolutional Neural Network (CNN) trained on synthetic geodetic time-series data. The model takes GNSS measurements from 60 stations as input and forecasts tsunami waveforms at three coastal gauges. Data was generated using MudPy for earthquakes and Clawpack/GeoClaw for tsunami simulations.

Results and Key Insights

The analysis reveals that instability is fundamentally low-dimensional. Even in large networks, only a few directions lead to adversarial collapse. This makes the problem of improving NN robustness more tractable through projection-based filtering, which removes input signal components aligning with these unstable directions.

Sensitivity and Adversarial Attacks

In toy models, the nonlinear component $F_\sigma$ was found to be significantly more sensitive than the stable $F_0$ part. As shown in Figure 1, the sensitivity ratio can reach values near 200, indicating that the nonlinear triggers are the primary source of instability.

Sensitivity ratios show that the nonlinear component $F_\sigma$ can be orders of magnitude more sensitive than the constant linear part $F_0$.

In the tsunami model, a tiny 2% perturbation caused a 27% error in predicted wave height using standard attack methods (like PGD). However, the low-rank analysis identified a specific 2% perturbation that caused a massive 83% error, demonstrating that this method captures the true limits of model stability better than standard algorithms.

Robustness to Noise

The model is relatively robust to white noise, which is unlikely to align with the tiny unstable subspace. However, structured noise (like Brownian noise common in sensors) is more dangerous. By applying a low-rank filter, the authors reduced the error caused by Brownian noise from 24% to just 3%, effectively neutralizing the instability.

Discussion

While promising, the computational cost of calculating the full expansion for every input remains high. Future work will focus on optimizing sampling methods for real-time use and extending the framework to other activation functions (e.g., Sigmoid, Tanh) and architectures like Transformers. Additionally, testing against real-world sensor data and complex environmental noise is a critical next step for operational deployment in early warning systems.

Summary updated

Abstract

Neural networks (NNs) enable precise modeling of complicated geophysical phenomena but are sensitive to small input changes. In this work, we present a new method for analyzing this instability in NNs. We focus our analysis on adversarial examples, test-time inputs with carefully-crafted human-imperceptible perturbations that expose the worst-case instability in a model's predictions. Our stability analysis is based on a low-rank expansion of NNs on a fixed input, and we apply our analysis to a NN model for tsunami early warning which takes geodetic measurements as the input and forecasts tsunami waveforms. The result is an improved description of local stability that explains adversarial examples generated by a standard gradient-based algorithm, and allows the generation of even worse examples. Our analysis can predict whether noise in the geodetic input will produce an unstable output, and identifies a simple approach to filtering the input that enables more robust forecasting from noisy input.
BibTeX
@article{rim2024stability,
  author = {Donsub Rim and Sanah Suri and Sanghyun Hong and Kookjin Lee and Randall J. LeVeque},
  title = {{A Stability Analysis of Neural Networks and Its Application to Tsunami Early Warning}},
  journal = {Journal of Geophysical Research Machine Learning and Computation},
  year = {2024},
  doi = {10.1029/2024jh000223},
}
Figure