scieee AI-readable full text Open interactive document viewer

Hardware Architecture Proposal for TEDA Algorithm to Data Streaming Anomaly Detection

Da Silva, Lucileide M. D.,Ruiz Medina, María Dolores

Abstract

The amount of data in real-time, such as time series and streaming data, available today continues to grow. Being able to analyze this data the moment it arrives can bring an immense added value. However, it also requires a lot of computational effort and new acceleration techniques. As a possible solution to this problem, this paper proposes a hardware architecture for Typicality and Eccentricity Data Analytic (TEDA) algorithm implemented on Field Programmable Gate Arrays (FPGA) for use in data streaming anomaly detection. TEDA is based on a new approach to outlier detection in the data stream context. The suggested design has a full parallel input of N elements and a 3-stage pipelined architecture to reduce the critical path and thus optimize the throughput. In order to validate the proposals, results of the occupation and throughput of the proposed hardware are presented. The design reached a speed of up to 693x, compared to other software platforms, with a throughput of up to 10.96 MSPs (Mega Sample Per second), using a small portion of the target FPGA resources. Besides, the bit accurate simulation results are also presented. This work is a pioneer in the hardware implementation of the TEDA technique in FPGA. The project aims to Xilinx Virtex-6 xc6vlx240t-1ff1156 as the target FPGA.

Full text

