## 3 Proposed Algorithm
### Hand Patch Extraction Based on HPE
The VISILAB video dataset is used to fit the function in Equation (1) consists of 259 videos, categorized into two classes: _'handgun'_ (141 videos) and _'no gun'_ (118 videos). We introduce the following notation: Let \(M\in K\) represent the number of subject tracks  
Figure 5: Distance based patch size estimation: (**a**) patch of observed hand changes w.r.t. the distance between the subject and the camera. This relation can be described by a second order polynomial; (**b**) second order polynomial function used to fit the function; (**c**) graphical representation of fitted function and (**d**) residual plot of predicted values. The variable patch sizes computed for VISILAB _no gun_ and _handgun_ dataset are shown in Figure 6.  
captured by different cameras, where each track has a length \(N_{m}\in\mathbb{N}\), with \(m\in\{1,\cdots,K\}\). The distance and patch data are represented as observation pairs:  
\[\underbrace{\left(d_{1}^{1},r_{1}^{1}\right),\cdots\left(d_{N_{1}}^{1},r_{N_{1} }^{1}\right)}_{\text{1.4 subject}}\underbrace{\left(d_{1}^{2},r_{1}^{2}\right), \cdots\left(d_{N_{2}}^{2},r_{N_{2}}^{2}\right)}_{\text{2.4 subject}}\cdots \underbrace{\left(d_{1}^{K},r_{1}^{K}\right),\cdots\left(d_{N_{K}}^{K},r_{N_{K} }^{K}\right)}_{\text{$K_{\text{th subject}}$}} \tag{4}\]  
Initially, to obtain the distance and patch value pairs \((d,r)\) used for function fitting in Equation (1), a representative and suitable patch size \(r\) must be carefully selected along with its corresponding distance \(d\) from the given subject segment. To ensure a diverse selection, we choose suitable \(r\) and corresponding \(d\) values from the segmented subjects, considering both the minimum and maximum distances from different cameras used in VISILAB video dataset. The graph in Figure 6a illustrates the varying patch sizes extracted from the _handgun_ and _no-gun_ dataset based on the subject's distance from the imaging device. As shown, the patch size is determined automatically for the entire dataset, with a maximum size of 90 \(\times\) 90 and a minimum size of 32 \(\times\) 32. Observing the patches in the left column of Figure 6b, we see that, in some frames, the fixed patch size successfully captures hands holding a gun in the last two cases. However, for other instances, the fixed patch size fails to effectively extract hand details when the subject is closer to the camera. Conversely, as shown in the right column of Figure 6b, when patch sizes are adjusted based on the calculated distance from landmarks, both gun-holding and empty hands are extracted accurately without cropping or oversizing. Once the subject's distance is determined using the measurements between _torso_ landmarks (see Figure 4), the hand patches are extracted based on the confidence values of key landmarks associated with the left and right hands, specifically the (i.e., _wrist, pinky, index_, and _thumb_). This ensures accurate hand patch selection for deep feature extraction while maintaining consistency in deep feature representation. The process for selecting patches for both the left and right hands is as follows:  
* Step-1: For each frame, compute the maximum confidence value of landmarks belong to left and right hand (i.e., _wrist, pinky, index_, and _thumb_ landmarks). Figure 6: Patch sizes computed for VISILAB _no gun_ and _handgun_ dataset: (**a**) patch size vs. distance; (**b**) examples of patches with variable and fixed sizes. * Step-2: Discard patches and landmarks if the computed confidence (computed in step-1) for both left and right hands is below 20%. Frames that do not meet this threshold will be excluded from both the training and testing phases. * Step-3: If one hand (left or right) is not visible, copy the landmark values and patches from the last frame for that hand. This reduces the waste of patches and body landmarks. Therefore, if the confidence for one hand is above the threshold, but the other hand's confidence is below, the information for the invisible hand will be determined by the last frame for that invisible frame.