# Federated Learning for Malware Detection in IoT Devices

IoT 기기의 악성코드 탐지를 위한 연합 학습

Valerian Rey, Pedro Miguel Sánchez Sánchez, Alberto Huertas Celdrán, Gérôme Bovet, Martin Jaggi · arXiv · 2021년 4월 15일

- **연구 문제** IoT 장치의 악성코드 탐지에 필요한 행동 데이터는 민감하여 중앙 서버로 모으기 어렵고, 이 논문은 연합 학습으로 원본 데이터 공유 없이 탐지 모델을 학습할 수 있는지 검토합니다.
- **연구 방법** 클라이언트가 장치별 N-BaIoT 트래픽 특징으로 로컬 모델을 학습하고 서버가 파라미터를 집계하며, 지도 분류기와 비지도 오토인코더 이상 탐지를 함께 평가합니다.
- **주요 결과** 지도 설정에서 MINI-BATCH AVG는 중앙 집중 학습에 가까운 정확도를 보였고, 비지도 설정에서는 알려진 장치의 TPR이 단독 학습보다 크게 높았습니다. 악의적 클라이언트에 대해서는 평균 집계가 취약했고 MED가 대부분 공격에서 더 나은 저항성을 보였습니다.

## IoT 악성코드 탐지에서 데이터 공유의 한계

IoT 장치는 보안 기능이 부족한 채 대량으로 배치되어 악성코드 감염의 위험이 큽니다. 기존 ML/DL 기반 탐지는 여러 장치의 데이터를 중앙 서버에 모아 학습하는 경우가 많지만, 장치 행동 데이터에 민감하거나 사적인 정보가 포함되면 이 방식은 프라이버시와 무결성 측면에서 적합하지 않습니다. 이 논문은 연합 학습(Federated Learning) 으로 원본 데이터를 공유하지 않고 IoT 악성코드 탐지 모델을 학습할 수 있는지 검토합니다. 연구 질문은 두 가지입니다. 첫째, 연합 학습 모델이 각 클라이언트의 단독 학습과 중앙 집중 학습에 비해 얼마나 좋은 성능을 보이는지입니다. 둘째, 악의적 클라이언트가 섞인 상황에서 연합 학습이 얼마나 취약하며 강건한 집계 함수가 이를 얼마나 완화하는지입니다.

데이터셋은 9개 실제 IoT 장치의 네트워크 트래픽을 담은 N-BaIoT이며, 장치마다 파일이 나뉘어 있어 클라이언트별 비동일 분포 분할에 사용됩니다.

## 클라이언트·서버 구조와 두 가지 집계 방식

각 클라이언트는 한 IoT 장치의 트래픽 데이터를 가지며, 서버는 모델 초기화와 파라미터 집계를 담당합니다. 입력은 패킷마다 얻은 115차원 수치 특징이고, 전처리로 min-max 정규화를 씁니다. 연합 정규화에서는 각 클라이언트가 로컬 최솟값과 최댓값을 서버에 보내고, 서버가 원소별 전역 최솟값과 최댓값을 계산해 다시 배포합니다. 지도 학습 설정에서는 MLP 분류기를 쓰며, 은닉층이 없는 선형 모델부터 최대 3개 은닉층까지 네 구조를 비교합니다. 비지도 설정에서는 오토인코더를 학습합니다. 오토인코더는 MSE로 정상(양성) 데이터를 재구성하도록 학습되고, 재구성 오차의 평균과 표준편차로 임계값을 정해 임계값을 넘는 샘플을 이상으로 판정합니다.

임계값 식은 평균 더하기 표준편차 형태입니다. 집계는 FedAVG를 기반으로 하며, 집계 함수를 교체할 수 있는 매개변수로 다룹니다. MINI-BATCH AGGREGATION은 미니배치 하나를 학습할 때마다 서버와 통신하고, MULTI-EPOCH AGGREGATION은 E 에폭을 한 번에 학습한 뒤 서버와 통신하며 T=30 라운드 동안 반복합니다. 이 두 방식은 통신 횟수와 로컬 학습량의 조합이 서로 달라 비용 비교의 기준이 됩니다.

