CHAPTER 6

Federated Edge Learning

Beyond Static Models

Traditional edge AI deploys static models—trained once in the cloud, frozen, then distributed. These models never improve from real-world usage. Federated learning enables collaborative model training across thousands of edge devices while keeping data local, combining the benefits of centralized learning (model improvement from diverse data) with edge AI (privacy preservation, offline capability).

Federated Learning Fundamentals

The Core Concept

Instead of collecting data centrally for training, federated learning brings training to the data. The process:

  1. Distribution: Server sends current global model to participating devices
  2. Local Training: Each device trains on its private data for a few epochs
  3. Update Sharing: Devices send only model updates (gradients or weights) to server, not raw data
  4. Aggregation: Server combines updates from many devices using averaging or weighted schemes
  5. Broadcasting: Improved global model is sent back to devices
  6. Iteration: Process repeats until convergence
// Federated learning workflow (pseudo-code)
// Server side
global_model = initialize_model()

for round in range(num_rounds):
    # Select participating devices
    selected_devices = sample(all_devices, participation_rate=0.1)

    # Send global model to devices
    for device in selected_devices:
        send_model(device, global_model)

    # Wait for local updates
    updates = []
    for device in selected_devices:
        local_update = receive_update(device)
        updates.append(local_update)

    # Aggregate updates (FedAvg algorithm)
    global_model = federated_averaging(global_model, updates)

// Device side
def local_training(global_model, local_data, epochs=5):
    model = download_model(global_model)

    for epoch in range(epochs):
        for batch in local_data:
            loss = model.forward(batch)
            gradients = model.backward(loss)
            model.update_weights(gradients)

    local_update = compute_update(global_model, model)
    send_update(server, local_update)
    return model

Privacy Preservation

Federated learning preserves privacy because:

Federated Averaging (FedAvg)

The Standard Algorithm

FedAvg, introduced by Google in 2016, is the foundational federated learning algorithm:

// FedAvg aggregation on server
def federated_averaging(global_weights, device_updates):
    """
    device_updates: List of (device_id, local_weights, num_samples)
    """
    total_samples = sum(num_samples for _, _, num_samples in device_updates)

    # Weighted average based on local dataset size
    aggregated_weights = {}
    for layer_name in global_weights.keys():
        weighted_sum = 0
        for device_id, local_weights, num_samples in device_updates:
            weight = num_samples / total_samples
            weighted_sum += weight * local_weights[layer_name]

        aggregated_weights[layer_name] = weighted_sum

    return aggregated_weights

Devices with more data have proportionally higher influence on the global model. This ensures the model reflects the true data distribution across all participants.

Convergence Challenges

Federated learning converges slower than centralized training due to:

Federated Learning on Edge Devices

On-Device Training Constraints

Training (even for a few epochs) is more demanding than inference:

Resource Inference Training Ratio
Memory Model size only Model + gradients + optimizer state 3-5x
Computation Forward pass Forward + backward pass 2-3x
Power Milliseconds Minutes 1000x total

Strategies to enable edge training:

TensorFlow Federated

Google's open-source framework for federated learning research and deployment:

// TensorFlow Federated example
import tensorflow_federated as tff

# Define model
def model_fn():
    return tff.learning.from_keras_model(
        keras_model=create_keras_model(),
        input_spec=input_spec,
        loss=tf.keras.losses.SparseCategoricalCrossentropy(),
        metrics=[tf.keras.metrics.SparseCategoricalAccuracy()]
    )

# Federated averaging process
iterative_process = tff.learning.build_federated_averaging_process(
    model_fn,
    client_optimizer_fn=lambda: tf.keras.optimizers.SGD(0.02),
    server_optimizer_fn=lambda: tf.keras.optimizers.SGD(1.0)
)

# Initialize
state = iterative_process.initialize()

