# GLBRF: Group-Based Lightweight Human Behavior Recognition Framework in Video Camera
## 4 Proposed System
### System Procedure  
The flowchart of GLBRF is shown in Figure 6. First, the _people detection_ function receives each frame of the video as input and recognizes objects using the YOLO model. If a person is recognized among the recognized objects, it outputs a bounding box with  
Figure 4: General process of behavior recognition using deep learning.  
Figure 5: Proposed system architecture.  
the coordinates of the person in the frame (\(x_{1}\),\(y_{1}\),\(x_{2}\),\(y_{2}\)). If the person is not recognized, the centroid coordinates cannot be calculated, so the frame must be repeated until the person is recognized. The _centroid coordinates calculation_ function calculates the center coordinates (\(x\),\(y\)) using Equation (1) and the \(x_{1}\),\(y_{1}\),\(x_{2}\),\(y_{2}\) coordinates of the bounding box. This center coordinate is used as a point representing the person's location. The _centroid-tracking_ function uses Equation (2) and the centroid-tracking algorithm to track the person's center coordinates in consecutive frames. A maximum Euclidean distance is set as a threshold to determine the same person in the current and previous frames. The threshold is the average width of the bounding box of the recognized people. If the distance is greater than the threshold compared to the center coordinates of the previous frame, the person is determined to be a new person and assigned a unique ID. If the distance is not greater than the threshold, the person with the closest center coordinate is determined to be the same person and assigned the ID of that center coordinate. The _grouping_ function groups people who belong to the same group in the current frame. It again sets a maximum Euclidean distance as a threshold to determine the same group. The threshold is based on arm length, considering the distance at which people interact with each other. The arm's length is based on the \"8 th Domestic Body Size Survey\" by Size Korea, an institution providing standard body size data for Koreans under the Korea Agency for Technology and Standards (KATS) [28]. They stated that the average arm length is about 1/3 of a person's height. Thus, the distance determining proximity between people in the _grouping_ process is set to 2/3 of the average height of the detected people. If the Euclidean distance between all centroid coordinates in the current frame is below the threshold, they are deemed to be in the same group. The _behavior recognition_ function identifies specific behaviors using the behavior recognition training model. The current system's behavior recognition training is constructed by labeling each group's behavior using MobileNetV2 as the behavior recognition model. The behavior of all groups in each frame of the video is recognized based on a specific number of frames. The _classification_ function classifies behaviors for each group by repeating based on a specific number of frames. The behavior recognition results (behavior classes) from the _behavior recognition_ function are stored for each group in each frame. For each group, the behavior class recognized most frequently over a specific number of frames is classified as the behavior for that entire frame span.