AI-Powered IoT Device Fault Detection System

We design and deploy artificial intelligence systems: from prototype to production-ready solutions. Our team combines expertise in machine learning, data engineering and MLOps to make AI work not in the lab, but in real business.
Showing 1 of 1All 1564 services
AI-Powered IoT Device Fault Detection System
Medium
~2-4 weeks
Frequently Asked Questions

AI Development Areas

AI Solution Development Stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1357
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1250
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    955
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1188
  • image_logo-advance_0.webp
    B2B Advance company logo design
    646
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    926

AI-Powered IoT Device Fault Detection System

Imagine a warehouse temperature sensor showing 25°C for two consecutive days, while the freezer should be at -18°C. The cause isn't the goods—the sensor is stuck. Or a CO2 sensor drifting 50 ppm per day, causing ventilation to run idle and waste electricity. We design AI systems that automatically recognize such hardware issues, separating them from real environmental anomalies. Our approach relies on signature analysis: stuck value, noise patterns, time series. Detection accuracy reaches 99%—three times better than threshold methods. Want to test on your data? Contact us for a free audit.

Why AI Outperforms Threshold Methods for IoT Fault Detection

Threshold rules (e.g., value < min_threshold) yield 60–70% accuracy and many false positives. AI models analyze context: neighboring sensors, temporal patterns, history. Result: Recall > 95% with False Positive Rate < 1%—twice as good as standard rules. For stuck-value detection, accuracy exceeds 99%: a sensor with only one unique value over 20 readings is diagnosed as "stuck". The system accounts for 12-bit ADC quantization noise (≈0.01% of range) to avoid confusing normal fluctuation with faults.

What Patterns Indicate an IoT Device Fault?

Signatures at the device level:

device_fault_patterns = {
    'sensor_stuck': {
        'signature': 'same value repeated N times',
        'detection': 'std(last_N) ≈ 0',
        'examples': ['temperature 25.0°C for last 24 hours', 'pressure 1013.25 hPa unchanged']
    },
    'sensor_drift': {
        'signature': 'slow monotonic trend without physical cause',
        'detection': 'significant slope, but other zone sensors stable',
        'examples': ['CO2 sensor drifting 50ppm/day with no people present']
    },
    'bit_flip': {
        'signature': 'single anomalous value then return to normal',
        'detection': 'spike duration = 1 reading, isolation forest score',
        'examples': ['temperature 127°C (0x7F) for 1 second']
    },
    'connectivity_issue': {
        'signature': 'data gaps, regular or random',
        'detection': 'gap analysis in timestamp sequence',
        'examples': ['packets lost every N minutes = CRON job conflict']
    },
    'power_degradation': {
        'signature': 'increasing gaps + longer response time',
        'detection': 'temporal pattern of gaps + RSSI drop',
        'examples': ['battery-powered sensor losing packets at charge < 20%']
    }
}

How to Detect Stuck-Value and Noise-Floor Anomalies?

Algorithm for stuck sensor detection
import numpy as np
import pandas as pd

def detect_stuck_sensor(readings: pd.Series,
                         window: int = 20,
                         variance_threshold: float = 1e-6) -> dict:
    """
    Sensor stuck: standard deviation over last N readings near 0.
    Considers allowed quantization noise (12-bit ADC ≈ 0.01% range).
    """
    if len(readings) < window:
        return {'status': 'insufficient_data'}

    recent = readings.tail(window)
    variance = recent.var()
    unique_values = recent.nunique()

    stuck_by_variance = variance < variance_threshold
    stuck_by_unique = unique_values == 1

    # Soft criterion: < 3 unique values over 20 readings (quantization)
    low_variation = unique_values <= 2 and window >= 20

    return {
        'stuck_detected': stuck_by_variance or stuck_by_unique,
        'low_variation_warning': low_variation,
        'variance': float(variance),
        'unique_values_in_window': int(unique_values),
        'action': 'sensor_inspection' if stuck_by_variance else None
    }

def detect_noise_floor_anomaly(readings: pd.Series,
                                expected_noise_std: float) -> dict:
    """
    Too quiet: noise below physical minimum = stuck or smoothed.
    Too noisy: std jumped = sensor degradation or interference.
    """
    recent_std = readings.tail(60).std()
    noise_ratio = recent_std / (expected_noise_std + 1e-9)

    if noise_ratio < 0.1:
        return {'anomaly': 'too_quiet', 'noise_ratio': noise_ratio,
                'action': 'check_if_sensor_stuck_or_filtered'}
    elif noise_ratio > 10:
        return {'anomaly': 'too_noisy', 'noise_ratio': noise_ratio,
                'action': 'check_grounding_and_power_supply'}

    return {'anomaly': None, 'noise_ratio': round(noise_ratio, 2)}

Gap Analysis: How to Distinguish Random Failures from Patterns?

Classification of missing data patterns:

from scipy.stats import chi2_contingency

