Abstract
This paper presents an active safety warning system for two-wheeled motorcycles that integrates YOLO v4 image recognition technology with a heuristic weighting mechanism (HWM) model to calculate risk scores and thus alert riders. The system's analytical core is based on the NVIDIA Jetson TX2 module, with a camera mounted on the left-side rearview mirror of the motorcycle. YOLO is used to identify the type of approaching vehicle and measure the distance between the vehicle and the motorcycle. Moreover, the HWM model takes inputs such as vehicle type, spacing between the motorcycle and the vehicle, motorcycle speed, and distance from the intersection to generate potential risk scores. After training, the YOLO model for vehicle recognition achieved a mean Average Precision (mAP) of 92.78% at an Intersection over Union (IoU) threshold of 0.5. Additionally, the camera mounted at a 30° angle could clearly capture vehicles approaching from the left rear side of the motorcycle, achieving the highest vehicle recognition rate. Moreover, the HWM model generates a reasonable risk score to advise the rider to decelerate when the motorcycle is traveling at high speed with a vehicle approaching from behind, thereby reducing the risk of an accident and enhancing the safety of the motorcyclist.