Skip to content

Commit 2f829f1

Browse files
committed
docs(merge): sync with upstream changes
2 parents 73eda92 + fe354d2 commit 2f829f1

File tree

6 files changed

+50
-0
lines changed

6 files changed

+50
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ AcousticsLab implements a user-friendly web interface to visualize audio/vibrati
4444

4545
3. Open the console in your web browser at `http://localhost:7860`.
4646

47+
## Algorithms
48+
49+
AcousticsLab aims to provide a comprehensive set of SOTA algorithms for sound and vibration analysis. The current implementation includes:
50+
51+
- [Gyroscope Euclidean Distance Anomaly Detection (GEDAD)](docs/algorithms/gedad/how-it-works.md): A lightweight algorithm for detecting anomalies in gyroscope and 3-axis accelerometer data.
52+
4753
## Architecture Overview
4854

4955
This diagram shows a modular embedded AI architecture. It features a layered design with a Hardware Abstraction Layer (HAL), a Core Library (with DSP/ML), an API, and an Application layer. The architecture is designed to simplify development and integrate easily with platforms like Arduino and MicroPython.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Overview of the GEDAD Algorithm
2+
3+
Here we provide a detailed explanation of the **G**yroscope **E**uclidean **D**istance **A**nomaly **D**etection (GEDAD) algorithm, which initially developed for gyroscopes, and now it has been extended to 3-axis accelerometers while retaining its original name. The GEDAD algorithm consists of two core phases: **learning** and **inference**.
4+
5+
### Data Acquisition and Pre-processing
6+
7+
The process begins with data acquisition. While vibration data is collected from a 3-axis accelerometer via I2C and stored in a circular buffer, later the data undergoes a linear transformation where it is multiplied by a coefficient `alpha`, and added with another coefficient `beta`.
8+
9+
![Sampling from 3-Axis Accelerometer](sampling_example.png)
10+
11+
### Learning Phase
12+
13+
The objective of the learning phase is to establish a **baseline template of normal vibration** for the measuring device.
14+
15+
![Learning Process Example](learning_example.png)
16+
17+
1. **Template Generation**: First, a `sliding window` of 3-axis acceleration data, sized to cover a complete normal operational cycle, is collected to serve as the **template data**.
18+
2. **Distance Calculation**: The algorithm then randomly samples `N` short data segments or named `chunks` from identical positions within each channel of the template. Each chunk is then slid across the entire template of its corresponding channel with a defined `sliding step`, calculating the Euclidean (L2) distance at each position.
19+
3. **Threshold Calculation**: Next, outliers are filtered from these distances (e.g., using the 3σ rule; specifically, values less than a given EPS). For each channel, the remaining distances are sorted to identify the `M` smallest values. An average **threshold** is then computed for each channel from these `M` distances, defining the boundary between normal and abnormal states.
20+
4. **Parameter Calibration**: Finally, an additional parameter, `C`, is determined by finding the median counts of consecutive instances where the Euclidean distance is below the threshold during a subsequent comparison. This parameter is stored to enhance detection accuracy in the next phase.
21+
22+
### Inference Phase
23+
24+
During inference, the algorithm compares real-time 3-axis acceleration data against the established **template data** to identify any vibrations that do not match the normal *fingerprint*.
25+
26+
![Inference Process Example](inference_example.png)
27+
28+
The process is similar to training, but it uses real-time data segments for comparison instead of randomly sampled `chunks`.
29+
30+
* If the real-time data segment is sufficiently similar to a portion of the template (i.e., its Euclidean distance is below the threshold), the vibration is deemed **normal**.
31+
* Conversely, if the distance remains above the threshold after comparison against the entire template, the system flags the vibration as an **anomaly**.
32+
33+
The actual computation is more complex, involving the fusion of anomaly scores across channels and the use of the parameter `C`.
34+
35+
## Summary and Future Work
36+
37+
In summary, the algorithm's advantages include:
38+
39+
* Fast training speed
40+
* Low computational overhead
41+
* Suitability for low-power embedded devices
42+
* Requires only a small amount of normal data for training
43+
44+
We are also exploring engineering optimizations, such as using Fast Fourier Transform (FFT) to analyze frequency components and considering time-frequency characteristics and average amplitude. Future work will focus on further enhancing the algorithm's accuracy, efficiency and robustness.
263 KB
Loading
248 KB
Loading
214 KB
Loading
202 KB
Loading

0 commit comments

Comments
 (0)