Multi-Region Asynchronous Swarm Learning for Data Sharing in Large-Scale Internet of Vehicles

To provide various intelligent services in Internet of Vehicles (IoVs), such as autonomous driving, data sharing technologies enable vehicles to overcome information barriers and provide a big data foundation. Federated Learning (FL), which shares models instead of raw data, has emerged as a popular solution to address privacy concerns. However, current approaches have limited scalability and security, which are not suitable for the dynamic network topology of IoV scenarios. In this letter, we propose a Multi-Region Asynchronous Swarm Learning (MASL) framework in IoVs, which is empowered by the hierarchical blockchain and executed parallel between multiple regions. The MASL integrates identity verification and asynchronous model training while ensuring secure aggregation as well as data privacy. Through intra-regional and cross-regional sharing, the security and efficiency during large-scale data sharing in IoVs are effectively improved while alleviating the not Independent and Identically Distributed (Non-IID) data problem. Finally, both the simulation and hardware testbed results demonstrate that the proposed MASL framework could achieve better performances in terms of efficiency and security compared with the existing algorithms.

Multi-Region Asynchronous Swarm Learning for Data Sharing in Large-Scale Internet of Vehicles Hongbo Yin , Xiaoge Huang , Member, IEEE, Yuhang Wu, Chengchao Liang, and Qianbin Chen , Senior Member, IEEE Abstract-To provide various intelligent services in Internet of Vehicles (IoVs), such as autonomous driving, data sharing technologies enable vehicles to overcome information barriers and provide a big data foundation.Federated Learning (FL), which shares models instead of raw data, has emerged as a popular solution to address privacy concerns.However, current approaches have limited scalability and security, which are not suitable for the dynamic network topology of IoV scenarios.In this letter, we propose a Multi-Region Asynchronous Swarm Learning (MASL) framework in IoVs, which is empowered by the hierarchical blockchain and executed parallel between multiple regions.The MASL integrates identity verification and asynchronous model training while ensuring secure aggregation as well as data privacy.Through intra-regional and crossregional sharing, the security and efficiency during large-scale data sharing in IoVs are effectively improved while alleviating the not Independent and Identically Distributed (Non-IID) data problem.Finally, both the simulation and hardware testbed results demonstrate that the proposed MASL framework could achieve better performances in terms of efficiency and security compared with the existing algorithms.
Index Terms-The Internet of Vehicles, data sharing, blockchain, swarm learning.

