Enkhtur Tsogbaatar
email: tsogbaatar.enkhtur.ta4@is.naist.jp

Monowar H Bhuyan
email: monowar@cs.umu.se

Yuzo Taenaka

Doudou Fall
email: doudou-f@is.naist.jp

Khishigjargal Gonchigsumlaa
email: khishigjargal@must.edu.mn

Erik Elmroth
email: elmroth@cs.umu.se

Youki Kadobayashi
email: youki-k@is.naist.jp

SDN-enabled IoT Anomaly Detection using Ensemble Learning

Keywords: Internet of Things (IoT), Anomaly detection, Autoencoder, Probabilistic Neural Networks (PNN), Software Defined Network (SDN), Ensemble learning

devices are inherently vulnerable due to insecure design, implementation, and configuration. Aggressive behavior change, due to increased attacker's sophistication, and the heterogeneity of the data in IoT have proven that securing IoT devices is a making challenge. To detect intensive attacks and increase device uptime, we propose a novel ensemble learning model for IoT anomaly detection using software-defined networks (SDN). We use a deep auto-encoder to extract handy features for stacking into an ensemble learning model. The learned model is deployed in the SDN controller to detect anomalies or dynamic attacks in IoT by addressing the class imbalance problem. We validate the model with real-time testbed and benchmark datasets. The initial results show that our model has a better and more reliable performance than the competing models showcased in the relevant related work.

Introduction

The rapid evolution of the Internet of Things has brought billions of internetenabled devices into our daily life to make it smarter by bridging the gap between the physical and the virtual world. Frost and Sullivan [START_REF] Frost | IoT Security Market Watch-Key Market Needs and Solution Providers in the IoT Landscape[END_REF] have predicted that the number of connected devices will increase by up to 45.41 billion by 2023. Autonomous decision making, information to end-users, machine-to-machine and machine-to-user interaction have boosted the acceptance of IoT as a critical asset in the service chain. IoT systems open up several opportunities in areas of autonomous transportation and industrial automation. As manufacturers hastily produce new IoT devices without basic security and privacy checks; thus, allowing attackers to easily and swiftly identify vulnerabilities that allow them to evade, manipulate, and take over IoT networks. The failure to implement proper security and privacy measures have already resulted in dire consequences for certain IoT manufacturers and service providers in terms of reputation and financial penalties [START_REF] Farris | A survey on emerging and NFV security mechanisms for IoT systems[END_REF]. Hence, security is becoming crucial to protect IoT devices and applications from cyberattacks in both small and large-scale networks comprised of physical and virtual infrastructures.

SDN [START_REF] He | Flexibility in Softwarized Networks: Classifications and Research Challenges[END_REF] attracts both academia and industry due to appealing features such as flexibility, dynamicity in network operations and resource management. By leveraging SDN, we can provide several attractive benefits for IoT security. Unfortunately, managing heterogeneous IoT networks and detecting dynamic attacks become challenging due to changing behaviour, constraint resources, and limited scalability. Hence, the ensemble learning model is developing a detection module within the SDN framework by: (i) isolating compromised devices, (ii) doing early detection and mitigation, (iii) reducing resource wastage, (iv) improving accuracy by deploying sophisticated algorithms. Mostly, detection models suffer class imbalance problems that incur significant performance loss for detecting attacks in IoT. This work takes the benefits of SDN controller at switches by grabbing the features of data back-and-forth into IoT devices.

To address these challenges, we present an SDN-enabled ensemble learning model for IoT anomaly detection that utilizes the appealing features of deep auto-encoders and probabilistic neural networks. Our proposal uses both device and network switching level features to build an efficient detection system, which will ensure the increase of IoT device uptime and performance. We make the following contributions.

-A novel SDN-enabled IoT anomaly detection using ensemble learning:

• It utilizes the principles of deep autoencoders and probabilistic neural networks. • It can detect dynamic attacks and handle the class imbalance problem.

-Systematic and extensive experimental analysis using testbed and benchmark datasets, showing the proposed method is superior to competitors in terms of F 1 measure.

Related work

Several significant amounts of works [START_REF] Bhunia | Dynamic attack detection and mitigation in IoT using SDN[END_REF][START_REF] Meidan | N-BaIoT -Network-based detection of IoT botnet attacks using deep autoencoders[END_REF][START_REF] Zolanvari | Effect of imbalanced datasets on security of industrial iot using machine learning[END_REF][START_REF] Nguyen | DIoT: A Federated Self-learning Anomaly Detection System for IoT[END_REF] have been proposed to address the machine learning-driven IoT anomaly detection problems with and without the SDN. Bhunia et al. [START_REF] Bhunia | Dynamic attack detection and mitigation in IoT using SDN[END_REF] present a machine learning-driven anomaly detection and mitigation method for IoT using the SDN. This method deploys the SVM model at the SDN controller to monitor and learn the behavior of IoT devices over time and detect attacks. The evaluation was ensured based on Mininet-based emulation by considering multiple attack scenarios and claimed that the method can detect and mitigate attacks within a few seconds. Zolanvari et al. [START_REF] Zolanvari | Effect of imbalanced datasets on security of industrial iot using machine learning[END_REF] demonstrate the efficiency of Artificial Neural Network (ANN) in detecting anomalies with Industrial IoT (IIoT) testbed datasets having class imbalance. This method leverages Synthetic Minority Over-Sampling Technique (SMOTE) to address the class imbalance problem in IIoT datasets to achieve expected ANN performance. Recently, Thien et al. [START_REF] Nguyen | DIoT: A Federated Self-learning Anomaly Detection System for IoT[END_REF] propose an autonomous self-learning distributed system for detecting compromised IoT devices using GRU (Gated Recurrent Units) known as D ÏoT. This method was evaluated with 33 IoT devices and demonstrates True Positive Rate (TPR) is 95.6% and can detect compromised devices within 257 ms. However, still, several opportunities are left to address IoT security problems in small and large-scale industries with a comprehensive solution focus either centralized or distributed fashion. Some problems including increase uptime of devices that deployed in the edge of the network, device heterogeneity, reliability, and early detection of attacks irrespective of class imbalance issues. We are motivated to address two primary aspects including early detection of dynamic attacks and class imbalance problems using the data-driven mechanism.

System Model

We present a novel ensemble learning-based anomaly detection model for IoT using SDN primarily to detect anomalies or dynamic attacks for increasing device uptime and detection efficiency. This model aims to provide security of IoT devices by monitoring traffic and system metrics in SDN switches. Also, it can handle the class imbalance problem where attack classes are rarer than legitimate classes. An SDN-enabled IoT anomaly detection framework is given in Figure 1. This framework has three primary components, including an SDN controller, SDN switches, and IoT devices. Further, the proposed framework has data collection and preprocessing, a learning module, a detection module, a flow management module, and the maintenance of a status table. The network operators employ the SDN-enabled framework to isolate the services, increase reachability, improve service-oriented policies at the switch level. The SDN controller disintegrates policies into service-specific rules and colonizes into flow tables of SDN-switches through the standard channel like OpenFlow [START_REF] Mckeown | OpenFlow: Enabling Innovation in Campus Networks[END_REF]. Each packet is forwarded based on the enabled rules in the flow table. Each rule have three most common fields including matching field, actions, and flow counters.

If a packet header matches a rule, then the controller must take actions (e.g., forwarding to a specific device) and update the counters immediately. We assume that the controller has complete information of network topology and can make a request for each counter rule from switches [START_REF] Foundation | OpenFlow Switch Specification[END_REF]. A new rule is installed or updated reactively when new flows come to the network without any matching rules. In the following subsections, we discuss the anomaly detection, flow management and maintenance of the status table.

Anomaly Detection

