| As a country with a large number of car owners,China’s traffic safety problems have been relatively serious,causing a large amount of life safety and property damage to society every year.Studies have shown that when people’s emotions fluctuate,their judgment and perception ability are seriously decreased,and drivers’ abnormal driving behavior when angry is easy to cause traffic accidents.The aggressive or angry behavior of drivers is often referred to as "road rage",but it has not been clearly defined by laws and regulations.Accidents caused by "road rage" can only be handled according to the actual situation,which is not conducive to a fair division of accident responsibility.Therefore,strengthening the supervision and guidance of drivers from the source is an effective way to regulate road rage driving behavior.This research focuses on real-time expression recognition in embedded system.Taking drivers road rage emotion warning as the application scenario,an edge computing device with real time anger emotion monitoring function is gradually realized from hardware design,software development,algorithm research and deployment optimization.In brief,this study first designs a compact embedded hardware system according to the functional needs of the device.Then,for the hardware device,the kernel is cut to refine the operating system,and the frame processing workflow is designed to accelerate the pre-process from the camera stream to the neural network input layer using hardware units VPU and RGA;the software architecture of parent-child process monitoring and multi-thread synchronization is also designed to improve the software stability and multi-task parallelism.After that,considering the disadvantages of CNN networks in terms of inference speed and computation volume,this study proposes feature shift operation with multilayer perceptron as the basic structure,and designs a new Token sub-module feature extraction method,which achieves a balance of recognition accuracy,computation volume,number of parameters,and inference speed,and produces a road rage emotion dataset for validating the model generalization ability.Finally,a hybrid quantization approach is used to compact the network model,optimize the AI inference performance in the edge device,and realize the real-time expression recognition and road rage emotion warning function in the embedded system.The experimental results on a 7-classification task on the FER2013 dataset show that the proposed network achieves an accuracy of 70.53% with an inference speed of126 FPS,which is better than other networks in terms of comprehensive performance and more advantageous in the embedded environment.The binary classification recognition of angry and non-angry is examined in a homemade dataset with 81.7%accuracy and better generalization capability.From the demonstration effect,the terminal achieved a facial expression recognition speed of 21.5 FPS at 720 P,and the accuracy of angry expression recognition in simulated scenarios reached over 75%,which can be used for monitoring driver’s road rage. |