# Training round
for round_num in range(num_rounds):
    state, metrics = iterative_process.next(state, federated_train_data)
    print(f'Round {round_num}: loss={metrics["loss"]}, accuracy={metrics["accuracy"]}')

Flower: Scalable Federated Learning

Open-source framework supporting diverse platforms and frameworks:

# Flower client (runs on edge device)
import flwr as fl

class EdgeClient(fl.client.NumPyClient):
    def get_parameters(self):
        return get_model_weights()

    def fit(self, parameters, config):
        set_model_weights(parameters)
        train_model(local_data, epochs=5)
        return get_model_weights(), len(local_data), {}

    def evaluate(self, parameters, config):
        set_model_weights(parameters)
        loss, accuracy = evaluate_model(test_data)
        return loss, len(test_data), {"accuracy": accuracy}

# Start client
fl.client.start_numpy_client(server_address="server:8080", client=EdgeClient())

Privacy-Enhancing Technologies

Differential Privacy

Add calibrated noise to model updates to prevent reconstruction of individual data points:

// Differential privacy for federated learning
def add_differential_privacy(gradients, epsilon=1.0, delta=1e-5):
    """
    epsilon: Privacy budget (lower = more privacy, less accuracy)
    delta: Probability of privacy breach
    """
    sensitivity = compute_l2_sensitivity(gradients)

    # Gaussian mechanism for (ε, δ)-differential privacy
    sigma = (sensitivity * sqrt(2 * log(1.25 / delta))) / epsilon

    noisy_gradients = {}
    for layer_name, gradient in gradients.items():
        noise = np.random.normal(0, sigma, gradient.shape)
        noisy_gradients[layer_name] = gradient + noise

    return noisy_gradients

Trade-off: Stronger privacy (lower epsilon) reduces model accuracy. Typical values: epsilon=1-10.

Secure Aggregation

Cryptographic protocol ensuring the server can only see aggregated updates, never individual device updates:

  1. Devices generate random pairwise masks
  2. Each device encrypts its update with these masks
  3. Server receives masked updates from all devices
  4. Masks cancel out when aggregating, revealing only the sum
  5. Individual updates remain hidden from server

This prevents the server from singling out any individual contribution, even though it computes the global aggregate.

Real-World Applications

Gboard (Google Keyboard)

Google's mobile keyboard uses federated learning to improve next-word prediction:

Apple Siri and QuickType

Apple uses federated learning for:

Updates are uploaded anonymously when devices are locked and charging. Apple's differential privacy adds noise to ensure individual contributions can't be identified.

Healthcare: Disease Prediction

Hospitals collaborate on predictive models without sharing patient data:

Finance: Fraud Detection

Banks improve fraud detection across institutions:

Challenges and Solutions

Communication Efficiency

Problem: Transmitting full model updates (megabytes) for every round consumes bandwidth and battery.

Solutions:

// Gradient compression: Top-K sparsification
def compress_gradients(gradients, k=0.01):
    """Keep only top k% of gradients by magnitude"""
    flat_grads = flatten(gradients)
    threshold = np.percentile(np.abs(flat_grads), 100 * (1 - k))

    compressed = {}
    for layer_name, grad in gradients.items():
        mask = np.abs(grad) >= threshold
        compressed[layer_name] = {
            'values': grad[mask],
            'indices': np.where(mask)
        }

    # Typical compression: 100x smaller updates
    return compressed

Non-IID Data

Problem: Device data distributions differ significantly (e.g., language preferences, photo content).

Solutions:

Device Heterogeneity

Problem: Devices have vastly different computational capabilities and availability.

Solutions:

弘益人間 Federated Learning Principle:

Federated learning embodies "benefit all humanity" by enabling collective intelligence while preserving individual privacy. Healthcare models improve from global patient data without violating confidentiality. Language models learn from billions of users without collecting their personal messages.

Future Directions

Federated Analytics

Beyond model training—compute statistics and insights across distributed data without centralization. Example: Aggregate usage statistics while preserving individual privacy.

