Detection of Global Anomalies
on Distributed IoT Edges
with Device-to-Device Communication
Local Anomaly(Anomaly for the node, but not for some others)

αDevice 1

Device 0

Model ExchangeandAggregationModel
1 1 1 1 3 1 1
Data Set

αα

Model

Device 2

Device 1

ModelModel1 1 1 1 3 1 1
Data Setα

Device 1

Contact Area

1 1 1 1 3 1 1
Data Set

2 2 2 4 2 2 2
Data Set

Device 1αDevice 2

Device 3

Device 3αModelModel4 1 4 4 4 4 4Data Set

Device 43 3 3 3 3 2 3Data SetTrajectory of Device 1

Contact Area

Model Exchange
andAggregation

αGlobal Anomaly Our target is “Global Anomaly”
12(Anomaly for all the nodes)

Device 4

Model4 1 4 4 4 4 4Data Set

Contact Area

Model Exchange
andAggregation

Trajectory of Device 4

Hideya Ochiai, Riku Nishihata,
Eisuke Tomiyama, Yuwei Sun, Hiroshi Esaki
The University of Tokyo, Japan1

Table of Contents• Introduction• Previous Studies• WAFL-Autoencoder for Global Anomaly Detection• Evaluation• Conclusion2

Toward On-Device Training• Machine Learning has evolved with cloud computing.
• Nowadays :• AI Chips are available for 10 USD.
• Machine Learning shifts onto IoT Edges.

• Issues:• Learning on an Edge may lead to model overfit.

AI Chip (10USD)
Mode Switch
0: Neutral
1: Train
2: Predict
Label for Supervising (Binary)
01234…F

Prediction (Binary)
01234…F• Approach of this issue:• Collaborative Training with Device-to-Device
Communication.

• Focus of this research:• Training Distributed Autoencoder• Global Anomaly Detection with Benchmark Settings

Edge AI Testbed3

Table of Contents• Introduction• Previous Studies• WAFL-Autoencoder for Global Anomaly Detection• Evaluation• Conclusion

4

Previous Studies (1/5):

Wireless Ad Hoc Federated Learning (WAFL) [1]with Device-to-Device Communication
1. Each node individually trains
its ML model using its local data.

Data

Data

2. Each node encounters the other.
3. They can communicate with local
wireless communication media
such as Wi-Fi Ad Hoc modeor Bluetooth

5[1] Ochiai, Hideya, et al. "Wireless ad hoc federated learning: A fully distributed cooperative machine learning." arXiv preprint arXiv:2205.11779 (2022).

Previous Studies (2/5):

Wireless Ad Hoc Federated Learning (WAFL) [1]with Device-to-Device Communication
1. Each node individually trains
its ML model using its local data.
2. Each node encounters the other.
3. They can communicate with local
wireless communication media
such as Wi-Fi Ad Hoc modeor Bluetooth

4. They exchange and aggregate
the models to develop a new model.
5. This enables collaborative training.
6[1] Ochiai, Hideya, et al. "Wireless ad hoc federated learning: A fully distributed cooperative machine learning." arXiv preprint arXiv:2205.11779 (2022).

Previous Studies (3/5):

Wireless Ad Hoc Federated Learning (WAFL) [1]with Device-to-Device Communication
WAFL has achieved almost thesame performanceas conventional federated learning.
10.0-11.5% Improvement

Accuracy of Self-Trainstatic_line

static_tree

static_ringstar static_dense
24

Random Waypoint Mobility

Ochiai, Hideya, et al. "Wireless ad hoc federated learning: A fully distributed cooperative machine learning." arXiv preprint arXiv:2205.11779 (2022).
7

Previous Studies (4/5):
Extensions and Variations of WAFL (1/2)
WAFL-Vision Transformer [1]Device AClassAuditorium
Eng Bldg. 1Eng Bldg. 2…

Device C

Device B
Parameter Exchange

MLP
Head

WAFL- Multi-Task Learning[2]ClassTransformer
Encoder
Linear Projection

Auditorium
Eng Bldg. 1
Eng Bldg. 2…

