## 2 Materials and Methods
### Method  
Figure 3 shows how the model was created and how AI CCTV worked. DRAS can detect traffic accidents on the road and blockages, such as stones on the road, and alert app users. The hardware configuration for real-time vehicle accidents and model learning of the road obstacle notification system DRAS is Intel i7-9750H 2.60 GHz, 16 GB RAM, and GeForce RTX 2060. For model learning, the software uses the deep learning framework Darknet. Through the Daily Blockchain company, 1200 black boxes and CCTVs were provided with video footage of accidents in Korea and abroad. To extract frames from these images, FFmpeg was used to capture multiple moments of vehicle accidents in the image. Because each car accident had a different area of collision or reason for the accident, classification was needed according to the picture of the car accident. There were four categories of collision: head-on collision, rear-end collision, side collision, and collision after rotation alone. Among them, the image quality of the images related to the frontal collision of the front part of the car was high, and the number of data was high. Therefore, 700 images related to head-on collision were collected. The training data were set as 600 photos, and the test data were set as 100 photos. Nevertheless, there was not a lot of photo data from head-on collisions. Therefore, the number of images was increased using image rotation. It was incremented by more than 2000 images through a rotation of 90 degrees and 180 degrees. \begin{table}
\begin{tabular}{c c} \hline \hline
**Category** & **Items** \\ \hline Image acquisition and analysis & OpenCV, FFmpeg \\ Deep learning (image processing) & YOLOV3, DarkNet \\ Server-client & HTTPRequest, FCM \\ Server & Django, Flask \\ UI/UX & Figma, Axure \\ API & Web app, Naver Map API, Google Map API \\ Web hosting & PythonAnywhere \\ Programming language & Python, HTML, Javascript \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Development terms. Figure 3: Flow chart about the detection model and the DRAS alarm system. After that, image labeling was carried out using a car accident that occurred in a head-on collision as an object. I have labeled only the car crash, so I have been working on it for four hours. The class was set to one as 'car_accident', and the weights were determined to have a mAP (mean average precision) of 82.36% based on an IoU (intersection over union) threshold of 50%. Because it is trained through the YOLOV3 model, it was conducted through the pre-learning model of Darknet53. It took about 5 h to train the YOLO model. The YOLOV3 custom weights file learned through the Darknet framework was converted into a TensorFlow model. The converted model was set up to save the photo after assuming that a traffic accident occurred when the core reached 0.7 or higher in detect_video.py. However, saving pictures with 0.7 or higher scores per frame increases the data to be transferred, so only images with 0.7 or higher scores per 40 frames are implemented. The model learned is uploaded on Flask and Django servers. With CCTV test images implemented on servers, it sends warning notifications via FCM and POST upon the detection of obstacles and accidents. Through this, it displays a notification window on the Web application around the location of the accidents with a message for caution about the accidents and a frame about the detected situation. The model implements the new object-detection algorithm by using YOLO. YOLO is a deep neural network designed to perform object detection, which can obtain information about the type and location of objects with a single look at the image. An object-detection algorithm is used in this process to compute the object probabilities about several bounding boxes presented in a single network. The object-detection algorithms have been divided into region proposal and classification, but YOLO can skip the region proposal and can perform object detection at once.