I. INTRODUCTION
I NTERNET of Vehicles (IoVs) is a new paradigm of mobile networks composed of vehicles supporting the Internet of Things (IoTs).The advancements in technologies such as B5G, IoT and Edge Computing (EC) paved the way for the rapid development of IoVs, resulting in an exponential growth of data generated by traffic participants.
These unprecedented amounts of data play an important role in the intelligent applications of IoVs, such as automatic driving [1].In urban vehicular networks, a formidable obstacle arises in the form of constrained computational resources and limited bandwidth of wireless networks.These limitations present a challenge for vehicles seeking to harness the vast amounts of data available to enhance services like autonomous driving and so on [2].Meanwhile, the reliance on centralized cloud computing engenders the user data privacy breaches risk.
Digital Object Identifier 10.1109/LCOMM.2023.3314662 the issue of data privacy in data sharing.FL enables vehicles to train locally with private data and upload model parameters to a central server for aggregation.Lu et al. [4] proposed PermiDAG that skillfully transformed the data sharing problem into a machine learning (ML) problem by FL to construct data models.By sharing the data models instead of the raw data itself, user data privacy is effectively safeguarded.Due to the distributed characteristics of data sharing architecture based on FL, it can be effectively integrated with blockchain technology to provide tamper-resistance and traceability [5].This integration serves to mitigate security threats and malicious attacks encountered by FL models, including disruptions, availability attacks, single-point failures, poisoning attacks, and so on.Swarm learning (SL) was introduced in [6], which combines FL and blockchain technology, allowing edge nodes to process user data and model parameters without the central coordinator, thus surpassing the limitations of FL.
A blockchain-based semi-asynchronous FL method named BlockFL was proposed in [7], which was limited due to its PoW consensus mechanism.In [8], an on-device Directed Acyclic Graph (DAG) blockchain based asynchronous FL approach was proposed to provide resistance against malicious attacks, but its performance suffers from the not Independent and Identically Distributed (Non-IID) data.PermiDAG [4] demonstrated stable performance in the Non-IID data and malicious attack scenarios, but it is not suitable for highly dynamic IoV environments.A hierarchical multi-chain mechanism named WU-layered FL was proposed in [9] for data sharing in IoVs, significantly enhancing the scalability of the blockchain.Nevertheless, it lacks cross-regional identity verification and sharing mechanisms, leading to a low model generalization within a single region with the Non-IID data.
To address these issues, this letter proposes an asynchronous swarm learning framework for data sharing in large-scale IoVs.The proposed framework integrates identity verification and asynchronous training while ensuring secure model aggregation as well as user data privacy.The main contributions of this letter are summarized as follows: Firstly, a Multi-Region Asynchronous Swarm Learning (MASL) framework is proposed, which is empowered by the hierarchical blockchain and executed in parallel between multiple regions, to solve the problem of large-scale data sharing in the IoV scenario.
Secondly, an asynchronous model training method is designed, which integrates the DAG blockchain in SL to achieve secure and efficient asynchronous training and sharing while protecting user data privacy.
Thirdly, a cross-regional sharing method is developed that executes the asynchronous model training and sharing 1558-2558 © 2023 IEEE.Personal use is permitted, but republication/redistribution requires IEEE permission.
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.between regions while alleviating the Non-IID problem of data, thereby enhancing model generalization while facilitating cross-regional identity verification processes.Finally, the MASL application program on the hardware testbed is developed and deployed to assess its effectiveness.

II. SYSTEM MODEL
Consider a two-layer IoV network empowered by EC, comprising the edge and user layer, as shown in Fig. 1.

A. Edge Layer
The edge layer consists of EC nodes including the Road Side Units (RSUs) and Base Stations (BSs), which are deployed near the roadways and host servers, providing communication, storage, and computing resources for vehicles.The RSUs are denoted as M = {1, .., m, .., M } and the BSs are denoted as L = {1, .., l, .., L}.

B. User Layer
The user layer consists of vehicles actively involved in data sharing, wherein they generate and gather local data for the purpose of sharing and assisting intelligent applications, such as autonomous driving.These vehicles are denoted as N = {1, .., n, .., N }.
As shown in Fig. 1, the edge layer is divided into multiple regions based on geographical locations, where each region is denoted as k l .Each region comprises one BS and several RSUs.These regions collaborate and parallel process data sharing tasks to improve the system efficiency.Each region independently maintains its blockchain to empower the data sharing process, which is carried out in the form of FL to ensure the data privacy of vehicles.Therefore, vehicles only need to share the models rather than the raw data itself.
A two-layer blockchain is implemented at the edge layer.In the lower layer, DAG-based sub-chains maintained by the associated RSUs are deployed in each region for asynchronous model sharing.However, efficient interaction between regions is required due to vehicle mobility and the cross-regional model generalization.Furthermore, the consensus latency of DAG relies on the transaction arrival rate.Therefore, the upper layer consists of a PBFT-based main-chain, which is collectively maintained by BSs in all regions.It is responsible for recording and validating the cross-regional model sharing.
The vehicles communicate with BSs and RSUs through wireless connections for model sharing.The model sharing tasks are divided into two categories: Intra-Regional (IR) sharing and Cross-Regional (CR) sharing.Correspondingly, RSUs are responsible for the IR sharing tasks within regions, while BSs handle the CR sharing tasks.The entire process of model sharing is recorded by the hierarchical blockchain.

