## 3 The Proposed Framework
### Anomaly Detection
#### 3.2.2 Classifier
For instance, a single pathway that is changed to a normal road or the introduction (or removal) of an element in the background. Another example can be the authorization of temporary interactions in an environment such as maintenance works that may create false alarms due to the use of special machines and uncommon tools. To the best of our knowledge, this problem was skipped in previous algorithms. That is why we proposed an adaptive method robust to any evolution of the surveilled scene. As seen in Figure 5, this method allows to reconsider false alarms obtained during the test process, i.e., if a patch is declared as a false alarm, the operator can declare its feature vector as a vector of interest to be included in the balanced distribution. This will avoid its future detection as abnormal. Figure 5: Robustness to false alarms. ``` Selection of Vectors of Interest; F=[\(F_{i};F_{i-1};F_{i-2}\)]; X=FeatureExtraction (F); C=X(1:N); my=mean(C); Q=inv(cov(C)); fori=N:841 do \(dist_{i}\)=(X(i)-moy)*Q*(X(i)-moy)'; ifsqrt(\(dist_{i}\)> \(\alpha\))then C(size(C,1)+1)=X(i); my=mean(C); Q=inv(cov(C));  end if end for each new frame \(F_{i}\)do F=[\(F_{i};F_{i-1};F_{i-2}\)]; X=FeatureExtraction (F); fori=1:841 do \(dist_{i}\)=(X(i)-moy)*Q*(X(i)-moy)'; ifsqrt(\(dist_{i}\)> \(\alpha\))then C(size(C,1)+1)=X(i); my=mean(C); Q=inv(cov(C));  end if end for  end for Distributionprunning; my=mean(C); Q=inv(cov(C)); fori=1:size(C,1)do \(dist_{i}\)=(C(i)-moy)*Q*(C(i)-moy)'; ifsqrt(\(dist_{i}\)< \(\eta\) * \(\alpha\) ; (0<\(\eta\)<1))then C(i)=[ ];  end for  end for Abnormal event detection; for each new frame \(F_{i}\)do  my=mean(C); Q=inv(cov(C)); fori=1:841 do \(dist_{i}\)=(C(i)-moy)*Q*(C(i)-moy)'; ifsqrt(\(dist_{i}\)> \(\beta\))then \(Patch_{i}\) is Abnormal;  end if end for  end for Furthermore, as any other methods of abnormal event detection, misdetections could also occur while using the proposed framework. That is why we propose as a next step its improvement into a semi-supervised model. Indeed, when the model generates misdetection, the CCTV operator can declare it as abnormal. i.e., the feature vector representing this event will be used to create a second distribution representing misdetected events. Thus, one can get two distributions representing normal and misdetected events. Consequently, to labelize a new event as normal, its feature vector should respect two conditions: The similarity between this new feature vector and the original distribution representing normal events should be established, and we should get a non-similarity with the new distribution representing the misdetected events. Thus, this operation will decrease misdetections and increase the performance of our proposed method. The implementation of this semi-supervised model will be developed in future work. ## 4 Results and Comparisons

In order to implement our methodology, we used Matlab and _caffe_ for the deep learning part [36]. We also implement our algorithm in C++ for real time detection. We tested our methodology on UCSD Ped2 Anomaly Detection Dataset and we apply it also for a real case of laboratory surveillance \"CapSec dataset\". The local dataset \"CapSec\" was constructed in our laboratory using a fixed camera. It represents daily behavior of students and researchers inside the laboratory. The image resolution is 1280 \(\times\) 720 pixels. It has training folders that contain only normal events and testing folders which also contains anomalies like falling people and objects that are not present in the training phase. One can see in Figure 6 some qualitative results. UCSD Ped2 \"([[http://www.svcl.ucsd.edu/projects/anomaly](http://www.svcl.ucsd.edu/projects/anomaly)]([http://www.svcl.ucsd.edu/projects/anomaly](http://www.svcl.ucsd.edu/projects/anomaly)))\" represents complex behaviors including pedestrians. It contains 16 and 12 folders for training and testing phases resepctively. The training folders contain only normal events of pedestrians. However, the test folders also contain abnormalities such as skaters, bikes and cars.