Skip to content
OnlyProjects
M.Tech / M.E. · Computer Science & EngineeringFor educational purposes only
Code included

Lightweight Federated Intrusion Detection for Campus IoT Networks on CICIoT2023

Centralised vs FedAvg training of a small MLP/1D-CNN across simulated campus gateways, with non-IID splits and Raspberry Pi latency

Mapped to your syllabusVTU M.Tech 2022 Scheme · 22SXX41 Project Work Phase-2 · Semester 4

Overview

1 min read

This dissertation studies whether a lightweight intrusion detection model can be trained collaboratively across the IoT gateways of an engineering campus without moving raw traffic to a central server. A typical Karnataka campus has separate network segments for hostels, laboratories, the library, CCTV and building management, each with cameras, smart plugs, access-control readers and sensors. Pooling all their traffic for training raises privacy, bandwidth and administrative concerns; federated learning (FL) lets each gateway train locally and share only model updates.

Using the public CICIoT2023 dataset from the Canadian Institute for Cybersecurity, I build a centralised baseline and a federated version (FedAvg) of two compact models — a multilayer perceptron and a 1D-CNN — and compare them under IID and non-IID partitions that mimic gateways seeing very different attack mixes. The evaluation reports macro-F1, per-class recall, communication rounds to reach a target F1, bytes transmitted, model size and inference latency on a Raspberry Pi 4, the kind of device that could sit at a gateway.

The implementation uses Python and PyTorch, with the Flower framework as an industry-standard extra for FL simulation. The work extends the Computer Networks & IoT Lab (22SCNL17) and applies the Research Methodology & IPR course (22RMI16) for experimental design, threats to validity and paper writing. All results are produced by the student's own runs; this bundle gives the protocol and empty results tables, not pre-filled numbers.

Relevant for
Karnataka
Level
Advanced · 24 weeks · solo
Common at
Visvesvaraya Technological University, Anna University, JNTU Hyderabad
Updated
Nov 2026

Syllabus alignment

VTU · M.Tech 2022 Scheme

22SXX41 · Project Work Phase-2 · Semester 4 · 18 credits · CIE 100 + SEE 100 (viva)

Subjects this project applies
  • 22SCNL17 Computer Networks & IoT Lab
  • 22RMI16 Research Methodology & IPR
  • 22SXX34 Project Work Phase-1 (literature survey and problem formulation)
  • Machine learning with Python
How it is evaluated

50 : 25 : 25 (report : presentation : Q&A)

Also fits: Anna University M.E. Regulation 2021, JNTUH M.Tech R22.

What's in the box

11 parts · 5 free · 2 previewed · 4 unlock for ₹2,000

Problem & synopsis

4 min read

Problem statement

Campus IoT networks are segmented across departments, and each segment's gateway sees a different mix of benign and malicious traffic. A centralised IDS requires copying traffic from every segment to one server, which conflicts with data-minimisation expectations under India's Digital Personal Data Protection Act, 2023, consumes backbone bandwidth, and crosses administrative boundaries. Federated learning avoids moving raw data, but its behaviour on realistic, heavily imbalanced and non-IID IoT attack data — particularly for rare attack classes — and its communication and edge-compute costs are not well characterised.

The problem addressed is: How close can a federated, lightweight IDS trained across simulated campus gateways come to a centralised model on CICIoT2023, in macro-F1 and per-class recall, as label skew increases — and at what communication cost and on-device latency?

Synopsis

Abstract

IoT devices on campus networks are frequent targets of botnet recruitment, DDoS, reconnaissance and spoofing attacks. Machine-learning intrusion detection systems (IDS) perform well when trained on pooled traffic, but pooling is often impractical across departments that manage their own networks. This work evaluates federated learning for a lightweight IDS: each simulated campus gateway trains a small neural network on its local share of CICIoT2023, and a coordinator aggregates weights with FedAvg. I compare federated and centralised training under IID and label-skewed non-IID partitions at 2-class, 8-class and 34-class granularity, and measure detection quality, communication cost and edge inference latency.

Introduction

Federated learning, introduced as FedAvg by McMahan et al., keeps data on clients and exchanges only model parameters. For IoT security this is attractive: gateways already see local traffic, and the model can be small enough to run on a single-board computer. The difficulty is statistical heterogeneity — a hostel gateway may see mostly Mirai-style scans while a lab gateway sees brute-force attempts — which slows convergence and can hurt minority classes.