III. MULTI-REGION ASYNCHRONOUS SWARM LEARNING
Due to the mobility of vehicles, the IoV network topology is dynamic, and a secure asynchronous data sharing mechanism is necessary to ensure the stability and security of model aggregations.Additionally, in the IoV scenario, data from vehicles are typically Non-IID, and this property is not only evident among vehicles but also exists between regions.Moreover, considering the mobility of vehicles, an efficient CR authentication and sharing mechanism is necessary to enable rapid collaborations between regions, thereby improving the model generalization.
To address these issues, a Multi-Region Asynchronous Swarm Learning (MASL) framework is proposed, which could achieve efficient and secure asynchronous model sharing and authentication by the IR and CR sharings.All shared models are recorded in the form of the site within the DAG, and the connections between sites in the DAG topology establish the verification and aggregation relationships, meaning that the model in a site is trained by aggregating the models from the connected sites.The MASL process consists of three phases: model downloading, local training, and model uploading.Each vehicle will perform these three phases asynchronously.

A. Model Downloading Phase
To obtain the latest models, firstly, vehicle n initiates a model downloading request to RSU m: where ϕ = 0 represents the IR sharing request.The tuple (Ad n , Ad m ) represents the blockchain addresses of vehicle n and RSU m, respectively.The tuple (k 1 , k 2 ) represents the local and target regions respectively, and k 1 = k 2 when ϕ = 0.
In addition, ϕ = 1 represents the CR sharing request, which will be forwarded to the BS for processing.The signature Sig n by vehicle n ensures the integrity of the request.Then, the Tips in the DAG will be packaged and sent back to the vehicle n and the return vector is as follows: ( As shown in Fig. 2, when ϕ = 0 (IR sharing), RSU m will package and sign the Tips in the local DAG and return them to the vehicle n, where T k1 being the Hash value list of these Tips.When ϕ = 1 (CR sharing), the request will be processed by the local BS.It firstly obtains Tips from the DAG in the target region k 2 and then packages the Tips from the local DAG together to return to the vehicle n.T k1 and T k2 are the Hash value lists for the Tips in local and target regions, respectively.Sig k1 and Sig k2 represent the signatures of BSs of regions k 1 and k 2 , respectively.In this process, only α tips are usually needed instead of all the tips to ensure that the communication delay is within a tolerable range.

B. Local Training Phase
As shown in Fig. 2, after receiving Tips, vehicle n will select some Tips according to the Tips Selection Algorithm (TSA), such as MCMC-TSA [10], the reputation-based weighted walk [4] and the reversed two-hop TSA (RTH-TSA) [11].In order to prevent malicious attacks and achieve rapid model convergence, we propose an Accuracy-based Weighted TSA (AW-TSA).The probability of Tip i being selected P i is given by: where A i is the model accuracy of Tip i that is evaluated by RSUs during the model uploading phase a small dataset.β is the amplification factor.Specifically, ϕ = 0 (IR sharing), vehicle n will select two Tips from T k1 based on the AW-TSA.When ϕ = 1 (CR sharing), it will select one Tip from T k1 and T k2 , respectively.Secondly, vehicle n will verify the effectiveness of these two Tips and extract the model ω 1 and ω 2 for aggregation: where A 1 and A 2 are the weight factors representing the accuracy of two models from Tips.Vehicle n will train the model ω based on its local dataset D n to update the model ω ′ .The gradient descent method is used to minimize the loss function F n (ω) in D n with learning rate η: Finally, vehicle n will package the updated model ω ′ as a site and sign it, then send it to RSU: where tuple (σ n , σ m ) represents the request vector pairs during the model downloading phase, which record the entire process of the model download.(H 1 , k 1 ) and (H 2 , k 2 ) represent the Hash values and regions of the selected two Tips, respectively.

C. Model Uploading Phase
To record the model to the blockchain, firstly, the RSU will validate the received site and evaluate the model accuracy using a small dataset D 0 , which could determine the more "promising" direction of the global model update [12].This accuracy will serve as the benchmark for the AW-TSA during the local training phase.Then, the RSU will run a simple PoW and add header information for the site.Finally, it will be broadcasted and added to the local DAG.
When ϕ = 1 (CR sharing), the site needs to be further processed by the BS.The BS l will bundle the site Hash value along with the chosen two Tips Hash value into a block: where H, H 1 and H 2 represent the Hash values of the site and two selected Tips.Then, the block is added to the main-chain through PBFT consensus among the BSs that ensures the reliability of the global record and validation of the CR sharing site.
For the CR sharing, the CR site is initially recorded in the DAG.However, its validity is difficult to verify because the selected Tips are not in the same DAG.Therefore, in the CR site verification process, it is necessary to obtain the associate supporting block from the main-chain.Moreover, the site released by the vehicle with invalid identities will not be recognized and be isolated.Thus, through the CR sharing, the MASL could effectively address the issue of the CR identity verification and transfer the endorsement mechanism from the centralized server to the edge.

D. System Performance Analysis
In this part, the theoretical analysis of the average latency and security of the AW-TSA is provided.Let N , M represent the number of vehicles and RSUs, k represents the number of regions.Then, M k is the number of RSUs in each region.Moreover, let p represent the proportion of the CR sharing, and α is the number of selected Tips in the model downloading phase.Additionally, an iteration is defined as a vehicle participating in an IR or a CR sharing process.
1) Average Latency: Assuming S dw and S up are the downlink and uplink transmission rates of vehicles, τ RSU and τ BS are the latency for transmitting one byte between RSUs and between BSs, respectively.D is the site size.Accordingly, the model downloading latency of the IR and the CR sharing are given by αD/S dw n,RSU and αDτ BS + 2αD/S dw n,BS , respectively.Besides, the model upload latency is D/S up n,RSU .Moreover, the consensus latency for DAG and PBFT are D( M k −1)τ RSU and 3µDτ BS ×5, respectively, where µ is the Hash compression ratio, and µ ≪ 1.Therefore, The average latency per iteration for the IR and the CR sharing are given by: Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
where T loc is a constant representing the local computing latency.Therefore, T IR , T CR and τ RSU are decreasing functions of k.The average latency for one iteration T is: Although increasing p could improve the model generalization, it also increases T .Furthermore, p and τ BS are increasing functions of k, thus k should be limited.
2) Security of AW-TSA: Assume i out of α are malicious Tips (i < α).According to the AW-TSA, the probability of malicious Tips not being selected P (i) is given by: where A and B (A ≫ B) are the average model accuracy of the normal and malicious Tips, respectively.Assuming δ is the proportion of malicious vehicles in the network, and 2λh is the current number of Tips in DAG [10], where λ is the site arrival rate and h is the average time for iteration.Then, The number of normal and malicious Tips are θ = 2λh(1 − δ) and ϵ = 2λhδ, respectively.The number of malicious Tips selected by RSUs or BSs is subject to the hypergeometric distribution: X ∼ H(2λh, α, i).Therefore, the probability of the AW-TSA selecting normal Tips is: Obviously, a reasonable β could effectively increase P and P ′ .When β → +∞, , P ′ only depends on α, and P ′ is an increasing function of α.However, a large β could reduce the model generalization, while a large α could increase T according to formula 8. Therefore, the appropriate value of α and β should be assigned to balance the tradeoff between P ′ and T in the actual scenario.

