dataesr/scientific-paragraphs-categorization huggingface dataset:
III. UNIFIED DEEP LEARNING MODEL Let A = {A 1 ,. A k ,. A K } be a set of K activity classes and I k = {I 1k ,. , I jk ,. I Jk } be a set of J activity instances of A k in training data set observed by S sensors deployed at different locations in a smart home. Each instance of an activity I jk is represented by a set of R features, F jk = f r jk R r=1. The features represent the duration spent to complete an activity, the number of sensors that are activated during an activity, the number of times an activity is performed by day, and the states (e. g. , ON/OFF) of all sensors during an activity. Our proposed unified model consists of three steps as shown in Fig. 1. In the first step, it extracts useful features from a given pre-segmented or labeled activities dataset. The extracted features should provide enough information about the classes so that a classifier can give high prediction accuracy.
IV. RESULTS AND DISCUSSION We evaluate our proposed monitoring system on a CASAS smart home datasets called Aruba and Cairo. In this section, we first present an overview of the datasets, followed by feature analysis and extraction. Then we evaluate the performance of different classifiers to recognize activities performed in smart homes, and separate anomalous activities from normal activity. The activities are then organized as consecutive series of events. A sequence prediction technique is employed to predict the next activity. The classification models are implemented in Python 3 using Keras and Sklearn open source libraries.
A. DATASETS We use Aruba and Cairo dataset to evaluate the performance of our proposed algorithms. The Aruba dataset consists of data from a total of 39 sensors, out of which 31 are used for motion sensors (M001-M031), 3 door closure sensors (D001, D002, and D004) and five temperature sensors (T001-T005). The activities of an elderly woman living in a house with layout as shown in Fig. 5a  are recorded for 220 consecutive days (∼7 months). There are 11 activities annotated within the dataset which consists of 1,719533 raw sensor data as shown in Fig. 5b. The number of times the activity appears in the dataset is given in Table  1a. As shown, the dataset is imbalanced, as some activities occur more frequently than others. The table also shows the activities performed on the first and second days as an example.
Some activities like sleeping begins at one day and completes in the next day, so in our analysis we assumed this activity belongs to the starting day only. Cairo dataset consists of 27 motion sensors (M001-M027) and 5 temperature sensors (T001-T005). It has 13 activities as listed in Table  1b  with shortcuts used in our paper. The dataset is collected for two adult couples (R1 and R2) and a dog living in the smart home. The couple's children also visited the house at least once. The data consist of 726534 raw sensors reading for 57 days distributed for the 13 activities as described in Table  1b.
B. FEATURE EXTRACTION From the dataset, we extract four features for activities recognition. The first feature is the ''duration'' which defines the total time spent to complete an activity. The second feature is the ''sensor count'' which represents the number of times each sensor remains active during an activity. The third feature is the ''activities per day'' which describes the number of times each activity is performed in a single day. The fourth feature is the set of ''sensor states'' which describes the states of sensors (ON/OFF) during an activity. Fig. 6  shows boxplot for the duration of activities performed by an elderly woman for 220 days, we plotted Relax (Rlx) and Sleeping (Slp) activities in separate figure because they takes longer duration than others. For illustration purpose, we omitted in Fig.
By summing up all the activities performed per day, we plotted the histogram as in Fig. 8b. The fitting curve on the histogram shows that an average of 29 activities is performed per day with a standard deviation of 7 days. The information provided by the figure determines the daily routine of an elderly resident, moreover, it provides information on whether the elderly is able to independently execute daily activities or need an intervention  [21] , for instance, a day is considered as anomalous if the number of activities executed in that day deviates from the normal pattern. We also extracted the three features presented earlier for the Cairo dataset as shown in Fig. 9. The duration boxplot (Fig. 9a ) shows the activities have different execution times and the highest outliers are found on Night Wandering activity.
C. ACTIVITY RECOGNITION ANALYSIS The extracted feature based on the label activities has 6477 instances, Table. 2 shows an example of the extracted features that will be used for activities recognition. used the following performance metrics to a classifier  [31] : Precision (specificity) = TP/(TP + FP) (1) Recall (sensitivity) = TP/(TP + FN) (2) Precision and recall are used to measure how well the classifiers perform on an imbalance dataset. The balance between the precision (P) and the recall (R) scores is described by F1-score as  [32] : F1-score = (2 * Precision * Recall)/(Precision + Recall) (3) On the other hand, the accuracy metric is given by: Accuracy = (TP + TN)/(TP + TN + FP + FN) (4) which represents the percentage of correctly classified activities, where TP is true positive, TN is true negative, FP is false positive and FN is false negative.
Matthew's correlation coefficient (MCC) is a coefficient that ranges between [-1, 1]. A coefficient of 1 indicates a perfect classifier, while 0 means a totally random prediction. A coefficient of -1 indicates a negative correlation or total disagreement between the prediction and actual value. The MCC is calculated as  [33] : MCC = (TP * TN -FP * FN) / (TP+FP) * (TP+FN) * (TN+FP) * (TN+FN) (5) We used a deep neural network with 3 input layers, three hidden layers with 128 neurons each and output layer with 11 neurons. Relu activation function is used for the first and second hidden layers, where softmax function is used for the last layer. Adam optimizer is used with a learning rate of 0. 001. The training of the network is performed with 50 epochs consisting of 128 batches. The Aruba data which includes 6477 instances is divided into 70% for training and 30% for testing.
The decision tree classifier has shown comparable performance to DNN. To further improve the classification task, we combined the three input features with the binary sensor states and evaluated the performance of the classifiers as shown in Table  3c. The table shows further improvement in all the metrics performance. The best classification has been achieved by linear SVM, where the F1-score has been improved from 51% in Table  3a  to 71% in Table  3b  to 90% in Table  3c. It is worth mentioning that, the three classifiers DNN, Decision tree and SVM (linear) have shown competitive performance in the three scenarios. Table  4  provides a summary of the features that are extracted from the Aruba dataset, the classifiers used and metrics performance that has been achieved in other literature paper in comparison to best result obtained by our works.
For Cairo dataset, Table  5  shows comparison of the classifiers using 35 inputs which are duration, sensor count, activity per day and the states of 32 sensors during an activity. The best performance is achieved by the proposed DNN. In  [12] , accuracy of 70. 10% is achieved using motion sensor ON/OFF, 72. 73% using count of motion sensors, and 76. 57% using graphic-based method. Our achieved result for Cairo dataset is very closed to the graphic-based method used in  [12].
D. ANOMALY DETECTION After performing activity recognition, it is important to check if the given activity is normal or abnormal. However, the dataset does not provide ground truth to know the anomaly detection. We can generate approximate ground truth based on boxplot analysis by defining two conditions of anomaly events. The first condition is the deviation of duration of activity from the whisker (Fig. 6 ), and the second condition is based on the deviation of number of sub-events for activity from whisker (Fig. 7 ), where the whiskers are Q 3 + 1. 5(Q 3 -Q 1 ) and Q 1 -1. 5(Q 3 -Q 1 ) and Q s is the s th quartile. If a certain event satisfies the two conditions, it is considered an anomaly. Table  6  shows the number of normal and anomaly events for each activity of the Aruba and Cairo datasets.
We can observe the number of normal behavior is greater than the anomalous per activity, activity like 'Resperate' has no anomaly event recorded and activity 'Housekeeping' has only one anomaly. In the Cairo dataset, the number of anomaly instances is very small compared to Aruba instances. Within each activity class, the anomaly detection approach identifies activity instances with abnormal duration and number of events. The Aruba datasets are used with a trainingto-test ratio of 70:30 for each activity class. The anomalies correctly identified by the anomaly detection approach are represented by true positives (TPs). Since we have only two input features (duration and sensor count), we propose to use OCD-AE with hidden layers consist of 32, 14, 7 and 14 neurons each. Activity regularizer of 10 -7 and reduction in hidden layers neurons are used to prevent AE from learning identity function and improve the ability to capture useful features.
The performance evaluation of the proposed autoencoder and other popular classifiers such as SVM and K-means for anomaly detection in the Aruba dataset are shown in Table  7. We also include the results obtained by the H2O autoencoder used in  [21]  for comparison purpose. It is noted that the proposed OCD-AE correctly identifies the maximum number of TPs (anomalies) in 10 out of 11 activities with accuracy of more than 90%. The K-means classifier shows a comparable performance with accuracy of more than 90% for 8 activities, in which 4 of them achieved higher accuracy than the proposed autoencoder. 12a  shows example of AE reconstruction error that is used to classify normal and anomaly event for the activity 'Work'. The threshold value is chosen to be 0. 07 to decide the anomaly events. Five events are TPs classified correctly as anomaly and 44 events are TNs classified correctly as normal events.
However, two anomaly events are FPs classified wrongly as normal and 1 event is FN classified as anomaly event. The drawback of autoencoder is the requirement to manually select the threshold value based on the reconstruction error to classify anomaly events. Fig. 12b  shows receiver operating characteristic (ROC) plot that demonstrates the good ability of the autoencoder to discriminate between normal and anomaly cases. Table  8  shows the anomaly detection for Cairo dataset, the proposed OCD-AE performs the best in most of the activities and only it has been outperformed by SVM in activity R2_take_medicien (R2Me).
E. NEXT ACTIVITY PREDICTION The activities performed by a resident can be arranged in a sequence to predict the next activity. Certain activities are easily predictable, such as ''leave home'' activity is always followed by ''enter home'', ''Sleeping'' activity is sometimes followed by ''bed_to_toilet'' activity, however, other activities need a technique to learn the pattern of activities performance. To predict the next activity, we arranged the normal activities as sequence and employed three algorithms such as LZ78, ALZ and LSTM to do the prediction. In the Aruba dataset, LZ78 generated a tree with 808 nodes while ALZ generated a tree of 20819 nodes using 70% of the sequence as training. The remaining 30% of the sequence is used for testing the accuracies of the algorithms. The accuracy of sequential prediction algorithms for the activities in Aruba and Cairo datasets are shown in Fig.
13. LZ78 and ALZ give accuracies of 38% and 50. 3% respectively with a sequence length of 4. LSTM gives an accuracy of 54. 6% with memory length of 4 using two hidden layers with 32 neurons each and 0. 5 dropout layer between them. For the Cairo dataset, the best accuracy is achieved by LSTM with 45. 4%. The accuracy of sequence prediction algorithms are low due to the limited length of sequence used for training the models, for example, the length of the training sequence in the Aruba dataset is greater than the Cairo dataset, therefore, we can notice an improvement in the algorithms accuracy of Aruba dataset.
V. CONCLUSION This paper proposed a new sensor-based unified deep learning model for monitoring the elderly with cognitive impairments (such as dementia) living in a smart home. Our proposed method can recognize activities, detect anomalies and predict next activity by exploiting neural networks techniques such as deep neural network (DNN), overcomplete-deep autoencoder (OCD-AE) and long shortterm memory (LSTM) network respectively. The accuracy of the activity recognition task has been increased by adding more features extracted from the dataset. Our results on activity recognition show great competition between DNN, Decision tree and SVM classifiers. Accuracies of 93% and 76% have been achieved in Aruba and Cairo datasets respectively by DNN. In addition, results on anomaly detection give promising results to detect most of the abnormal behaviors with accuracies of more than 90% detected using the proposed OCD-AE by considering boxplot outliers as ground truth.
Finally, a clean sequence of activities has been constructed by discarding the anomalous instances. A sequence prediction algorithm such as LSTM has been used to predict the next activity. The proposed approach provides a comprehensive monitoring system that has the ability to recognize activities, detect anomalies and predict the next activity to assist elderly and medical team to identify health situations and generate preventive and corrective measures. A future work for this research paper can be extended to study approaches to handle the imbalance dataset to improve the deep learning models.
, 2016). Mother-child pairs were recruited from the general population from 2003 to 2010 at early prenatal care visit (during the first trimester for INMA and RHEA, during the first and second trimesters for EDEN, and during the second and third trimesters for BiB). Children were followed at similar ages from pregnancy through childhood. We included singleton children with urban exposure data available (13,954 children). We further excluded children who were missing for all cognitive or motor scores (from 26% for INMA to 61% in BiB) resulting in 5,403 children  (Appendix, Figure S. 1). Each cohort obtained approval from national ethics committees and all participating women provided informed written consent.
Urban environment assessment Assessment of the urban environment (i. e. built environment, natural spaces, and air pollution) was conducted using a geographic information system (GIS)-based environmental model built for the whole HELIX study area. Exposures were assigned to the home addresses during pregnancy (from conception to birth) and for the year before the cognitive and motor assessment (hereafter referred as "childhood"). The detailed description of the exposure assessment can be found in  Robinson et al. (2018). Sources of data for each exposure are summarized in Supplementary material, Table  S1. Briefly, for built environment indicators, we obtained topological maps from local authorities or from Europe-wide sources. We calculated population density as the number of inhabitants per square kilometer at the home address (from 100 m × 100 m raster).
Statistical analyses Continuous exposure variables with a non-normal distribution were transformed to approach normality using a Box-Cox power transformation approach. All continuous exposures were standardized by the interquartile range (IQR) to express all estimates as the mean change in outcome score for an IQR increase in exposure level. Missing data for all potential confounding variables and exposures among all participants with available data on at least one outcome variable were imputed using the chained equations method (Appendix, Table  S5 ). We generated two sets of twenty imputed datasets, one for cognitive outcomes and one for motor outcomes, used in all of the analyses mentioned hereafter. Rubin's rules were used to aggregate the results from the twenty imputed datasets  (Little and Rubin, 2019).
Mediation analysis Third, when we observed 1) associations of urban environment with air pollution, 2) of urban environment and air pollution with the same outcome, and 3) urban environment was not used to model air pollution  (Beelen et al. , 2013; Eeftens et al. , 2012) , we applied mediation analysis for estimating whether part of the urban environment effect was mediated by air pollution  (Valeri and VanderWeele, 2013). We used linear regressions for both outcome regression and mediator regression models on the twentieth imputed dataset. Standard errors were calculated using bootstrapping. We estimated the natural direct effect, the natural indirect effect, and the total effect. We also calculated the proportion mediated as the natural indirect effect/total effect. All statistical data from all areas were pooled in a mega-analysis to increase statistical power, avoid assumptions of within-area normality and known within-area variance, and assuming homogeneity of the estimates between areas.
To confirm the validity of mega-analysis, for exposures included in the multi-exposure models, we analyzed associations separately for each area, and area-specific effect estimates were combined using inverse variance-weighted random-effects metaanalyses with the Der Simonian-Laird estimator  (Smith-Warner et al. , 2006). We assessed heterogeneity in the estimates using the I 2 statistic. We did not interpret the associations of the mega-analysis in case of heterogeneity across areas. All analyses were performed with R statistical software (version 4. 0; R Development Core Team), using the mice package for multiple imputation, DSA for the DSA algorithm, regmedint for mediation, and ggplot2 for drawing plots.
Acknowledgements We are grateful to all the participating children, parents, practitioners and researchers in the four countries who took part in this study. This work was supported by funding from the  European Community 's  Seventh Framework Programme  [FP7/2007-206 n 308333; the  HELIX  project]. This INMA cohort was funded by grants from  Instituto de Salud Carlos III  (Red INMA  G03/176 ;  CB06/02/0041 ;  PI041436 ;  PI081151  incl. FEDER funds,  FIS PI06/0867 ,  FIS-PI09/00090 ,  FIS  and  FIS-PI18/ 01142  incl. FEDER funds, FIS-FEDER:  PI03/1615 ,  PI04/1509 ,  PI04/ 1112 ,  PI04/1931 ,  PI05/1079 ,  PI05/1052 ,  PI06/1213 ,  PI07/0314 ,  PI09/02647 ,  PI11/01007 ,  PI11/02591 ,  PI11/02038 ,  PI13/1944 ,  PI13/ 2032 ,  PI14/00891 ,  PI14/01687 ,  PI16/1288 ,  PI16/00118  and  PI17/ 00663 ;  FIS-FSE: 17/00260 ;  Miguel Servet-FEDER   CP11/00178 ,  CP15/ 00025 ,  CPII16/00051 , and  CPII18/00018 ), from  UE  ( FP7-ENV-2011 cod 282957 ,  HEALTH.
The work was also supported by  MICINN  [ MTM2015-68140-R]  and  Centro Nacional de Genotipado-CEGEN-PRB2-ISCIII (Spain). The Rhea project was financially supported by European projects, and the  Greek Ministry of Health  ( Program of Prevention  of obesity and neurodevelopmental disorders in preschool children, in Heraklion district, Crete, Greece: 2011-2014; " Rhea Plus": Primary Prevention Program of Environmental Risk Factors for Reproductive Health , and Child Health:  2012-15 ). This paper presents independent research funded by the  National Institute for Health Research (NIHR)  under its  Collaboration for Applied Health Research and Care (CLAHRC) for Yorkshire and Humber (UK). The EDEN study was supported by  Foundation  for medical research (FRM),  National Agency for Research (ANR) ,  National Institute for Research in Public health (IRESP: TGIR cohorte santé 2008 program ),  French Ministry of Health (DGS) ,  French Ministry of Research, INSERM Bone and Joint Diseases National Research (PRO-A) , and  Human Nutrition National Research Programs, Paris-Sud University, Nestlé ,  French National Institute for Population Health Surveillance (InVS) ,  French National Institute for Health Education (INPES) , the  European Union   FP7  programs (ESCAPE, ENRIECO, Medall projects),  Diabetes National Research Program  (through a collaboration with the  French Association of Diabetic Patients (AFD)) ,  French Agency for Environmental Health Safety and French National Agency for Food Security (now ANSES) , Mutuelle Générale de l'Education Nationale  a complementary health insurance (MGEN), French-speaking association for the study of diabetes and metabolism (ALFEDIAM).
This task requires to verify the truthfulness of messages related to a particular event and return a binary decision stating whether the message is authentic. In the literature, most automatic rumor detection approaches address the task as a classification problem. They generally extract features from two aspects of messages: textual content (Pérez-Rosas, Kleinberg, Lefevre, & Mihalcea, 2018) and social context (L. Wu & Liu, 2018). However, the multimedia content of messages, particularly images that present a significant set of features, are little exploited. In this paper, we second the hypothesis that the use of image properties is important in rumor verification. Images indeed play a crucial role in the news diffusion process. For example, in the dataset collected by  Jin, Cao, Zhang, Zhou, and Tian (2017) , the average number of messages with an attached image is more than eleven times that of plain text messages.
Eventually, we conduct extensive experiments two real-world datasets to show the effectiveness of our rumor detection approach. MONITOR indeed outperforms all state-of-the-art machine learning baselines with an accuracy and F1-score of up to 96% and 89% on the MediaEval benchmark  (Boididou et al. , 2015)  and the FakeNewsNet dataset  (Shu, Mahudeswaran, Wang, Lee, & Liu, 2018) , respectively. Furthermore, all metalearning algorithms notably increase MONITOR's performance. The remainder of this paper is organized as follows. In Section 2, we review all the research related to our problem. In Section 3, we detail MONITOR and especially its feature extraction and selection. In Section 4, we present and comment on the experimental results that we achieve with respect to stateof-the-art methods.
MediaEval MediaEval  (Boididou et al. , 2015)  is collected from Twitter and includes all three characteristics: text, social context and images. It is designed for message-level verification. The dataset has two parts: a development set containing about 9,000 rumor and 6,000 non-rumor tweets from 17 rumor-related events; a test set containing about 2,000 tweets from another batch of 35 rumor-related events. We remove tweets without any text nor image, thus obtaining a final dataset including 411 distinct images associated with 6,225 real and 7,558 fake tweets, respectively.
FakeNewsNet FakeNewsNet  (Shu, Mahudeswaran, et al. , 2018)  is one of the most comprehensive fake news detection benchmark. Fake and real news articles are collected from the fact-checking websites PolitiFact and GossipCop. Since we are particularly interested in images in this work, we extract and exploit the image information of all tweets. To keep the dataset balanced, we randomly choose 2,566 real and 2,587 fake news events. After removing tweets without images, we obtain 56,369 tweets and 59,838 images.