The proposed model aims to detect anomalies in IoT based on the dynamic observation of both packet and flow level traffic instances that pass through SDN switches as well as system metrics. We deploy the detection module that can monitor traffic and system metrics of deployed devices as well as applications for anomaly detection.

Learning Module: Anomaly detection models have a vital requirement to have aggregated data either at an endpoint or from multiple sources. The model adopts packet level, flow level, and system metrics data to detect anomalies in IoT. Because the attackers primarily target different performance or system metrics. We validate this model using both testbed and benchmark datasets.

For testbed data, we set up a real-time testbed comprising multilevel hierarchical architecture from physical infrastructures to IoT devices. The preprocessing function extracts significant features that the attackers typically utilize and labels them based on the behavioral analysis. For the benchmark, we use a recent dataset, called N-BaIoT [START_REF] Meidan | N-BaIoT -Network-based detection of IoT botnet attacks using deep autoencoders[END_REF] for our experimentation. We provide extended explanations of each dataset in Section 4.

To make an efficient and better representation of features, we use autoencoder and deep feature representation by a non-linear transformation of features set before feeding data into the learning model. This module employs both legitimate and anomalous features or system metrics to learn the model for anomaly detection in IoT. Let's assume that

X = {x 1 , x 2 , • • • , x n } is the input data, X = {x 1 , x 2 , • • • , x n } is the encoded output, F = {f 1 , f 2 , • • • , f n }
is the features set, and h is the hidden layers.

Autoencoder and deep feature representation are multilayer neural networks having multiple hidden layers, h, to encode the input and to reconstruct the output as similar as possible to the input. The network has two parts: an encoder, h = f (x) and a decoder r = g(h) [START_REF] Goodfellow | Deep Learning[END_REF]. We employ deep autoencoder (DAE) to extract and represent the features set obtained from the preprocessing function. The primary advantage of using deep autoencoder is having multiple hidden layers. More hidden layers incur better feature representation, which is advantageous for an anomaly detection model [START_REF] Berman | A Survey of Deep Learning Methods for Cyber Security[END_REF]. The under-complete autoencoders have a lower number of nodes in hidden layers.

Detection Module: This module employs the outcome of a learning module for detecting anomalies in IoT within an SDN-enabled framework. We explain the components of the detection module below.

Probabilistic Neural Networks (PNN) is a multilayered feedforward network with four primary layers, including input, pattern, summation, and output layers. The PNN is represented as a Kernel Discriminant Analysis (KDA), which is a generalization of Linear Discriminant Analysis (LDA) to find a linear combination of features that separates classes. A PNN consists of several sub-networks that estimate the Parzen window probability density function of each class using the samples of the training set. Each node of the network calculates the probability density function for each training sample according to the Equation [START_REF] Berman | A Survey of Deep Learning Methods for Cyber Security[END_REF].

p(x) = 1 σ ω( x -x i σ ) (1)
where x i is the i th sample and x is the input instance (unknown), ω() is the weighting function and σ is the smoothing parameter. The nodes are grouped according to the classes of the training sample in the pattern layer, and each group sums up for the next to get the class-wise probability. In summation layer, the l th nodes aggregate the values from the pattern layer of l th classes. This summation is estimated based on mixed Gaussian or Parzen window estimator as defined in Equation ( 2).

f l (x) = 1 nσ ω n l n=1 ( x -x i σ ). ( 2
)
where n l is the number of sample in l th classes. Hence, the summation layer maps the l th nodes to the l th classes. For new samples, f l (x) can be estimated without retraining. The PNN needs more samples to achieve a high probability of mapping score from input instances to underlying classes where f l (x) has a maximum posterior probability of a class. The weight function ω() is chosen as a kernel function (e.g., Radial Basis Function (RBF)) to compute the distance between the known and unknown sample points. If the distance is nearest, then it has more influence on the end class. The use of PNN provides multiple benefits, including insensitive to an outlier in the data, new input patterns stores in the network, and the smoothing parameter σ. Additionally, it reduces the retraining of the network if the training samples become large. Each sub-network of PNN implies a Parzen density estimator for a particular class. These features boost the detection of exceptional events in the data. However, it has observed that PNN alone cannot provide better results. Hence, we have used deep autoencoder probabilistic neural networks to detect anomalies in IoT.

Deep autoencoder probabilistic neural networks (DAE-PNN) is an autoencoder integrated with probabilistic neural networks. It encodes input using multilayer neural networks instead of stacked layers. In anomaly detection, anomalous classes are rare, whereas legitimate classes are frequent. Hence, binary classifier gets more biased performance [START_REF] Ghosh | Big data and its utility[END_REF]. Such classifiers can be used to refine the decision boundary between the rare and frequent classes. In the proposed method, we have used deep autoencoder PNN for encoding the input and feed them into PNN for classification. These inputs include samples from both rare and frequent classes. In anomaly detection, we have to make the trade-off between generalization and specialization to refine the decision boundary for achieving high accuracy. Most anomaly detection models are not specialized except just giving a bias to rare classes. The proposed model mitigates these drawbacks and gains substantial performance improvement thanks to ensemble learning. In PNN, the smoothing parameter σ determines the spread of RBF where it reaches a peak in the center of weighting. Selecting optimal values of σ implies a better spread of RBF in PNN. A shallow value of σ causes model to over-fit whereas an extremely high value may cause model to under-fit. However, both factors are essential to address the class imbalance problem during anomaly detection in IoT. These problems motivate us to develop an ensemble learning model, which we explain below.

Ensemble Learning employs multiple PNNs as weak classifiers to address the biases by fine-tuning the smoothing parameter σ. This model takes inputs from the encoded features of the deep autoencoder PNN to construct inputs for the next layer. Let's assume that A = {x a1 , x a2 , • • • , x an } is the set of anomalous instances, L = {x l1 , x l2 , • • • , x ln } is the legitimate instances, S is the training dataset, Y is the test dataset, tr and te indicate training and testing instances, then we can get S and Y as in Equation ( 3): As the legitimate instances are more than attack instances, we divided the legitimate instances into N subsets and we kept anomalous instances as one class for training. We used N number of PNNs for ensemble learning, where i th PNN is trained with i th subset of datasets. Hence, we chose i th PNN for training with (i + 1) th PNN for binary classification. However, we chose N th PNNs for the majority of the classes and one more PNN for an anomalous class, specifically for the multiclass problem. For this, we used deep autoencoder, since we know that autoencoder provides the non-linear transformation of input data to reduce features set. A pictorial representation of the proposed model is given in Figure 2. Let f be a non-linear activation function with weight Ω and bias b then the deep autoencoder is formulated as in Equation ( 4):

S = A tr ∪ L tr Y = A te ∪ L te (3)
ξ = f (Ωx + b) DAE(x) = ξ 1 (ξ 2 (ξ 3 (• • • ξ h (x)))) (4)
where ξ() is the encoding function whereas ξ i () is the i th deep encoder, h is the number of hidden layers, each feature vector x is transformed to x using DAE(x) defined in Equation [START_REF] Farris | A survey on emerging and NFV security mechanisms for IoT systems[END_REF].

z n c (x) = f n c DAE(x) (5)
Each input instance x is assigned to C classes based on intermediate RBF score received from the n th PNNs. However, if there are N PNNs for the ensemble, then each instance, x is assigned to C classes based on the Equation ( 6). The classification score is computed using Equation ( 7) for each instance x that belongs to a specific class.

z c (x) = N n=1 (z n c (x)) ( 6
)
s c (x) = z c (x) -min(z c (x)) max(z c (x)) -min(z c (x)) (7)
Once we get the classification score for each instance, we label the unknown instance x as anomalous or legitimate based on the node's maximum probability, max(s c (x)).

Flow Management

This module is enabled to prepare appropriate rules and to dynamically update the switch as a set of actions. If the network flow is marked as legitimate, it can then pass the flow across the controller without any interruption. Otherwise, the controller blacklists the flow and investigates further to verify the types of attacks.