MLP
HeadMLP
HeadTransformer
EncoderPurple
AppleBig

Transformer
Encoder
Data Collection

Linear Projection

WAFL-GAN[3]

D2DCommunication

Device D

MLP
Head
Data Collection

Data Collection

Transformer
Encoder

1. Individual Training
at Various Cognitive Axes

Data Collection

2. Integration
over D2D Communication
Apple

Mission-Oriented
Task

PurpleE.g., UTokyo Campus Building RecognitionBig

3. Multi-Task Execution[1] Hideya Ochiai, Atsuya Muramatsu, Yudai Ueda, Ryuhei Yamaguchi, Kazuhiro Katoh, and Hiroshi Esaki, "Tuning
Vision Transformer with Device-to-Device Communication for Targeted Image Recognition", IEEE World Forumon Internet of Things, 2023 (Best Paper Award).
[2] Ryusei Higuchi, Hiroshi Esaki, Hideya Ochiai, "Collaborative Multi-Task Learning across Internet Edges with
Device-to-Device Communications“, IEEE Cybermatics Congress, 2023 (under review).
[3] Eisuke Tomiyama, Hiroshi Esaki, Hideya Ochiai, "WAFL-GAN: Wireless Ad Hoc Federated Learning for Distributed8
Generative Adversarial Networks", IEEE International Conference on Knowledge and Smart Technology, 2023.

Previous Studies (5/5):
Extensions and Variations of WAFL (2/2)
WAFL-Personalization[4]WAFL-Localization[5]WAFL-Security[6]Poisoned model (constant)persistently injected by Attacker m

Flow of poison

Flow of resilience
Force of driving

in response to the input flow

Legitimate Area

[4] Ryusei Higuchi, Hiroshi Esaki, and Hideya Ochiai, "Personalized Wireless Ad Hoc Federated Learning for Label Preference
Skew", IEEE World Forum on Internet of Things, 2023.
[5] Yusuke Sugizaki, Hideya Ochiai, Muhammad Asad, Manabu Tsukada, and Hiroshi Esaki, "Wireless Ad-Hoc Federated
Learning for Cooperative Map Creation and Localization Models", IEEE World Forum on Internet of Things, 2023.
[6] Naoya Tezuka, Hideya Ochiai, Yuwei Sun, Hiroshi Esaki, "Resilience of Wireless Ad Hoc Federated Learning against
Model Poisoning Attacks", IEEE International Conference on Trust, Privacy and Security in Intelligent Systems, andApplications (TPS-ISA), 2022.

For IoT applications, we propose WAFL-Autoencoder for anomaly detection. 9

Table of Contents• Introduction• Previous Studies• WAFL-Autoencoder for Global Anomaly Detection• Evaluation• Conclusion

10

Anomaly Detection in Non-IID Scenario

Local Anomaly(Anomaly for the node, but not for some others)

Device 0
Device 1
Device 2
Device 3
Global Anomaly Our target is “Global Anomaly”
11(Anomaly for all the nodes)

To Detect a Global Anomaly
Encoder Decoder

Legitimate
Input

OutputAutoencoder(@ Device n) (Reconstruction)
Encoder Decoder

AnomalyInput“To precisely reconstruct
the legitimate inputs”,
WAFL-Autoencoder
should learn thelegitimate features.

WAFL-Autoencoder should
fail in reconstructing
a Global Anomaly input.

OutputAutoencoder(Reconstruction)(@ Device n)

12Anomaly Detection Thresholds
ThresholdMSE

If the distance is more than a calculated threshold,the input is detected as an anomaly!!

Input

OutputMSE

Input

OutputThreshold can be calculated locally at the device with its local validation data.
13
Each device may have different thresholds !! (especially in Non-IID case)Model Parameter and Threshold Aggregation
through Device-to-Device Communication• WAFL Model Parameter Aggregation• Threshold Aggregationnbr(n) gives a set of the neighbors of device n.
14
These algorithms aggregate models and thresholds across distributed devices.

Model Parameter and Threshold Aggregation through Device-to-Device Communication
αDevice 1

Model ExchangeandAggregationModel
1 1 1 1 3 1 1
Data SetααModelαDevice 2

