Skip to content

Latest commit

 

History

History
133 lines (98 loc) · 4.56 KB

File metadata and controls

133 lines (98 loc) · 4.56 KB

ProbMon: Probabilistic Condition Monitoring

Python 3.9+ License: MIT Code style: black

Bayesian change-point detection and degradation modeling for predictive maintenance of LEDs and semiconductors.

ProbMon implements probabilistic condition monitoring using two core Bayesian methods:

  1. Bayesian Online Change-Point Detection (BOCD) — detects regime changes in sensor signals in real time
  2. Bayesian Degradation Modeling — estimates Remaining Useful Life (RUL) with full uncertainty quantification

Architecture

                  Sensor Data
                      |
         +------------+------------+
         |                         |
    BOCD Detector           Degradation Model
    (changepoint.py)        (degradation.py)
         |                         |
    Change-point             RUL Distribution
    probabilities            (mean, std, samples)
         |                         |
         +------------+------------+
                      |
              Visualization & Report
              (plots.py, dashboard.py)

BOCD Algorithm

The change-point detector implements the Adams & MacKay (2007) algorithm from scratch:

  • Maintains a posterior distribution over run lengths (time since last change-point)
  • Uses a constant hazard function as the prior on change-point occurrence
  • Employs a Normal-Inverse-Gamma conjugate model for the observation likelihood
  • Updates run length probabilities online with O(t) complexity per step
  • Detects change-points where P(run_length = 0) exceeds a configurable threshold

Degradation Model

The RUL estimator uses conjugate Bayesian inference:

  • Linear degradation model: y(t) = a + b*t + noise
  • Sequential Normal-Normal updates on the degradation rate b
  • Monte Carlo projection to failure threshold for RUL distribution
  • Full posterior uncertainty propagated to predictions

Project Structure

probmon/
├── probmon/
│   ├── __init__.py
│   ├── sensors.py         # Synthetic sensor data (temperature, vibration, current)
│   ├── changepoint.py     # BOCD implementation (Adams & MacKay 2007)
│   ├── degradation.py     # Bayesian degradation model (RUL estimation)
│   ├── plots.py           # Visualization (heatmaps, fan charts, dashboards)
│   └── dashboard.py       # Text summary report
├── demo.py                # Entry point
├── requirements.txt
├── LICENSE
└── README.md

Quick Start

# Install dependencies
pip install -r requirements.txt

# Run full demo (all sensors)
python demo.py

# Run specific sensor
python demo.py --sensor temp --points 500

# Custom output directory
python demo.py --output-dir results/

Command-line Options

Flag Description Default
--sensor Sensor type: temp, vibration, current, all all
--points Number of data points 500
--output-dir Output directory for plots and report output
--seed Random seed for reproducibility 42

Output

The demo generates:

  • BOCD plots: Signal with detected/ground-truth change-points + run-length heatmap
  • RUL plots: Observed data + predicted trajectory with uncertainty fan + failure threshold
  • Posterior evolution: How the degradation rate estimate converges over time
  • Multi-sensor dashboard: All sensors at a glance
  • Text report: Precision, recall, F1, detection latency, RUL estimates

Sensors

Sensor Physical Model Degradation Pattern
Temperature LED thermal sensor (~65C baseline) Gradual rise + pre-failure spikes
Vibration Bearing RMS vibration Increasing amplitude + harmonic defects
Current Semiconductor leakage Step changes + exponential runaway

References

  • Adams, R. P., & MacKay, D. J. C. (2007). Bayesian Online Changepoint Detection. arXiv:0710.3742.
  • Murphy, K. P. (2007). Conjugate Bayesian analysis of the Gaussian distribution. Technical report, UBC.

Requirements

  • Python 3.9+
  • numpy >= 1.24
  • scipy >= 1.11
  • matplotlib >= 3.7
  • seaborn >= 0.13

No C compiler or external Bayesian libraries needed. Pure Python/NumPy/SciPy implementation.

License

MIT License - see LICENSE.

Author

Eric Gil — BSc Computer Science, Universitat de Lleida