## 6 Experimental Results and Analysis
### Analysis of Load Balancing Based on Genetic Algorithm  
In order to avoid human interference and make the agent's task amount more objectively, the experiments were simulated by randomly assigning 6, 8, 12, 16, 20, 24, and 28 videos to four agents. The total number of pedestrians in all the videos handled by four agents was 10, 16, 24, 31, 37, 42, and 49. In the experiment, each agent first counts the number of videos it processes and the number \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Number of Pedestrians** & **2** & **3** & **4** & **5** & **6** \\ \hline Average time on the agent side (s) & 0.0213 & 0.0318 & 0.0466 & 0.0538 & 0.0648 \\ Average time on the server side (ms) & 0.1492 & 0.2688 & 0.3156 & 0.3674 & 0.4566 \\ Transmission time from agents to server (s) & 0.0089 & 0.0149 & 0.0216 & 0.0301 & 0.0365 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The average processing time on the agent side, the recognition time on the server side, and the transmission time from agents to the server with different number of pedestrians. Figure 6: The recognition results. of pedestrians in each video. The statistics are then sent to the server by agents. Finally, the server reassigns the videos to each agent by applying load balancing algorithms. Therefore, the results of the experiment are mainly affected by the equalization algorithm. Load balancing algorithms are the particle swarm optimization (PSO), the improved genetic algorithm (MGA), and the random partition method (RPM). Here, we analyze the performance of the load balancing algorithm by comparing the processing time and CPU utilization. The results are shown in Figure 7.  
Figure 7a shows the average time for processing a frame in a video. As the number of pedestrians increase, the average time becomes longer. Generally, after using the MGA for task equalization, the average time is reduced by 20.36% compared to the RPM and 9.71% compared to the PSO. The PSO occasionally experiences instability during task processing, which leads to long average time, and the MGA has advantages in stability. Figure 7b shows the average time to identify a pedestrian in one video frame. With the number of pedestrian increases, the average time for processing a pedestrian becomes shorter. Figure 7c shows the comparison of CPU utilization on the server side. The server-side CPU utilization is affected by the number of times the connection function is executed. The agent calls a connection function for each face image. Therefore, the more times the server executes the connection function, the higher its CPU is utilized. By using MGA, the average CPU utilization in the agent side is about 24.85% lower than RPM's and10.63% lower than PSO's. Figure 7d shows the comparison of the maximum CPU utilization among the four agents. When the total number of pedestrians in the video reaches to 49, the maximum CPU utilization at the agent side is almost 100% by using the RPM, whereas that using the PSO's is 76.73%. The MGA's is 67.65%, which is obviously lower than the previous two methods. Figure 7: Performance comparison of processing time and CPU utilization for different number of pedestrians in videos. (**a**) Comparison of the average time for processing a frame; (**b**) comparison of the average time to identify a pedestrian; (**c**) comparison of the CPU utilization on the server side; (**d**) comparison of the maximum CPU utilization among the four agents. From the above experimental results, we can see that compared to RPM, both PSO and MGA can balance the agent tasks better, and can effectively improve the efficiency of the agent-based distributed face recognition model. Here, RPM randomly distributes videos to each agent. As the number of videos increases, their actual allocation effect is getting closer to assigning an average number of videos to each agent.