Maintenance of Status Table

This module takes input from the flow management module and generates profiles for each IoT device with the outcome of metrics such as packet, flow, and system. This table is comprised of three columns, including time, device ID, and status. The status of each IoT device is marked either as 0 (legitimate) or as 1 (legitimate) for each time point. The system manager utilizes this feature to easily handle large-scale IoT devices as well as their services to the end-users.

Performance Evaluation

This section reports and explains the intensive experimental results obtained from a real-time testbed and benchmark datasets. We begin with datasets description and proceed with experimental results.

Datasets

The proposed method is evaluated using two datasets: (i) real-time testbed data, and (ii) benchmark data. The real-time testbed data is generated with a significant amount of attacks on IoT devices and applications.

Real-time testbed data:

The experiment is performed in a virtualized environment with a hierarchical deployment of IoT devices to physical servers in the real-time testbed. Figure 3 illustrates the architecture of the real-time testbed setup. The testbed is comprised of multiple servers and applications at a physical level, virtualized level, IoT devices and IoT applications. We consider multiple VMs, one of the VMs is a target of attackers. We generate both DoS and DDoS attacks using the Targa24 attack generation tool, the D-ITG internet traffic generator tool [START_REF] Botta | A tool for the generation of realistic network workload for emerging networking scenarios[END_REF], the BoNeSi botnet simulator 5 , and the stress-ng6 system resources load generator. We generate multiscale attacks [START_REF] Bhuyan | Multi-Scale Low-Rate DDoS Attack Detection Using the Generalized Total Variation Metric[END_REF] to the IoT devices and applications when they are deployed in the virtualized environment. We collect multiple metrics (e.g., packet, flow, system metrics, device uptime, etc.) from devices to physical infrastructures for learning the proposed ensemble model. POX 7 is an OpenFlow controller used to deploy the learning algorithm to detect anomalies in IoT devices based on dynamic policy updating within the SDN framework. Benchmark data: Due to the non-availability of benchmark datasets, we used the N-BaIoT [START_REF] Meidan | N-BaIoT -Network-based detection of IoT botnet attacks using deep autoencoders[END_REF] dataset for our experiments. This dataset was prepared using two attack tools, i.e., Mirai (scan, ACK flooding, SYN flooding, UDP flooding, UDPplain attacks) and Bashlite (scan, junk, UDP flooding, TCP flooding, COMBO attacks), with 9 commercial IoT devices. There are 5 Bashlite, 5 Mirai, and 1 legitimate datasets, having 115 features in each of them. We created an imbalanced dataset by separating 98514 legitimate and 9850 anomalous instances with a combination of 10 different kinds of Mirai and Bashlite attacks.

Results

The proposed framework is evaluated using both real-time testbed and benchmark datasets. We present the results based on real-time testbed datasets that consider multi-level metrics such as packet, flow, and system metrics. To observe the behavior of both real-time testbed and benchmark datasets, we estimate the cumulative density for legitimate and attack instances, as shown in Figure 4.

From the figure 4, is clear that the distribution of legitimate instances differs from attack instances. Dependency analysis on σ: The proposed framework analyzes the dependency of σ to identify suitable values that illustrate the maximum detection rate. The performance of PNN depends on the suitable values of σ. Notably, the lower values of σ provide a lower false-negative rate and higher values of σ yields a lower false-positive rate. We have heuristically identified the range of values for σ as 0.1 -0.3 for real-time data and 0.1 -0.3 for benchmark data, respectively. These experiments were conducted by considering imbalanced datasets. Figure 5 illustrates the performance in the real-time testbed and benchmark datasets.

Dependency analysis on deep layers:

We used deep autoencoder to extract features from both real-time testbed and benchmark datasets. As we know, an increasing number of hidden layers in the autoencoder excels the performance of the model. However, finding the optimal depth of hidden layers for a specific domain and address the class imbalance problem in parallel is still tricky. Figure 6 provides the empirical investigation on the number of deep layers (3 for realtime testbed and 4 for benchmark datasets) to acquire the best performance of the model. Our model recommends that deep neural networks improve the model performance significantly, but a vast number of layers may overfit the model. Performance on attack analysis in IoT: The proposed framework is evaluated with intensive experiments for multiple attack scenarios using real-time testbed and benchmark datasets. In the testbed data, we consider multiscale attacks (i.e., DoS, DDoS) with class imbalance scenarios. Also, we found multiple attack scenarios from the benchmark dataset. Figures 7a and7b illustrate the improved performance of the proposed framework for detecting anomalies in IoT.

Comparison with Competing Methods

To assess the efficiency of the proposed framework for detecting anomalies in IoT, we compared it with existing methods including SoftThings [START_REF] Bhunia | Dynamic attack detection and mitigation in IoT using SDN[END_REF], networkbased IoT anomaly detection [START_REF] Meidan | N-BaIoT -Network-based detection of IoT botnet attacks using deep autoencoders[END_REF], and D ÏoT [START_REF] Nguyen | DIoT: A Federated Self-learning Anomaly Detection System for IoT[END_REF]. The SoftThings [START_REF] Bhunia | Dynamic attack detection and mitigation in IoT using SDN[END_REF] can detect and mitigate dynamic attacks in IoT using SDN. The system achieves 98% precision. It employs Support Vector Machine (SVM) when detecting IoT attacks at the SDN controller in a mininet simulation environment. The network-based IoT anomaly detection [START_REF] Meidan | N-BaIoT -Network-based detection of IoT botnet attacks using deep autoencoders[END_REF] IoT. The system has been evaluated using testbed datasets and it achieves 100% detection rate. The D ÏoT [START_REF] Nguyen | DIoT: A Federated Self-learning Anomaly Detection System for IoT[END_REF] reports an autonomous self-learning anomaly detection system for IoT. The system provides evidence to detect anomalies with 95.6% detection rate.

Although the existing methods have positive performance, the majority of existing methods or systems were evaluated either as testbed data or in simulated environments. Additionally, our framework shows its superiority in terms of the following points: (i) we detect anomalies with 99.8% detection rate for testbed and 99.9% detection rate for benchmark datasets, (ii) we address the class imbalance problem by using ensemble learning, (iii) we increase IoT device uptime.

Conclusion and Future Work

This work presents a novel ensemble learning model for IoT anomaly detection using SDN while addressing the class imbalance problems. Our model integrates the deep autoencoder to encode the features set and impedes them to an ensemble of PNNs for performance improvement of the baseline learning model. The proposed method is shown to perform better than the existing techniques for binary classification anomalies in IoT by employing the appealing features of SDN. We demonstrated superior performance as compared to existing methods in the real-time testbed and benchmark datasets with 99.8%.

In the future, we would like to extend our work to design and implement the deep ensemble learning model for multi-class anomaly detection in IoT. The deep ensemble learning model will consider the maximum composition of multi-scale attacks in IoT within SDN framework.

Fig. 1 :

 1 Fig. 1: SDN-enabled framework for IoT anomaly detection.

Fig. 2 :

 2 Fig. 2: The proposed model: an integration of deep autoencoder and ensemble of PNNs.

Fig. 3 :

 3 Fig. 3: Real-time testbed setup.

Fig. 4 :

 4 Fig. 4: Characterization of data: cumulative density for legitimate vs. attack instances.

Fig. 5 :

 5 Fig. 5: Performance variation of F 1 score with respect to σ of PNN.

Fig. 6 :

 6 Fig. 6: Performance variation of F 1 score with respect to number of deep layers.

  employs the deep autoencoders to detect anomalies in 0

Fig. 7 :

 7 Fig.7: F 1 score variation with respect to σ using ensemble model for detecting anomalies in IoT.

http://packetstormsecurity.com/

https://github.com/Markus-Go/bonesi

