PySensors: A Python package for sparse sensor placement

Brian M. de Silva, Krithika Manohar, Emily Clark, Bingni W. Brunton, J. Nathan Kutz, Steven L. Brunton

Abstract

Successful predictive modeling and control of engineering and natural processes is often entirely determined by in situ measurements and feedback from sensors (S. L. Brunton et al.). PySensors is an open-source Python library that automates the selection of optimal sensor locations. By leveraging data-driven dimensionality reduction and efficient matrix algorithms, it identifies near-optimal sensor placements for signal reconstruction and classification, bypassing the computational complexity of combinatorial optimization.

Introduction

In fields ranging from aerospace manufacturing to geophysical monitoring, placing sensors is a "Goldilocks" problem: too few sensors and critical data is lost; too many, and the cost becomes prohibitive. Determining mathematically optimal locations is an NP-hard problem because the number of possible combinations grows exponentially with system size. Traditionally, engineers relied on expert intuition or expensive simulations. PySensors addresses this by providing a scalable, data-driven alternative suitable for high-dimensional systems where underlying physics may be complex or partially unknown.

Methodology

PySensors unifies several state-of-the-art algorithms into a modular framework compatible with the scikit-learn ecosystem. Its core methodology relies on two main pillars:

1. Dimensionality Reduction

Before selecting sensor locations, PySensors uses techniques like Principal Component Analysis (PCA/SVD) or Proper Orthogonal Decomposition (POD) to find a low-dimensional basis ($\Phi$) that captures the most important dynamics of the data.

2. Sparse Optimization

  • Reconstruction: For reconstructing a full signal from a few points, the package uses a QR-based pivoting strategy. This is a computationally efficient "greedy" algorithm that selects sensor locations (rows of the measurement matrix) that are most informative for the chosen basis.
  • Classification (SSPOC): For tasks like state identification (e.g., fault detection), it implements the Sparse Sensor Placement Optimization for Classification algorithm. This identifies the smallest set of sensors needed to reconstruct a discriminating plane in the feature subspace.
PySensors workflow for reconstruction and classification tasks.

Software Architecture

By mirroring the scikit-learn API, PySensors makes advanced sparse sensing accessible. Users can use standard routines like cross-validation to tune hyperparameters, such as the number of sensors or modes, just as they would for a standard machine learning model. The package also includes routines for cost-sensitive placement, recognizing that sensor installation costs often vary by location.

Applications and Results

The package has been validated across diverse domains, including fluid dynamics, geophysics, and manufacturing. A primary result is the ability to reconstruct high-resolution fields from extremely sparse measurements. For example, in geophysical monitoring, PySensors can identify key locations for buoys to accurately reconstruct global sea-surface temperature maps.

Reconstruction of sea-surface temperature data using sparse sensors selected via QR pivoting.

Conclusion and Future Work

PySensors bridges the gap between theoretical sparse sensing research and practical engineering. While currently tailored for reconstruction and classification, it provides a robust foundation for data-driven experimental design. Future work may expand the library to include non-linear manifolds or deep learning-based embeddings, further extending its utility in complex, non-linear systems.

Summary updated

BibTeX
@article{silva2021pysensors,
  author = {Brian M. de Silva and Krithika Manohar and Emily Clark and Bingni W. Brunton and J. Nathan Kutz and Steven L. Brunton},
  title = {{PySensors: A Python package for sparse sensor placement}},
  journal = {The Journal of Open Source Software},
  year = {2021},
  doi = {10.21105/joss.02828},
}
Figure