dataesr/scientific-paragraphs-categorization huggingface dataset:
The housing could be mounted with a standard 100 mm pipe bracket from a hardware or plumbing store. Bluetooth Low Energy, WiFi and Sigfox) capacity with a micro-controller. Programming for the LoPy4 is in MicroPython  [29] , a variation of the popular Python  [30]  language. The LoPy development board  [31]  provides an SD card socket and a small aerial was attached inside the case. Arduino hardware is cheaper than the LoPy4 and works well in situations where radiocommunications were not available. The language is C++ and there are many software libraries available. More recent versions of Arduino have LoRaWAN capability built in (e. g. Seeed studio). Software created for the devices is open source and freely available for download. The devices with Arduino processors used Arduino scripts and the devices equipped with LoPy4 chips used Micropython.
Consistency between sensors Two sensors were compared by locating them in the same housing and making measurements for 14 days. The 2 sensors in the same housing produced very similar readings in the comparison. Data was collected every 40 sec for 14 days, resulting in 30,909 readings. The full dataset is plotted for PM 2. With averaging over 15 minutes, the small differences in raw data between the sensors were almost eliminated: The comparison between sensors in the single housing showed excellent agreement between the 2 sensors across all concentrations measured. The differences in spread between PM 2. 5 and PM 10 are most likely due to the 3-fold increase in concentration for PM  10. The small scatter of readings suggests that averaging of the data is beneficial. A 15 minutes interval of averaging gives a good compromise between accuracy and temporal resolution for these sensors.
Roadside values were elevated well above the Australian recommended safe limits (8 μg m -3 annual average or 25 μg m -3 daily average  [44] ) for much of the measuring period. This is consistent with the results of a study  [45]  in Randwick, a municipality in south-eastern Sydney. PM 2. 5 concentrations along a main road there were about double those at the nearby Randwick Air Quality Monitoring Station. Readings from other roadside devices (Fig  8 ) around the city centre showed that elevated readings were common. Even though all devices were located in the city centre, readings differed considerably between locations. This data will allow for relative estimates of exposure at different locations and assist in prioritising where efforts need to be made to reduce exposure to hazardous pollution.
Concentrations at roadsides were often up to an order of magnitude greater than background values measured at a nearby air quality station. Since the publicly available air quality data is derived from the background readings, roadside data provides valuable additional information for people spending time in city streets. Accuracy of PM 2. 5 measurements may be improved with the addition of sensors to measure temperature and humidity  [46]. The devices were reliable, after initial software bugs and hardware problems were eliminated (e. g. communications problems, drifting of the real-time clocks, power management) and the housing optimized for outdoor environments. Those attached to mains power and connected to the LoRaWAN network returned data 95% of the time. The only downtimes were due to an outage of the network infrastructure used by The Things Network.
Since the sensors are transmitting a limited amount of information every 40 seconds (the payload of each message is only 12 bytes), the sensors have a very limited footprint on the overall capacity of the network. The network of sensors has been deployed for over a year; we do not know how well the sensors will perform over extended periods. It is likely that at some stage, continuous exposure to contaminated air will result in a loss of sensitivity. We plan to re-test the performance of the sensors following the recent extended and severe bushfire season. Finally, as part of the Smart Cities, Smart Liverpool, Smart Pedestrians project, air quality sensors are collocated with other visual sensors dedicated to monitor the flow of people and vehicles. The data from the two types of sensors can be combined to compute the PM exposure of pedestrians in the central business district.
Acknowledgments For technical advice and logistical support:  Clare Murphy  ( Paton-Walsh ) and  Graham Kettlewell  from the  Centre for Atmospheric Chemistry at the University of Wollongong. Mitch Boles  for his assistance with installing devices. Liverpool City Council, particularly  Emily Tinson  and  George Harb , for assistance with installation of sensors in Liverpool. Ruby Kan from the  NSW Department of Planning, Industry and Environment  for assistance with device validation. Chris Dunn ,  SMART Infrastructure Facility, University of Wollongong , for the construction instructions and University of Wollongong Engineering Mechanical and  Electronics Workshops  for construction of the devices, particularly  Steve Selby  and  Frank Mikk.
In response to these risks, a first approach is to use network intrusion detection system (IDS) tools such as Snort (open source IDS tool) to analyze network traffic and extract signatures that can be compared to known attack signatures. This type of approach has two limitations: on the one hand, the signature of an attack must already be known and on the other hand, it generates a high false positive rate  [4]. An alternative approach is to use Machine Learning (ML) techniques. These techniques include supervised learning to classify network flows into different categories and unsupervised learning to detect anomalies. Supervised learning is only possible by having a dataset available, in this case the recording of network frames containing normal traffic and attacks. Cellular or WLAN conecctivity are quite common in IoT and connected cars and we can consider that the intrusion is similar to the attack that would be carried out on a conventional computer network.
Common network intrusion detection datasets like KDD-Cup99  [9] , NSL-KDD  [17]  or CICIDS2017  [14]  containing different types of attacks against computers or servers can be used for IoT and connected cars. Traditional machine learning algorithms and neural network-based techniques (also called deep learning) can be used as supervised learning methods. The former group contains algorithms like Decision Tree, Random Forest, or SVM. Multi-Layer Perceptron (MLP), Convolutional Neural Network (CNN) or Recurrent Neural Network (RNN) are examples of the latter group. In IDS researches, many papers cover deeply the traditional approaches while a smaller amount of papers concentrate on neural network techniques. Our main contributions consist in two parts. Firstly, we propose an approach based on multi-layer perceptron exercised on recent dataset.
CICIDS2017 contains intrusion attacks and traffics that are representative of current network usage. All steps are detailed from dataset analysis to tuning of neural network. Secondly, we analyse previous works on the same dataset and compare their performances with our experimental results. This paper presents in section 2 the related work. Our proposed methodology is described in section 3. Section 4 provides the results of our approach using several metrics and compares it to previous works. A link to the source code is provided so that it can be used to reproduce results and for further improvements. Finally, section 5 concludes this paper and identifies ideas for future work.
Related work Several studies have been conducted on multiple network intrusion detection datasets using various methods. Dhanabal et Shantharajah  [3]  analyzed the NSL-KDD dataset content and studied several classifiers from the traditional machine learning techniques. They obtained pretty good intrusion detection with accuracy around 99% with SVM and J48 (C4. 5) decision tree. Tang et al. [16]  used a deep learning approach on the same dataset. They proposed a small neural network with a very limited number of features in input and reached an accuracy of almost 76%. With the release of CICIDS2017, Sharafaldin et al. [14]  provided performances of intrusion detection on their dataset. A significant gap is observed on precision, recall and f 1 -measure between all traditional ML algorithms and multi-layer perceptron.
K-Nearest Neighbors and Quadratic Discriminant Analysis outperformed MLP by almost 20%. Feature selection, data pre-processing and details about the classifiers are not described and therefore results cannot be reproduced. In their paper, Jiang et al. [6]  focused only on denial of service, 4 classes among the 14 of CICIDS2017 dataset. They proposed new features and compared the results of a neural network with features provided in original CICIDS2017 CSV files. A two-level model was proposed by Ullah et Mahmoud  [18]. The first level classes traffic either as normal or attack with a decision tree and the second one identifies the attack type with a random forest after data augmentation based on synthetic minority oversampling technique  [2]  and edited nearest neighbors. The method has been tested on CICIDS2017 and UNSW-NB15 datasets.
Choice of dataset KDD-Cup99 is a dataset for IDS publicly released in 1999. It is derived from DARPA-98 dataset that contains raw data corresponding to captured network frames with TCPDUMP. The training set is composed of 24 types of attacks. Raw data have been processed to produce 41 features in KDD-cup99. A first critique of this dataset has been carried out by McHugh  [10]. Tavallaee et al. [17]  provided a detailed analysis and proposed a derived dataset referred to as NSL-KDD with the goal to solve some of the shortcomings of KDD-Cup99 described McHugh. NSL-KDD dataset has been widely used for IDS since 2009. Despite that attacks has evolved over the time, KDD-Cup99 and NSL-KDD remains a subject of study  [13]  [15]  [20]. We can consider that most of current attacks are not present in a dataset relying on traffic recorded 20 years ago.
In 2015, Moustafa et Slay proposed a new dataset called UNSW-NB15  [11]  that has been generated by simulation and representing 31 hours of traffic. As a major difference with NSL-KDD, it contains low footprint and modern attacks retrieved from CVE site 3  that are grouped in nine different families of attacks. UNSW-NB15 is composed of 49 features. A part has been extracted from packet headers while some others have been generated specifically. Gharib et al. [5]  reviewed different datasets and evaluated them with respects to 11 criteria: complete network configuration, complete traffic, labeled dataset, complete interaction, complete capture, available protocols, attack diversity, anonymity, heterogeneity, feature set, metadata. On top of elements already identified in  [17] , KDD-Cup99 and therefore its NSL-KDD derivative suffer from the lack of some important protocols like HTTPS.
The University of New Brunswick's Canadian Institute for Cybersecurity released the CICIDS2017 dataset based on the framework defined in  [14]  intending to solve shortcomings of previous datasets. Raw data in the form of PCAP files are provided together with a set of 84 features in CSV files. Network traffic has been recorded over 5 days. The first one only contains normal traffic while 14 types of attack appear for the other days. Due to the shortcomings of KDD-cup99 and NSL-KDD, we restricted the choice to either UNSW-NB15 or CICIDS2017. Table  1  presents 7 parameters. The first one is year of creation of each dataset. Then the number of features gives us the quantity of input data and labels characterizing each record. The number of records and the distribution between normal traffic and data are important information for dataset selection.
We observe that CICIDS2017 is more recent, include more features and contains more instances than UNSW-NB15. Date of creation and quantity of data are key elements. Firstly, old dataset are no longer representative of current network traffic. As example NSL-KDD does not contain HTTPS exchanges while it represents more than 70% of traffic today. Secondly, more data leads to better learning. For these reasons, CICIDS2017 dataset is selected for the evaluation of our intrusion detection solution.
Data Preparation Original dataset Clean-up A series of operations has been carried out to detect the presence of empty lines, redundant features and non numeric values in numeric fields. This systematic verification allowed to drop more than 280,000 instances whose all features were empty. One column corresponding to forward header length appearing twice, one instance has been removed. Most of features are numeric but some values are not a number. Such cases appear in 6 different traffic types: BENIGN, FTP-PATATOR, DoS Hulk, Bot, PortScan and DDoS. As the number of instances containing 'NaN' or 'Infinity' is negligible in each traffic type, these instances have simply been removed. Table  2  provides the number of records for each traffic type and the number of 'NaN'/'Infinity'. Each instance is characterized by its source and destination port and IP address, its protocol and a flow identifier containing the same information.
As 'FlowID' feature is redundant with other features, it has been removed from the dataset. Our model will be trained with 2 feature sets in order to ease comparison with previous works on the same dataset. Variant-1 contains 73 characteristics: all features except those listed above. In variant-2, source/destination IP address and source port have be dropped, resulting in 70 features. Standardization Data pre-processing is essential to prepare the dataset for an efficient training. In particular, the neural network can better learn when all features are scaled within the same range. This is especially useful when the inputs are on very different scales. Several normalization techniques exist. In our implementation, Z-score normalization (also called standardization) has been selected as it presents better results than other techniques on the selected dataset.
Model creation Model description Multi-layer perceptron is a fully connected, feed-forward neural network classifier. Figure  2  shows the architectural design of our model. Inputs correspond to the normalized values of the selected features of the original dataset. Both hidden layers contain 256 nodes. The classifier has 15 outputs for the 14 types of attacks and the benign traffic. Dropout is used as regularization technique for hidden layers to prevent over-adjustment on training data by dropping units randomly in the MLP with a probability keep prob. Neural network output h (3) is calculated by chaining outputs of the different layers according to equations 2, 3 and 4 in which x, W (i) and b (i) are respectively the input vector containing selected features, the matrix of weights and the vector of biases for layer i.
Evaluation Metrics Several key information can be extracted from a confusion matrix as depicted in Table  4 : True Positive (TP) is the number of attacks correctly predicted as attacks, True Negative (TN) is the number of normal instances classified as normal traffic while False Positive (FP) and False Negative (FN) are respectively the number of normal instances classified as attacks and the number of attacks predicted as normal traffic. Different metrics can be derived from the information contained in the confusion matrix. As some existing papers use only a subset of metrics, we propose to cover more metrics in order to enable comparison of our work with future studies on the same dataset. T N rate given in equation 8 is the percentage of traffic classified as benign over the actual number of benign instances and F P rate in equation 9 is the percentage of benign traffic classified as attacks.
P recision = T P T P + F P (10) Recall = T P T P + F N (11) Accuracy measures the proportion of total number of correct classifications. Accuracy = T P + T N T P + T N + F P + F N (12) f 1 score is the harmonic mean of P recision and Recall f 1 score = 2 × precision × recall precision + recall (13) Matthews Correlation Coefficient (MCC) is an interesting measure taking into account all elements of the confusion matrix in a correct way for imbalanced dataset as opposed to the accuracy which may report high value even when the whole minority class is wrongly classified. As intrusion detection datasets are intrinsically imbalanced, this is an key metric for such application. MCC provides a value between -1 and +1. A perfect prediction corresponds to M CC = 1. At the opposite, M CC = -1 denotes a full disagreement between predictions and actual classes.
This clearly show the importance of these 3 features. Even if the accuracy is above 99%, the recall falls from 99. 99% to 99. 34% and F P rate goes up from 0. 08% to 0. 62%. Our classifier provides an MCC value close to 1 and therefore indicate a pretty good performance. All results can be fully reproduced by using the source code available on Github (https://github. com/ArnaudRosay/mlp4nids) to generate the training, cross-validation and test sets, build the golden model and obtain the values of all the metrics described in this document.
Conclusion This paper proposed an approach based on multi-layer perceptron for network intrusion detection system covering analysis of the dataset, definition of the MLP and its training. As in any machine learning project, cleaning the dataset and selecting features is an important step before optimization of a neural network. The experiment has shown that MLP is a viable solution reaching top performance. Our approach provides better results than previous implementations with neural networks. It should be noted that IP addresses and destination port are important features, helping to detect intrusion detection. Nevertheless this is not suitable for real world implementation. Without these features, our approach reaches high performance at the cost of a longer training phase. Deep learning techniques are computationally expensive.
CICIDS2017 Traffic Instances. Training set, cross-validation set and test set creation As shown in Table2, the dataset is highly imbalanced at two different levels. First, the normal traffic (BENIGN) accounts for 80% and second, some attacks (Heartbleed, Infiltration, WebAttack SQL injection) are represented by a very limited number of instances. This is known to be a challenge for supervised learning. The proposal to create dataset for MLP training and testing consists in choosing randomly 50% of each attacks for the training set, 25% for the cross-validation set and 25% for the test set, ensuring that each instance is used only once. Then each set is completed by adding randomly selected instances of normal traffic. This results in a dataset that is balanced in term of normal traffic versus attacks but still imbalanced in term of attack types.
Dataset Split. Feature selection Feature selection is one of the fundamental concepts of machine learning that greatly influences the model performance. Irrelevant or partially relevant features can have a negative impact and lead to a decrease in accuracy. An analysis of the dataset revealed 8 features that are not informative as their value is constant whatever the traffic types. Consequently, features 'Bwd PSH Flags', 'Bwd URG Flags', 'Fwd Avg Bytes/Bulk', 'Fwd Avg Packets/Bulk', 'Fwd Avg Bulk Rate', 'Bwd Avg Bytes/Bulk', 'Bwd Avg Packets/Bulk', 'Bwd Avg Bulk Rate' have been dropped. As we don't want the model to learn when attack occurs, the 'Timestamp' feature cannot be considered as informative.
Stimuli and Task Stimuli  (Vilarem et al. , 2019)  were presented using Psychophysics Toolbox 3  (Brainard, 1997; Kleiner et al. , 2007 ) in MATLAB version 2014b (MathWorks, Inc. , 2014). They depicted a waiting room with four chairs, with two individuals seated on the two chairs in the middle. One of the two depicted individuals always displayed a neutral facial expression while the other displayed, in one third of the trials, either a neutral, angry, or fearful expression. The stimuli included facial expressions from 10 different pairs of individuals from the Radboud Faces Database  (Langner et al. , 2010) , which were matched for gender as well as for perceived threat and trustworthiness  (Vilarem et al. , 2019). Expressions of anger and fear varied along 4 levels of intensity (morphs between the neutral and the full emotional expression), which were equalized for perceived emotion intensity  (El Zein et al.
After session 1, the experimenter attached electrodes to participants' hand-wrists and demonstratively turned on the heart rate acquisition system, although no data were recorded. To minimize possible experimenter biases, participants were randomly assigned to a posture condition just before posture instructions were provided (see SI for more details on instructions). Careful debriefing at the end of the experiment suggested that only 12 participants had noticed an influence of facial expressions on their decisions, none could specifically identify anger and fear as the two displayed emotions, and only 2 participants suspected a link between the posture and the task. Excluding these 2 participants did not change the results. Such low familiarity with power posing may be due to the fact that all sessions were conducted between November 2016 and March 2017, when media coverage on power poses in France was low.
Data Analysis After exporting data from Matlab, all analyses were conducted in R version 3. 4. 4 (R Core Team, 2018) using the packages dplyr, tidyr, ez, ggplot2 and psych  (Lawrence, 2016; Revelle, 2017; Wickham, 2009; Wickham et al. , 2017; Wickham & Henry, 2018)  , in addition to those specifically mentioned below. We recorded which chair was chosen (coded as moving away from or toward the emotional individual), and the movement kinematics initiation time (time from scene onset to mouse click) and movement duration (time from mouse click to release within the chair area).
Data cleaning. Only valid trials were included in the analysis (landing on top of a chair area and under 1400ms). Additionally, we removed two types of trials which reflected lack of compliance with task instructions: trials in which participants anticipated the scene onset due to the fixed duration of the inter-trial interval and clicked too early (trials with initiation times below the 5th percentile, i. e. below 95ms) and trials in which participants clicked after the beginning of the movement (trials for movement durations below the 5th percentile, i. e. shorter than 184ms). To ensure a sufficient number of trials per participant, we required at least 50% of valid trials per session above the respective 5th percentile threshold for both initiation time and movement duration, which entailed the exclusion of 6 participants.
Proportion of choice. Analysis of choice (away vs. toward), and movement kinematics was performed using linear mixed-effects models (LMEM) as implemented in the lme4 package  (Baguley, 2012)  to account for repeated-measures and the unbalanced design (unequal number of participants per posture and valid trials per condition), and to consider random variation between participants as well as stimuli. For choice, we analysed effect of emotion (anger vs. fear, within-subject), and session (session 1 baseline vs. session 2 with posture, within-subject) and posture (expansive vs. contracted, between-subject). We chose not to examine the effect of intensity because we had no particular hypothesis regarding intensity and posture, and models without intensity already involved interactions of three and four predictors for choice and kinematics, respectively.