https://kernel.ubuntu.com/cking/stress-ng/

https://github.com/noxrepo/pox

Acknowledgment

Part of this study was funded by the ICS-CoE Core Human Resources Development Program. Additional support was provided by the JST CREST Grant Number JPMJCR1783, Japan.


Antonis Pardos
email: antonispardos@bioassist.gr

Andreas Menychtas
email: amenychtas@bioassist.gr

Introducing an edge-native deep learning platform for exergames

Keywords: Deep learning, edge computing, exergames, computer vision, convolutional neural networks, rehabilitation

The recent advancements in the areas of computer vision and deep learning with the development of convolutional neural networks and the profusion of highly accurate general purpose pre-trained models, create new opportunities for the interaction of humans with systems and facilitate the development of advanced features for all types of platforms and applications. Research, consumer and industrial applications increasingly integrate deep learning frameworks into their operational flow, and as a result of the availability of high performance hardware (Computer Boards, GPUs, TPUs) also for individual consumers and home use, this functionality has been moved closer to the end-users, at the edge of the network. In this work, we exploit the aforementioned approaches and tools for the development of an edge-native platform for exergames, which includes innovative gameplay and features for the users. A prototype game was created using the platform that was deployed in the real-world scenario of a rehabilitation center. The proposed approach provides advanced user experience based on the automated, real-time pose and gesture detection, and in parallel maintains low-cost to enable wide adoption in multiple applications across domains and usage scenarios.

Introduction

The computer games landscape is very rich nowadays and is continuously expanding with new approaches which are based on innovative technologies for human-computer interaction, provide advanced game-play, are available on multiple platforms and devices, and target different user groups. Therefore, the users can find in the market a variety of games, from the traditional video games, in which a player is seated in front of the screen and controls the game with a controller such as keyboard, mouse or gamepads, to the virtual and augmented reality games which require special equipment. In this work, we focus on the Serious Games [START_REF] Susi | Serious games: An overview[END_REF] category and particularly the exergames, that has great scientific value and impact, and serves purposes beyond the game itself and the satisfaction of the player [START_REF] Styliadis | Employing affection in elderly healthcare serious games interventions[END_REF]. Active Video Games (AVG) or exergames are based on the technology that monitors body movement or reactions and have been credited with upgrading the game stereotype as a sedentary activity, promoting a more active lifestyle. Golstein et al [START_REF] Goldstein | Video games and the elderly[END_REF] showed that there was a significant improvement in the reaction time of 69-90 year old when they were playing video games for 5 hours each week, for 5 consecutive weeks.

There several works in the literature highlighting the positive effects of exergames, both generally, regarding the increase of the physical activity and improvement of well-being, and also for specific use case scenarios, such deployments in schools, elder houses, rehabilitation centers, and more, where the benefits in the certain context are better measurable with the direct involvement of scientific personnel and experts [START_REF] Matallaoui | How effective is "exergamification"? a systematic review on the effectiveness of gamification features in exergames[END_REF][START_REF] Skjaeret | Exercise and rehabilitation delivered through exergames in older adults: An integrative review of technologies, safety and efficacy[END_REF]. In technical level, these exergames are usually based on the use of particular platforms such as Nintendo Wii, and require the use of peripherals that the players hold or wear and act as game controls. The controls (boards, sticks, patches) capture the characteristics of the user's movement and interpret it to events or gestures through which the game is controlled.

The recent technological advancements in the areas of computer vision and deep learning enable the real-time analysis of images and streaming video to solve several classification problems, from object detection and face recognition, to emotion analysis and pose detection, which in turn are applied to real-world scenarios for providing advanced interactivity with systems and creating rich user experiences. Particularly, the detection body pose or face landmarks is applied in several entertainment, medical and business use cases exploiting the increased computational capabilities of the available hardware nowadays and the advanced features of the computer vision and deep learning frameworks and models. In this work we propose an exergame platform which runs on low-cost commodity hardware and utilizes deep learning pose detection based on Convolutional Neural Networks -CNN for human-game interaction. Nowadays, the exegames are implemented using expensive, special purpose systems, which are designed and implemented specifically for the a particular game. The proposed solution, is a modular and extensible platform that is based on commodity hardware and uses generic purpose software and tools, not only allowing for the inexpensive implementation of several different games that exploit computer vision and deep learning on top of the platform, but also enabling its use and the adoption of the overall concept, in other fields and use cases where human-computer interaction is required.

The rest of the document is structured as follows. Section 2 analyses the related works and the technological and scientific baseline for the proposed platform. The platform of the overall system is presented in section 3 along with the hardware elements, the software frameworks and the techniques that were deployed. Section 4 describes the use of the system in a real scenario as well as initial results of its operation. Finally, section 5 concludes the manuscript and presents future extensions and improvements.

Related work and background information

Studies have shown that exergames can offer significant benefits to the mental and physical health of people who play especially for the elderly, children, adolescents and people with disabilities [START_REF] Benzing | Exergaming for children and adolescents: strengths, weaknesses, opportunities and threats[END_REF][START_REF] Brox | Healthy gaming-Video game design to promote health[END_REF][START_REF] Street | Gaming your way to health: A systematic review of exergaming programs to increase health and exercise behaviors in adults[END_REF], such as the significant decrease in BMI (Body Mass Index) in some cases. Games that enhance physical activity have been developed in the past. Some examples are: "Dance Dance Revolution" [START_REF] Trout | Using dance dance revolution in physical education[END_REF], introduced in Japan in 1998. Players standing on a "dance platform" or stage and hit colored arrows laid out in a cross with their feet to musical and visual cues. Players are judged by how well they time their dance to the patterns presented to them and are allowed to choose more music to play to if they receive a passing score. "Active Life Outdoor Challenge" [START_REF] Deutsch | Nintendo wii sports and wii fit game analysis, validation, and application to stroke rehabilitation[END_REF], a video game for the Wii platform, where players use a mat in conjunction with the Wii remote in order to complete a variety of mini games. "The Think & Learn Smart Cycle" [START_REF] Al-Hrathi | Exerlearn bike: An exergaming system for children's educational and physical well-being[END_REF] is a stationary bike that hooks up to a tablet via Bluetooth for preschoolers to play different learning games. There are games about Letters & Phonics, Spelling & Vocabulary, and Reading & Rhyming. In addition to learning, this game also keeps them active because the faster they pedal, the faster the on-screen action. "Wii Fit" [START_REF] Deutsch | Nintendo wii sports and wii fit game analysis, validation, and application to stroke rehabilitation[END_REF], It is an exercise game with several activities using the Wii Balance Board peripheral, a device that tracks the user's center of balance.

In order to be effective, a game of this type must always take into account the user himself. Children, adolescents, elderly or people with disabilities have different needs, which if properly defined will greatly contribute to the success of the game. Another key component to the success of these games after identifying users' needs, is that the game should entertain and stimulate the user's interest, while convincing him for more exercise. A game that captures the attention of the user is often the impulse for a longer training period, examples like a fixed bike on which a user controls the flow of a game while cycling, resulting in more power being consumed by another user who did the same without controlling a game. Graphics are also an important factor in the success of the game. Seniors need games with simple graphics, easy information and more time available for understanding processes [START_REF] Brox | Healthy gaming-Video game design to promote health[END_REF]. On the other side are the younger users who are expecting games with rich graphics and speed. These games may be adapted in accordance with user's physical condition improvement, or user needs as mentioned above. Through this process significant benefits have been observed in restoring the development of children and young people (5-25 years old) with mobility problem [START_REF] Pope | The effects of active video games on patients' rehabilitative outcomes: a meta-analysis[END_REF].

