CoolFace
Datasetpublic

ssam17/Edge-Industrial-Anomaly-Phi3

Edge-Industrial-Anomaly-Phi3: A Curated Dataset for SLMs This dataset is a curated collection of industrial sensor data formatted specifically for Small Language Models (SLMs) like Phi-3. It merges three high-value industrial domains into a unified "Natural Language Reasoning" format to move beyond simple binary classification. πŸš€ Purpose Standard anomaly detection uses CSVs and Scikit-Learn. This dataset enables Generative Anomaly Detection, where a model like… See the full description on the dataset page: https://huggingface.co/datasets/ssam17/Edge-Industrial-Anomaly-Phi3.

sourceHugging Faceapache-2.0updated 9mo agoView on Hugging Face
1likes45downloads
Dataset Card

Edge-Industrial-Anomaly-Phi3: A Curated Dataset for SLMs

This dataset is a curated collection of industrial sensor data formatted specifically for Small Language Models (SLMs) like Phi-3. It merges three high-value industrial domains into a unified "Natural Language Reasoning" format to move beyond simple binary classification.

πŸš€ Purpose

Standard anomaly detection uses CSVs and Scikit-Learn. This dataset enables Generative Anomaly Detection, where a model like Phi-3 can explain why an anomaly is happening based on sensor drifts and thresholds.

Key Innovation

Instead of outputting 0 or 1, the fine-tuned model generates:

  • β€”Status classification (NORMAL/ANOMALY/SECURITY ANOMALY)
  • β€”Root cause analysis in natural language
  • β€”Actionable recommendations for operators

This approach is ideal for edge deployment where human operators need interpretable AI assistance, not just binary alerts.

πŸ‘₯ Authors

