## 4 Results
### First Scenario: Video with a Passenger Getting off the Bus
This graph helps pinpoint the specific moments in the video where errors occur, which can be valuable for further fine-tuning the model. By identifying the periods of misclassification, the model can be adjusted to reduce false positives (incorrectly recognizing activities like falling) and improve overall accuracy. Figure 7: Frequency of activities recognized by the ML-RF model throughout the video. Given that the videos are recorded at 60 frames per second, the x-axis in Figure 9 is divided into groups of 60 frames, corresponding to each second of the video. The graph shows the activities predicted by the ML-RF model for each 60-frame block. From the graph, it is clear that activities recognized with less frequency are displayed with lighter colors. These less frequent activities are often the ones that the model misclassifies or identifies only sporadically. To improve the interpretation of the prediction for each 60-frame block, the data are normalized, as shown in Figure 10.  
Normalization helps provide a clearer view of the activity distribution across the video by scaling the predictions into a range that highlights relevant activities and reduces the influence of sporadic misclassifications or noise. This process ensures that activities with lower recognition frequency do not dominate the analysis and allows for a more accurate representation of the most significant actions in the video. Figure 8: Activity recognition performed by people in the video over time. Figure 10: Normalized grouping of activities recognized per 60 frames (1 s). Figure 9: Grouping of activities recognized every 60 frames (1 s). By normalizing the data, the analysis can focus on the most consistent and relevant predictions, making it easier to understand the model's behavior over time. This approach also helps filter out irrelevant activities and provides a more reliable overview of the video's events. In Figure 11, the predictions made by the ML-RF model are normalized for every 60 frames by dividing the predictions by 60. From Figure 10, it can be concluded that activities that do not actually occur in the video, such as falling, have very little weight in each block of the graph. Therefore, to consider a recognized activity as relevant, it is assumed that for each second of the video (60 frames), the same activity must be recognized in at least half of the frames (>0.5). This means that if the activity for each second of the video shows a number higher than 0.5, it indicates that the activity was recognized in the majority of the 60 frames. On the other hand, if the number is lower than 0.5, it means that the activity was recognized in less than half of a second, and thus, it can be considered an irrelevant prediction. Taking this into account, activities with a weight below 0.5 are approximated to 0, and activities with a weight greater than 0.5 are approximated to 1. The graph in Figure 11 shows the approximated activities for each second of the video. This normalization and thresholding process helps improve the robustness of the model by filtering out minor or false positive predictions (such as the activity of falling when it did not actually occur), focusing only on those activities that are clearly visible and consistent in the video. With the approximated activities (Figure 11), we can observe the relevant activities recognized by the ML-RF model for each second of the video. The graph in Figure 11 shows a clear representation of the activities that have been consistently identified over time, where values closer to 1 indicate that the activity was recognized across most of the frames in that second. On the other hand, values closer to 0 reflect activities that were either only detected briefly or were misclassified, making them less relevant for further analysis. This visualization allows us to pinpoint which activities the model consistently recognized, and which were not as clearly identified.