Studies have shown that after a few weeks the frequency the user plays is decreased and as a result there is no significant improvement in the user's physical condition [START_REF] Street | Gaming your way to health: A systematic review of exergaming programs to increase health and exercise behaviors in adults[END_REF]. This is why it is prominent to be the right evaluation of the target group in order the main strategy and design of the game to be drawn. Another crucial factor that limits the scope of these games is the hardware that must be applied. Examples of the exergames we saw above make use of special peripherals and this makes the game more complicated in terms of both architecture and cost. However, there should be a balance in the length and frequency the user is involved with the game, and extra care must be taken to avoid overuse as there is possibility of injury [START_REF] Street | Gaming your way to health: A systematic review of exergaming programs to increase health and exercise behaviors in adults[END_REF]. To avoid such situations, clear instructions should be given to the user, as well as a game play program. A key factor in using these games is their design and their strategic goal. For example, some games require the user to carry on-screen objects with their hands, while others, such as the "Fish 'n Steps" project encourage the community to walk around in order to grow a virtual aquarium fish. In all cases the player is evaluated according to the strategy of the game and the result he wants to achieve. For example he can be scored according to the accuracy, speed, or the "Quantity" of movement.

System Architecture and Implementation

The objective of this work is to deliver a stand-alone exergame solution, exploiting computer vision and deep learning techniques for the human -game interaction. The proposed system combines state-of-the-art hardware and software technologies and tools in order to deliver advanced exergames features and performance, without compromising the requirements for cost and user experience. An overview of the system is depicted in Fig. 1. The main components of the system include a) the core game implementation, b) the video analysis and inference mechanism, and c) a custom mapper for interpreting the users' pose and gestures to events and signals for controlling the game. In addition, a database for storing the game results and managing the users has been integrated into the system. The game implementation is based on the popular Python library PyGame while the video analysis and inference on OpenCV and Tensorflow framework.

One of the main challenges while designing the system was to address the contradicting requirements considering on one hand the low-cost and one the other hand the nature of the exergame which required satisfying game speed, graphics and control. The most common computer board that could be used in order to meet the requirements for low-cost, since custom hardware was not an option, is Raspberry Pi Model 3 [START_REF] Senthilkumar | Embedded image capturing system using raspberry pi system[END_REF]. There were two technical difficulties following with this approach though: a) to perform the video analysis and deep learning inference operations in such hardware, like in any edge computing architecture and b) the remote management and maintenance of the edge device. The first one was addressed by using the Coral USB [START_REF] Cass | Taking ai to the edge: Google's tpu now comes in a maker-friendly package[END_REF] Tensor Processing Unit (TPU), a special circuit designed to achieve high computational speeds in neural network applications which is compliant with the Tensorflow tools and the deep learning models applied. The TPU is designed for the performance phase, when systems with compiled models are presented with real-world data and are expected to behave appropriately using a version of TensorFlow called TensorFlow Lite. In order to facilitate remote management and maintenance, the deployment and operation was based on the Balena.io remote management solution which allows for dockerization of the software elements and their instantiation through well-defined DevOps processes [START_REF] Menychtas | A versatile architecture for building iot quantified-self applications[END_REF].

Additional hardware peripherals were integrated for the interaction with the users; a Raspberry Pi Camera Module v2 is used for capturing images as the input sensor for controlling the game as well as a TV monitor connected via a HDMI. On software level, the proposed solution was based on Linux Debian 10 (codename: buster) which allowed for the smooth and flawless delivery of the complete software stack through the balena.io services.

CNN-based Pose and Gesture Detection

For the implementation of the pose and gesture detection system, the TensorFlow framework has been used, as an end-to-end open source solution that has a comprehensive, flexible ecosystem of tools, libraries and community resources. This framework allowed for using state-of-the-art convoluntional neural networks and models like Posenet [START_REF] Papandreou | Personlab: Person pose estimation and instance segmentation with a bottom-up, partbased, geometric embedding model[END_REF].

The model was trained on COCO dataset on top of MobileNet V1 network architecture. MobileNet architecture differs in the convolution process. Standard convolution filters and computes a new set of outputs in one step which costs in speed and time. In MobileNet, this is a two step procedure which is factorized in a depthwise convolution for filtering and a 1x1 convolution for combining. This factorization reduce model size and computation drastically [START_REF] Howard | Mobilenets: Efficient convolutional neural networks for mobile vision applications[END_REF]. Posenet provides an average keypoint precision of 0.665 to 0.687 depending on single or multi-scale inference. For person detection and pose estimation, Posenet adopts the bottom-up approach by localizing identity-free semantic entities (landmarks) and grouping them into person instances. The model learns to predict the relative displacement between each pair of keypoints starting from the most confident detection of a distinguished landmark such as nose. Totally seventeen [START_REF] Trout | Using dance dance revolution in physical education[END_REF] heatmaps have been developed, each one corresponding to a keypoint along with offset vectors. In the proposed approach, this procedure runs on the TPU module that is connected on Raspberry pi. Each keypoint is related to a heatmap

Exergame Engine Implementation

As already mentioned the exergame engine is based on PyGame, which is a cross platform set of modules that is used for writing video games in Python and includes computer graphics and sound libraries. The various software components were designed in order to connect neural network landmarks output with the control of the game. The deep learning framework provides for each analysis a dictionary in the following format: {keypoint 1 : (x, y, score), ...keypoint 17 : (x, y, score)}, where x, y are the pixel coordinates of input image. Following the analysis, set of rules are applied to the result to inference the user's gesture 3. What happens in practise is that a gesture is recognized and the event that is associated with this gesture is passed through Event2SignalMapper and a signal is generated. Game Manager receives the signal and updates Menu's selected button through the Inflator update. The Inflator updates the container and displays it on the screen surface.

The Game in Practice

In order to assess the capabilities of the game engine and the overall system a prototype game has been developed. The story of the game is as follows: The player tries to pop bubbles with one part of his body, which in this case was the nose for two main reasons: a) it is part of the body that achieves a high score of confidence and b) it forces the player to move his whole body to pop the bubbles. The deep learning framework returns the nose coordinates and a gun-sight icon is drawn on the screen to these coordinates.

In Fig. 4 two sample levels of the game are presented, each one of which has a time limit of two minutes. In the first level the player has to move the gun-sight in a bubble and hold it there for 5 seconds. Following this approach, the player experiences how the gun-sight can be moved through the game and how the game perceives the player's movements. At the next level the player has to pop a number bubbles which are appearing gradually. Every effort of the player and the score of each level is kept in a database. The game also includes a main menu which is also controlled in as similar way. More specifically, the user can navigate right or left as presented in Fig. 5 and with other similar gestures, the OK and Cancel events are triggered.

As part of the system evaluation, extensive measurements have been performed on different aspects of the proposed implementation. During the game different models have been tested in respect to input size Table 1, taking into consideration the input sizes that are accepted in each model, which considerable affects the inference time of the deep learning framework. In Table 2, we measure the total cycle time (in milliseconds) in respect to frame sampling in a model with image input size 480x350. Finally, in Table 3 we depicts the frame rate of the game with 200ms frame sampling in respect to different video input sizes.

Conclusions and Future Work

The research presented in this work focused on the implementation of an innovative exergame engine exploiting state-of-the-art software technologies and the use of low-cost, commodity hardware. This was achieved by making use of methodologies and frameworks which are based on edge computing and computer vision using deep learning and convolutional neural networks. Concerning the deployment on user's environment, a Raspberry Pi device was used, bundled with a USB tensor accelerator enabling the execution of the deep learning models. The experimentation with a prototype in a real scenario presented significant results, both for the user's perception and for the system performance. The future plans include the use of more effective game control approaches based on better models for pose detection and video analysis techniques, and the support of multi-user gameplay. In addition, given the fact that the proposed exergame engine belongs to the family of serious games and targets specific user groups and use cases, more aspects of the users' physical and mental condition will be taken into consideration such as their biosignal measurements and their emotions during the game. This is expected to increase the effectiveness of the games allowing for better analysis of their health status and providing at the same time more incentives through the advanced gameplay and the enhanced game experience.

