The advent of Internet of Things and widespread mobile devices in urban cities have motivated a new paradigm emergence that is smart city. Data acquired from ubiquitous devices can be used to train the Artificial Intelligence(AI) models that support the smart services and benefit society in all aspects. Federated learning (FL) as a distributed learning technology enables multiple edge nodes collaboratively train a global model with remaining their raw data in local, which protects data privacy. Previous efforts mostly focus on offline FL task assignment where datasets are offline, i.e., continuously training the model with the same datasets. Actually, there is always new data produced during training process and these new data should be added to training datasets as an update for improving the performance of the model and online datasets scenario is more realistic. Based on Lyapunov optimization theory, we constructe a dynamic queue model to formalize the online dataset of each edge node. To effectively assign the model to the edge nodes, an online task assignment algorithm that is Federated Online Control Algorithm (FedOCA) is proposed. Through empirical analysis, we found that our proposed algorithm can achieve higher accuracy compared to Fedavg on the FashionMNIST dataset. We also verify the effect of batch size on accuracy, and find that the larger batch has worse effect.
|