Received June 27, 2021, accepted July 12, 2021, date of publication July 19, 2021, date of current version July 27, 2021. Digital Object Identifier 10.1109/ACCESS.2021.3098004 Hardware Architecture Proposal for TEDA Algorithm to Data Streaming Anomaly Detection LUCILEIDE M. D. DA SILVA 1,2, MARIA G. F. COUTINHO 1, CARLOS E. B. SANTOS, JR.1, MAILSON R. SANTOS 3, M. DOLORES RUIZ 4, LUIZ AFFONSO GUEDES 3, AND MARCELO A. C. FERNANDES 1,3 1Laboratory of Machine Learning and Intelligent Instrumentation, Federal University of Rio Grande do Norte, Natal 59078-970, Brazil 2Federal Institute of Education, Science and Technology of Rio Grande do Norte, Santa Cruz, State of Rio Grande do Norte 59200-000, Brazil 3Department of Computer Engineering and Automation, Federal University of Rio Grande do Norte, Natal, State of Rio Grande do Norte 59078-970, Brazil 4Department of Statistics and Operations Research, University of Granada, 18071 Granada, Spain Corresponding author: Marcelo A. C. Fernandes ([email protected]) This work was supported in part by the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior (CAPES) under Finance Code 001. ABSTRACT The amount of data in real-time, such as time series and streaming data, available today continues to grow. Being able to analyze this data the moment it arrives can bring an immense added value. However, it also requires a lot of computational effort and new acceleration techniques. As a possible solution to this problem, this paper proposes a hardware architecture for Typicality and Eccentricity Data Analytic (TEDA) algorithm implemented on Field Programmable Gate Arrays (FPGA) for use in data streaming anomaly detection. TEDA is based on a new approach to outlier detection in the data stream context. The suggested design has a full parallel input of N elements and a 3-stage pipelined architecture to reduce the critical path and thus optimize the throughput. In order to validate the proposals, results of the occupation and throughput of the proposed hardware are presented. The design reached a speed of up to 693x, compared to other software platforms, with a throughput of up to 10.96 MSPs (Mega Sample Per second), using a small portion of the target FPGA resources. Besides, the bit accurate simulation results are also presented. This work is a pioneer in the hardware implementation of the TEDA technique in FPGA. The project aims to Xilinx Virtex-6 xc6vlx240t-1ff1156 as the target FPGA. INDEX TERMS Data streaming, FPGA, anomaly detection, TEDA. I. INTRODUCTION Outlier detection or anomaly detection consists of detecting rare events in a data set. When data is captured and processed continuously in an online way they are considered as data streams [1]. Due to the increasing number of sensors in the most diverse areas and applications, streaming data is currently generated from many different sources and there is a huge rise in the availability of time-series data. It is a central problem in many application areas such as time-series forecasting, medical systems, industrial process monitoring, telecommunications, sensors networks, internet traffic and others [2], [3]. These systems provide users with real-time information and continuously seek to extract knowledge from structures of unified analysis from within massive data flows. Time-series anomaly detection helps to monitor the different metrics and parameters of industrial and The associate editor coordinating the review of this manuscript and approving it for publication was Christian Pilato . corporate applications and services in real-time. It supervises the time-series continuously and sends alerts for probable risky events related to incidents instantly [4]. Consequently, outlier detection of data streams is a prominent research area in data mining [5], as well as an important task in various industrial applications. Industry 4.0 projects are an area where anomaly detection has been increasingly applied to [3]. One of the challenges of Industry 4.0 is the detection of production failures and defects [6]. New technologies aim to add value and increase process productivity, but face difficulties in performing complex and massive-scale computing tasks due to the large amount of data generated [7]. Many solutions presented in the literature require a knowledge of full data set processes and the systems for modelling and making a series of initial assumptions. These, in most cases, are not applied [8], hence, traditional anomaly detection techniques may not be an applicable approach to detect anomalies in real-time streaming data series [9]. VOLUME 9, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ 103141 L. M. D. da Silva et al.: Hardware Architecture Proposal for TEDA Algorithm to Data Streaming Anomaly Detection Typicality and Eccentricity Data Analytic (TEDA) algorithm has been presented as a possible solution for anomaly detection with streaming algorithms [10]–[12]. It is based on a new approach of outlier detection in a data stream context [13] and, for example, it can be applied with an algorithm to detect autonomous behavior in an industrial process operation. TEDA can be used as an alternative to statistical framework for analyzing most data. It is based on new metrics, all based on the similarity/proximity of data in the data space, not in density or entropy, as per traditional methods. Real-time analysis stream data is critically dependent on computational infrastructure. The huge accumulation of real-time data to flow in a network, for example, can quickly overload traditional computing systems due to the large amount of data that originates from sensors and a requirement for intensive processing and high performance. Therefore, software-only approaches cannot keep up with the growing computational demands of real-time analysis, given the barriers to reducing latency in large volumes. In addition, as the number of nodes increases to handle the ever-growing amounts of data, performance is not scaled linearly [14]–[16]. The ability to process massive data flows from different sources at high speed is a critical problem. Some important aspects need to be considered when choosing an anomaly detection method, such as the computational effort required to handle large streaming data. Since they are dynamic, unknown and unlimited, the received information needs to be stored and analyzed without compromising memory and run-time. Handling this type of data requires three fundamentals, which are high-throughput, ultra-low-latency, and low-power [14]–[19]. Thinking about the challenges presented, this work proposes a specialized hardware architecture of TEDA in reconfigurable computing using FPGAs for Real-Time Anomaly Detection of Streaming Data. The development of the hardware technique allows systems to be made even faster than their software counterparts. This extends the possibilities of use especially during situations where time constraints are at their most severe. Reconfigurable computing is an emerging area, and it provides the possibility of developing hardware architectures customized to the algorithm. The main objective is to fit hardware to the algorithm, and it is not to fit the algorithm to hardware, unlike the traditional model where the algorithm fits the instructions of the processor. In the traditional model, complex algorithms with high degrees of parallelization are inhibited in terms of computational performance, as they often have to shape themselves sequentially to the target hardware [20], [21]. The development of a more specialized hardware architecture has been presented as an exciting alternative for overcoming bottlenecks, making it possible to create solutions for mass data processing and, at the same time, consider ultra-low-latency, low-power, high-throughput, security and ultra-reliable conditions [22], [23], all-important requirements for increasing productivity and quality in industry 4.0 processes. One of the motivations for this work is the possibility of accelerating the TEDA algorithm for time-constrained applications, massive data, and energy efficiency by using a hardware-based implementation [24], [25]. All validation and synthesis results were made using an FPGA Virtex 6 xc6vlx240t-1ff1156. The FPGA choice was because it has high performance and flexible architecture. This paper is organized as follows: This first section is presented as an introduction to the work, explaining the motivation behind it and major contributions. Section II discusses some related works and the state of the art. Section III presents a theoretical foundation regarding the TEDA technique. Section IV presents the implementation description details for the architecture proposed. Section Vpresents the validation and synthesis results of the proposed hardware, as well as comparisons with software implementations. Finally, Section VI presents the conclusions regarding the obtained results. II. RELATED WORK Real-time anomaly detection in data streams has the potential to be applied to many areas such as; preventive maintenance, fault detection, fraud detection and signals monitoring. These are concepts that can be used in different ranges of the industry, among others these can include technology, finance, medicine, security, energy, e-commerce, agriculture and social media. In the literature, there are some uses of the TEDA technique for anomaly detection and even for classification. The article presented in [26] shows a proposal for a new TEDA-based anomaly detection algorithm. The proposed method compares the accumulated proximity information of all samples against previous specific point pairs suspected of being anomalies. The method/technique uses local spatial distribution information about the vicinity of the suspect point. In the journal, TEDA is compared to an approach using traditional statistical methods, emphasizing that the set of initial assumptions is different. TEDA is a generalization of traditional statistics, although TEDA does not need the initial assumptions. Besides, it has been shown that due to the recursion feature, TEDA is computationally more efficient and suitable for online and real-time applications. Other works in the literature also present similar results and conclusions [8], [10], [12], [27], [28]. The characteristics and advantages of the TEDA algorithm presented in these references have justified and motivated the choice of this algorithm, among several anomaly detection algorithms, for the implementation of the hardware architecture for streaming processes. Another motivation for using the Algorithm TEDA in hardware implementation is the possibility of paralleling it. In the work shown in [11], a new algorithm is presented with a parallel structure within big data processing classification. The main feature of the proposed algorithm, called TEDAClassBDp, is the processing of block data, where each block uses the TEDAClass so that all blocks operate in parallel. As with TEDAClass, the proposed algorithm does 103142 VOLUME 9, 2021 L. M. D. da Silva et al.: Hardware Architecture Proposal for TEDA Algorithm to Data Streaming Anomaly Detection not require information from previous data, and its operation occurs recursively, online and in real-time. The parallel structure presented is very suitable for FPGA, its implementation in hardware would improve the performance and efficiency of the system in terms of latency, throughput and energy consumption. This enables the use of the proposal in response to problems where these restrictions may be limiting the processing of large volumes of data. As the amount of data that needs to be processed grows exponentially, and autonomous systems become increasingly important and necessary, the implementation of machine learning, fault and anomaly detection and streaming algorithms on hardware have been studied in the literature. In work [29], an implementation of target and anomaly detection algorithms for real-time hyper-spectral imaging was proposed on FPGA. The algorithms were implemented in streaming fashion, similar to this work. The results obtained from a Kintex-7 FPGA using fixed-point structure were satisfactory for their application. However, they present an occupied area much larger than our proposal, using twice as many LUTs, almost 70 times more registers and 10 times the number of multipliers. The outcome also shows a very low throughput, with a processing time in the range of seconds. The work [30] presented a study on the impact of Neural Network architectures compared to statistical methods which are used in the implementation of an Electrocardiogram (ECG) anomaly detection algorithm on FPGA. The fixed-point implementation contributes to reducing the number of required resources, however the design was created with High-Level Synthesis (HLS), which, perchance, was not able to optimize the FPGA resource consumption, when regarding higher resource consumption compared with manual optimization. In this work, only occupation and accuracy results are analyzed, no throughput or time analyzes are presented. The implementation presented in [31] describes an accelerated FPGA architecture for anomaly detection based upon a Neural Network in pipeline. The design has a 200MS/s throughput and a 105ns latency likewise used in Radio Frequency Signals. The work presents a high throughput and ultra-low latency for inference, considerably faster than other similar implementations. However because the proposed hardware uses an NN-based algorithm, it needs a training stage, which is hosted in a PC (heterogeneous architecture) and this considerably limits the systems adaptability. As presented, the throughput and latency of the architecture are 1290ns (or 775KS/s) and 1285ns respectively, with both their NN-weights and biases to be updated. This makes the true throughput of the system, taking into consideration its adaptability, almost 10 times lower than ours. Even though all processing is done using 16-bit-fixed point with truncated rounding. Fixed-point with low resolution allows the possibility of keeping everything on-chip although with considerable impact on the weight system accuracy. Concerning the TEDA algorithm, to date, no literature or studies have been aimed at exploring the implementation of its hardware on FPGA. This paper proposes to accomplish this feat in a pioneering manner. III. BACKGROUND TEDA was introduced by [32] as a statistical framework, influenced by recursive density estimation algorithms. Unlike algorithms that use data density as a measure of similarity, TEDA uses concepts of typicity and eccentricity to infer whether a given sample is normal or abnormal to the dataset. The typicality of TEDA is the similarity of a given data sample to the rest of the dataset samples to which it belongs. Eccentricity, on the other hand, is the opposite of typicality, which indicates how much a sample is dissociated from other samples within its set. Therefore an outlier can be defined as a sample with high eccentricity and low typicality, when taking into consideration the established threshold for comparison. It is important to note that for eccentricity and typicality calculations no parameter or threshold is required. To calculate the eccentricity of each sample, TEDA utilizes the sum of the geometric distances between the analyzed sample xkand the other samples in the set. Thus, the greater the value, the greater the eccentricity of the sample, and consequently, the lower its typicality. [26] proposed recursively calculating the eccentricity. The eccentricity, ξcan be expressed as ξk(x)=1 k+(µx k−xk)T(µx k−xk) k[σ2]x k ,[σ2]x k>0 (1) where kis the discretization instant; xkis an input set of N elements in the k-th iteration, xk=[x1 kx2 k. . . xN k]; µk xis also an N elements vector, equal to the average of xkat the k-th iteration and [σ2]x kis the variance of xkat the k-th iteration. The calculation of µk xand [σ2]x kare also done recursively, using the following equation µx k=(k−1) kµx k−1+1 kxk,k≥1,µx 0=0 (2) and [σ2]x k=(k−1) k[σ2]x k−1+1 k xk−µk  2, k≥1,[σ2]x 0=0.(3) The typicality of a given sample xk, at the k-th iteration, can be expressed as a complement to eccentricity, as follows [26] τk(x)=1−ξk(x).(4) Besides, [26] also defined that normalized eccentricity can be calculated as ζk(x)=ξk(x) 2, k X i=1 ξk(x)=1,k≥2.(5) To separate normal state data from abnormal state data, it is necessary to define a comparison threshold. For anomaly detection, the use of the mσ[33] threshold is widespread, however this principle must first assume the distributional VOLUME 9, 2021 103143 L. M. D. da Silva et al.: Hardware Architecture Proposal for TEDA Algorithm to Data Streaming Anomaly Detection behaviour of the analyzed data, such as the Gaussian distribution [26]. Chebyshev inequality can be used for any data distribution, assuming that the probability that the data samples are more than mσfrom the average is less than or equal to 1/m2, where σis the standard deviation of the data [34]. The condition that produces the selfsame results as Chebyshev’s inequality, discarding any assumptions about data and its independence, can be expressed as ζk>m2+1 2k,m>0 (6) where mcorresponds to the comparison threshold [26]. For the hardware implementation, we have used the TEDA algorithm as presented in Algorithm 1in a 3-stage pipelined architecture, based upon the equations presented above. Algorithm 1 TEDA Input:xk:k-th sample; m: threshold Output: outlier: sample classification as abnormal or normal 1: begin 2: while receive x do 3: if k=1 then 4: µx k←xk; 5: [σ2]x k←0; 6: else 7: update µx kusing equation 2; 8: update [σ2]x kusing equation 3; 9: update ξk(x) using equation 1; 10: update ζk(x) using equation 5; 11: if ζk(x)>m2+1 2kthen 12: outlier ←true; 13: else 14: outlier ←false; 15: k←k+1; The inputs of the Algorithm 1are the data samples, xk, and a comparison threshold, m. The output for each entry, xk, is the indication of the sample’s classification as abnormal (outlier =true) or normal (outlier =false). IV. PROPOSED ARCHITECTURE In this work, a TEDA FPGA proposal was implemented using Register Transfer Level (RTL) such as the works presented in [25], [35]–[38]. A design overview can be seen in Figure 1. It has four different block structures: The MEAN module, the VARIANCE module, the ECCENTRICITY module and the OUTLIER module. The characteristics of the proposal and modules description will be presented and discussed in the following section. A. ARCHITECTURE PROPOSAL OVERVIEW The architecture was developed to pipeline the operations presented in Algorithm 1. The MEAN module implements the average described in Equation 2and it is one clock cycle ahead of the VARIANCE module, which is responsible for calculating the variance as presented in the equation 3; The ECCENTRICITY module calculates the eccentricity as presented in the equation 1and it is one clock cycle delayed to the VARIANCE module and two to the MEAN module; The OUTLIER module is used to normalize the eccentricity as in Equation 5and to compare with the threshold, as shown in Equation 6and it operates at the same clock cycle as ECCENTRICITY. Each module is detailed later in the following section. 3-stage pipelined architecture reduces the critical path and thus optimizes the throughput. The critical path is reduced through the placement of pipeline registers between the modules. The placements of the registers are, 1) at the output of MEAN module, N registers illustrated as MREGn, and also at the input of the VARIANCE module, N registers illustrated as VREG1n, where Nis the size of the input vector xk, 2) at the output of VARIANCE module, one register represented as VREG1, and at the input of ECCENTRICITY module, two registers illustrated as EREG3, EREG4. A total of three clock cycles are required to classify the input signal in outlier or non-outlier. The first cycle is required to calculate the mean, µn k, (Equation 2), the second one to calculate the variance, [σ2]x k,(Equation 3) whereas the third cycle is required to calculate the eccentricity, (Equation 1) and ultimately classify the sample in outlier or not-outlier. it causes a 3 clock cycle delay, however, it decreases the critical path and consequently improves throughput. The implementation has the Algorithm 1as reference. The system receives the FPGA clock and the k-th sample vector xkas inputs. The k-th iteration number is updated from the increment of a counter and the mthreshold is used as a constant, stored in the OUTLIER module. As in the algorithm line 7, the MEAN module calculates each single element average of xkvector. It is possible to observe that there are NMEAN blocks, where Nis the vector size. This block will be detailed in section IV-B. After this step, moving to the next line (8), the calculation of variance is done in the VARIANCE Module, this block is detailed in the section IV-C. The ECCENTRICITY block has, as inputs, the signals that left the block VARIANCE and k, referenced at line 9and detailed in subsection IV-D. The OUTLIER block is detailed in subsection IV-E. It receives the ECCENTRICITY, ξk(x), and calculates the normalized eccentricity to compare against the threshold as presented in lines 10,11 and 12. B. MODULE I - MEAN Each n-th MEAN module computes the average of each individual n-th element vector xkacquired at run time. The implementation is based on Equation 2and it is detailed in Figure 2. In addition to receiving the n-th element of vector xkas an input, the MEAN block uses a counter to define the number of sample interactions, k. The implementation uses a comparator block identified as in the Figure 2as MCOMPn 103144 VOLUME 9, 2021 L. M. D. da Silva et al.: Hardware Architecture Proposal for TEDA Algorithm to Data Streaming Anomaly Detection FIGURE 1. General architecture overview. FIGURE 2. MEAN module. which is used to verify if the system is in the first iteration as Line 3of Algorithm 1. The MMUXnis a multiplexer that acts as a conditional evaluation, using as a selecting value, the output of MCOMPncomparator. The register MREGn stores the vector n-th µx kelements (µn k). The µn kvalue stored in MREGnis multiplied with k−1 kin MMULT1nand added in MSUMnwith the output of MMULT2nthat has as input xn kand the inverse value of k. Each n-th element of vector xk, xn k, requires a MEAN block. The MEAN module computes every single element average of xkin parallel, regardless of the size of the vector, thus enabling the processing of several signals in parallel at the same clock. C. MODULE II - VARIANCE The VARIANCE module is illustrated in Figure 3. It computes the variance of xkvector samples by receiving the xk vector itself and its average, µx k, which were calculated in the previous MEAN blocks. The VARIANCE module, akin to the MEAN module, uses a comparator identified at the Figure 3as VCOMP1 to verify if the system is in the first iteration (Line 3of Algorithm 1). The VMUX1 is a multiplexer that also implements a conditional evaluation to release the value of 0 in the register output VREG1 in the first iteration. The register VREG1 stores the variance value, [σ2]x k, from the second iteration. The other registers in the block, VREG2 register and the N VREGn registers, are used to delay the iteration number kby one clock cycle and the elements of xkrespectively. As demonstrated in Equation 3, the variance calculation is done recursively. It is necessary to calculate  xk−µk  2 and to do that, N subtractors (VSUBn) and N multipliers (VMULT1_n) are used, as well an adder (VSUM1) with N inputs. Each element of vector µx kis subtracted from its respective element in vector xkand the result of this operation is multiplied by itself (squared) and then added to the other results. The  xk−µk  2value is then multiplied (at VMULT2) by 1/k. It is then added at VSUM2 adder with the variance calculated in the previous iteration, [σ2]x k, multiplied (VMULT3) by (k−1)/k. From the second iteration on, this value passes through the VMUX1 multiplexer to the VREG1 register, delivering the calculation of the variance value to the VARIANCE block output. The values of  xk−µk  2and 1/kare also delivered to the output of the VARIANCE block to avoid redundant operations as they will be implemented in the next block, the ECCENTRICITY block. D. MODULE III - ECCENTRICITY The ECCENTRICITY module is a simpler block than those previously presented. This is because it uses operations that have already been performed in the VARIANCE block to calculate eccentricity. The geometric distance  xk−µk  2 (equivalent to (µx k−xk)T(µx k−xk)) is stored in register EREG3 and 1/kis stored in EREG4 register. As the ECCENTRICITY module is the architectural design of Equation 1 (Algorithm 1line 9), the variance value [σ2]x kis multiplied by k(EMULT1) and used to divise (EDIV1) the geometric distance (µx k−xk)T(µx k−xk). This operation output is added to 1/kin the ESUM1 adder, subsequently calculating the eccentricity of the samples (ξk(x)) and delivering them to the ECCENTRICITY block output. E. MODULE IV - OUTLIER Finally, in the OUTLIER block, the samples are classified as abnormal (outlier =true) or normal (outlier =false). VOLUME 9, 2021 103145 L. M. D. da Silva et al.: Hardware Architecture Proposal for TEDA Algorithm to Data Streaming Anomaly Detection FIGURE 3. VARIANCE module. FIGURE 4. ECCENTRICITY module. The design module can be seen in Figure 5. To classify the samples, the OUTLIER block normalizes eccentricity by dividing (ODIV1) with a constant, as shown in Equation 5,. The comparative block (OCOMP1, compares this normalized eccentricity with a threshold as shown in the Lines 11,12,13 and 14 of the Algorithm 1. The registers OREG1 and OREG2 are used to synchronize the iteration number k, since as the modules act in pipeline, the operations carried out in the OUTLIER block (as well as ECCENTRICITY module) are delayed by two clock cycles concerning the system input. F. PROCESSING TIME To parallelize the input of data from the sensors, we use the technique of data parallelization, as described in [39]. All N main modules are identical operators processing, in parallel, different portions of the input data. Each of the N input FIGURE 5. OUTLIER module. signals ([x1 kx2 k. . . xN k]) is processed independently. When the number of input signals increases, this parallel structure can be updated, keeping the OUTLIER and ECCENTRICITY modules unchanged and changing the VSUM1 adder of the VARIANCE module. VSUM1 will perform a tree sum. Exploring this type of parallelism justifies speed up compared to other solutions. In sequential architectures, in cases where the arrival rate or amount of date items exceeds the processing rates of the sequential structure [39], input signals from each sensor are processed one after the other increasing the operator’s input queue. The use of the pipeline technique allows the system to be divided into consecutive operators. Each operator receives the output data from the previous one. Because it’s a 3-step pipeline design, the proposed architecture has an initial delay, d, that can be expressed as d=3×tc(7) where tcis the system critical path time. 103146 VOLUME 9, 2021 L. M. D. da Silva et al.: Hardware Architecture Proposal for TEDA Algorithm to Data Streaming Anomaly Detection TABLE 1. Fault types [40]. The circuit implemented for the TEDA algorithm has an execution time which is determined by the system critical path time, tc. After the initial delay, the execution time of the proposed TEDA, tTEDA, can be expressed as tTEDA =tc(8) Therefore, in every tTEDA it is possible to obtain the output of an inserted sample, that is, the sample classification of abnormal or normal. The throughput of the implementation, thTEDA, in samples per second (SPS) can be expressed as thTEDA =1 tTEDA .(9) V. RESULTS The hardware validation and synthesis results for the architecture proposed in this work are presented in this section. The behavioural simulation results of Algorithm 1are first validated with their corresponding Python-based functional models. Then, the RTL models are synthesized on a Virtex 6 (xc6vlx240t-1ff1156) FPGA device. Validation results were used to verify the hardware functionality, while synthesis results allowed the system to be analyzed for important parameters for the design of hardware architectures. Analysing parameters such as hardware occupancy and processing time whilst also considering factors such as throughput and speedup. All cases were validated and synthesized on floating-point. A. VALIDATION RESULTS To validate the hardware architecture of the TEDA algorithm, we used the DAMADICS (Development and Application of Methods of the Actuator Diagnosis in Industrial Control Systems) benchmark dataset [40]. The benchmark provides a real data set of the water evaporation process in a Polish sugar factory. It is a plant with three actuators; a control valve, which controls the flow of water in the pipes; a pneumatic motor, which controls variable valve openings and a positioner. This dataset has faults at different times of the day on specific days. There are four different fault types, as shown in Table 1. Artificial failures were introduced on specific days to plant operation data. The dataset has a set of 19 faults in these 3 actuators. As a way to validate the architecture, actuator 1 failures were simulated. Table 2shows a detailed description of some introduced faults for actuator 1. The behavioral results, after synthesis, are presented in Figures 6,7,8and 9. The hardware architecture was designed with a floating point number format. FIGURE 6. Behavior of fault item 1 - input vector xk. FIGURE 7. Behavior of fault item 1 - normalized eccentricity ζk(x) with 5/k(m=3) threshold. Figures 6and 7show the results obtained for the fault tabulated as item 1 in Table 2. Figure 6illustrates the behavior of two simulated input variables (xk=[x1 kx2 k]). It is possible to observe that a failure happens between the moments k=58900 and k=59800. In Figure 7it is possible to observe that there is a sudden change in the behavior of the eccentricity (black curve), surpassing the value of the comparison threshold with m=3 (red curve). In Figures 8and 9it is possible to observe the results obtained for the fault tabulated as item 7 in Table 2. Figures 6 and 7, Figures 8illustrate the behavior of two elements of input xk=[x1 kx2 k] and Figure 9shows the eccentricity and the threshold. The failure happens between moments k=37700 and k=38400. It is possible to observe that there is a change of eccentricity (black curve), surpassing the value of the comparison threshold (red curve) also to m=3. B. SYNTHESIS RESULTS After validation of the implemented circuit, the hardware synthesis was wielded to obtain the FPGA resource occupation report, as well as the critical time information and clock cycles used to calculate the proposed implementation processing time. VOLUME 9, 2021 103147 L. M. D. da Silva et al.: Hardware Architecture Proposal for TEDA Algorithm to Data Streaming Anomaly Detection TABLE 2. List of artificial failures introduced to actuator 1 [40]. FIGURE 8. Behavior of fault item 7 - input vector xk. FIGURE 9. Behavior of fault item 7 - normalized eccentricity ζk(x) with 5/k(m=3) threshold. 1) HARDWARE OCCUPATION Table 3presents data related to the hardware occupation of the circuit in the target FPGA for 5 scenarios, with a different number of input sensors for each of them. The first column shows the number of input sensors, the second column displays the number of multipliers used, the third column displays the number of registers, and the fourth column shows the number of logical cells used as LUT (nLUT ) throughout the circuit. Analyzing the data presented in Table 3, it was identified that even whilst using a floating-point resolution, only a small portion of the resources were occupied from the target FPGA. For the first scenario, these resources had a total of only 3% from multipliers, less than 1% from registers, and about 7% TABLE 3. Hardware occupation. TABLE 4. Processing time. from logical cells, used as LUT. This demonstrates that the proposed circuit, when used with a small number of input sensors, could also be applied to low-cost FPGAs, where the amount of available hardware resources are even smaller. In addition, multiple TEDA modules could be applied in parallel, for anomaly detection in the same dataset to further reduce processing time. 2) SAMPLING RESULTS The results for the operational processing time of the architecture are presented in Table 4. The first column indicates the number of input sensors for each scenario, the second column presents the circuit critical time, tc, the third column shows the initial delay, expressed by Equation 7, the fourth column, the TEDA computation-time, expressed by Equation 8, and the last column, the implementation throughput in samples per second (SPS), expressed by Equation 9. The throughput consists of the number of samples processed and classified (as normal or outlier) by TEDA every second. The data presented in Table 4is quite expressive. The circuit critical time, which also corresponds to the TEDA runtime, was only tc=122.1ns in the worst scenario. Hence, after the 366.3 ns delay, it is possible to get output for a processed sample sorted every 122.1ns, which guarantees a throughput of 8.19 million sorted samples per second, for the 32 input sensors case. These results indicate the viability of using the proposal presented in this work to manipulate large data flows in real-time. Another outcome of using the architecture was low consumption systems. As presented in [41] there is a strong dependency between operational clock frequency and the dynamic power. Using the clock rate lower than the maximum theoretical operating frequency causes a decrease in the dynamic power, making it possible to reduce energy 103148 VOLUME 9, 2021 L. M. D. da Silva et al.: Hardware Architecture Proposal for TEDA Algorithm to Data Streaming Anomaly Detection FIGURE 10. Comparison of processing time for different platforms. consumption in applications where the processing speed is not limited and/or there is a need for low energy consumption. C. PLATFORMS COMPARISON To date, no previous literature has been found to explore TEDA hardware implementations. Thus, this paper presents, for the first time, a proposal to implement the TEDA technique on FPGA. To verify the advantages of the hardware application proposed here over implementations on other software platforms, some comparisons of the FPGA processing time with the processing time of other software implementations were made. Table 5presents the results of the comparisons made. The first column indicates the number of input sensors, the second the hardware used, the third presents the processing time required to obtain the classification of each sample, and the fourth column, the speedup achieved by the proposal presented in this paper. The hardware implementation on FPGA proposed here has been able to achieve speedups of up to 3.9 times faster when compared to a C implementation on Intel Core i7-9750H CPU in the first scenario and 19.9 times in the scenario with the highest number of input sensors. For a CUDA implementation using the NVIDIA GeForce GTX 1660 GPU, a speedup of 693 and 538 times was obtained for 2 and 32 sensors input respectively. Figure 10 presents a bar chart with processing time for this FPGA proposal and the two other platforms compared in this work, CPU (with C) and GPU (with CUDA) respectively. The vertical axis is presented in a logarithm scale due to the asymmetry between the CUDA processing time and the other two implementations. The number of input sensors for the 5 simulated and synthesized different scenarios are presented in the horizontal axis. Analysing the Figure is possible to notice that the processing time with CUDA is much more substantial than the others but it remains almost constant, the C data presents an expressive growth with the increase in the number of input sensors while the FPGA processing time performs a slow augmentation. TABLE 5. Software implementations comparison. Regarding the GPU implementation with CUDA, this happens because the process of copy between host and device has an impact in small groups threads due to the system bus bandwidth, latency and also because Single Instruction Multiple data (SIMD) turns into a important constraint for any innate different task [42]. An increase in the number of sensors improves the relative performance of a CUDA implementation as it is possible to handle more threads in parallel, but there is a limit of 1024 threads per block on GPU devices. Threads from different blocks share data through global memory using different kernel invocations, adding overhead [43]. All the CUDA scenarios used here for comparison were done in a single thread block. The C implementation presents an expressive growth in the processing time due to the sequential architecture of the CPUs where augmenting the number of sensors has a significant impact. The FPGA sensors inputs (nMEAN modules - µn k) are parallel, this makes it possible to increase the number of sensors without losing a lot of performance and throughput. Despite this, the tree sum in the VSUM1 adder (VARIANCE module) causes a slight increase in the FPGA processing time. VOLUME 9, 2021 103149