# A Deep Similarity Metric Method Based on Incomplete Data for Traffic Anomaly Detection in IoT
## 1 Introduction
A fast and reliable method for anomaly detection and localization in video data showing crowded scenes is described in [10]. In recent years, Convolutional Neural Network (CNN) has been popularized in computer vision and image processing [11; 12; 13]. A new CNN architecture employing an adaptation layer and an additional domain confusion loss to learn a representation that is both semantically meaningful and domain invariant is proposed in [13]. Increasingly, researchers apply CNN to anomaly detection tasks [14; 15; 16; 17; 18]. Combining hand-crafted appearance and motion features with deep features, unsupervised deep learning methods are presented in [14; 17]. [PERSON] et al. reduce the feature dimension when the model is fused, and the nonlinear expression ability of the model is improved [16]. [PERSON] et al. exploit a convolutional sparse model by learning a dictionary of filters from normal images [15]. Anomalies are then detected by identifying outliers from the model. [PERSON] et al. learn a generative model for regular motion patterns using multiple sources with very limited supervision [17]. [PERSON] et al. apply compressed-sensing (CS) theory to generate the saliency map to label the vehicles and exploit the CNN scheme to classify them [18]. Then a fully convolutional feed-forward AutoEncoder is built to learn both the local features and the classifiers. Several works based on similarity metric CNN have achieved excellent results in many scenarios and tasks [19; 20; 21; 22; 23]. Generator Adversarial Networks (GAN) can continuously learn the distribution of simulated data and generate samples with similar distribution of the training data [24; 25; 26; 27]. [PERSON] et al. proposed a class of CNNs called deep convolutional generative adversarial networks (DCGANs) which can learn a hierarchy of representations from object parts to scenes in both the generator and discriminator [24]. [PERSON] et al. extended GAN to the semi-supervised context by outputting class labels from the discriminator network [25]. [PERSON] et al. utilized GAN to learn a transformation in the pixel domain from one domain to the other [26]. [PERSON] et al. proposed the DiscoGAN to exploit relations between different domains so that the style from one domain to another can be successfully transferred [27]. In the past two years, AutoEncoders (AEs) are often used to detect abnormal events, especially in video surveillance [28; 29; 30; 31; 32; 33]. [PERSON] et al. proposed Semantic AutoEncoder (SAE) which project a visual feature vector into the semantic space for zero-shot learning [28]. Their model can also be applied to the supervised problem. [PERSON] et al. combined CNN and AE for cross-dataset transfer learning in person re-identification [29]. Spatio-temporal AutoEncoders are applied to detect the abnormal events [31; 33]. [PERSON] exploited 3-dimensional convolutions to extracts features from both spatial and temporal dimensions for video representation [31]. [PERSON] et al. proposed an architecture including a component for spatial feature representation and another component for temporal learning [33]. [PERSON] exploited Gaussian Mixture Variational AutoEncoder (GMVAE) to model the video anomalies as the Gaussian components of the Gaussian Mixture Model (GMM) [30]. A two-stream network framework is employed to combine the appearance and motion anomalies. A dynamic anomaly detection and localization system including a sparse denoising AutoEncoder is proposed in [32]. In this article, we propose a similarity metric CNN based on a channel attention model for a road anomaly detection task. The method mainly includes (1) A Siamese network with a hierarchical attention model by word embedding so that it can selectively measure similarities between anomalies and the template. (2) A deep transfer learning method can automatically annotate unlabeled data while fine-tuning the network, improving the accuracy of transfer learning and reducing the additional time consumption compared with DCGAN method and AutoEncoder method.