FEDERATED EDGE SMALL LANGUAGE MODELS FOR PERSONALIZED NUTRITIONAL RECOMMENDATION WITH REAL-TIME FOOD RECOGNITION
Keywords:
Federated learning, edge intelligence, small language models, food recognition, personalized nutrition, model quantization, on-device inference, non-IID aggregationAbstract
Personalized nutrition has emerged as a cornerstone of therapy for metabolic and renal disorders. Yet current dietary recommender solutions are built on the collection of image data and meal history from central servers, posing ethical and practical issues. In this work, we present a federated edge small language model (SLM) architecture, which combines on-device visual recognition of food with private, clinically justified dietary recommendations. Our approach runs entirely on commodity smartphones: distilled vision encoder detects dishes and their portion size from a single image, and a compact SLM generates recommendations at meal level conditioned on eight clinically meaningful nutrients and user-reported diagnosis. Local adaptation is done with personalized low-rank layers using proximal updates and not requiring any image or meal logging. In order to operate within constrained budget on computation and network bandwidth, the proposed framework leverages sensitivity-weighted structured pruning, mixed-precision quantization by straight-through estimator, and knowledge distillation from cloud teacher in a multi-objective Lagrangian optimization. Federated server aggregation is heterogeneity-aware: client weights are computed with the use of kernel maximum-mean-discrepancy metric plus Dirichlet smoothed reliability criterion, ensuring that densely represented dietary categories do not dominate minority cultures. Clinical safety is enforced during decoding with the help of differentiable constraint layer, which penalizes glycemic-load, sodium, potassium, and phosphorus budget violations before generating any recommendations. The proposed framework is evaluated using federated dataset of 118,000 meal images (110,730 after cleaning) representing eleven cuisines and split into highly non-IID clients. Deployed model demonstrates 91.4% top-1 accuracy, 0.887 macro F1, 0.903 macro recall, and 27 ms median detection latency on a mid-range smartphone while transmitting 24.8 times less payload compared to full-model federated averaging. Constraint satisfaction on the clinical side increases from 71.2% to 96.5%, and personalization is reached within nine iterations by new users. Thus, privacy, cultural diversity, and clinical safety can all coexist on-device.