AI-Powered Smart Meter Analytics for Resource Accounting
You know the scenario: a meter reads zero in a house with a family, while network losses exceed the norm by 12%. The cause: a faulty device or theft. Without an ML layer, such issues take weeks to identify—operators manually cross-reference logs and dispatch field crews. We build analytics on top of AMI (Advanced Metering Infrastructure) that detects anomalies, theft, and predicts load for network balancing in real time. The system processes data from hundreds of thousands of meters at intervals from 15 to 60 minutes and issues an alert within seconds of detecting a deviation. Our experience across 200+ projects shows that ML analytics reduces incident response time from 3-5 days to 2-3 hours, and commercial losses drop by 15-25% in the first year, representing savings of up to $500k annually for a medium city grid.
How AI Improves Automatic Resource Accounting
Traditional threshold-based rules (delta > 0, loss_rate > 5%) generate many false positives. ML models account for seasonality, consumption history, weather, and behavior of neighboring subscribers. For example, Isolation Forest from sklearn detects theft three times more accurately than manual balance calculation—a 300% improvement. And LightGBM forecasts daily load with MAPE < 5%, which for a medium-sized city grid means up to 10% savings on wholesale market purchases. Our certified ML engineers with 10+ years in energy ensure robust deployment.
Problems We Solve
Zero consumption. A meter goes silent—fault or disconnection. The algorithm compares the last three reading increments: if delta = 0 and history confirms a static period, a ticket is raised to check the communication channel. Negative increment. After meter replacement, readings "decrease"—the system detects delta < 0 and checks whether a replacement was logged. If not, a field visit is triggered. Network balance. On a segment with 1000 kWh supplied and 880 kWh consumed, with technical losses of 3%, commercial losses are 90 kWh (9%). If loss_rate > 8%, we initiate a subscriber audit.
How We Do It: Stack and Architecture
Data collection chain: meter → concentrator (DCU) → MDMS → ML analytics + billing. Protocols and intervals are summarized in the table.
| Resource |
Protocol |
Communication |
Interval |
| Electricity |
DLMS/COSEM (IEC 62056) |
PLC G3, NB-IoT, GPRS |
30 minutes |
| Water |
Modbus RTU / M-Bus |
LoRaWAN, NB-IoT |
60 minutes |
| Heat |
M-Bus (EN 13757) |
LoRa, GPRS |
60 minutes |
| Gas |
Modbus / GSM |
GSM/GPRS, NB-IoT |
60 minutes |
Reading Validation: Detection of Three Anomaly Types
The algorithm checks each new reading against history. Example code:
import pandas as pd
import numpy as np
from scipy import stats
def validate_meter_readings(meter_id: str, current_reading: float, history: pd.DataFrame) -> dict:
issues = []
if len(history) > 0:
prev_reading = history['reading'].iloc[-1]
delta = current_reading - prev_reading
if delta < 0:
issues.append({'type': 'negative_increment', 'delta': delta, 'severity': 'warning', 'action': 'check_meter_replacement'})
elif delta == 0 and history['reading'].diff().tail(3).sum() == 0:
issues.append({'type': 'zero_consumption_extended', 'zero_periods': 3, 'severity': 'major', 'action': 'check_meter_communication'})
if len(history) >= 30:
typical_deltas = history['reading'].diff().dropna()
z_score = stats.zscore([delta])[0]
if abs(z_score) > 4:
issues.append({'type': 'statistical_outlier', 'z_score': round(z_score, 2), 'severity': 'major' if z_score > 4 else 'critical', 'action': 'field_verification'})
return {'meter_id': meter_id, 'current_reading': current_reading, 'issues': issues, 'valid': len(issues) == 0}
Theft Detection: Loss Balance Method and Isolation Forest
Segment balance: supply minus sum of consumers = commercial losses. If loss_rate > 8%, anomaly. To find suspicious subscribers, we use Isolation Forest (scikit-learn) with features: monthly_kwh, night_ratio, weather_correlation, year_over_year_change, peer_group_deviation. Contamination 5%. This reduces false positives by 80% compared to rule-based thresholds.
Consumption Forecasting for Load Balancing
LightGBM model with features: hour, day of week, month, holiday/weekend, temperature, lags (24h and 168h), 7-day moving average. Trained on 15-minute meter data. Accuracy: MAPE < 5% for next-day forecast.
Integration with Billing and Customer Portal
MDMS platforms: Itron EE, Landis+Gyr Gridstream, OpenWay Riva. Data export to SAP IS-U, 1С:ЖКХ, and Billing Center via REST/SOAP. Consumer portal: consumption history, anomaly notifications, saving recommendations.
Project Workflow
- Analytics: audit of current infrastructure, protocols, data volumes. 2. Design: collection architecture, ML pipeline, integration points. 3. Implementation: connector to meters, MDMS, validation algorithms. 4. Testing: on historical data plus pilot segment. 5. Deployment: containerization, monitoring, documentation.
Estimated Timelines
| Phase |
Duration |
| AMI connector + reading validation + basic balance |
3-4 weeks |
| Full ML cycle (theft detection, load forecasting, billing integration, customer portal) |
2-3 months |
| Post-launch support |
3 months |
Cost is calculated individually after audit. Typical starting cost is $30,000 for basic implementation, with ROI within 6 months.
What's Included in the Result
- Architecture and API documentation.
- ML model code with metric descriptions.
- Integration tests with MDMS.
- Access to analytics dashboard.
- Operator training (2-3 days).
- 3 months of support after launch.
- Guaranteed accuracy and 10+ years team experience.
Contact us for a preliminary assessment of your project—we'll prepare a commercial proposal within 2 business days. Get a consultation from an engineer on integrating ML into your accounting system.
Anomaly Detection: Autoencoders, Isolation Forest, PyOD
Server monitoring shows CPU 85%, memory 91% — is this the start of an attack or normal peak load? A classifier won’t help: anomalies are by definition rare, diverse, and not pre-labeled. Supervised learning requires examples of anomalies in the training set — so it fails on what you haven’t seen yet. Without an unsupervised approach, detection turns into guesswork.
Why Does Anomaly Detection Require an Unsupervised Approach?
The main problem: no labels and extreme class imbalance. Fraud transactions account for 0.01–0.1% of total volume, production defects 0.5–3%. With such ratios, a naive “all normal” classifier gives 99.9% accuracy but recall for the anomalous class near zero. Supervised models are powerless.
Second: “normality” is always contextual. A login at 3 AM may be normal for a night‑shift user but suspicious for a day‑worker. Bearing vibration at 2.3 mm/s depends on operating mode and machine age. So we embed context via feature engineering and time windows.
Third: quality assessment without ground truth. No standard test set — AUC‑ROC is possible only if a few labeled examples exist. For fully unlabeled data, only domain expert validation and indirect metrics work.
How to Distinguish an Anomaly from Noise in Real Time?
With adaptive thresholds and continuous monitoring of model statistics. In the case section we show how.
| Method |
Data Type |
Training Speed |
Typical Application |
| Isolation Forest |
Tabular, categorical |
High |
Baseline for initial hypotheses |
| Autoencoder |
Images, time series, logs |
Medium |
Unstructured data |
| LSTM-AE |
Multivariate time series |
Low |
Industrial telemetry |
| PyOD (ensemble) |
Tabular |
High |
Quick comparison of 40+ methods |
Isolation Forest is the standard baseline for tabular data. Idea: anomalies are isolated faster by random partitioning of the feature space. Works well at contamination=0.01–0.1, robust to feature scale, no normalization required. Implementation in sklearn.ensemble.IsolationForest.
Typical mistake: setting contamination='auto' without understanding the data. Auto mode assumes a threshold of -0.5, which may not match the actual anomaly proportion. Better: estimate expected anomaly percentage through domain knowledge and set it explicitly. We guarantee contamination tuning for your case.
PyOD (Python Outlier Detection) is a library with 40+ algorithms under a unified API — OCSVM, LOF, COPOD, ECOD, DeepSVDD, AutoEncoder. Useful for quickly comparing methods on the same data.
Autoencoders are the main method for unstructured data (time series, images, logs). Train the network to reconstruct normal data; anomalies yield high reconstruction error. Anomaly threshold is the 95th or 99th percentile of error on a validation set of normal data.
Practical problem with autoencoders: overfitting on “normal” patterns that are still rare. If the training set contains even a few anomalies, the model may learn to reconstruct them well. Solution: thorough cleaning of training data or using a Variational Autoencoder (VAE), which generalizes better.
LSTM‑AE for time series captures temporal dependencies better than a regular AE. Especially effective for multivariate time series (10+ sensors simultaneously). Implementation via PyTorch, training with MSELoss on sliding windows.
In Detail: Anomaly Detection in Industrial Time Series
Problem: vibration sensors on 12 pumps at a chemical plant, 6 sensors per pump, frequency 100 Hz. Need to warn of impending failure 4–24 hours in advance.
Solution architecture: raw data → feature extraction (RMS, kurtosis, peak factor, FFT amplitudes at resonant frequencies) → normalization by 24‑hour sliding window → LSTM‑AE → reconstruction error → threshold logic + alerting.
LSTM window size: 60 seconds (6000 points at 100 Hz). Too small a window misses slow patterns, too large loses sensitivity to rapid changes.
Anomaly threshold: not fixed, but adaptive. threshold = mean(errors_last_7d) + 3 * std(errors_last_7d). As normal state drifts (planned wear), the threshold adapts, avoiding false positives.
Result over a 6‑month pilot: detected 4 out of 5 real pre‑failure conditions (recall 0.8), with 2 false alarms over 6 months (precision 0.67). Before implementation: 3 unplanned shutdowns. After implementation: cost savings verified in the pilot report.
What Specifics Does Fraud Detection Face?
Financial transactions have several features that complicate detection:
- Concept drift: fraud patterns change faster than normal behavior. A model trained six months ago becomes obsolete.
- Adversarial adaptation: advanced fraudsters adapt — making transactions resemble normal ones.
- Temporal dependency: a series of normal transactions followed by one unusual transfer is a sequence anomaly, not a single point.
Practical stack for fraud detection: LightGBM with SMOTE oversampling for the supervised part (known fraud cases) + Isolation Forest for unsupervised (new patterns). Both signals combined in an ensemble; final decision via thresholds tuned for acceptable FPR (0.1–1% of transactions sent to manual review).
How to Evaluate Quality Without Labels?
When ground truth is absent, we evaluate using:
- Synthetic anomaly injection: add artificial anomalies (spike, level shift, point outlier) and check if the model detects them.
- Expert validation: random sample of top‑K anomalies → expert review → precision.
- Business metric: did the number of missed incidents / false alarms decrease after deployment?
Technical detail: the adaptive threshold is computed as mean(errors) + k * std(errors) on a 7‑day sliding window. Coefficient k is tuned on a validation set with synthetic anomalies to achieve FPR < 0.1%. When features drift, the window automatically shifts.
Process
- Interview with domain experts — understand what “normality” means and what incidents have occurred.
- EDA and data preparation — cleaning, feature creation, time windows.
- Baseline (Isolation Forest) — fast validation on known incidents.
- Model selection and customization — Autoencoder / LSTM‑AE / ensemble.
- Training, validation with synthetic anomalies.
- Deployment to production — pipeline on Kafka + Flink / Airflow, alerting to Telegram/Slack, drift monitoring.
- Post‑deployment support — monitor model metrics, update thresholds.
What's Included
- Audit of current data and processes
- Development and training of models (Isolation Forest / Autoencoder / LSTM‑AE / ensemble)
- Configuration of adaptive thresholds and alerting
- Anomaly monitoring dashboard (Grafana / Streamlit)
- Model card and pipeline documentation
- Training for your team (2–3 sessions)
- 3‑month warranty support
Timeline: baseline system with one method — 2–4 weeks. Production system with adaptive thresholds, alerting, and monitoring — 2–5 months. Pricing is calculated individually for your case.
Our team has 8+ years of experience in industrial analytics and 15+ successful projects in anomaly detection for telemetry, finance, and IT monitoring. Get a consultation — we’ll tell you how to solve your problem. Contact us to discuss your data and receive a preliminary architecture proposal.