Platforms
Product Lines
Platforms Safecrete Safewall Mine Operating System (Coming Soon)
On this page

Anomaly Detection

Industrial Equipment Health - AI-Based Anomaly Detection

This document describes an IndustryOS solution that turns raw device telemetry into actionable maintenance insights using AI-powered anomaly detection.

Workflow

  1. Devices send telemetry data including vibration (mm/s), temperature (°C), and acoustic deviation (% from baseline)
  2. Calculated fields maintain a rolling window of the last N values (default: 100) and/or last M minutes for each metric
  3. The rolling window is forwarded to an AI Pipeline node (OpenAI or another LLM provider)
  4. If the AI detects an anomaly, the Pipeline creates an alarm and optionally sends a notification

Architecture

The anomaly detection system consists of:

  • Device Sensors - Collect telemetry from industrial equipment
  • Calculated Fields - Maintain rolling windows of sensor data
  • AI Pipeline Node - Analyses data patterns using large language models
  • Alarm System - Creates and manages alerts based on AI findings
  • Notification Service - Distributes alerts to relevant personnel

This architecture enables real-time anomaly detection with minimal latency whilst leveraging the power of AI for pattern recognition.

Prerequisites

Before implementing AI-based anomaly detection, ensure you have:

  • IndustryOS version 4.2+
  • Device(s) capable of sending the required telemetry values (for this guide, we will emulate them)
  • LLM provider credentials (OpenAI, Azure OpenAI, etc.)
  • Configured AI model in IndustryOS (see AI Models)

Telemetry Input and Output

Expected Telemetry Keys

Each monitored device should send the following telemetry:

  • vibration - Vibration level in mm/s (float)
  • temperature - Temperature in °C (float)
  • acousticDev - Acoustic deviation from baseline in % (float)

These metrics provide a comprehensive view of equipment health. Additional sensors can be added as needed for specific equipment types.

AI Output

The AI model returns structured data including:

  • anomaly - Short label describing the detected issue (e.g., “Bearing Wear”, “Misalignment”)
  • summary - Concise human-readable recommendation with context and suggested actions

Example output:

1
2
3
4
{
  "anomaly": "Bearing Wear",
  "summary": "Vibration has reached 7.4 mm/s and temperature is at 86°C accompanied by irregular acoustic patterns, indicating bearing wear. Recommend immediate bearing inspection and replacement to avoid catastrophic failure."
}

Configuration

Calculated Field Configuration

Purpose: Maintain a rolling window of the last N readings (default 100, configurable) efficiently and forward them directly to the AI node.

Steps

  1. Create or import an EquipmentSensor device profile
  2. Add a calculated field to the device profile with the following configuration:
    • Name - Rolling Window Records
    • Type - Rolling Window
    • Time Range - 1 day (or as required)
    • Maximum Values - 100 (default maximum is 1000, configurable in system settings)
    • Output Keys - acousticDevRecords, temperatureRecords, vibrationRecords

Sample Script

The calculated field uses a script to output the rolling values:

1
2
3
4
5
6
// Sample script to output raw values of the rolling arguments
return {
    "acousticDevRecords": acousticDevRecords,
    "temperatureRecords": temperatureRecords,
    "vibrationRecords": vibrationRecords
};

This ensures that historical context is available for AI analysis, enabling pattern recognition over time.

Pipeline Configuration

Purpose: Analyse the rolling window data, classify anomalies, and generate a plain-language summary. Works with OpenAI or other LLM providers.

Steps

  1. Create a new Pipeline rule chain called “Equipment Health Analysis”
  2. Add the following nodes to the chain:

Message Type Switch

Filter for Post Telemetry messages to ensure only relevant data is processed.

Deduplication Node

Configure with a 5-second interval to reduce AI token usage. This prevents excessive API calls for rapidly changing data.

AI Request Node

Configure the AI request node:

  1. Select your configured AI model
  2. Set the system prompt:
1
You are an industrial equipment monitoring AI. Analyse sensor readings and identify potential equipment failures. Respond in JSON format with 'anomaly' (short label) and 'summary' (detailed recommendation).
  1. Set the user prompt with variable references:
1
2
3
4
5
6
Analyse the following equipment sensor readings:
- Vibration history: $[vibrationRecords]
- Temperature history: $[temperatureRecords]
- Acoustic deviation history: $[acousticDevRecords]

Determine if there are any anomalies requiring maintenance attention. Consider patterns, trends, and correlations between metrics.
  1. Set response format to JSON Schema:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  "type": "object",
  "properties": {
    "anomaly": {
      "type": "string",
      "description": "Short label for the detected anomaly"
    },
    "summary": {
      "type": "string",
      "description": "Detailed recommendation with context"
    }
  },
  "required": ["anomaly", "summary"]
}