Fig. 1 .

 1 Fig. 1. Overview of the system.

Fig. 2 .

 2 Fig. 2. Example of heatmap #10 that represents keypoint 'Right Wrist'.

Fig. 3 .

 3 Fig. 3. Exergame platform component diagram

Fig. 4 .

 4 Fig. 4. (a) The user interface of the prototype game.

Fig. 5 .

 5 Fig. 5. Navigation on menu buttons: (a) Previous, (b) Next.

Table 1 .

 1 Inference time for different inputs with 200ms frame sampling.

	Image input size Inference Time (ms)
	480x350	51
	640x480	97
	1200x720	272

Table 2 .

 2 Total processing time for input size 480x350 for different frame samplings.

	Frame sampling to model (ms) Total Processing Time (ms)
	300	80-85
	200	90-100
	150	120

Table 3 .

 3 Frame rate for different inputs and sampling rate 5Hz.

Image input size Achieved Game Frame Rate (fps)

	480x350	10
	640x480	5
	1200x720	2

Acknowledgement: This research has been co-financed by the European Union and Greek national funds through the Operational Program Competitiveness, Entrepreneurship and Innovation, under the call RESEARCH -CREATE -INNOVATE (project code: SISEI Smart Infotainment System with Emotional Intelligence T1EDK-01046).


Ivan Kraljevski
email: ivan.kraljevski@ikts.fraunhofer.de

Frank Duckhorn
email: frank.duckhorn@ikts.fraunhofer.de

Yong Chul Ju
email: yong.chul.ju@ikts.fraunhofer.de

Constanze Tschoepe
email: constanze.tschoepe@ikts.fraunhofer.de

Matthias Wolff
email: matthias.wolff@b-tu.de

Acoustic Resonance Testing of Glass IV Bottles

Keywords: Acoustic resonance testing, Machine learning, Glass IV bottles, Non-destructive testing

In this paper, acoustic resonance testing on glass intravenous (IV) bottles is presented. Different machine learning methods were applied to distinguish acoustic observations of bottles with defects from the intact ones. Due to the very limited amount of available specimens, the question arises whether the deep learning methods can achieve similar or even better detection performance compared with traditional methods. The results from the binary classification experiments are presented and compared in terms of Balanced Accuracy Rate, F1-score, Area Under the Receiver Operating Characteristic Curve and Matthews Correlation Coefficient metrics. The presented feature analysis and the employed classifiers achieved solid results, despite the rather small and imbalanced dataset with a highly inconsistent class population.

Introduction

Glass materials are ubiquitous in many areas of everyday life, in the home, industry, medicine, vehicles, etc. The production quality of glass is of the highest importance, however, defects in glass materials may occur in the form of cracks, spots, bubbles and inclusions, holes and abrasions [START_REF] Rosli | Vision-based defects detection for glass production based on improved image processing method[END_REF].

Different defects will have different impacts on the usage of glass products, while cracks may have little effect on the ordinary household glass, even hairline or micro-sized cracks will have large effects on the glassware used in the pharmaceutical and medical industries.

Therefore, it is necessary to detect the presence of any defects in glass materials by employing non-destructive testing (NDT) in fabrication and in-service inspections to ensure product integrity and reliability.

Common approaches to NDT of glass materials are X-ray Computer Tomography (XCT), optical systems (OS) and acoustic emission testing (AE) [START_REF] Aastroem | From fifteen to two hundred NDT-methods in fifty years[END_REF]. In production, machine vision-based systems are providing reliable defect detection [START_REF] Mery | Automated visual inspection of glass bottles using adapted median filtering[END_REF], while in-service it would be difficult to deploy equipment and trained operators to track defects and subjectively interpret results. Many studies present such systems [START_REF] Zhou | A surface defect detection framework for glass bottle bottom using visual attention model and wavelet transform[END_REF][START_REF] Huang | Research and implementation of machine vision technologies for empty bottle inspection systems[END_REF][START_REF] Peng | An online glass medicine bottle defect inspection method based on machine vision[END_REF][START_REF] Tai | The application of digital image processing technology in glass bottle crack detection system[END_REF], where image processing algorithms are used to detect glassware defects.

To the best of our knowledge, machine learning (ML) approaches have not been extensively applied in the field of NDT on glassware and there are fewer studies on it. In one of them [START_REF] Liang | Real-time comprehensive glass container inspection system based on deep learning framework[END_REF], the authors applied Convolutional Neural Networks (CNNs) on images to detect defects in the mouth, body and the bottom of glass bottles achieving an average accuracy rate of 98.4%.

Alternatives to image-based systems are Resonance Acoustic Method (RAM) [START_REF] Stultz | Fundamentals of resonant acoustic method NDT[END_REF], known as Acoustic Resonance Testing (ART) [START_REF] Coffey | Acoustic resonance testing[END_REF] NDT systems. The mechanical vibrations in the structure are produced by impact and transmitted as audible signals carrying information about the object's material, structure and geometry in their entirety, but alone it will generally not diagnose the location, size, or type of defect.

ART was successfully applied in many areas, such as in automotive production lines [START_REF] Hertlin | Acoustic Resonance Testing: the upcoming volumeoriented NDT method[END_REF]. Artificial Neural Networks (ANN) were used for classifying automotive components as intact, without damage or defective with results that completely prevented false positives and only 2.61% of good parts detected as defective [START_REF] Sankaran | Low cost inline NDT system for internal defect detection in automotive components using acoustic resonance testing[END_REF]. Classification of magnetic tiles (qualified/unqualified) by their acoustic resonance after impact with a metal block was presented in [START_REF] Xie | Internal defect inspection in magnetic tile by using acoustic resonance technology[END_REF]. Impact tests to determine defects in glassware using Fourier analysis of the resonance frequency are presented in [START_REF] Gunathilaka | Using Fourier analysis of the resonance frequency in glassware to identify defects[END_REF]. Wavelet packet transforms and ANNs were used for the same problem in [START_REF] Gokmen | The defect detection in glass materials by using discrete wavelet packet transform and artificial neural network[END_REF], achieving an accuracy rate of 96.6% on 3 classes (no glass, good, defective). Smart signal processing in ART is crucial since every defect will produce a corresponding dynamic response depending on its size and the feature analysis should be able to reliably capture the deviations.

In this paper, acoustic resonance testing of glass IV (intravenous) bottles is presented. We collected a small database in trials where a hammer impact was used as excitation. The observation signals were labeled, pre-processed and feature analysis was performed. Different ML approaches were applied, and the results of the binary classification were presented and compared. Since the amount of the collected data is small, the question arises whether deep learning could provide comparable or even better performance against traditional ML methods.

The paper is organized as follows: Section 2 describes the selection of glass IV bottles used in the experiments, as well as, the data collection and their organization in a dataset and the employed feature analysis algorithms.

In Section 3, we first present the experimental setup and then each of the used ML approaches with their specific parameter configurations. In Section 4 we present the achieved results in the classification experiments across different machine learning and feature analysis approaches. We close this paper with concluding remarks in Section 5. The selection of glass IV bottles consists of used and empty ones which are: intact (120), artificially [START_REF] Gokmen | The defect detection in glass materials by using discrete wavelet packet transform and artificial neural network[END_REF] and naturally (3) damaged.

To provide representative examples of defects, different types of damages were artificially introduced to intact bottles in the form of smaller and larger cracks, abrasions and holes. In this case, each specimen has characteristic damage of different sizes and placement.

Bottles with defects that occurred naturally have small (the specimens B1 and B2) to middle size (the specimen B3) hairline cracks on the glass surface.

The bottles have the used rubber cap still on, and there was some intravenous fluid still present in most of them, which influenced their physical structure and consequently defined a unique set of characteristic spectral and temporal features, e.g. vibration properties.

