st_dense / README.md
FBAGSTM's picture
Release AI-ModelZoo-4.0.0
3226103 verified
metadata
license: other
license_name: sla0044
license_link: >-
  https://github.com/STMicroelectronics/stm32ai-modelzoo/blob/main/arc_fault_detection/st_dense/ST_pretrainedmodel_custom_dataset/LICENSE.md

st_dense models

Use case : Arc fault detection

Model description

The st_dense model is a lightweight fully connected neural network designed for arc fault detection (normal vs arc). It operates both on frequency and time domain. The provided models operate on frequency‑domain inputs derived from a 1024‑sample time window; thanks to spectrum symmetry, only the first 512 frequency bins are retained. A preprocessing pipeline performs downsampling, FFT conversion, and normalization, so the model directly consumes normalized spectral features rather than raw waveforms. Internally, the model applies batch normalization and two small dense layers with 16 and 8 units, using ReLU activations and light dropout. A final dense layer with softmax activation produces per‑channel class probabilities.

Two variants are provided: a single‑channel model with input shape (1 × 512 × 1) and output shape (1 × 2), and a multi‑channel model with input shape (8 × 512 × 1) and output shape (8 × 2).

This architecture offers a very small memory and compute footprint while preserving robust classification capability. The 1‑channel variant is provided as a standard Keras model (.keras) and as an INT8‑quantized TensorFlow Lite model (.tflite). The 8‑channel variant is provided as a standard Keras model (.keras) and as an INT8‑quantized TensorFlow Lite model (.tflite).

Network information

Network Information Value
Framework TensorFlow Lite
Params 10,506 (for both variants)
Quantization int8

Network inputs / outputs

The model expects frequency-domain inputs of shape (1, 512, 1) or (8, 512, 1) and outputs per-channel class probabilities for normal vs arc.

Input shape Description
(1, 512, 1) 1 channel window of 512 samples for the single‑channel model.
(8, 512, 1) 8 channel window of 512 samples for the 8-channel model.
Output shape Description
(1, 2) Per-class scores for [normal, arc] of the 1 channel input (single‑channel model)
(8, 2) Per-class scores for [normal, arc] of the 8 channels inputs (8-channel model)

Recommended platforms

Platform Supported Recommended
STM32U5 [x] [x]
STM32N6 [x] []

Performances

Metrics

  • Measures are done with default STEdgeAI Core configuration with enabled input / output allocated option.

Reference MCU memory footprint based on afd_test_bench dataset

Model Format Resolution Series Activation RAM (KiB) Runtime RAM (KiB) Weights Flash (KiB) Code Flash (KiB) Total RAM (KiB) Total Flash (KiB) STEdgeAI Core version
st_dense_freq_1channel_512 int8 1x512x1 B-U585I-IOT02A 2.0 1.3 8.24 8.04 3.3 16.28 3.0.0
st_dense_freq_8channels_512 int8 8x512x1 B-U585I-IOT02A 16 0 8.24 9.91 16 18.15 3.0.0

Reference inference time based on afd_test_bench dataset

Model Format Resolution Board Execution Engine Frequency Inference time (ms) STEdgeAI Core version
st_dense_freq_1channel_512 int8 1x512x1 B-U585I-IOT02A 1 CPU 160 0.26 3.0.0
st_dense_freq_8channels_512 int8 8x512x1 B-U585I-IOT02A 1 CPU 160 1.87 3.0.0

Accuracy with afd_test_bench dataset

The afd_test_bench dataset was generated by ST on a controlled test bench for an arc vs normal operating condition classification task. It contains 7000 waveforms, each of length 1024 samples, acquired at a sampling frequency of 125 kHz. Each line in the CSV files corresponds to a single waveform and is followed by its binary class label, where 1 = arc and 0 = normal operation. The dataset is split into 5000 samples for training, 1000 for validation, and 1000 for testing. An additional 40 samples composed by 20 arcs followed by 20 normal samples are available for prediction/inference purposes. All CSV files are named to reflect their specific role and are packaged into a single archive, afd_test_bench.zip, available in the 'stm32ai-modelzoo-services' under the use case arc_fault_detection.

Model Format Resolution Accuracy
st_dense_freq_1channel_512 float32 1x512x1 100%
st_dense_freq_1channel_512 int8 1x512x1 100%
st_dense_freq_8channels_512 float32 8x512x1 100%
st_dense_freq_8channels_512 int8 8x512x1 100%

Retraining and Integration in a simple example:

Please refer to the stm32ai-modelzoo-services GitHub here.