Rear-end collisions are a threat to road safety, so reliable collision avoidance technologies are essential. Traditional systems present several issues due to data loss and privacy concerns. The authors introduce an encrypted artificial neural network (ANN) method to prevent front-vehicle rear-end collisions. This system uses encryption techniques and ANN algorithm to recognize the front vehicle brake light in real time. Information can't be deciphered without the appropriate key using encryption. Intercepting data during transmission prevents reading. The system works day and night. ANN outperforms LR, SVM, DT, RF, and KNN in accuracy. An encrypted ANN-based ML model distinguishes between brake and normal signals. ANN accuracy was 93.7%. Driver receives further alerts to avoid rear-end collisions. This work proposes a lightweight, secure ANN-based brake light picture encryption method. The proposed approach may be applied to other collision circumstances, including side and frontal strikes. The technique would be more adaptable and applicable to many road safety circumstances.