Urgent.News

600+ sources. One page. See who else covered it.

Editions

Tech

Build a Federated Learning System on Android with Kotlin

Build a Federated Learning System on Android with Kotlin Traditional machine learning often requires collecting training data on a central server. Federated learning takes a different approach: the model is sent to participating devices, training happens locally, and devices send model updates rather than their raw training data. This tutorial explains how to design a federated learning prototype…

Federated learning enables machine learning on devices themselves, rather than requiring centralized training data. This tutorial explains how to build a federated learning prototype using Kotlin on Android. While federated learning improves data locality, it does not automatically ensure privacy, so additional security measures are required.

The architecture consists of a central server that coordinates training rounds, and mobile clients that host the ML model, dataset, training engine, update serializer, and secure API client. Kotlin handles application lifecycle, networking, storage, and orchestration, while a mobile-compatible ML runtime handles the actual training engine.

The server provides model versions, which the application downloads only when necessary, verifying the downloaded artifact first. Local training involves the client receiving a global model, training it against locally available data, and creating a model update. The update consists of the model version, sample count, and weights. Rather than uploading raw examples, clients send updates to the server. The server combines updates using Federated Averaging, a weighted average based on the number of local training samples.

Android's WorkManager can be used for background training tasks. The federated training worker class handles downloading the model, training locally, and uploading the update. The app should consider battery, network availability, charging state, device resources, and Wi-Fi-only uploads for background work. Model updates should be protected using HTTPS and authenticated requests, with additional security measures like request authentication, device attestation, signed model artifacts, checksums, and replay protection.

Differential privacy, secure aggregation, and handling unreliable devices are also important considerations. Finally, evaluation should track global accuracy, per-device accuracy, training rounds, client participation, communication volume, training time, and battery consumption to identify any mobile costs incurred by the federated learning system.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — it may contain errors, so check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in Tech

Should You Buy an iPhone 17 Now or Wait for iPhone 18?

For the first time since Apple started selling standard and "Pro" iPhones, we're not going to get an entry-level iPhone model this fall.

  • Apple will not release an entry-level iPhone in the fall.
  • iPhone 18 Pro, Pro Max, and Ultra models to launch in September.
  • iPhone 17 priced at $799, trade-in prices expected to drop.

Kotlin Compiler Plugins & KSP: Building Code Generation Tools

Kotlin Compiler Plugins & KSP: Building Code Generation Tools Large Kotlin applications often contain repetitive code for serialization, dependency injection, adapters, database mappings, and API…

  • Kotlin Compiler Plugins and KSP aid in building code generation tools for large Kotlin applications
  • KSP is used for annotation processing, source generation, symbol inspection, and generating adapters

Real-Time Object Detection and Tracking with Kotlin and YOLO on Android

Real-Time Object Detection and Tracking with Kotlin and YOLO on Android Real-time computer vision is one of the most useful applications of machine learning on mobile devices.

  • Kotlin application captures camera frames for real-time object detection
  • YOLO-style detector processes frames with GPU acceleration
  • Tracking system maintains object identity across frames using IoU