Script Transformation Node

Parse the AI response and prepare it for alarm creation:

1
2
3
4
5
6
7
8
9
10
11
12
var response = JSON.parse(msg.response);
if (response.anomaly && response.anomaly !== "None") {
    return {
        msg: {
            anomalyType: response.anomaly,
            anomalySummary: response.summary
        },
        metadata: metadata,
        msgType: "ANOMALY_DETECTED"
    };
}
return null; // No anomaly detected

Create Alarm Node

Configure to create an alarm when anomalies are detected:

  • Alarm Type - Equipment Anomaly
  • Severity - Critical (or based on anomaly type)
  • Details - Include anomaly type and summary

Send Notification Node (Optional)

Configure notification delivery to relevant personnel via email, Slack, or other channels.

  1. Link the device profile to use the “Equipment Health Analysis” Pipeline as its default rule chain

Important Details

  • System and user prompts can reference incoming message data using $[key] for message body fields and ${key} for metadata values
  • Supported response formats: TEXT, JSON, and JSON Schema (we use JSON Schema here for structured output)
  • The deduplication node reduces AI token usage whilst still maintaining responsive anomaly detection

Testing the Anomaly Detection System

Step 1: Create a Test Device

  1. Navigate to the “Devices” page
  2. Click the “+ Add device” button
  3. Name the device “Equipment Sensor 1”
  4. Set the device profile to “EquipmentSensor”
  5. Click “Add”

Step 2: Get Device Access Token

  1. Open the device details
  2. Copy the access token from the device credentials section

Step 3: Send Test Data

Use the following curl commands to test different scenarios. Replace $INDUSTRYOS_HOST with your IndustryOS instance host and $DEVICE_ACCESS_TOKEN with your device’s access token.

Normal Operation (No Alarm)

1
2
3
curl -v -X POST http://$INDUSTRYOS_HOST/api/v1/$DEVICE_ACCESS_TOKEN/telemetry \
--header Content-Type:application/json \
--data '{"vibration":4.2,"temperature":70,"acousticDev":5}'

Expected result: No alarm created. The AI determines that all readings are within normal parameters.

Bearing Wear Detection

1
2
3
curl -v -X POST http://$INDUSTRYOS_HOST/api/v1/$DEVICE_ACCESS_TOKEN/telemetry \
--header Content-Type:application/json \
--data '{"vibration":8.2,"temperature":88,"acousticDev":5}'

Expected result: An alarm is created with:

  • Anomaly Type: Bearing Wear
  • Summary: Description of elevated vibration and temperature with recommendation for bearing inspection

Misalignment Detection

1
2
3
curl -v -X POST http://$INDUSTRYOS_HOST/api/v1/$DEVICE_ACCESS_TOKEN/telemetry \
--header Content-Type:application/json \
--data '{"vibration":32.2,"temperature":38,"acousticDev":5}'

Expected result: An alarm is created with:

  • Anomaly Type: Misalignment
  • Summary: Description of vibration spike without temperature increase, indicating shaft misalignment

Verifying Results

  1. Navigate to the “Alarms” page to view created alarms
  2. Check the alarm details for the AI-generated summary
  3. Review the device’s latest telemetry to see the raw sensor data
  4. Examine Pipeline debug events if troubleshooting is needed

Common Anomaly Types

The AI model can detect various equipment anomalies:

Bearing Wear

Indicators:

  • Elevated vibration levels
  • Increased temperature
  • Irregular acoustic patterns

Typical Recommendation: Bearing inspection and replacement

Misalignment

Indicators:

  • Sudden vibration spike
  • Normal or low temperature
  • Minimal acoustic deviation

Typical Recommendation: Shaft and coupling alignment check

Lubrication Issues

Indicators:

  • Gradually increasing temperature
  • Moderate vibration increase
  • Consistent acoustic deviation

Typical Recommendation: Lubrication system inspection

Imbalance

Indicators:

  • Cyclic vibration patterns
  • Moderate temperature elevation
  • Acoustic fluctuations

Typical Recommendation: Rotor balancing

Cavitation

Indicators:

  • High acoustic deviation
  • Moderate vibration
  • Variable temperature

Typical Recommendation: Check fluid levels and pump operation

Performance and Cost Controls

To optimise the anomaly detection system:

Batching and Debouncing

Send data to AI only after N data points are collected or every T seconds. This reduces API calls whilst maintaining detection effectiveness.

Early Filters

Skip AI calls if all metrics are comfortably within normal bands. Implement simple threshold checks before invoking the AI model.

Payload Compacting

