7.7.5. Arc Fault Detection

Arc fault detection is one of the primary applications for Tiny ML Tensorlab. This example demonstrates detecting electrical arcs in DC power systems.

7.7.5.1. Overview

  • Task: Binary classification (Normal vs Arc)

  • Application: Solar inverters, battery systems, DC distribution

  • Dataset: Real current waveforms from arc fault experiments

  • Model: ArcFault_model_200_t (~200 parameters)

7.7.5.2. Why Arc Fault Detection?

Electrical arcs are dangerous:

  • Fire hazard in residential and commercial buildings

  • Equipment damage in industrial settings

  • Safety risk in electric vehicles and battery systems

Traditional protection (fuses, breakers) doesn’t detect arcs reliably. AI-based detection can identify arc signatures in current waveforms.

7.7.5.3. Running the Example

cd tinyml-modelzoo
./run_tinyml_modelzoo.sh examples/dc_arc_fault/config.yaml

7.7.5.4. Configuration

common:
  target_module: 'timeseries'
  task_type: 'generic_timeseries_classification'
  target_device: 'F28P55'
  run_name: '{date-time}/{model_name}'

dataset:
  enable: True
  dataset_name: 'dc_arc_fault_example_dsk'
  input_data_path: 'https://software-dl.ti.com/C2000/esd/mcu_ai/01_03_00/datasets/dc_arc_fault_example_dsk.zip'

data_processing_feature_extraction:
  feature_extraction_name: 'FFT1024Input_256Feature_1Frame_Full_Bandwidth'
  variables: 1

training:
  enable: True
  model_name: 'ArcFault_model_200_t'
  batch_size: 256
  training_epochs: 20

testing:
  enable: True

compilation:
  enable: True

7.7.5.5. Dataset Description

The dataset contains current waveform samples:

  • Normal class: Regular DC current with minor noise

  • Arc class: Current during arc fault conditions

Data characteristics:

  • Single channel (current)

  • High sampling rate (captures arc frequency components)

  • Pre-processed and labeled

7.7.5.6. Feature Extraction

FFT1024Input_256Feature_1Frame_Full_Bandwidth applies:

  1. 1024-point FFT

  2. Takes first 256 frequency bins (full bandwidth)

  3. Single frame (no temporal concatenation)

This captures the frequency signature of arcs, which have distinct high-frequency components.

7.7.5.7. Available Models

Important

The ArcFault_model_* models listed below are only available in TI’s Edge AI Studio (GUI) and are not included in the Tensorlab package. In Tensorlab, use the generic CLS_* or CLS_*_NPU models instead – they offer similar or better performance. For example, CLS_500_NPU (~500 params) or CLS_1k_NPU (~1,000 params) are suitable replacements.

Edge AI Studio models:

Model

Parameters

Description

ArcFault_model_200_t

~200

Minimal, fast inference

ArcFault_model_400_t

~400

Balanced

ArcFault_model_800_t

~800

Higher accuracy

ArcFault_model_1400_t

~1,400

Maximum accuracy

Tensorlab alternatives:

Model

Parameters

Description

CLS_500_NPU

~500

Small, NPU-optimized

CLS_1k_NPU

~1,000

Baseline NPU model

CLS_2k_NPU

~2,000

Medium NPU model

CLS_4k_NPU

~4,000

Recommended NPU model

7.7.5.8. Expected Results

Typical results with default configuration:

Float32 Model:
Accuracy: 99%+
F1-Score: ~0.99

Quantized Model:
Accuracy: 98%+

7.7.5.9. Interpreting Results

After training, check these outputs:

ROC Curve (One_vs_Rest_MultiClass_ROC_test.png):

ROC Curve for Arc Fault Detection

One-vs-Rest Multi-class ROC curves showing excellent class separation (AUC close to 1.0)

  • AUC should be close to 1.0

  • Shows trade-off between detection rate and false alarms

Class Score Histogram (Histogram_Class_Score_differences_test.png):

Class Score Histogram

Distribution of class score differences showing clear separation between correct and incorrect predictions

  • Shows how confidently the model separates classes

  • Wide separation indicates robust classification

FPR/TPR CSV (fpr_tpr_thresholds.csv):

  • Use to select operating threshold for your application

  • Balance between catching arcs and avoiding false alarms

7.7.5.10. Deployment Considerations

For real-world deployment:

False Positive Rate

In safety applications, you may prefer:

  • Higher sensitivity (catch all arcs, accept some false alarms)

  • Or higher specificity (fewer false alarms, may miss subtle arcs)

Adjust the threshold in your device code accordingly.

Inference Latency

Arc detection needs to be fast:

  • F28P55 with NPU: ~100-200 µs

  • Sufficient for real-time protection

7.7.5.11. AC Arc Fault Detection

7.7.5.11.1. Overview

AC arc fault detection is an Edge AI solution targeting the MSPM0G5187 microcontroller with on-chip NPU. It detects series arc faults in residential and commercial electrical systems – the leading cause of electrical fires – using machine learning inference on data captured through the TIDA-010971 analog front end with a PCB Rogowski coil. This enables Arc Fault Circuit Interrupter (AFCI) products that comply with the National Electrical Code (NEC).

7.7.5.11.2. Why AC Arc Fault Detection?

Arc faults cause more than 30,000 home fires each year in the United States alone, resulting in hundreds of deaths and over one billion dollars in property damage. Traditional circuit breakers are not designed to detect low-level arc faults and routinely fail to interrupt them before ignition occurs.

