How federated learning keeps data private
Federated learning trains a model across many devices that each keep their own data, and only the learned weights are shared with a central server. The raw data never leaves the device, so privacy is built into the method rather than bolted on after.
What is federated learning?
Instead of copying everyone’s data into one place to train a model, you send the model to the data. Each device trains on what it has, then sends back only the weights it learned, the numbers that hold the learning, not the records. The server averages those weights into a stronger shared model and sends it back out. The data itself never moves.
Why does that protect privacy?
Because the thing you move is the math, not the records. A hospital, a phone, or a factory line can take part in training without handing over its raw data. There is no central pile of sensitive records to leak, and each owner keeps control of what they collected.
Where I used it
I built a federated system for metal defect detection. Raspberry Pi devices and personal computers acted as edge clients, each training a YOLOv8 object detection model on its own images and sending weights to a server over a secure SSH connection. Moving from two to three client devices raised average precision by 8.42 percent, and proper data cleaning with balanced sampling added another 8.51 percent F1 score and 10.10 percent accuracy. The full write-up is on the project page.
When is it worth it?
Federated learning is worth the extra coordination when the data is sensitive or hard to move, and when it lives in many places at once. Medical imaging across hospitals is a clear example: each hospital can help train a shared model for spotting anomalies without ever sharing patient scans. That is the direction I want to take this work next.
Questions
Does the raw data ever leave the device?
No. Each device trains on its own data and sends only the model weights. The raw data stays where it was collected.
Is federated learning slower than normal training?
Each round has some overhead from coordinating devices, but you save the cost and risk of gathering all the data in one place, and you can train closer to where the data lives.