![Figure 1: Framework architecture and its components. The sharing of normalization values and the collaborative hyper- parameter selection are omitted for simpl…](https://refivu.com/papers/95bd62ab-6913-4636-86fb-d82f1fc8a32c/figures/figure-6faee97a69d62dddcaf420048b749073.png?thumb=512)

**Figure 1** : Framework architecture and its components. The sharing of normalization values and the collaborative hyper- parameter selection are omitted for simplicity.

[원문](https://arxiv.org/abs/2104.09994v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Valerian Rey, Pedro Miguel Sánchez Sánchez, Alberto Huertas Celdrán, Gérôme Bovet, Martin Jaggi · Federated Learning for Malware Detection in IoT Devices · 원문 그림 인용 · 원본 PDF 5쪽에서 그림 영역을 추출했습니다.

## 중앙 학습 및 단독 학습과의 성능 비교

실험에서는 8개 클라이언트가 9개 장치 중 하나씩을 맡고, 나머지 한 장치를 학습에 쓰지 않은 새로운 장치로 두어 평가했습니다. 지도 학습 결과에서 MINI-BATCH AVG는 세 가지 클래스 비율 설정 모두에서 중앙 집중 학습과 매우 가까운 정확도를 보였습니다. MULTI-EPOCH AVG도 알려진 장치에서 정확도가 약간 낮아지는 대신 새로운 장치에서는 중앙 학습을 넘는 경우를 보였습니다. 예를 들어 알려진 장치(7.87%) 설정에서 정확도는 중앙 학습 99.96, MINI-BATCH AVG 99.96, MULTI-EPOCH AVG 99.92, 단독 학습 99.78입니다. 새로운 장치(7.87%) 설정에서는 단독 학습 98.94, MULTI-EPOCH AVG 99.89, MINI-BATCH AVG 99.89, 중앙 학습 99.88입니다.

비지도 설정에서는 알려진 장치의 TPR이 단독 학습 88.00에서 연합 학습 99.98로 크게 오르지만, 같은 알려진 장치의 TNR은 단독 학습 97.38이 연합 학습 94.84 및 95.12보다 높습니다. 새로운 장치에서는 TNR이 단독 학습 59.66에서 연합 학습 91.78에서 92.61 사이로 올라갑니다. 저자들은 이 결과로 더 많고 다양한 데이터를 쓰는 연합·중앙 방식이 성능에 큰 이점을 준다고 해석하며, 연합 학습이 프라이버시를 지키면서 중앙 학습 수준에 도달할 수 있다고 봅니다. 다만 50%와 95% 설정에서는 30 라운드 뒤에도 정확도가 완전히 수렴하지 않은 것으로 보고됩니다.

## 악의적 클라이언트와 강건한 집계 함수

적대적 실험은 지도 학습 설정에서 95% 양성 데이터 분할과 MINI-BATCH AGGREGATION으로 수행되었습니다. 데이터 포이즈닝으로는 All labels flipping 공격을 사용했고, 모델 포이즈닝으로는 Gradient factor 공격과 Model cancelling 공격을 사용했습니다. 평균 집계(AVG)는 모든 클라이언트가 정직할 때 가장 좋지만, 악의적 클라이언트가 한 명이라도 있으면 Gradient factor와 Model cancelling 공격에서 모델이 상수 예측기로 무너지는 것으로 보고됩니다. 좌표별 중앙값(MED)은 대부분의 공격에서 평균보다 저항성이 높지만, All labels flipping 공격에서 악의적 클라이언트가 3명일 때 평균 F1-Score가 약 14%에 그칩니다.

또한 한 명의 악의적 클라이언트만 있어도 All labels flipping과 Model cancelling 공격의 최소 F1-Score가 0%까지 떨어질 수 있습니다. 좌표별 트리밍 평균 TM(c)은 악의적 클라이언트 수가 c를 넘으면 실패하며, 2-Resampling은 정직한 클라이언트만 있을 때 정확도를 높이지만 강건성을 낮춥니다. 이 결과는 강건한 집계 함수가 피해를 줄이지만 충분한 방어는 아니라는 저자들의 결론을 뒷받침합니다.

## 실험 범위와 적용 조건

이 결과에는 몇 가지 적용 범위가 있습니다. 첫째, 학습 클라이언트 수는 8명으로 제한되었으며, 이는 N-BaIoT가 9개 장치의 데이터만 담고 있기 때문입니다. 둘째, 적대적 실험의 악의적 클라이언트 비율은 최대 37.5%이며 저자들은 이 범위에서만 결과를 해석합니다. 셋째, 저자들은 대규모 B5G 환경으로의 외삽을 제안하지만 실제 대규모 데이터셋으로 검증하지는 않았습니다. 넷째, 실험 결과의 분산이 커서 악의적 클라이언트 무작위 선택에 따라 평균 F1-Score가 직관과 다르게 나타날 수 있다고 밝혀져 있습니다. 통신 비용 분석에서 MULTI-EPOCH AVG는 MINI-BATCH AVG보다 통신이 약 1300배에서 2000배 적지만, 로컬 학습 단계는 약 3.75배 많습니다.

이 비용 비교는 선택된 하이퍼파라미터와 모델 크기 조건에서 계산된 것입니다.

## 논문 정보

- **저자**: Valerian Rey, Pedro Miguel Sánchez Sánchez, Alberto Huertas Celdrán, Gérôme Bovet, Martin Jaggi
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2021년 4월 15일
- **등록일**: 2026년 11월 6일
- **수정일**: 2021년 11월 19일
- **버전**: v3
- **arXiv**: 2104.09994
- **DOI**: 10.1016/j.comnet.2021.108693
- **분류**: cs.CR · cs.LG
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2104.09994v3) · [원문 PDF ↗](https://arxiv.org/pdf/2104.09994v3)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

This work investigates the possibilities enabled by federated learning concerning IoT malware detection and studies security issues inherent to this new learning paradigm. In this context, a framework that uses federated learning to detect malware affecting IoT devices is presented. N-BaIoT, a dataset modeling network traffic of several real IoT devices while affected by malware, has been used to evaluate the proposed framework. Both supervised and unsupervised federated models (multi-layer perceptron and autoencoder) able to detect malware affecting seen and unseen IoT devices of N-BaIoT have been trained and evaluated. Furthermore, their performance has been compared to two traditional approaches. The first one lets each participant locally train a model using only its own data, while the second consists of making the participants share their data with a central entity in charge of training a global model. This comparison has shown that the use of more diverse and large data, as done in the federated and centralized methods, has a considerable positive impact on the model performance. Besides, the federated models, while preserving the participant's privacy, show similar results as the centralized ones. As an additional contribution and to measure the robustness of the federated approach, an adversarial setup with several malicious participants poisoning the federated model has been considered. The baseline model aggregation averaging step used in most federated learning algorithms appears highly vulnerable to different attacks, even with a single adversary. The performance of other model aggregation functions acting as countermeasures is thus evaluated under the same attack scenarios. These functions provide a significant improvement against malicious participants, but more efforts are still needed to make federated approaches robust.

## 원문 인용

Valerian Rey, Pedro Miguel Sánchez Sánchez, Alberto Huertas Celdrán, Gérôme Bovet, Martin Jaggi (2021). Federated Learning for Malware Detection in IoT Devices. arXiv:2104.09994v3. https://doi.org/10.1016/j.comnet.2021.108693

**BibTeX**

```
@article{rey2021federated,
  title = {{Federated Learning for Malware Detection in IoT Devices}},
  author = {Valerian Rey and Pedro Miguel Sánchez Sánchez and Alberto Huertas Celdrán and Gérôme Bovet and Martin Jaggi},
  year = {2021},
  eprint = {2104.09994},
  archivePrefix = {arXiv},
  doi = {10.1016/j.comnet.2021.108693},
  url = {https://arxiv.org/abs/2104.09994v3}
}
```

## 이 논문의 용어

- [accuracy](https://refivu.com/terms/1995c0cd6282-accuracy)
- [Mean Squared Error](https://refivu.com/terms/e8df98e6d7b7-mean-squared-error)
- [f1-score](https://refivu.com/terms/bab94490d1a7-f1-score)
- [Federated Learning](https://refivu.com/terms/c6fc55e6f812-federated-learning)
- [FedAvg](https://refivu.com/terms/42fd22f625c0-fedavg)
- [Autoencoder](https://refivu.com/terms/a4d4d93d1cff-autoencoder)
- [non-IID](https://refivu.com/terms/83ef54c01151-non-iid)
- [coordinate-wise median](https://refivu.com/terms/11155fa8b677-coordinate-wise-median)
- [Label Flipping](https://refivu.com/terms/e16cb743d05b-label-flipping)
- [Min-max feature scaling](https://refivu.com/terms/b4d46146d172-min-max-feature-scaling)

## 다른 논문 해설

- [GAN Based Image Deblurring Using Dark Channel Prior](https://refivu.com/papers/5edf08c5-5bc5-49d5-aebd-05eaa0a5fff4-gan-based-image-deblurring-using-dark-channel-prior.md)
- [Quantum machine learning for image classification](https://refivu.com/papers/a3af30fc-a9cc-43a1-9191-a441c6d06b37-quantum-machine-learning-for-image-classification.md)
- [Frequency-Assisted Mamba for Remote Sensing Image Super-Resolution](https://refivu.com/papers/63382188-9e18-459f-8b8e-eca2d338fa84-frequency-assisted-mamba-for-remote-sensing-image-super.md)
- [BinsFormer: Revisiting Adaptive Bins for Monocular Depth Estimation](https://refivu.com/papers/7fc81cb2-3782-4326-9ffa-5af4ea6fe25b-binsformer-revisiting-adaptive-bins-for-monocular-depth.md)
- [DepthFormer: Exploiting Long-Range Correlation and Local Information for Accurate Monocular Depth Estimation](https://refivu.com/papers/6ae73f26-dcaf-4126-aff6-1308b2c0214f-depthformer-exploiting-long-range-correlation-and-local.md)
- [Unifying Flow, Stereo and Depth Estimation](https://refivu.com/papers/a17a6b8c-5864-4598-9183-8a1c09180428-unifying-flow-stereo-and-depth-estimation.md)
- [Applying machine learning to improve simulations of a chaotic dynamical system using empirical error correction](https://refivu.com/papers/dc4f9780-d956-4cc3-81a2-15fa5b7b76a4-applying-machine-learning-to-improve-simulations-of-a.md)
- [Learning Robust Autonomous Navigation and Locomotion for Wheeled-Legged Robots](https://refivu.com/papers/d721c896-f444-49d4-9962-484aef58a0b3-learning-robust-autonomous-navigation-and-locomotion-for.md)
- [Towards Reuse and Recycling of Lithium-ion Batteries: Tele-robotics for Disassembly of Electric Vehicle Batteries](https://refivu.com/papers/749da90c-41d2-4957-a50b-33a16d581d02-towards-reuse-and-recycling-of-lithium-ion-batteries.md)
- [Learning Disentangled Representation Implicitly via Transformer for Occluded Person Re-Identification](https://refivu.com/papers/ce1bed15-4e9f-43c2-88a8-7932eb7cdc7b-learning-disentangled-representation-implicitly-via.md)
- [DU-GAN: Generative Adversarial Networks with Dual-Domain U-Net Based Discriminators for Low-Dose CT Denoising](https://refivu.com/papers/46030b78-75d0-4156-80ef-e92602d09b95-du-gan-generative-adversarial-networks-with-dual-domain.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/95bd62ab-6913-4636-86fb-d82f1fc8a32c-federated-learning-for-malware-detection-in-iot-devices)