Literature Gap

  • Many IDS studies report high accuracy on centralised splits of older datasets, where accuracy hides poor minority-class recall.
  • Federated IDS papers often use IID splits or a single granularity, and seldom report communication cost or on-device latency together.
  • Gap: a reproducible comparison of centralised vs FedAvg (with FedProx as an extension) on a recent large IoT dataset, under controlled non-IID skew, reporting macro-F1, per-class recall, rounds, bytes and Raspberry Pi latency for models under a fixed size budget.

Proposed Work

  • Preprocessing pipeline with leakage-safe splits and class-balanced evaluation sets.
  • Two compact models (MLP and 1D-CNN) under a parameter budget.
  • FL simulation with 10 gateways, Dirichlet label skew (α ∈ {100, 1.0, 0.3, 0.1}) and partial participation.
  • Edge benchmark of exported models on a Raspberry Pi 4.

Feasibility

The dataset is public; PyTorch and Flower are open-source; simulation runs on a single GPU or a CPU workstation; a Raspberry Pi 4 costs a few thousand rupees and is available in most college IoT labs.

Objectives

  1. 01Build a leakage-safe preprocessing pipeline for CICIoT2023 with 2-, 8- and 34-class label sets and stratified, class-balanced test sets.
  2. 02Train centralised MLP and 1D-CNN baselines under a fixed parameter budget and report macro-F1 and per-class recall.
  3. 03Simulate federated training across 10 campus gateways with FedAvg (and FedProx as an extension) using Flower.
  4. 04Quantify the effect of Dirichlet label skew and client participation rate on convergence, macro-F1 and minority-class recall.
  5. 05Measure communication cost (rounds and megabytes) needed to reach a target macro-F1.
  6. 06Export the best models to ONNX and measure size and inference latency on a Raspberry Pi 4.
  7. 07Write the results as a conference-style paper with threats to validity.

Scope

In scope

  • Offline experiments on the published CICIoT2023 CSV feature files; no live capture of campus traffic.
  • Two compact neural models plus a random-forest reference; FedAvg and FedProx aggregation.
  • Simulated 10-client federation on one machine; optional two-Pi real deployment for latency.
  • Metrics: macro-F1, per-class recall, confusion matrices, rounds and bytes, model size, latency.

Out of scope

  • Secure aggregation, differential privacy and defences against poisoned clients (discussed as future work).
  • Payload inspection or deep-packet inspection.
  • Production deployment on the actual campus network.

Methodology

Research design: quantitative, controlled experimental study with repeated runs (5 seeds per configuration), following the experimental-design and reporting practices taught in 22RMI16.

StageWeeksActivitiesOutput
Phase-1 recap1–2Refine research questions and hypotheses from the Phase-1 literature surveyRQ document
Data engineering3–5Download, merge, deduplicate, scale, create label maps and splitsClean parquet files, data card
Centralised baselines6–8MLP, 1D-CNN, random forest; tuning on validation setBaseline table
FL simulation9–14Flower clients/strategy, IID and Dirichlet splits, FedAvg then FedProx, participation 50–100%Convergence curves
Edge benchmark15–16ONNX export, optional int8 quantisation, latency on Raspberry Pi 4Latency table
Analysis17–19Statistical tests, error analysis, ablationsResults chapter
Writing20–24Thesis, paper draft, plagiarism check, viva preparationSubmission

Research questions

  • RQ1: Under IID partitioning, how does FedAvg macro-F1 compare with the centralised model?
  • RQ2: How do macro-F1 and minority-class recall degrade as Dirichlet α decreases?
  • RQ3: How many rounds and megabytes does FL need to reach a target macro-F1?
  • RQ4: Do the models meet an edge budget (target: < 1 MB, < 5 ms per flow batch on a Raspberry Pi 4)?

Evaluation protocol

  • Split by capture file where possible, not by random rows, to reduce temporal leakage; fit scalers on training data only.
  • Hold out one global balanced test set; every configuration is evaluated on it.
  • Report mean ± standard deviation over 5 seeds; compare configurations with a paired Wilcoxon signed-rank test on seed-wise macro-F1.
  • Targets (hypotheses, not results): FedAvg within 2 macro-F1 points of centralised at α = 100; the gap widening at α = 0.1; FedProx reducing that gap.

