{'fraction_non_alphanumeric': 0.024278584562272505, 'fraction_numerical': 0.011257458065968704, 'mean_word_length': 4.806100217864924, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Security Detection in Audio Events: A Comparison of Classification Methods

The security of public places is becoming important with the increased rate of violence and subversion. Recently, several types of research have been proposed to automatically detect abnormal behavior in public places like a car crash, violence or other hazardous events in an attempt to improve security and save lives. Furthermore, most of the researches are using supervised classifications techniques to classify the audio signals. This paper proposes the use of the kernel principal component analysis (KPCA) to reduce the number of MFCC features extracted from the audio signal and then apply an unsupervised classification algorithm. Moreover, this paper presents the results of several supervised and unsupervised classification methods for audio events detection and compares these results with the result of the proposed approach. Experiments are done using a real data set recorded at the mean of public transportation. The obtained results reveal that K-means on 2 KPCA components gave good results for triggering a true alarm as well as detecting a false alarm; where the percentages of false and missed alarms were 4.5% and 7.8% respectively; whereas these values were 0.8% and 9.3% respectively for kernel k-means. Notwithstanding the DNN network gave the best results with a false alarm rate of 0% and 1.4% missed alarm.


Introduction
Nowadays CCTV surveillance systems are integrated into the means of public transport and in cities for the purpose of security and to decrease the rate of crime. The analysis of videos recorded by the CCTV system is not always sufficient to take into account the passengers activities like screaming or any violent action especially when the environment is too busy. For that reason video surveillance system must be accompanied by an audio surveillance system where the detection of any unusual audio event is becoming possible. Many researches proposed a join audio-visual approach for speech recognition and audio event detection. Authors in [1] presented an end-to-end audiovisual approach based on a 2-layer Bidirectional Gated recurrent Units which simultaneously learn to extract both audio and visual features. In [2], the authors propose a novel method to incorporate audios and videos by building an on-line Audio-video concurrence matrix that detects events using hierarchical clustering. In [3] the authors used lips reading to speech recognition. The authors in [4] presented a platform for audio-visual video analysis to assist agencies in analyzing and identifying suspects from large scale videos recorded after a terrorist attack.
Recently, the classification of audio events detection is becoming an active topic because of the increased rate of violence and thank to the availability of audio signals recorded in public places. However, audio signals are considered high-dimensional data and therefore they need special treatment before the step of classification. Most of the researches are using supervised classification techniques which require labeled dataset to learn the classifier. Labeling a dataset isn't an easy task and in a real-world application, labels are not available.
This drawback motivates the authors of the current paper to investigate the usefulness of the unsupervised classifications. Therefore, this paper studies the effectiveness of applying non-supervised techniques in the context of audio event detection and presents a new approach based in three steps; the first transform the audio signal into features; the second one is using the kernel principal component analysis (KPCA) to reduce the features from the first step and take the components that are sufficient for classification. In the third step an unsupervised classification algorithm is applied to classify the audio signal.
The automated event detection system passes through the feature extraction step before the process of classification. By feature extraction, we recognize the signal components that are essential for classification and discard unnecessary components. In the context of speech recognition, three main feature extraction techniques are used namely the Mel Frequency Cepstral Coefficients (MFCCs), the Linear Prediction Coefficients (LPCs) and Linear Prediction Cepstral Coefficients (LPCCs) [2,5,6]. Sharan and Moir in [7] provide an overview of the different features extraction techniques used in an automated sound system, from cepstral features like MFCC and Gammatone Cepstral Coefficients GTCC, to time-frequency features like Central moments; these methods were followed by the use of either a Gaussian Mixture Model (GMM) or a Hidden Markov Model (HMM) to classify the audio signal.
In the other side, several classification architectures have been proposed in the literature for audio events detection. Vacher and al. used a GMM classifiers trained on several features to detect screams or gunshots [8]; Laffite and al. measured the performances of diverse neural network architectures to detect shouts and scream in transportation means [9]; Valenzise and al. used a short audio frame where the input signal is used to modeling the background sounds [10]. Rouas and al. used a combination of GMM and SVM to reduce the effect of the background sounds on the classification results in order to detect scream in an outdoor environment [11], while, Ntalampiras and al. used a two-stage GMM classifier where in the first stage the audio is classified into normal or abnormal events and in the second stage classifier, it is classified into a specific class [12]; Foggia and al. used a pool of SVM classifiers learned on a bag of word approach to detect audio events for surveillance applications [13].
In this paper, the Mel Frequency Cepstral Coefficients is used to extract 39 coefficients correspond to the first 12 MFCC coefficients, three energy terms, the first and second derivatives of the 12 coefficients. The kernel PCA method is then used to reduce the 39 features into smaller number to capture the maximum information in the data set; finally the unsupervised k-means algorithm is applied to separate abnormal events like screaming, shouting or any dangerous events that could happen in public transportation means from the noise and the normal speech. Moreover, the paper presents a comparative study of several classifiers from both supervised and unsupervised methods used in the literature for audio event detection. The audio signal used is recorded in public transport means by the French project SAMSIT.
The paper is organized as follows: Section 1 presents the MFCC features extraction method, the proposed method and briefly describes several classification methods. Section 2 provides the results of the experiments and the evaluation of the methods, and section 3 concludes the paper.

MFCC feature extraction
Automatic speech recognition is a well-established area of research, from which technologies for the development of real-world applications emerge. However, in a real application, recognition systems are subject to many sources of noise causing significant degradation of performance. The speech signal has a very large variability. The same person never pronounces a word twice in the same way. The speech rate may vary; the duration of the signal is then changed. Finally, the speech is a means of communication where many elements come into play, such as the place, the speaker's emotion, the relationship that is established between the speakers (stressful or friendly). The acoustics of the place (protected environment or noisy environment); these factors influence the form and content of the message.
Therefore, it is necessary to format the audio signal before any process of clustering. For this, some operations are performed before any treatment. The signal is first filtered and then sampled at a permitted frequency. A pre-emphasis step is made to record the high frequencies. Then the signal is segmented into frames. Each frame consists of a fixed number N of speech samples. In general, N is set such that each frame corresponds to about 16-20 ms of speech (duration during which speech can be considered as stationary). In this example, a 16 ms frame is used followed by a Fast Fourier Transform (FFT) to calculate the short-range spectrum. Subsequently, sixteen overlying Mel-scale triangular filters are computed. A logarithm transformation is applied to the filter bank outputs followed by Discrete Cosine Transform which consequently generates 12 cepstrum coefficients. To detect the spectrum relationships between neighboring frames, first and second derivatives of the 12 attributes plus three terms of energy are added to end up with 39 MFCC attributes [11,14].
The following we describe the signal processing used in this article: 1. An automatic segmentation of the sound which divides the signal into several quasi-stationary consecutive zones (Fig. 1). The algorithm used is the "Forward-Backward Divergence" [15]. 2. Next, an activity detection algorithm that removes silence and low-level signal noise that is not considered essential sound activities (Fig. 2). 3. A merging step, to bring together the areas of successive activities. 4. MFCCs Extraction (Fig. 3)

Fig. 2. Detecting audio signal activity zones (in gray)
The steps for calculating the MFCC coefficients after the step of pre-emphasis: 1. A Hamming windowing is done to limit the effects of the Gibbs phenomenon and to keep continuity of the signal. 2. To transform the signal time domain into frequency, we use Fast Fourier Transform FFT method. 3. Mel triangular filters spaced according to the Mel scale in order to get smooth magnitude spectrum. 4. Take the Log of the frequency. 5. Transformed into Discrete Cosine (DCT). 6. Add the log energy and perform delta operation (first and second derivatives).

The proposed approach
As noted before, the main issue with supervised classification is the availability of labeled datasets and that many external and internal factors affects the content of the speech signal making the use of a trained classifier from previous datasets inefficient and the need for an automated classification in real applications a necessity. Fig. 4 describes the proposed approach for audio event detection. The audio signal is analyzed to get the 39 MFCC coefficients, then the KPCA is applied to reduce the dimension from 39 to few components (2 or 3) that capture the sufficient information to detect event in the audio signal. The KPCA components are input to the clustering algorithm; in our experiment we use the K-means algorithm for its simplicity.
In the following, we present the kernel PCA which will be used for the first time in the context of audio event detection. We will also present the kernel k-means algorithm for clustering. The results of the proposed method are compared to some state -of-art supervised methods. Therefore in the next section we will introduce the theoretical foundation of these supervised methods.

Kernel principal components analysis
Kernel PCA is firstly introduced by Shölkopf and al. in [16]. It is considered an effective way to extract nonlinear features from a dataset. Kernel PCA can improve the features of the input data which make easier the separation of clusters. In [17] authors used the scatter plot of a few components of KPCA to determine the number of clusters in the data. By using a nonlinear kernel function i.e. Gaussian or polynomial, KPCA implicitly performs the familiar PCA in a high-dimensional space which is non-linearly related to the input space. Consequently, kernel PCA produces features that capture the nonlinear structure in the data better than linear PCA.
It the present article, Kernel PCA is used to reduce the dimensionality of the 39 MFCC features in order to get the new components that are essential for clustering. This will reduce the complexity of clustering methods and provide better results. As noted before the main problem with other approach in the literature of audio event detection is the data labeling step. In [9] the data were manually cross-labeled by two different audio experts. Authors in [10] used two parallel GMM classifiers to discriminate, respectively, between screams and noise, and between gunshots and noise. Each binary classifier is trained separately with the samples of the respective classes using the Figueiredo and Jain algorithm.

Kernel K-means
The classical K-means algorithm fails to give good results when the clusters are non-linearly separable. Therefore the kernel K-means has been proposed as an alternative to K-means; Kernel K-means uses a nonlinear transformation from the input space to a feature space using the kernel function. Consequently, the algorithm is able to separate non-linear clusters in the input space [18].
The algorithm minimizes the squared distances between the data points and the corresponding centers ܿ ∅ in the feature space: The Euclidian distance in the feature space is calculated using only the kernel function K: Nevertheless, two parameters have to be chosen a priori, the parameter of the Gaussian kernel and K the number of clusters. In the following, we present the Kernel Davies & Bouldin internal index as a way to choose the optimal values of the two parameters.

Kernel Davies & Bouldin index
The non-linear version of the Davies & Bouldin (DB) validity index was first introduced by Nasser et al. [19]. The index is used to evaluate the quality of clustering algorithms by plotting the values of the index against the number of clusters; a minimal value indicates the optimal number of clusters within the dataset. The Kernel DB index algorithm is the following: The interclass dispersion φ k S in the feature space is defined by: For a Gaussian kernel interclass dispersions φ k S and ik d distances between centers of clusters are defined by the following equations:

The classifiers
Multi-layer Perceptron: A multi-layer perceptron (MLP) is a supervised classifier that uses backpropagation to learn to classify a dataset. The architecture of the network includes three layers, in addition to input and output layer, one or more hidden layers are included in between. Each layer is composed of several neurons or unit which performs a specific weighted transformation of its inputs providing the outputs of the previous layer. The training process of the network consists of adjusting the weight of each unit to arrive at the optimal solution. At the end of the process, the output layer is capable to choose which class the input belongs to. The MLP has been used in the domain of speech detection; in [20] a MLP is trained using modulation spectral features, compared to MFCC features. The speech features are input to the trained MLP to estimate phoneme posterior probabilities which they are merged into one speech class to derive speech/non-speech decisions.
SVM classifier: Support Vector Machine (SVM) is a supervised classifier that defines a hyperplane which divides the dataset into parts. Several algorithms are used to train the classifiers of which the sequential minimal optimization algorithm (SMO) has been shown to be an effective method. The SVM classifier has been widely used in the area of audio event and speech detection [11,13].
Random Forest: Random forests are a type of ensemble learning method for supervised classification. The Random forests classifier creates a set of decision trees from a randomly selected subset of the training set. The class of an object is decided by pooling together votes from different decision tree to come up with a final decision. Thambi et al. used the random forest to improve the performance of speech/non-speech detection [21].
Bayesian network: Bayesian networks are a type of graphical model that uses probability relationships to model conditional dependence. Giannakopoulos and al. used a multi-class classification algorithm for audio segments recorded from movies to detect violent content. A Bayesian network is used to classify the audio segments into six classes. Experiments showed good result as a multi-class classification scheme as well as a binary classifier for the problem of violent non-violent audio content [22].

Deep Neural Network (DNN):
A DNN is a feed-forward neural network; it is deep because it is formed of several hidden layers of elementary units. Each layer uses the outputs of the previous layer as input allowing the network to operate as a chain with complicated non-linear transformations of the input layer. The units of each layer represent unknown features which explain the data allowing for various level of abstraction and enabling the output layer to discriminate more efficiently the dataset. DNN has been successfully used in the field of automatic speech recognition [9,23].
Logistic regression: Logistic regression classifier is a simple supervised algorithm that uses logistic function whose coefficients are estimated while training using the training dataset; it then predicts the probability of test samples for each target category. When used for multi-class classification problem it assigns a category with the highest probability to this test instance. Logistic regression is widely used in various fields including natural language processing, audio event detection [24].
Decision tree: A Decision tree is a flowchart-like tree structure where each internal node denotes a test on an attribute, each branch represents an outcome of the test and each leaf node holds a class label. In our experiment we used the C4.5 algorithm developed by Ross Quinlan to generate a decision tree. Decision trees have been used in the field of signal processing and automatic audio information retrieval and classification [25].
K-means clustering: K-means is an unsupervised clustering algorithm that partitions the dataset into k clusters where k is specified a priori [26]. By minimizing the distance between the center of the class and the class members, the K-means algorithm classifies objects in groups such that objects within the same cluster are as similar as possible whereas objects from different clusters are as dissimilar as possible. Although the simplicity of the algorithm, results are sensitive to initialization and the number of clusters should be specified in advance. Regrettably, no theoretical method exists to find the optimal number of clusters. A practical approach is to compare the outcomes of multiple runs with different k and choose the best one based on a predefined criterion [26]. Several approaches have been proposed to choose the optimal value of K, in [19] we proposed to use the kernel Davies & Bouldin index to determine the optimal k value. In [27] we compare several internal validity indices to determine the optimal value of K clusters.
EM clustering: Expectation-Maximization or EM algorithm derived from the GMM model. It assumes that each group of data has a specific distribution i.e. Gaussian. EM algorithm tries to find the parameters of the distributions by solving an optimization algorithm using two steps; The E-step which computes the probability that each data point belongs to a particular cluster evaluated using the current estimate for the parameters and the M-step which maximizes the probability of data point within the cluster by computing a weighted sum of data point within each cluster.

Experiments
The audio signals used in our experiments are recorded in public transportation by 4 microphones. The audio signal contains three classes: speech, noise and spray bomb. The total number of MFCC coefficients extracted is 39 formed by the first 12 MFCC coefficients plus energy, supplemented by their first and second derivatives. For a window of 16ms with an overlap of 8ms, an observation vector is obtained every 8 ms.

First audio signal with two classes
This dataset composed of speech and noise that we seek to classify. In this first signal, we try to analyze the content of the signal and the effectiveness of the unsupervised clustering using different framing windows. Fig. 5 shows the plots of the first two MFCC features using 8ms and 40 ms windows. Note that obviously when the width of the window increases, the sample data will decrease. In Fig. 6, we show the effect of the sampling window used to extract the MFCC attributes on clustering accuracy using K-means. Fig. 6 shows the K-means classification error rates for the different sampling periods. Although this rate is minimal for MFCC coefficients sampled at 40ms, for the second audio signal we will use 16ms as it gives good results and the sampled data is much larger. Table 1 gives the confusion matrix of the best result for a sampling period of 40ms. We note that 10.7% of the points are misclassified.

Second audio signal with 3 classes
The signal we are using here has three classes, Speech, Noise and Spray Bomb. Fig. 7 shows the data plot on the 1 st and 2 nd MFCC features where we can distinguish the three classes: Speech (blue), Noise (red) and Spray bomb (green).   For reliability measures, we run the algorithms several times with different seed values in order to test the sensitivity of the algorithms to initial starts and guarantee consistent results. We present in the following the confusion matrix of the result of each algorithm in the tables below:   Table 3 showed that 0.5% of Speech and 0% of noise are classified as false alarm, whereas 9.78% of spray bomb missed the alarm.  Table 4 showed that 0.17% of Speech and 0.08% of noise are classified as false alarm, whereas 7.17% of spray bomb missed the alarm.  Table 5 showed that 0.83% of Speech and 0% of noise are classified as false alarm, whereas 11.73% of spray bomb missed the alarm.  Table 6 showed that 0.47% of Speech and 4.13% of noise are classified as false alarm, whereas 0% of spray bomb missed the alarm.  Table 7 showed that 1.65% of Speech and 0.39% of Noises are classified as false alarm, whereas 7.2% of spray bomb missed the alarm.  Table 8 showed that 2.98% of Speech and 0.55% of Noises are classified as false alarm, whereas 5.2% of spray bomb missed the alarm.  Table 9 showed that 24.63% of Speech and 34.72% of Noises are classified as false alarm, whereas 1.09% of spray bomb missed the alarm.  Table 10 showed that 0% of Speech and 0% of Noises are classified as false alarm, whereas 13.3% of spray bomb missed the alarm.

Classification using K-means on reduced data and kernel k-means
Now we will apply KPCA for dimensionality reduction technique to the 39 MFCC. The variances of the first 39 KPCA components are presented in Fig. 9. It shows that the first 13 components capture 87.8% of the information about the 39 components. For the calculation of the kernel function, we used a Gaussian kernel with width σ equals 11.26 found by using the approximated Parzen window given by [28]: σ is the trace of the covariance matrix of the dataset.

Fig. 9. Variances of KPCA components
The K-means method is applied on the 39 and 2 KPCA components. . The values 3.32 and 59.68 are the minimal and maximal distances between points in the initial space, we then used 60 values of σ equally spaced in that interval.
Kernel K-means is computed 10 times for each pair of parameters ( ) σ , K to avoid the problem of initialization of the cluster centers. Note that, only the minimal values of kernel DB are kept. Fig. 10 "The effect of parameters on the clustering results" shows that the best value of k and sigma are 3 and 20 respectively.    Tables 11 and 12 show the confusion matrices obtained by components respectively.
The MFCC features after dimensionality reduction are classified into three classes: spray bomb, speech, and noise. Noise is often confused with speech class but infrequently affect with Table 11 showed that 0.08% of Speech and 0.5% of Noises are classified as false alarm, whereas 10.7% of spray bomb missed the alarm. Now for comparison purpose, we applied kernel k given in Table 13. 0.5% of speech is categorized as bomb which triggers are categorized a spray bomb triggering a fa Noise.  Tables 11 and 12 show the confusion matrices obtained by K-means method applied to the 39 and 2 KPCA features after dimensionality reduction are classified into three classes: spray bomb, speech, and noise. Noise is often confused with speech class but infrequently affect with the bomb class.  Table 14 summarizes the result of the classification methods presented in this paper. Although supervised classification methods give better results than unsupervised classification methods, whereas our proposed approach along with the Kernel k-means provides competitive results compared to other supervised methods. The percentage of false alarm (False Positive rate) was relatively comparable to the supervised classification. The obtained results recommend the adoption of the unsupervised classification in real-time detection system.

Conclusion
We proposed in this paper a new approach for automatic detection system based on unsupervised classification and presented a comparative study of several supervised and unsupervised classification methods for audio event detection. The motivation of this work is to secure the public transportation and places by triggering an alarm whenever an unusual audio event happens in those places. The MFCC feature extraction is used to transform the audio signal into discrete features using 39 features, then kernel PCA is used to reduce the 39 dimensions into fewer dimensions which capture 87.8% of the information. After that, the k-means clustering algorithm is then applied to those KPCA components and compared to Kernel Kmeans. K-means on two KPCA components gave good results for triggering a true alarm as well as for the fault alarm where the percentage of misclassification is 12.44%. The percentage of misclassification is 8.63% for kernel k-means. Note that results for KPCA are quite similar to kernel K-means. In the other hand, DNN network gave the best results compared to other supervised methods presented in this article. We conclude that our proposed method is reliable for audio event detection in real applications.

Future Work
The proposed approach of using unsupervised classification and KPCA will be subject to more investigation on the future using real dataset from publicly database and hopefully with data recorded in the Lebanese roads for security purposes. Our goal is to build an unsupervised application for the early detection of abnormal events in public places in the hope of reducing violence and crime.