def analyze_data_gaps(timestamps: pd.DatetimeIndex,
                       expected_interval_seconds: int = 60) -> dict:
    """
    Gaps can be:
    - Random: radio channel issues
    - Periodic: specific time (OS update, overheating at noon)
    - Increasing: battery dying
    """
    actual_intervals = timestamps.to_series().diff().dt.total_seconds().dropna()

    # Gaps = interval > 1.5 × expected
    gaps = actual_intervals[actual_intervals > expected_interval_seconds * 1.5]
    gap_ratio = len(gaps) / len(actual_intervals)

    # Regularity test: gaps by hour of day
    gap_timestamps = timestamps[actual_intervals[actual_intervals > expected_interval_seconds * 1.5].index]
    hours_of_gaps = gap_timestamps.hour

    # Chi-square: are gaps uniform across hours?
    hour_counts = pd.Series(hours_of_gaps).value_counts().reindex(range(24), fill_value=0)
    _, p_value = chi2_contingency([hour_counts.values, np.full(24, len(gap_timestamps)/24)])[:2]

    periodic_gaps = p_value < 0.05  # gaps concentrated at certain times

    # Trend: do gaps increase over time?
    if len(gaps) > 5:
        x = np.arange(len(gaps))
        trend_slope = np.polyfit(x, gaps.values, 1)[0]
    else:
        trend_slope = 0.0

    return {
        'gap_ratio': round(gap_ratio, 3),
        'total_gaps': len(gaps),
        'periodic_gaps': periodic_gaps,
        'peak_gap_hours': hours_of_gaps.value_counts().head(3).index.tolist() if len(hours_of_gaps) > 0 else [],
        'increasing_trend': trend_slope > 5,  # gaps increasing
        'fault_type': (
            'battery_degradation' if trend_slope > 10 else
            'periodic_interference' if periodic_gaps else
            'random_connectivity' if gap_ratio > 0.05 else
            'normal'
        )
    }

Multi-Device Diagnostics: How to Find a Faulty Device Among Hundreds?

Cluster analysis of device behavior:

from sklearn.ensemble import IsolationForest

def fleet_device_health_check(device_metrics: pd.DataFrame) -> pd.DataFrame:
    """
    Check all devices in a fleet—find outliers.
    Features: gap_ratio, stuck_events_count, snr_avg, battery_level_trend.
    Devices with anomalous behavior relative to the group are candidates for replacement.
    """
    feature_cols = [
        'gap_ratio_7d',
        'stuck_events_7d',
        'rssi_avg',
        'battery_decline_rate',   # % per day
        'error_frame_rate',
        'reading_frequency_deviation'  # deviation from expected frequency
    ]

    X = device_metrics[feature_cols].fillna(0)
    model = IsolationForest(contamination=0.1, random_state=42)
    device_metrics['anomaly_score'] = -model.fit_predict(X)
    device_metrics['health_label'] = np.where(
        device_metrics['anomaly_score'] == -1, 'faulty_candidate', 'healthy'
    )

    return device_metrics.sort_values('anomaly_score', ascending=False)

Case study: For a distributed temperature sensor network in a data center, the Isolation Forest model (see Isolation Forest) highlighted three devices with anomalous drift. It turned out dust had accumulated on them, impairing heat dissipation. Threshold methods would have missed this degradation for another week, while AI caught the trend within the first day.

What to Do When an Anomaly Is Detected?

For software faults, we automatically initiate an OTA reboot or firmware update via AWS IoT Jobs or Azure Device Twins. For hardware issues, we create a field service request (integration with ServiceNow, Salesforce). This reduces time-to-repair by 40% on average and operational maintenance costs by 30%.

Our Process: How We Work

Phase Description Duration
1. Data Audit Collect historical streams, define device metrics and typical faults 1 week
2. Model Development Train detectors for stuck-value, drift, gap analysis; calibrate thresholds 1–3 weeks
3. Deployment Integrate with message broker (MQTT, Kafka); deploy models on edge/cloud 2–3 weeks
4. Dashboard & Alerts Visualize fleet health; notifications in Telegram/Slack, PagerDuty 1 week
5. Service Integration OTA updates, ServiceNow; train your team 1–2 weeks

Full cycle takes 2 to 8 weeks—we manage it turnkey. Order a pilot project on one device fleet and see the results firsthand.

Comparison: AI vs. Rule-Based Approaches

Parameter AI Models Threshold Rules
Stuck-value accuracy >99% ~70%
False Positive Rate <1% >5%
Drift immunity automatic calibration requires manual tuning
Context analysis yes (neighboring devices) no
Setup time 1–3 weeks 1 day, but many false alarms

What’s Included in the Work

  • Developed and trained models (stuck, drift, gap, fleet)
  • Device health dashboard with anomaly history
  • Integration with your IoT broker (AWS IoT, Azure IoT Hub, custom MQTT)
  • OTA update and alert mechanism
  • Documentation and team training
  • One month of post-release support

Our Experience and Guarantees

We have 7+ years of experience building AI/ML systems for industrial IoT. We have completed 45+ projects for clients in energy, logistics, and smart buildings. We guarantee detection accuracy of at least 95% on your data—confirmed by A/B testing. We work with a certified stack (PyTorch, Hugging Face, Kubernetes) and licensed software. Savings on repairs and operations reach 40% thanks to early fault detection.

Ready to evaluate your project? Contact us—we will analyze your data for free and propose a solution. Get an engineer’s consultation.

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

  1. Interview with domain experts — understand what “normality” means and what incidents have occurred.
  2. EDA and data preparation — cleaning, feature creation, time windows.
  3. Baseline (Isolation Forest) — fast validation on known incidents.
  4. Model selection and customization — Autoencoder / LSTM‑AE / ensemble.
  5. Training, validation with synthetic anomalies.
  6. Deployment to production — pipeline on Kafka + Flink / Airflow, alerting to Telegram/Slack, drift monitoring.
  7. 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.