Architecture & tech stack

1 diagram · 7 technologies · 2 min read

  • Python
  • PyTorch
  • Flower (industry-standard FL framework)
  • scikit-learn
  • pandas
  • ONNX Runtime
  • Raspberry Pi 4

The experimental system has four parts: data pipeline, centralised trainer, federated simulation (Flower server + N gateway clients), and edge benchmark.

flowchart TD
  A["CICIoT2023 CSV files"] --> B["Preprocess: dedupe, scale, label maps (2/8/34 classes)"]
  B --> C["Global balanced test set"]
  B --> D["Training pool"]
  D --> E["Centralised trainer: MLP, 1D-CNN, RF"]
  D --> F["Partitioner: IID or Dirichlet alpha"]
  F --> G1["Gateway client 1: Hostel"]
  F --> G2["Gateway client 2: Library"]
  F --> G3["Gateway clients 3 to 10: Labs, CCTV, Admin"]
  G1 --> S["Flower server: FedAvg or FedProx"]
  G2 --> S
  G3 --> S
  S --> G1
  S --> G2
  S --> G3
  E --> H["Evaluator: macro-F1, per-class recall"]
  S --> H
  C --> H
  S --> X["ONNX export"]
  X --> P["Raspberry Pi 4 latency benchmark"]

Models (parameter budget ≈ 50k)

  • MLP: input (published CSV features) → 128 → 64 → classes; ReLU, dropout 0.2, batch norm.
  • 1D-CNN: features treated as a 1-D sequence; two Conv1d layers (32 and 64 filters, kernel 3), global average pooling, dense output.
  • Reference: random forest (scikit-learn), centralised only.
  • Loss: weighted cross-entropy; optimiser: Adam for centralised, SGD with momentum on clients.

Federated setup

  • 10 clients, 1–5 local epochs, batch 256, 50–100 rounds, fraction fit 0.5 or 1.0.
  • FedAvg weights client updates by local sample count; FedProx adds a proximal term μ‖w − w_global‖² to the local loss.
  • Communication per round = 2 × model bytes × participating clients (upload + download), logged by the strategy.

Results tables (to be filled from your runs)

SettingModelGranularityMacro-F1 (mean ± sd)Min per-class recallRounds to targetMB transferred
CentralisedMLP8-class——
FedAvg α = 100MLP8-class
FedAvg α = 0.1MLP8-class
FedProx α = 0.1MLP8-class
ModelParamsONNX size (KB)Pi 4 latency per 1,000 flows (ms)int8 size (KB)int8 macro-F1 drop
MLP
1D-CNN

Modules

5 modules

  1. Module 01

    Data Pipeline and Partitioner

    Loads CICIoT2023 CSV files in chunks, removes duplicates and infinite values, builds 2-, 8- and 34-class label maps, fits a standard scaler on training data only, writes parquet shards, and creates IID or Dirichlet label-skew partitions for ten simulated campus gateways with a reproducible seed.

  2. Module 02

    Centralised Baselines

    Trains the MLP, 1D-CNN and random-forest reference on pooled training data with weighted cross-entropy, early stopping on a validation split, and logs macro-F1, per-class recall and confusion matrices on the global balanced test set.

  3. Module 03

    Federated Simulation (Flower)

    Implements a Flower NumPy client that wraps the PyTorch model and a custom strategy extending FedAvg to log bytes per round and evaluate the global model centrally each round; FedProx is added through a proximal loss term on clients. Supports partial participation and varying local epochs.

  4. Module 04

    Edge Benchmark

    Exports the global model to ONNX, applies optional dynamic int8 quantisation, and runs a timing harness with ONNX Runtime on a Raspberry Pi 4 measuring median and 95th-percentile latency per batch, model size and peak memory.

  5. Module 05

    Analysis and Reporting

    Aggregates results across seeds, runs Wilcoxon signed-rank tests, plots convergence curves and per-class recall bars, and generates LaTeX or Word tables for the thesis and paper.

Slides