IV. SIMULATION AND IMPLEMENTATION
In this section, we evaluate the proposed MASL with comparison algorithms through the simulation platform to verify its performance.Furthermore, we proceed to develop and deploy the MASL application program on the hardware testbed to assess its effectiveness by multiple datasets.
A. Simulation Setup 1) Network Initialization: Consider 100 vehicles in the IoV scenario which are uniformly deployed in two regions.These vehicles possess local data and actively participate in the sharing process.The states of these vehicles are uncertain, thus there could have malicious behaviors.
2) Datasets and Models: The proposed MASL framework is evaluated on the Traffic Signs Pre-processed dataset based on GTSRB [13], which is divided and assigned to 100 vehicles randomly.According to the actual IoV scenarios, the assigned data distribution between regions is greatly Non-IID, while within a single region is moderately Non-IID.The Convolutional Neural Network (CNN) model LeNet is adopted for the model training.3) Comparison Algorithms: To evaluate the performance of the MASL framework, FL [3], BlockFL [7], DAG-FL [8], PermiDAG [4] and WU-layered FL [9] algorithms are used for comparisons.In the FL, 10% vehicles are selected to participate in the model training.Similar to the MASL, the WU-layered FL is divided into two regions with 50 vehicles per region.The FL, DAG-FL, BlockFL and PermiDAG have 100 vehicles in the whole region.