Data Collection and Organization

The recording sessions were carried out in a soundproof room, where the acoustic responses of the bottles were measured by a microphone array [START_REF] Wawra | Experiments in acoustic pattern recognition[END_REF].

A human operator was knocking the bottles using a modal hammer on three different locations, a force sensor was used as a recording trigger, ensuring consistent acoustic signal onset across the recordings. The recording setup with two different damaged bottles with marked cracks is presented in Figure 1.

The acoustic responses were acquired by four high-performance Microtech Gefell MK 301 E microphone cartridges placed horizontally at: -125, -25, 25 and 125 millimeters of the field center, and 125 millimeters vertically from the base. The bottles were placed at a distance of 30 centimeters and a height of 165 millimeters, the holder was aligned by a perforated base plate with the microphone field in the center. The hammer impacts were applied at the positions (20 times on each): 0, 120 and 240 degrees counter-clockwise rotation, the 0 degree position is where the bottle label is aligned with a marked holder.

The dataset contains 8002 observations labeled according to the condition of the IV bottle specimens. The originally damaged bottles were labeled with "B" (broken) -181 (2.3%), the artificially damaged with "D" (defective) -602 (7.5%) and the undamaged bottles were labeled with "V" (valid) 7219 (90.2%) observations.

Feature Analysis

Acoustic response observations were obtained by simple delay-and-sum beamforming of individual microphone signals, providing more acoustic information than separate ones, at the same time reducing the computational costs of the feature analysis and the classification.

The acoustic resonance observations were transformed into three different feature sets:

1. The raw signal (SIG) observations, where the analog signals were A/D converted to 48 kHz, 16 bit, little-endian PCM and summed into one single observation with a fixed duration of one second, the dimension of the features is 48000 × 1 elements. 2. The primary feature analysis (PFA) was done over the SIG features, by short-time Fourier transformation with a Blackman window of 512, and MEL filter-bank with a triangular transfer function. The feature vector dimension per observation is 298 × 30. 3. Secondary feature analysis (SFA) was performed over the PFA features by their standardization to zero mean and unit variance, computing the delta features and performing Principal Component Analysis (PCA) for size reduction, producing feature vectors with a dimension of 298 × 24.

Experiments and Results

The choice of an appropriate machine learning approach should also be based on the following factors:

tolerance of high dimensionality, the capability of exploiting a small dataset, and handling of imbalanced datasets.

The objective is to find out which ML approach is best suited for the given dataset: Hidden Markov Models (HMMs), Support Vector Machine (SVM) models or Deep Learning methods.

Stratified 5-fold Cross-Validation (CV) was employed in all experiments, ensuring proper representations of the classes in the train and the test folds. The 95% confidence intervals (CI) for balanced accuracy rate (BAR) [START_REF] Brodersen | The balanced accuracy and its posterior distribution[END_REF], the macro average (µ) and standard deviation (σ) of the F1 score were used as performance metrics. The Area Under the Curve (AUC) and the Matthews Correlation Coefficient (MCC) were calculated, as well. The class weights were applied accordingly in the training procedure to anticipate the highly imbalanced dataset during training.

The objective of Experiment 1 is to classify acoustic responses of intact and artificial damaged bottles. The dataset folds were created by random sampling at the same time ensuring that the train and the test sets do not contain the same signal observations. The class distribution was also taken into account and the classes were accordingly represented in both sets.

In the second experiment (Experiment 2), the training was performed by leaving out a specific group of bottles from the k-fold training runs. They were used as an additional dataset and tested on the models trained for each fold.

This represents a real use-case, where few damaged specimens are available. In the case when no damaged specimens are available at all, other ML approaches for one-class or anomaly (outliers) detection have to be considered.

Here, the dataset was divided into disjoint groups: V1, V2, and V3 (each with different 40 bottles from class V), B1, B2, and B3 (each with one bottle from class B). The training was performed in the following combinations:

training V1, V2, B1, B2, and test V3, B3; training V1, V3, B1, B3, and test V2, B2; training V2, V3, B2, B3, and test V1, B1. The false negative rates (FNR) of the observations of natural damaged bottles ("B") with the 95% CI were calculated. Miss-classifying observations of damaged bottles (positive identification) as observations of intact ones is more critical than the miss-classifying observations of intact bottles as damaged (false positives).

Hidden Markov Models

Hidden Markov Models (HMM), model the signals as Markov processes where the states emit the observations by a Gaussian probability density function. Apart from other areas of application (speech and handwriting recognition, bioinformatics, etc.) they were also successfully applied in NDT [START_REF] Tschoepe | Statistical classifiers for structural health monitoring[END_REF].

In the experiments, the HMMs were created using the dLabPro software [START_REF] Hoffmann | Analysis of verbal and nonverbal acoustic signals with the Dresden UASR system[END_REF][START_REF] Wolff | dLabPro: A signal processing and acoustic pattern recognition toolbox[END_REF]. To represent the subtle temporal features, the classes were modeled by five-state forward connected HMMs with exactly one Gaussian probability density function (PDF) and full covariance matrix per state. The model parameters are iteratively estimated by the Viterbi training algorithm alternated with Gaussian splitting, with maximum of 5 splits and a different number of iterations per split.

The similarity measure describes how well a model fits an observation and is estimated by computing neg-log likelihoods (NLLs). The model which yields the highest likelihood defined predicted class label.

Support Vector Machines

SVMs predict class labels by finding the best hyperplane that separates samples of one class from those of the other class. They are very effective in the case where the dimension of the features is much higher than the number of observations in the dataset. The choice of kernel parameters plays an important role in achieving acceptable results for binary classification with SVMs [START_REF] Cortes | Support-vector networks[END_REF].

To train the SVM models, we used the python scikit-learn [START_REF] Pedregosa | Scikit-learn: Machine learning in Python[END_REF] interface to the well known LIBSVM library [START_REF] Chang | LIBSVM: A library for support vector machines[END_REF]. The Radial Basis Function (RBF) was chosen as a kernel because of its good general performance and the SVMs were tuned over a range of the cost (10 -4 to 10 1 ) and the gamma (10 -9 to 10 1 ) parameters.

Deep Neural Networks

Deep Feed-forward (DFFN) and Convolutional Neural Network (CNN) were trained over the feature sets with Keras [START_REF] Chollet | Keras[END_REF] and Tensorflow [START_REF] Martín | Tensorflow: A system for large-scale machine learning[END_REF]. For all employed classifiers random search was performed over the hyper-parameter space in the pre-tests to estimate appropriate architectures and parameter values.

The DFFN architectures consist of an input layer corresponding to the feature vectors, output layer with one unit and softmax activation. They have two fully connected hidden layers: the first with 256 (128 for SFA features) units and the second with the half of units from the first layer, respectively.

The Leaky Rectified Linear Unit (LeakyReLU) [START_REF] Maas | Rectifier nonlinearities improve neural network acoustic models[END_REF] was used as the activation function, batch normalization and dropout layers [START_REF] Srivastava | Dropout: a simple way to prevent neural networks from overfitting[END_REF] with Adaptive Gradient Algorithm (Adagrad) [START_REF] Duchi | Adaptive subgradient methods for online learning and stochastic optimization[END_REF] as the optimization function.

For PFA and SFA features, the CNN architectures have two 2D convolutional layers with 32 filters of size 5 x 5, Exponential Linear Unit activation (ELU) [START_REF] Clevert | Fast and accurate deep network learning by exponential linear units (elus)[END_REF], followed by batch normalization, dropout, and MaxPooling layers.

The output of the convolutional layers was flattened and feed to a fully connected layer with 90 units and ReLU activation and Adadelta [START_REF] Zeiler | Adadelta: an adaptive learning rate method[END_REF] as optimization function.