13 slides · titles free · bullets, notes and the .pptx unlock

  1. Slide 1

    Lightweight Federated Intrusion Detection for Campus IoT

  2. Slide 2

    Motivation

  3. Slide 3

    Problem and Research Questions

  4. Slide 4

    Related Work and Gap

  5. Slide 5

    Dataset: CICIoT2023

  6. Slide 6

    Methodology

  7. Slide 7

    System Architecture

  8. Slide 8

    Experimental Setup

  9. Slide 9

    Results: Detection Quality

  10. Slide 10

    Results: Communication and Edge

  11. Slide 11

    Discussion and Threats to Validity

  12. Slide 12

    Contributions

  13. Slide 13

    Conclusion and Future Work

Bullets, speaker notes and the .pptx · ₹2,000

The titles above are the real outline. The rest is what you present from.

Unlock for ₹2,000

Viva questions & answers

3 of 15 answered free · 12 unlock

Read each answer, close it, and say it in your own words. Your viva will ask. Now you'll know.

  1. 01General

    What is the novelty of your dissertation?

    The novelty is a reproducible, combined evaluation of centralised versus federated lightweight IDS on CICIoT2023 under controlled label skew, reporting macro-F1, minority-class recall, communication cost and Raspberry Pi latency together. Most prior federated IDS work reports only accuracy on IID splits.

  2. 02General

    What did you complete in Phase-1 and what is new in Phase-2?

    Phase-1 (22SXX34) contained the literature survey, research questions, dataset study and a preliminary centralised baseline. Phase-2 (22SXX41) adds the full federated simulation, non-IID experiments, FedProx, edge benchmark, statistical tests, thesis and paper draft.

  3. 03Concept

    How does FedAvg work?

    In each round the server sends the global model to selected clients, each client trains for a few local epochs on its own data, and the server averages returned weights in proportion to client sample counts. Raw traffic never leaves the gateway; only parameters are exchanged.

+12 more questions, with answers

Try the free ones out loud first. Your examiner will not accept “it's in the PPT”.

How to run

8 steps · complete source code · unlocks with the project

Unlocks with the project · ₹2,000

8 steps · source code zip

Prerequisites, install, seed data and tests, written for demo day. Plus the complete source.

Unlock for ₹2,000

Read me first

242 words · unlocks with the project

What to change before it goes anywhere near a submission. Skipping it is how the demo fails live.

Unlocks with the project · ₹2,000

242 words · ~1 min read

The checklist of things to rename, re-seed and re-think so the project reads as yours.

Unlock for ₹2,000

Submission checklist

261 words · unlocks with the project

How to study it, adapt it and walk your examiner through it, step by step.

Unlocks with the project · ₹2,000

261 words · ~1 min read

Report structure, formatting rules and the submission checklist your department will grade.

Unlock for ₹2,000

References

10 sources

  1. CICIoT2023 dataset — Canadian Institute for Cybersecurity, University of New Brunswick
  2. E. C. P. Neto et al., CICIoT2023: A Real-Time Dataset and Benchmark for Large-Scale Attacks in IoT Environment, Sensors, 2023
  3. H. B. McMahan et al., Communication-Efficient Learning of Deep Networks from Decentralized Data, AISTATS 2017
  4. T. Li et al., Federated Optimization in Heterogeneous Networks (FedProx), MLSys 2020
  5. T.-M. H. Hsu, H. Qi & M. Brown, Measuring the Effects of Non-Identical Data Distribution for Federated Visual Classification, 2019
  6. D. J. Beutel et al., Flower: A Friendly Federated Learning Research Framework, 2020
  7. P. Kairouz et al., Advances and Open Problems in Federated Learning, Foundations and Trends in Machine Learning, 2021
  8. Flower Framework Documentation
  9. PyTorch Documentation
  10. ONNX Runtime Documentation

Cite this bundle

OnlyProjects. (2026). Lightweight Federated Intrusion Detection for Campus IoT Networks on CICIoT2023: M.Tech / M.E. Computer Science & Engineering project bundle [Educational resource]. https://onlyprojects.online/projects/mtech-cse-federated-iot-intrusion-detection

Future scope

1 min read

  • Secure aggregation and differential privacy to protect client updates, with a privacy–utility curve.
  • Robust aggregation (median, trimmed mean) against poisoned or compromised gateways.
  • Personalised FL so each gateway fine-tunes for its own traffic mix.
  • Real deployment on campus Raspberry Pi gateways with live flow features from a lightweight extractor.
  • Continual learning to add new attack classes without forgetting old ones.

Keep browsing

Same degree, same syllabus slot, different idea. Pick the one your guide will actually approve.