B. Simulation Results
Define the latest model accuracy of Tips in the DAG within one region as the current global accuracy.Fig. 3(a) illustrates the test accuracy versus iterations for different p of MASL.The model interaction between regions increases with increasing p, while the convergence of the model requires fewer iterations.This implies that the CR sharing effectively mitigates the data Non-IID problem between regions.Furthermore, a small p could greatly improve the model generalization.However, as p increases, the communication costs will increase as shown in Fig. 3(b).In this case, the gains in generalization and convergence speed become less significant.Therefore, in practical deployments, p should be set within a reasonable range through incentive mechanisms to improve system efficiency.

C. Hardware Testbed Result
In order to illustrate the feasibility of MASL, a practical platform is implemented to achieve MASL on a real testbed with two Servers and ten Onboard computers, as shown in Fig. 6(a).The Servers work like the BS that maintains one region and monitors the state of the system in real time through a web-based visualization platform, including the DAG topology, current model accuracy, and other relevant information.The Onboard computer deployed on the vehicle with privacy data, and each region is assigned five Onboard computers.The dataset is distributed to ten Onboard computers, and the performance of the MASL on multiple datasets is observed through the visualization platform.As shown in Fig. 6(b), the performance of the MASL with different datasets on hardware platforms is similar to the simulations, indicating its efficiency in the Non-IID scenario.Fig. 6(c) shows the number of Tips in one DAG versus iterations, demonstrating that the DAG of MASL can operate stably in the actual deployment.
V. CONCLUSION In this letter, we have proposed the MASL framework empowered by hierarchical blockchain for large-scale data sharing in the IoV scenario.The MASL integrated blockchain, EC, and FL technologies to ensure the security and privacy of the sharing process.By coordinating the IR and the CR sharing, secure asynchronous model training and identity authentication have been achieved, and the Non-IID data problem between regions has been alleviated.In addition, empowered by the DAG, the MASL is a fully asynchronous system and could effectively respond to abnormal vehicles in IoV.Both the simulation and hardware testbed results verified the superior performance of the proposed MASL framework.

Fig. 3 .
Fig. 3. (a) Accuracy versus iterations for different p (p is the proportion of CR sharing).(b) Average communication costs per iteration versus p.

Fig. 4 .
Fig. 4. (a) Accuracy versus iterations for different algorithms.(b) Communication costs versus the different number of vehicles.

Fig. 4 (
a) illustrates the accuracy versus iterations for different algorithms.The fluctuation of the curves reflects the sensitivity of algorithms in the Non-IID scenario.The MASL and PermiDAG could effectively mitigate the accuracy fluctuations caused by the Non-IID data.The FL and BlockFL demonstrate faster convergence speeds, while the DAG-FL exhibits slower convergence speed due to its TSA.Due to the lack of CR-sharing mechanisms, the WU-layered FL shows poorer model generalization.Although the convergence speed of MASL is not the fastest, the increase in communication costs with the number of vehicles is slight, as shown

Fig. 5 .
Fig. 5. (a) Accuracy of different algorithms with 10% poisoning attacks.(b) Accuracy of MASL with different proportions of poisoning attacks.