## 3 The Proposed Framework for Anomalous Event Recognition
### Proposed Joint Learning Model and Multiple Ranking Measures (MRMs)
#### 3.3.3 Proposed Multiple Ranking Measures
Moreover, segment-level or instance-level annotations are not required in these ranking conditions. In addition to these ranking conditions, there is one more ranking measure condition, Similarity Measure \((\mathrm{SM})\), which needs to be considered, as follows:  
\[SM(S_{n})=\sum_{i}^{n-1}\left(R\left(S_{n}^{i}\right)-R\left(S_{n}^{i+1}\right) \right)^{2} \tag{8}\]  
Equation (8) refers to the fact that consecutive instances of a negative group should have similar features. Therefore, the model should predict approximately the same abnormality score (close to zero) for all such instances. This condition forces the network to learn the similarity of features among the instances of a negative group, leading the network to understand the similarity among the instances of positive groups. To define MRMs, all predicted abnormality scores of negative group instances should be kept far apart from all the positive group instances. Consequently, MRMs \((MRM)\) is a combination of all the aforementioned ranking condition measures. Therefore, the MRMs is defined as the following hinge loss formulation and satisfy all the ranking measure conditions as mentioned earlier from Equations (3)-(8) except Equation (7):  
\[MRM(S_{a},S_{n})=rm_{1}(S_{a},S_{n})+rm_{2}(S_{a},S_{a})+rm_{3}(S_{a},S_{n})+ \gamma_{1}SM(S_{n}) \tag{9}\]  
where \(\gamma_{1}\) is the model's hyper-parameters, and ranking measures \(rm_{1}(S_{a},S_{n}),rm_{2}(S_{a},S_{a})\), \(rm_{3}(S_{a},S_{n})\), and \(rm_{4}(S_{a},S_{n})\) are described in Equations (10)-(13), respectively, as follows:  
\[rm_{1}(S_{a},S_{n}) =\max\left(0,1-\max_{i\in S_{a}}R\left(S_{a}^{i}\right)+\max_{i\in S _{n}}R\left(S_{n}^{i}\right)\right) \tag{10}\] \[rm_{2}(S_{a},S_{a}) =\max\left(0,1-\max_{i\in S_{a}}R\left(S_{a}^{i}\right)+\min_{i\in S _{a}}R\left(S_{a}^{i}\right)\right)\] (11) \[\max_{i\in S_{a}}R\Big{(}S_{a}^{i}\Big{)}>\max_{i\in S_{n}}R\Big{(}S_{n}^{i} \Big{)} \tag{3}\]0 (12) \[\max_{i\in S_{a}}R\Big{(}S_{a}^{i}\Big{)}>\max_{i\in S_{n}}R\Big{(}S_{n}^{i} \Big{)} \tag{3}\]1  
The ranking loss mentioned by [PERSON] et al. [14] does not consider both cases of false alarms. Considering both cases result in a reduced false alarm rate for our network in comparison to [14]. Yet similarly to [14], the two following constraints \((\varepsilon_{1}\) and \(\varepsilon_{2})\) are utilized in order to preserve the sparsity \(\varepsilon_{1}\) in Equation (14) and temporal smoothness \(\varepsilon_{2}\) in Equation (15) of the abnormality score:  
\[\max_{i\in S_{a}}R\Big{(}S_{a}^{i}\Big{)}>\max_{i\in S_{n}}R\Big{(}S_{n}^{i} \Big{)} \tag{3}\]2  
\[\max_{i\in S_{a}}R\Big{(}S_{a}^{i}\Big{)}>\max_{i\in S_{n}}R\Big{(}S_{n}^{i} \Big{)} \tag{3}\]3  
where \(\gamma_{2}\), and \(\gamma_{3}\) are the model's hyper-parameters. Therefore the new proposed objective function using MRMs for the DMIL can be defined as follows:  
\[\max_{i\in S_{a}}R\Big{(}S_{a}^{i}\Big{)}>\max_{i\in S_{n}}R\Big{(}S_{n}^{i} \Big{)} \tag{3}\]4  
Finally, our proposed objective function, along with a regularization term, is mentioned as follows:  
\[\max_{i\in S_{a}}R\Big{(}S_{a}^{i}\Big{)}>\max_{i\in S_{n}}R\Big{(}S_{n}^{i} \Big{)} \tag{3}\]5  
where \(\mathbf{W}\) represents model weights and \(\gamma_{4}\) is the model's hyper-parameters. Consequently, the network learns to predict the abnormality scores for all instances or samples of both groups using the aforementioned objective function for DMIL and using a large number of positive and negative instances from the training dataset. With our proposed framework, DMRMs, the network learns the context-dependency of the normal and anomalous videos (shown in Section 4.4.2). The framework also addresses the problem of the unavailability of a large annotated dataset by exploiting the video-level annotations. **Inference Phase**  
During the inference phase, the video is given to the proposed framework (DMRMs), and its motion flow maps are then extracted. These maps, along with the video, are divided into temporal segments.