Inspiration
During our master’s degree programme, we were part of a team that developed a GPU-intensive convolutional network that detects Tuta absoluta on tomato leaves with laboratory-grade accuracy (Mkonyi L, et al. ). When we demonstrated the model to farmers in Northern Tanzania, they posed a pivotal question: “Can it run on our farms without internet or expensive hardware?” The disconnect was clear: smallholder farmers work under strict power budgets, endure intermittent connectivity, and are reluctant to upload data. Their feedback motivated us to redesign the entire pipeline around the principle of learning where the data already lives.
What it does
A lightweight federated-learning framework that trains soil-based crop-recommendation models directly on Raspberry Pi edge nodes, eliminating the need to stream raw sensor data to the cloud.
How we built it
We deployed three Raspberry Pi 4 clients and one 16 GB HP EliteBook server. A public dataset of 2 200 soil-feature records covering 22 crops was partitioned to emulate three farms. The learning core is a lightweight three-layer feed-forward network (64–32–22 neurons) implemented in PyTorch. Communication uses Python’s socket, pickle, and struct libraries, limiting each round to < 50kB over Wi-Fi. For farmer I/O, we integrated a Twilio SMS gateway for notifications and a ThingSpeak dashboard to visualize N, P, K, temperature, humidity, pH, rainfall, and model confidence—creating a working “farm kit” on low-cost hardware.
Challenges we ran into
We encountered several challenges while developing the federated learning framework. On the hardware side, working with Raspberry Pi 4 devices required careful memory and thermal management due to their limited 4 GB RAM and modest processing power. Prolonged training initially caused overheating, which we mitigated by reducing model complexity, applying dropout layers, and introducing CPU throttling. On the software side, setting up a communication pipeline over a local Wi-Fi network involved using low-overhead socket-based protocols instead of heavier frameworks like gRPC. Serializing model updates with pickle and structuring communication using struct helped reduce payload sizes to below 50 kB per round. We also had to simulate farm-like conditions using a public crop recommendation dataset by partitioning it across the devices, while ensuring fairness in data distribution.
Accomplishments that we're proud of
After 20 communication rounds and 200 local epochs, the federated model achieved 92 % test accuracy—over 30 percentage points higher than earlier centralised Gaussian-NB baselines—while keeping RAM usage to 1.5–1.9 GB. Per-round traffic stayed below 50 kB, well within 2 G budgets. When deployed on-farm, farmers receive site-specific crop recommendations on hardware that costs less than many modern personal computers. Also linking it to Twilio and Thingspeak demostrate the scalability of our system into generating useful insights that can be used to inform management of a variety of farm inputs
What we learned
Field visits yielded four key insights:
(1) Farm data rarely leaves the farm;
(2) bandwidth is precious—sending even a few megabytes per day is costly;
(3) A model need not be massive to be accurate if it is properly tailored to the task.
What's next for FieldEdge FL
Future work will integrate solar-powered LoRa nodes for farms beyond Wi-Fi range, incorporate weather forecasts and satellite NDVI for richer feature sets tha account for spatial and temporal variablity of the soil data, and release a plug-and-play SD-card image enabling any farmer group to launch a private FL cluster in under 30 minutes.
Log in or sign up for Devpost to join the conversation.