One dimensional CNN based on the Soundnet architecture [START_REF] Abdoli | End-to-end environmental sound classification using a 1D convolutional neural network[END_REF] was used for the SIG features (Table 1), with Rectified Linear Unit (ReLU) activation, batch normalization, dropout and MaxPooling layers (MPL). The output of the convolution layers (with a dimension of 512) was flattened into two fully connected layers with 64 and 32 units respectively, providing a rather small size of trainable parameters (283217) well suited for small datasets. For all of them, the output layer has a softmax activation and binary-cross entropy as a loss function.

To avoid over-fitting which is even more emphasized in the case of a small dataset and larger feature dimensions, proper parameters for optimizer algorithms, training batch size, dropout rate, and early stopping criteria, were discovered during hyperparameter optimization.

The maximum number of epochs was set to 200 with the condition of 10 (DFFNs) or 25 (CNNs) epochs with no improvement (patience parameter) after which the training was stopped. The patience parameter and the high dropout rate allow longer training and better generalization.

Results and Discussion

The inconsistency of the dataset samples across classes was the main issue as already described in Section 2. This influenced the overall resonance frequencies and could mask those related to the condition of the bottle.

Also, the hammer impacts made by a human operator gave inconsistent acoustic resonance responses per specimen. On the other hand, this represents the real use-case, where inexperienced personnel should assess the glassware condition in a non-ideal environment.

Experiment 1

Table 2 presents the results achieved in Experiment 1, in terms of balanced accuracy rate (BAR) with the 95% confidence intervals and the mean (µ) of the F1 scores across folds with standard deviation (σ), across all features and classifiers. The SIG/HMM combination was omitted from the experiments as infeasible due to the dimensionality of the features.

It can be seen that CNN models performed well across all feature types in terms of BAR and better than any other in terms of F1-score, despite small and imbalanced dataset. The models were able to discover patterns that can be interpreted as detectors of dynamic events in the time domain (SIG), as well as, in the time-frequency domain (PFA and SFA). The PFA features have the edge over the raw signals for all classifiers except HMMs, mainly because of the dimensionality reduction which compensates the smaller observation counts.

In the pre-trials with even a smaller dataset (600 samples), the performance gap between the raw signal-based features and the other two for each classifier was even larger. Given more training data, it is expected that CNNs outperform the other approaches on raw signals, where more optimal that the handcrafted features will be discovered.

Figure 2 presents the AUC and the MCC metrics for the binary classification, where the damaged bottle label was chosen as positive, since detecting those observations correctly is more important than the intact ones.

The CNNs are performing equally well as the SVMs which, in general, are more suitable choice for binary classification given the size and nature (imbalanced data) of the dataset.

Experiment 2

Because they are of higher importance, Table 3 presents only the results for false negative rates on class "B" obtained in Experiment 2. It can be seen that most of the classifier/feature models failed to reliably detect unseen damaged specimens. The reason is the small amount of the damaged bottles samples (only from two specimens) in the training set and the large variation in the acoustic resonance responses of the intact bottles.

Although class weighting was applied, the characteristic features of damaged bottles were not properly generalized for the unseen specimens.

McNemar's test [START_REF] Salzberg | On comparing classifiers: Pitfalls to avoid and a recommended approach[END_REF] showed that there are significant differences in FNR (p ≤ 0.05) across all classifier-feature combinations, except in the cases: CNN/PFA against HMM/PFA and DFFN/PFA against CNN/SIG.

In general, the CNNs along with HMMs performed better in predicting observations from damaged bottles than other models, particularly with PFA features. In comparison with others, they managed to reliably capture the subtle differences between the damaged and intact bottles.

The CNN/PFA model achieved an overall BAR (%) of 94.94 +0.68 -0.72 and FNR (%) of 9.97 +1.48 -1.34 , while the HMM/PFA achieved overall BAR (%) of 94.36 +0.67 -0.73

and FNR (%) of 9.81 +1.47 -1.33 .

Conclusions

Different machine learning approaches in acoustic resonance testing of glass IV bottles are presented. Despite the rather small and imbalanced dataset with highly inconsistent classes, the presented feature analysis, and the employed classifiers achieved solid results.

The HMM and CNN models in combination with handcrafted features achieved the best overall performance in both experiments. Providing a larger amount of data, the CNNs have the potential of improving the prediction of raw signals.

In practical application, when a high detection accuracy is of critical importance, ensemble modeling should be considered. Here multiple models are created on different training sets, and the prediction is performed by aggregating their classification results.

Alternatively, higher detection performance can be achieved using one trained model and combining the predictions from multiple impacts on different positions on a tested specimen. Moreover, the classifier system should be able to detect and adapt to changing environmental conditions and data properties.

Fig. 1 :

 1 Fig. 1: Recording setup with naturally damaged bottles

Fig. 2 :

 2 Fig. 2: AUC and MCC across features and classifiers.

Table 1 :

 1 The configuration of the convolutional and pooling layers applied to raw audio signals.

					Layers
		CL1 MPL1 CL2 MPL2 CL3 CL4 CL5 MPL3
	Dim.	24000 3000 1500 188 24 12 6	2
	# Filters 16	16	32	32	64 128 256 256
	Filter Size 64	8	32	8	16 8	4	4
	Stride	2	8	2	8	2	2	2

Table 2 :

 2 Balanced Accuracy Rate (%) and F1-score.

	Experiment 1	SIG	PFA	SFA
		95% CI of BAR
	HMM	N/A	91.17 +0.86 -0.94	93.90 +0.67 -0.78
	SVM	89.45 +0.93 -1.02	90.85 +1.27 -1.39	84.75 +1.58 -1.62
	DFFN	60.66 +1.51 -1.49	82.36 +1.62 -1.68	80.80 +1.68 -1.72
	CNN	86.60 +1.47 -1.53	93.05 +1.12 -1.23	88.50 +1.43 -1.47
		F1-score: µ (σ)
	HMM	N/A	0.77 (0.01)	0.83 (0.02)
	SVM	0.74 (0.01)	0.93 (0.01)	0.89 (0.01)
	DFFN	0.63 (0.04)	0.86 (0.02)	0.84 (0.02)
	CNN	0.87 (0.02)	0.94 (0.01)	0.90 (0.02)

Table 3 :

 3 False Negative Rate (%) for class "B".

	Experiment 2	SIG	PFA	SFA
		train: V1V2B1B2	test: V3B3
	HMM	N/A	10.67 +4.06 -3.26	20.33 +5.00 -4.41
	SVM	58.33 +5.64 -5.80	29.00 +5.49 -5.07	62.67 +5.49 -5.74
	DFFN	82.33 +4.14 -4.80	32.33 +5.61 -5.26	37.00 +5.74 -5.48
	CNN	32.00 +5.60 -5.24	13.00 +4.34 -3.59	21.33 +5.08 -4.50
		train: V1V3B1B3	test: V2B2
	HMM	N/A	4.00 +2.88 -1.92	46.33 +5.82 -5.75
	SVM	79.00 +4.47 -5.05	17.33 +4.77 -4.11	49.67 +5.80 -5.80
	DFFN	97.67 +1.39 -2.41	26.33 +5.37 -4.89	43.67 +5.82 -5.69
	CNN	31.67 +5.59 -5.23	2.33 +2.41 -1.39	7.67 +3.62 -2.74
		train: V2V3B2B3	test: V1B1
	HMM	N/A	18.69 +4.84 -4.22	50.49 +5.75 -5.76
	SVM	87.87 +3.44 -4.20	37.38 +5.70 -5.45	83.61 +3.97 -4.64
	DFFN	87.54 +3.49 -4.24	20.98 +5.01 -4.43	56.07 +5.65 -5.77
	CNN	24.59 +5.23 -4.73	16.07 +4.61 -3.94	14.10 +4.42 -3.70