NameEmailGitHubORCIDGoogle ScholarResearchGate
[Samaresh Kumar Singh](https://www.linkedin.com/in/samaresh-singh-9772ba23/)ssam3003@gmail.comGitHubORCIDGoogle Scholarβ€”
[Joyjit Roy](https://www.linkedin.com/in/royjoyjit/)joyjit.roy.tech@gmail.comGitHubORCIDGoogle ScholarResearchGate

πŸ“Š Included Data Sources

The dataset is derived and transformed from three complementary Kaggle datasets:

1. Industrial Fault Detection

  • β€”Source: Kaggle - Industrial Fault Detection Dataset
  • β€”Domain: Manufacturing equipment monitoring
  • β€”Features: Temperature, Pressure, Vibration, Flow Rate
  • β€”Use Case: Real-time equipment health monitoring

2. Edge-IIoTset Cyber Security

  • β€”Source: Kaggle - Edge-IIoTset
  • β€”Domain: IoT/IIoT network security
  • β€”Features: Network telemetry, packet statistics, protocol metrics
  • β€”Use Case: Intrusion detection for edge devices

3. Machine Failure Prediction

  • β€”Source: Kaggle - Predictive Maintenance
  • β€”Domain: Predictive maintenance for rotational machinery
  • β€”Features: Rotational speed, torque, tool wear, temperature
  • β€”Use Case: Preventing catastrophic equipment failures

πŸ›  Format: Phi-3 Chat Template

Each entry is formatted in the Phi-3 chat structure using special tokens:

<|user|>
[Sensor data summary]
<|end|>
<|assistant|>
[Status and natural language reasoning]
<|end|>

Example Entry

Input (User):

Sensor Readings: Temperature: 82Β°C, Vibration: 3.8 m/s, Pressure: 112 kPa, Flow: 16.5 L/min

Output (Assistant):

Status: ANOMALY. Reason: Critical overheating detected. Temperature (82Β°C) exceeds the safety threshold of 75Β°C. Excessive vibration detected (3.8 m/s). May indicate mechanical imbalance. Immediate inspection required.

πŸ“‚ Dataset Structure

The dataset consists of three JSONL files:

β”œβ”€β”€ industrial_faults_phi3.jsonl    (~10K entries)
β”œβ”€β”€ edge_iiot_phi3.jsonl            (~10K entries)
└── predictive_maint_phi3.jsonl     (~10K entries)

Each JSONL file contains records with a single field:

  • β€”display_text: The complete Phi-3 formatted conversation

🎯 Intended Use Cases

Primary Applications

  1. 1.Edge Device Deployment: Run Phi-3 on industrial gateways or microcontrollers
  2. 2.Operator Assistance: Provide real-time explanations to maintenance personnel
  3. 3.Anomaly Root Cause Analysis: Go beyond detection to explanation
  4. 4.Multi-Domain Industrial AI: Single model for faults, security, and predictive maintenance

Suitable Models

  • β€”Phi-3 Mini (3.8B parameters) - Recommended
  • β€”TinyLlama (1.1B parameters)
  • β€”Qwen-2.5-Coder (1.5B parameters)
  • β€”Any SLM supporting chat templates

πŸ’» Usage

Load with Hugging Face Datasets

python
from datasets import load_dataset

# Load the complete dataset
dataset = load_dataset("your-username/Edge-Industrial-Anomaly-Phi3")

# Load individual splits
industrial = load_dataset("your-username/Edge-Industrial-Anomaly-Phi3", data_files="industrial_faults_phi3.jsonl")
edge_iiot = load_dataset("your-username/Edge-Industrial-Anomaly-Phi3", data_files="edge_iiot_phi3.jsonl")
predictive = load_dataset("your-username/Edge-Industrial-Anomaly-Phi3", data_files="predictive_maint_phi3.jsonl")

Fine-Tuning Example

python
from transformers import AutoModelForCausalLM, AutoTokenizer, TrainingArguments
from trl import SFTTrainer

# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct")

# Load dataset
dataset = load_dataset("your-username/Edge-Industrial-Anomaly-Phi3")

# Configure training
training_args = TrainingArguments(
    output_dir="./phi3-industrial-anomaly",
    per_device_train_batch_size=4,
    num_train_epochs=3,
    learning_rate=2e-5,
    fp16=True,
    logging_steps=10,
)

# Initialize trainer
trainer = SFTTrainer(
    model=model,
    args=training_args,
    train_dataset=dataset["train"],
    dataset_text_field="display_text",
)

# Train
trainer.train()

πŸ“Š Dataset Statistics

DatasetEntriesAvg LengthAnomaly %
Industrial Faults~10,000180 tokens~45%
Edge-IIoTset~10,000165 tokens~35%
Predictive Maint~10,000175 tokens~40%
Total~30,000173 tokens~40%

βš™οΈ Data Processing Pipeline

The dataset was created using an automated curation pipeline:

  1. 1.Download: Kaggle API pulls raw CSV datasets
  2. 2.Normalization: Column names standardized, missing values handled
  3. 3.Reasoning Synthesis: Rule-based logic generates explanations:
  4. 4.Temperature > 75Β°C β†’ "Critical overheating"
  5. 5.Vibration > 3.5 m/s β†’ "Mechanical imbalance"
  6. 6.Pressure anomalies β†’ "Outside operational range"
  7. 7.Format Conversion: Transform to Phi-3 chat template
  8. 8.Export: Save as JSONL for easy loading

πŸ”¬ Evaluation Metrics

For models trained on this dataset, consider evaluating:

  1. 1.Classification Accuracy: Can the model correctly identify NORMAL vs ANOMALY?
  2. 2.Reasoning Quality: Does the explanation match the sensor values?
  3. 3.Hallucination Rate: Does the model invent sensor readings not in the input?
  4. 4.Deployment Metrics: Inference latency on target edge hardware

πŸ“ Limitations

  • β€”Synthetic Reasoning: The natural language explanations are rule-based, not human-annotated
  • β€”Domain Coverage: Limited to three specific industrial domains
  • β€”Sensor Diversity: Only includes common sensor types (temp, pressure, vibration, etc.)
  • β€”Language: English only

🀝 Citation

If you use this dataset, please cite the original Kaggle sources:

bibtex
@misc{edge-industrial-anomaly-phi3,
  author = {Your Name},
  title = {Edge-Industrial-Anomaly-Phi3: A Curated Dataset for Small Language Models},
  year = {2026},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/datasets/your-username/Edge-Industrial-Anomaly-Phi3}}
}

πŸ“œ License

This dataset is released under the Apache 2.0 License, consistent with the source datasets and Phi-3 model licensing.

πŸ› οΈ Contributing

Found an issue or want to improve the dataset? Contributions are welcome:

  • β€”Report issues on GitHub
  • β€”Suggest additional industrial domains
  • β€”Propose improved reasoning templates

πŸ“§ Contact

For questions or collaboration opportunities, please open an issue on the dataset repository.


Built for the Edge AI Community πŸš€