Edge AI addresses this gap by enabling:

  • Complex pattern recognition – identifying subtle arc signatures that rule-based approaches miss.

  • Multi-feature analysis – combining frequency-domain and temporal information in a single inference pass.

  • Adaptive detection – maintaining accuracy across diverse load types and operating conditions.

Key performance targets for the AC arc fault solution:

Metric

Target

Response time

< 10 ms

Detection accuracy

> 95%

Compliance

UL 1699

7.7.5.11.3. System Components

Hardware

  • MSPM0G5187 – Arm Cortex-M0+ microcontroller with integrated NPU.

  • TIDA-010971 – Analog front end reference design featuring a PCB Rogowski coil for non-intrusive current sensing.

Software

  • Code Composer Studio (CCS) 12.x or later

  • MSPM0 SDK 2.08.00 or later

  • TI Edge AI Studio / TI Tiny ML Tensorlab

7.7.5.11.4. Running the AC Arc Fault Example

cd tinyml-modelzoo
./run_tinyml_modelzoo.sh examples/ac_arc_fault/config_MSPM0.yaml

7.7.5.11.5. AC Arc Fault Configuration

common:
  task_type: arc_fault
  target_device: MSPM0G5187

dataset:
  dataset_name: ac_arc_fault_log300_example_dsk
  input_data_path: https://software-dl.ti.com/C2000/esd/mcu_ai/01_03_00/datasets/ac_arc_fault_log300.zip

data_processing_feature_extraction:
  feature_extraction_name: ArcFault_512Input_FE_RFFT_32Feature_8Frame_1InputChannel_removeDC_Full_Bandwidth
  store_feat_ext_data: false

training:
  model_name: CLS_1k_NPU
  batch_size: 30
  training_epochs: 30
  num_gpus: 0
  quantization: 2
  learning_rate: 1e-5
  weight_decay: 1e-5

testing: {}
compilation: {}

7.7.5.11.6. AC Arc Fault Dataset

The example dataset (ac_arc_fault_log300.zip) contains 100+ captures per load type, organized into three categories:

Normal operations

  • Inductive loads

  • LED lighting

  • Switched-mode power supplies (SMPS)

  • Mixed loads

Arc fault conditions

  • Series arc faults

  • Parallel arc faults

Masking loads (loads whose signatures can resemble arcs)

  • Vacuum cleaners

  • Drills

  • Dimmers

  • Compressors

  • Resistive loads

A dedicated labelling script, AFCI_LabellingScript.py, is provided in the example directory for preparing custom datasets. Refer to readme_labelling.md in the same directory for detailed instructions.

7.7.5.11.7. AC Feature Extraction

The default feature extraction pipeline (ArcFault_512Input_FE_RFFT_32Feature_8Frame_1InputChannel_removeDC_Full_Bandwidth) processes raw ADC samples through the following stages:

  1. ADC capture – 512 samples at 107 kSps (~4.76 ms per frame).

  2. 512-point real FFT – computed with the ARM CMSIS-DSP library.

  3. Complex magnitude – converts complex FFT output to magnitudes.

  4. DC removal – discards the DC component (bin 0).

  5. Binning – groups 8 adjacent frequency bins into one, producing 32 features per frame.

  6. INT8 normalization – scales features to the INT8 range.

  7. Frame concatenation – concatenates 8 consecutive frames to form a single input vector of 256 features.

7.7.5.11.8. AC Arc Fault Models

Important

The ArcFault_model_* models listed below are only available in TI’s Edge AI Studio (GUI) and are not included in the Tensorlab package. In Tensorlab, use the generic CLS_*_NPU models instead – 11 CNN and ResNet architectures ranging from ~100 to ~20,000 parameters with NPU support are available via the Tensorlab CLI. See the tinyml-modelzoo README for the full list.

Edge AI Studio models (GUI only):

Model

Parameters

Flash (MSPM0G5187)

Inference Time

Accuracy

Note

ArcFault_model_200_t

~200

3.6 KB

99.60%

ArcFault_model_300_t

~300

3.9 KB

99.60%

ArcFault_model_700_t

~800

4.5 KB

99.42%

ArcFault_model_1400_t

~1,600

5.6 KB

0.7 ms

99.88%

Recommended

Tensorlab alternatives:

Model

Parameters

Description

CLS_500_NPU

~500

Small, NPU-optimized

CLS_1k_NPU

~1,000

Baseline NPU model (default in config)

CLS_2k_NPU

~2,000

Medium NPU model

CLS_4k_NPU

~4,000

Recommended NPU model

7.7.5.11.9. AC Arc Fault Performance

Performance measured on MSPM0G5187 with NPU using the recommended configuration:

Metric

Value

End-to-end latency (including 8-frame voting)

< 150 ms

Detection accuracy

> 99%

False positive rate

0.01%

Precision

99.97%

Recall

99.72%

F1-Score

99.84%

7.7.5.11.10. AC Training Details

The default training configuration uses:

  • Batch size: 50

  • Learning rate: 0.04

  • Optimizer: SGD

  • Quantization: INT8 via Quantization-Aware Training (QAT) – required for NPU deployment

  • Compilation: TI Neural Network Compiler (NNC)

Note

INT8 quantization is the default and is required for deployment on the MSPM0G5187 NPU. The configuration file sets quantization: 2 to enable QAT during training.

7.7.5.11.11. AC Arc Fault References

7.7.5.12. Next Steps