Send statistics (min/mean/max/std, trend) instead of full arrays if the AI prompt allows. This reduces token usage and costs.

Model Selection

Choose appropriate models for your use case:

  • Smaller models (e.g., GPT-4o-mini) for cost-effective basic detection
  • Larger models (e.g., GPT-4) for complex pattern recognition

Deduplication Periods

Adjust the deduplication period based on:

  • Rate of change in your sensor data
  • Acceptable detection latency
  • Cost constraints

Troubleshooting

No Alarms Generated

If anomalies are not being detected:

  1. Verify Raw Data - Check that device data is available in the ‘Latest Telemetry’ tab
  2. Review Calculated Fields - Enable and browse calculated field debug events to ensure rolling windows are being created
  3. Check Pipeline Nodes - Enable debug mode on Pipeline nodes to see data flow
  4. Validate AI Model - Test the AI model connectivity in settings
  5. Review Prompts - Ensure prompts are correctly formatted with variable references

High Costs

If AI usage costs are higher than expected:

  1. Increase Deduplication Period - Reduce the frequency of AI calls
  2. Optimise Prompts - Shorten prompts whilst maintaining effectiveness
  3. Switch Models - Use more cost-effective AI models
  4. Implement Early Filtering - Add threshold checks to skip obvious normal readings
  5. Reduce Rolling Window Size - Use fewer historical data points if acceptable

False Positives

If too many false alarms are being generated:

  1. Adjust Thresholds - Review and tune the sensitivity of detection
  2. Refine Prompts - Provide more specific criteria for anomaly classification
  3. Add Context - Include equipment type and normal operating ranges in prompts
  4. Implement Confirmation - Require anomalies to persist for multiple readings

False Negatives

If anomalies are being missed:

  1. Increase Rolling Window Size - Provide more historical context
  2. Enhance Prompts - Add more detailed instructions for subtle anomalies
  3. Reduce Deduplication Period - Check data more frequently
  4. Add Additional Sensors - Include more metrics for better detection

Advanced Configurations

Multi-Sensor Fusion

Combine data from multiple sensors on the same equipment:

1
2
3
4
5
6
7
return {
    "vibrationRecords": vibrationRecords,
    "temperatureRecords": temperatureRecords,
    "acousticDevRecords": acousticDevRecords,
    "pressureRecords": pressureRecords,
    "currentRecords": currentRecords
};

Equipment-Specific Models

Create different device profiles and Pipeline chains for different equipment types, each with tailored prompts and thresholds.

Severity Classification

Enhance the AI output to include severity levels:

1
2
3
4
5
6
7
8
9
{
  "type": "object",
  "properties": {
    "anomaly": {"type": "string"},
    "summary": {"type": "string"},
    "severity": {"type": "string", "enum": ["Low", "Medium", "High", "Critical"]},
    "urgency": {"type": "string", "enum": ["Normal", "Urgent", "Emergency"]}
  }
}

Trend Analysis

Include rate of change calculations in the calculated field:

1
2
3
4
5
6
7
8
9
10
var vibrationTrend = calculateTrend(vibrationRecords);
var temperatureTrend = calculateTrend(temperatureRecords);

return {
    "vibrationRecords": vibrationRecords,
    "temperatureRecords": temperatureRecords,
    "acousticDevRecords": acousticDevRecords,
    "vibrationTrend": vibrationTrend,
    "temperatureTrend": temperatureTrend
};

Best Practices

When implementing AI-based anomaly detection:

  1. Start with One Equipment Type - Perfect the configuration before scaling
  2. Collect Baseline Data - Gather normal operation data before enabling alarms
  3. Tune Gradually - Adjust sensitivity based on real-world results
  4. Document Anomaly Types - Keep a record of detected anomalies and their outcomes
  5. Monitor Costs - Track AI API usage and optimise as needed
  6. Maintain Prompts - Version control your AI prompts and document changes
  7. Train Operators - Ensure maintenance teams understand AI-generated recommendations
  8. Regular Reviews - Periodically review alarm accuracy and adjust configuration
  9. Plan for Failures - Implement fallback rules if AI service is unavailable
  10. Secure Credentials - Use Secrets Storage for API keys

Integration with Maintenance Systems

Connect anomaly detection to your maintenance workflows:

Work Order Creation

Automatically create work orders in your CMMS when critical anomalies are detected.

Maintenance Scheduling

Prioritise preventive maintenance based on AI predictions and anomaly trends.

Parts Inventory

Trigger parts ordering based on predicted failures (e.g., order bearings when bearing wear is detected).

Downtime Planning

Schedule maintenance windows proactively based on anomaly severity and urgency.

Next Steps