Cross-Device and Cross-Silo

Federated Transfer Learning

Combine federated learning with transfer learning—pre-train foundation models on public data, fine-tune collaboratively on private edge data.

Blockchain-Based Federated Learning

Use blockchain for decentralized aggregation, removing need for trusted central server. Participants verify and record updates on distributed ledger.

Summary

Federated edge learning enables collaborative model training across distributed devices while preserving privacy. Key concepts:

  • Federated Averaging: Devices train locally, share only model updates, server aggregates into global model
  • Privacy Preservation: Raw data never leaves device, differential privacy adds mathematical guarantees
  • On-Device Training: Requires optimization for edge constraints (memory, computation, power)
  • Communication Efficiency: Gradient compression and sparsification reduce bandwidth

Real-world deployments include Google Gboard, Apple Siri/QuickType, healthcare collaborations, and financial fraud detection. Challenges include non-IID data, device heterogeneity, and communication costs—addressed through algorithm improvements (FedProx), personalization, and compression.

Federated learning represents the future of privacy-preserving AI, enabling collective intelligence without data centralization.

Review Questions

  1. Explain the federated learning workflow from model distribution to aggregation.
  2. How does federated learning preserve privacy compared to centralized training?
  3. What is FedAvg (Federated Averaging), and how does it work?
  4. Why is training on edge devices more resource-intensive than inference?
  5. What strategies enable training on resource-constrained edge devices?
  6. How does differential privacy enhance federated learning?
  7. What is secure aggregation, and what problem does it solve?
  8. Describe two real-world applications of federated learning.
  9. What is the non-IID data problem in federated learning, and how can it be addressed?
  10. How does gradient compression reduce communication costs in federated learning?

Korea Digital Transformation Detailed Mapping

Korea operates digital transformation through a comprehensive governance system. Digital Government: Digital Platform Government Committee (established September 2022, under the President)·Ministry of the Interior and Safety Digital Government Bureau·e-Government Support Center·Gov.kr·National Citizen Service·KDIS (Korea Digital Information Society)·NIA (National Information Society Agency)·MOIS (Ministry of the Interior and Safety). K-DNS Infrastructure: Korea Internet & Security Agency (KISA) Korea Internet Center·KISA DNS Root Server·KRNIC (Korea Network Information Center)·BGP Korea·National Cyber Security Center (NCSC)·KCC (Korea Communications Commission)·MSIT (Ministry of Science and ICT)·NIA·NIPA. Korean Cloud Infrastructure: KT Cloud·NAVER Cloud (NCloud)·Samsung SDS Cloud·LG U+ Cloud·NHN Cloud·Kakao Enterprise Cloud·SK Telecom Cloud·KISA Cloud Security Assurance Program (CSAP)·KCMVP-validated cloud·ISMS-P (Information Security & Personal Information Management System). Korean Security Certifications: KISA ISMS-P certification·KCMVP (Korean Cryptographic Module Validation Program)·NIS (National Intelligence Service) "National Cryptographic Technology Operation Standards"·NCSC "National Cyber Security Strategy 2024-2028"·CC (Common Criteria) Korean evaluation bodies·EAL4·EAL5·KS X ISO/IEC 15408·19790·24759 Korean Profile. Korean Data Standards: NIA AI Hub·National Data Standardization Committee·Statistics Korea (KOSTAT)·MyData 4 Designated Combination Specialists (Samsung SDS, KICI, KOSTAT, KFTC)·National Institute of Korean Language·National Law Information Center·National Spatial Information Platform·National Spatial Data Center·Korean Spatial Information Standards. Finance and Fintech Standards: FSC (Financial Services Commission)·FSS (Financial Supervisory Service)·FIU (Financial Intelligence Unit)·BOK (Bank of Korea)·FSEC (Financial Security Institute)·KFTC (Korea Financial Telecommunications)·KSD (Korea Securities Depository)·KRX (Korea Exchange) 8-agency cooperation. 5G/6G Communications Infrastructure: 5G subscribers 35 million (2024)·5G base stations 350,000·6G commercialization target 2028·5G dedicated networks 16 operators·6G Acceleration Council (MSIT, 2024). K-Content: KOCCA (Korea Creative Content Agency)·MCST (Ministry of Culture, Sports and Tourism)·KCA (Korea Communications Agency)·Korea Culture Information Service Agency·Korean Film Archive·Korea Publishing Industry Promotion Agency. Data 3 Acts (Personal Information Protection Act·Credit Information Act·Telecommunications Network Act, 2020 enforcement)·Data Industry Act (2021)·Public Data Act (2013)·AI Framework Act (2026)·Digital Platform Government Framework Act (2024 proposed) — Korea digital transformation core legislation.