ModelModel1 1 1 1 3 1 1
Data Set

Device 1

Contact Area

1 1 1 1 3 1 1
Data Set

2 2 2 4 2 2 2
Data Set

Device 1α

Device 3αModelModel4 1 4 4 4 4 4Data Set

Device 43 3 3 3 3 2 3Data Set

Trajectory of Device 1

Contact Area

Model Exchange
andAggregation

αDevice 4

Model4 1 4 4 4 4 4Data Set

Contact Area

Model Exchange
andAggregation

Trajectory of Device 415

Table of Contents• Introduction• Previous Studies• WAFL-Autoencoder and Anomaly Detection• Evaluation• Conclusion

16

Data Set Configuration
Test Dataset for all the devices

ALL MNIST Classes

Non-IID Train/Val Dataset@ Device 0Noisy MNIST

Occuluded MNIST

Fashion MNIST

Kuzushiji MNIST

Local Anomaly

Legitimate Data
Other training dataset for other devices
We considered 10 devices totally.

Legitimate

Global Anomaly

17Experimental Setup• ML model (2D-CNN)• Mobility Pattern• Random Waypoint Mobility (RWP)• Simulation• We carried out the experiment bysimulation on a single computer.

Random Waypoint Mobility
18

Reconstructions at Device 8 with WAFL
In case of Legitimate Inputs
1. WAFL (epoch 0 – after Self-Training)
the autoencoder gave 8 to any inputs 0 ～ 9.

2. As the WAFL training proceeds, WAFL’s model
aggregation allowed the precise reconstructionof all the legitimate samples (0 ～ 9).

19Reconstructions at Device 3 with WAFL
In case of Global Anomaly Inputs.
1. WAFL (epoch 0 – after Self-Training)
the autoencoder gave 3 to any global anomalies.

2. Even though the WAFL training proceeded,
the autoencoder did not reconstruct theglobal anomaly input (which is succeeded).

20

Global Anomaly Detection: Performance Overview
with D2D Communication(Our Proposal)

without D2D Communication

Global anomaly can bedetected without D2Dcommunication.
(TPR is good)
However, local anomalies
was counted
as Global anomaly.
(FPR is bad)?

Good scoreBad score
Without D2D, local anomalies was counted as global anomaly.

Anomaly Detection(@Device 0)
1. At Epoch 0 (after Self-Train)
many samples except 0 wererecognized as anomaly.
2. At Epoch 100, anomaly samples
were recognized as legitimate.
3. After Epoch 1000, it could recognize
legitimate or anomaly precisely(except Occluded-MNIST).

22

Latent Space (@Device 4)

Table of Contents• Introduction• Previous Studies• WAFL-Autoencoder and Anomaly Detection• Evaluation• Conclusion

24

Conclusion• WAFL-Autoencoder successfully reconstructed legitimate
images by aggregating the individually trained autoencoders
through device-to-device communication.

• Detection of global anomalies using WAFL-Autoencoder ispromising. However, it is still under MNIST-based study.
• More studies will be needed with practical IoT applications.

25

Thank you

Local Anomaly(Anomaly for the node, but not for some others)αDevice 1

Device 0

Model Exchange
andAggregationModel
1 1 1 1 3 1 1
Data SetααModelαDevice 2Device 1

Model

Model

1 1 1 1 3 1 1
Data Set

Device 1

Contact Area1 1 1 1 3 1 1
Data Set

2 2 2 4 2 2 2
Data Set

Device 1α

Device 2

Device 3

Device 3αModelModel4 1 4 4 4 4 4Data Set

Device 43 3 3 3 3 2 3Data Set

Trajectory of Device 1

Contact Area

Model Exchange
andAggregationαGlobal Anomaly Our target is “Global Anomaly”
12(Anomaly for all the nodes)

Device 4Model
4 1 4 4 4 4 4Data Set

Contact Area

Model Exchange
andAggregation

Trajectory of Device 426

Appendix27

Classification became clearer

Global Anomaly
InputsLegitimateInputs

Latent Space (@Device 4)

Anomaly Classes got separated,