## 3 Materials and Methods
### Person Detection and Subject Anonymization  
For a system focused on crucial safety tasks like monitoring elderly people, picking the right machine learning model is important. It needs to be not only real-time and reliable but also computationally efficient. After looking into several options, this study chose YOLOv8 for its strong ability to detect people and estimate their poses in real time. Developed by Ultralytics and released in January 2023, YOLOv8 [60] has quickly become a favorite in both practical applications and academic research, due to its reliable and accurate detection and classification capabilities. Several researchers have used YOLOv8 for multiple tasks, including multi-object pedestrian tracking [61], student behavior detection in classroom [62], road defect detection [63], safety helmet detection [64], and human pose estimation [65]. The YOLOv8 architecture, shown in Figure 3, is designed to be efficient and not demanding on system resources, meaning that it can run smoothly on various types of hardware, from personal computers to more powerful GPU-based systems. This flexibility is vital for ensuring that the proposed elderly monitoring system can operate effectively across different settings without needing specialized equipment. The YOLOv8's architecture consists of IP camera-to-fine (c2f) modules, which allow the model to first identify larger, more general areas where a person might be (the \"coarse\" part) and then refine its focus to detect finer details within those areas (the \"fine\" part). This approach is particularly effective for identifying not just the bounding boxes that indicate where a person is in a video but also the specific pose keypoints or body joints. In our proposed system for elderly monitoring, the subject anonymization process was developed using the YOLOv8 model's capabilities. The algorithm, as shown in Figure 4, initiates by setting a background image filled entirely with black pixels, creating an empty buffer for the background of subsequent frames. As the system processes each frame of the video stream, it employs YOLOv8 (yolov8s-pose.pt) to detect bo  
Figure 3: YOLOv8 model used for person bounding box detection and pose keypoint estimation. in the frame. The original model is converted to support the open neural network exchange (ONNX) runtime to increase the inference speed across CPU and GPU architectures. This step identifies the regions within the frame that require anonymization or privacy protection. Following detection, the algorithm assesses whether any individuals have been identified. If they have, it proceeds to selectively update the regions within these bounding boxes using content from a predefined or updated background buffer image, effectively anonymizing the subject by replacing their visual representation with backgrounds of previously acquired frames. Conversely, if no individuals are detected within a frame, the algorithm updates the entire background buffer with the current frame, refreshing the scene in the absence of significant foreground activity. This dynamic updating mechanism allows the system to maintain an up-to-date background representation of the monitored environment. For frames where individuals are detected, the system further uses human pose keypoint data to extract the joint angles of the skeleton representation. Leveraging this information, the algorithm adjusts a 2D avatar to match the detected pose, overlaying this avatar within the bounding box in place of the person's image. Moreover, the area  
Figure 4: Flowchart of subject anonymization technique used for elderly privacy protection. outside the detected bounding boxes is utilized to update the existing background buffer image, ensuring that the scene information remains current in each frame. This step not only preserves the anonymity of the monitored individual but also retains a visual cue of their activities and movements, which is crucial for monitoring well-being and detecting potential emergencies.