Korea Industrial, Research, Education Infrastructure Mapping

Korea operates its industrial ecosystem and standardization system through the following core infrastructure. Korea Top 5 Groups: Samsung, Hyundai Motor, LG, SK, Lotte. Each group operates standardization committees and ISO/IEC TC Korean secretariats. Samsung Electronics (semiconductors, displays, home appliances, telecom)·Hyundai Motor (automobiles, mobility)·LG Electronics (home appliances, displays, OLED)·SK hynix (memory)·LG Energy Solution·Samsung SDI (batteries)·POSCO Future M (materials)·Hyundai Mobis (parts). Korean IT Big Tech: NAVER (search, cloud, AI HyperCLOVA)·Kakao (messenger, payment, mobility, banking)·Coupang (e-commerce, logistics)·Karrot Market·Toss·Woowa Brothers. Korea Telcos: SK Telecom·KT·LG U+. 5G·5G dedicated networks·B2B cloud·AI businesses operating. Korea Top 7 Research Universities: Seoul National University·KAIST·POSTECH·Yonsei University·Korea University·UNIST·DGIST·GIST. All serve as standardization R&D bases and ISO/IEC/IEEE Korean chairs. Korea Government-affiliated National Research Institutes (26): KIST, KAERI, KIMM, KIER, KFRI, KRICT, KRIBB, KARI, KASI, KIGAM, KICT, KISTI, KETI, ETRI, NIMS, KIMS, KISDI, KOTRA, STEPI, KOEN, KICCE, KIET, KIPF, KIHASA, KICJ, KLRI. Korea Industrial Complexes / Tech Valleys: Pangyo Techno Valley·Dongtan·Gwanggyo·Songdo IBD·Yeouido·Gangnam·Sihwa·Banwol·Gumi·Ulsan·Changwon·Geoje·Yeosu·Onsan·Cheongju·Iksan·Gwangyang·POSCO Gwangyang Steel Mill·Asan Bay·Seosan·Songdo·Incheon Airport·Sejong·Cheongna·Geomdan. Korea Trade and Finance Infrastructure: Korea International Trade Association (KITA)·Korea Trade-Investment Promotion Agency (KOTRA)·Export-Import Bank of Korea (KEXIM)·Bank of Korea·Kookmin Bank·Shinhan·Hana·Woori·NH Nonghyup·IBK Industrial Bank·SC First Bank·Citi Bank Korea·HSBC Korea·DBS Korea — 14 Korean major banks and foreign banks. Korea K-POP / K-Content: HYBE·SM·YG·JYP 4 major entertainment companies·CJ ENM·tvN·MBC·KBS·SBS·EBS·YTN·Yonhap News TV·JTBC Korean broadcasting·NETFLIX Korea·Disney Plus·TVING·Wavve·Watcha·Coupang Play. Korea Gaming Industry: Nexon·NCsoft·Krafton·Netmarble·Kakao Games·Pearl Abyss·Com2uS·Gamevil·NHN·Smilegate·Webzen. Korea Automotive / Battery: Hyundai Motor·Kia·Genesis·LG Energy Solution·Samsung SDI·SK On·POSCO Future M·EcoPro·L&F battery cathode material suppliers. Korea Semiconductor: Samsung Electronics (HBM3E·HBM4)·SK hynix (HBM3E 12-Hi)·DB HiTek·SK siltron·SK Enpulse·Dongjin Semichem·Seoul Semiconductor·Simmtech·Samsung Display·LG Display.

