CMAD: Convolution Matrix Anomaly Detection for negative spatio-temporal anomalies
Project description
CMAD — Convolution Matrix Anomaly Detection
CMAD is a lightweight, unsupervised framework for detecting negative spatio-temporal anomalies
in sequential 2D data.
It is designed for applications such as ice melt detection, environmental degradation,
loss analysis, and decline-focused change detection.
CMAD operates on consecutive time steps, requires no labels, and adapts automatically to arbitrary spatial resolutions.
⚠️ Important Version Note
This version of CMAD detects negative anomalies only.
An anomaly is flagged only when the change between consecutive time steps is negative (e.g., loss, decrease, melting, erosion).
Positive changes are intentionally ignored in this release.
Key Features
- ✔ Unsupervised (no training labels required)
- ✔ Works with images or generic 2D time-series arrays
- ✔ Supports arbitrary spatial dimensions (no fixed size)
- ✔ Adaptive IQR-based thresholding
- ✔ Binary anomaly masks (
1 = anomaly, 0 = normal) - ✔ CPU-only by default (GPU-ready via PyTorch)
- ✔ Suitable for large spatio-temporal datasets
Method Overview
Given a time series of 2D data
[
X = {X_1, X_2, \dots, X_T}, \quad X_t \in \mathbb{R}^{H \times W}
]
CMAD performs:
-
Temporal differencing [ D_t = X_{t+1} - X_t ]
-
2×2 convolution + stride-2 downsampling
-
Second-stage 2×2 pooling
- Produces local neighborhoods of 4 values
-
Adaptive IQR thresholding
- Per-cell thresholds learned from training data
-
Back-projection
- Anomalies mapped to original resolution using 4-corner mapping
-
Negative-only filtering
- A location is anomalous only if:
- It exceeds the adaptive threshold and
- The temporal difference is negative
- A location is anomalous only if:
Installation
pip install cmad
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cmad-0.1.0.tar.gz.
File metadata
- Download URL: cmad-0.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f79f561aa7083044b0ca03c9a4730772f5c7a72c62db176fcc93606408c0d030
|
|
| MD5 |
abda1b7ec073559759cf5688af618437
|
|
| BLAKE2b-256 |
091da214d29d929eeafb9b53747573f08644b4fb03bd649e3cd203f1649da5b0
|
File details
Details for the file cmad-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cmad-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb0976886b51f0c6b4b572885f747bd82e502a5bcbfd5e764ed422ee39f2f4c7
|
|
| MD5 |
01a5b212211c3e9ed72a9397982b49c4
|
|
| BLAKE2b-256 |
cb68ca6061bc4b472938f543daf7f459999a868eeea8786b114f10c9f0682a39
|