Korea Standardization Infrastructure Mapping

Korea operates a comprehensive standards governance system through inter-ministerial cooperation. National Standards Council (under Prime Minister's Office, per Framework Act on National Standards Article 5) coordinates KATS (Korean Agency for Technology and Standards), MFDS (Ministry of Food and Drug Safety), MOTIE (Ministry of Trade, Industry and Energy), MSIT (Ministry of Science and ICT), MOIS (Ministry of the Interior and Safety), MOE (Ministry of Environment), MOHW (Ministry of Health and Welfare), MND (Ministry of National Defense), MCST (Ministry of Culture, Sports and Tourism), MOFA (Ministry of Foreign Affairs), MOJ (Ministry of Justice), and FSC (Financial Services Commission). Accreditation and Testing: KOLAS (Korea Laboratory Accreditation Scheme) accredits 800+ testing laboratories. KAS (Korea Accreditation System) accredits 50+ certification bodies. KTC (Korea Testing Certification), KTR (Korea Testing & Research Institute), KTL (Korea Testing Laboratory), and KCL (Korea Conformity Laboratories) provide conformance testing. Telecom and Cyber: KCC (Korea Communications Commission), KCA (Korea Communications Agency), TTA (Telecommunications Technology Association), IITP (Institute for Information & Communications Technology Planning & Evaluation), NIPA (National IT Industry Promotion Agency), KISA (Korea Internet & Security Agency), KCMVP (Korea Cryptographic Module Validation Program), NIS (National Intelligence Service), NSR (National Security Research Institute), and NCSC (National Cyber Security Center). National R&D Centers: KIST, ETRI, KAIST, Seoul National University, Yonsei University, Korea University, POSTECH, UNIST, GIST, DGIST, KISTI, KIER, KIMM, KRICT, KFRI, KRIBB. International Standards Cooperation: ISO TC/SC Korean secretariats, IEC TC/SC Korean secretariats, ITU-T Study Group Korean chairs, 3GPP RAN/SA Korean chairs, IEEE 802 Korean chairs, W3C Korea office, OASIS Korea office, IETF Korea cooperation, OECD CSTP, UN ESCAP, APEC SCSC Korean cooperation. Korean Industrial Standards (KS) Catalog: KS X (Information) 25,000+, KS A (Basic) 15,000+, KS B (Machinery) 25,000+, KS C (Electrical) 18,000+, KS D (Metallurgy) 12,000+, KS E (Mining) 5,000+, KS F (Construction) 18,000+, KS H (Food) 8,000+, KS I (Environment) 5,000+, KS J (Biology) 3,000+, KS K (Textile) 15,000+, KS L (Ceramics) 7,000+, KS M (Chemistry) 12,000+, KS P (Medical) 5,000+, KS Q (Quality Mgmt) 4,000+, KS R (Transport) 12,000+, KS S (Service) 3,000+, KS T (Packaging) 4,000+, KS V (Shipbuilding) 5,000+, KS W (Aerospace) 3,000+ — totaling 220,000+ Korean Industrial Standards. Key Acts: Personal Information Protection Act (Act 19234, effective Sept 15, 2024), Electronic Government Act, Electronic Signature Act, Act on Promotion of Information and Communications Network Utilization and Information Protection, Information and Communications Infrastructure Protection Act, Data Industry Act, Public Data Act, AI Framework Act (Act 20212, effective July 2026), Industrial Technology Innovation Promotion Act, Framework Act on Science and Technology — 70+ Korean standardization-related laws.