dataesr/scientific-paragraphs-categorization huggingface dataset:
In past implementations, Machine Learning forecasts have been performed on a remote server before delivering results on the IoT Computing Node to limit network traffic, Edge Computing  [1, 2]  setups can be employed to avoid intensive cloud access and keep that data storage and processing on the IoT device as much as possible. Our work is placed in this perspective. Notably, this paper reports an extended version of the work previously presented at ApplePies 2020  [3]. The system we report is based on the Raspberry Pi platform  [4, 5] , which is a low-cost, low-power credit-card-sized board that is used for embedded system and general-purpose computing applications. As for Machine Learning software, we have adopted for this investigation Rulex  [6] , which can be found online in  [7] , an AI (Artificial Intelligence) environment intended for non-domain experts, and we have ported it to the Raspberry Pi platform.
Rulex was ported to three different Operating Systems, namely to Windows 32 Bits, Ubuntu 64 Bits, and on Raspbian 32 Bits which is the official Operating System (OS) of the Raspberry Pi. All external and internal dependencies have been compiled  [3]  and verified. Moreover, the Client/Server setup has been used to perform forecasts on the edge after debugging the software through its source code. To explore the application possibilities of this operating environment, in addition to the Radar Classification dataset already reported in  [3] , three new pre-processed datasets taken from diverse domains were also implemented using Rulex on the Edge. These encompass a Human Activity Detection dataset using Smartphones, a Brainwave Mental State Classification dataset, and an Activity Recognition dataset for Dumpers in earth moving sites that are also recorded using Smartphones.
Also, in the linking process, the code needs to be changed to satisfy all the target platforms (Windows 64-bits, Windows 32-bits, Raspbian 32-bits, and Ubuntu 64-bits). Finally, the fully featured Rulex software package can be run on open-source hardware. Additionally, the pre-processing contribution and the ML tests on the system using multiple datasets and, in a Client/Server arrangement demonstrate the system effectiveness. In the rest of this paper Section 2 presents the literature review, Section 3 describes the actions taken to bring Rulex on Raspberry Pi in a Client/Server arrangement  [8] , Section 4 presents in detail the image pre-processing Algorithm, and reports the results of all the ML forecasts and energy consumption achieved. Finally, Section 5 draws the conclusions.
Hardware Platform The hardware platform adopted in this work is the multi-purpose Raspberry Pi  [4, 5]. It was conceived to handle application-specific tasks, as well as being used for everyday computing operations. It supports Universal Serial Bus (USB), HDMI, and SD Card connections, in addition to having standard digital Input/Output pins controlled through the on-board ARM microcontroller. Regarding Communication protocols, the Raspberry Pi orts Local Area Network (LAN) and Wi-Fi connectivity. Furthermore, the Raspberry Pi's digital pins can be used for interfacing with a wide variety of peripherals, for applications ranging from motor control, LCD Display functions, and may more and can be interfaced with compatible smart sensor modules.
Consequently, binary files could depend on other binary files, where in general, the final target is an executable. Rulex on the Raspberry Pi can operate in Standalone mode or Client/Server mode. In the latter case, a Windows 32-bit system is used as a client, where the Rulex GUI is running, and the Raspberry Pi functions as a server or ML engine. An SSH connection  [23]  is used in case the connection is over a public or private network. After connecting to the Rulex Engine on the Raspberry Pi, remote development was used to debug the code so it can operate on both Windows 32 Bits as well as Linux 32 Bit/ 64 Bit such that it runs without any manual modification. In the process of testing, the software runs showed that some of the original C/C++ variables from the Windows 64-bit version are not compatible with 32 Bit systems.
Therefore, it was necessary to make the source redundant concerning this issue. So, the flow of the code was diverted to a path or snippet specific to the running OS, which is implemented using Macros. For example, a Macros such as _WIN32 was used to detect a Windows 32-bits OS and _WIN64 for detecting Windows 64-bits. Also, to detect ARM, the __arm__ Macro was executed. Rulex GUI source code was debugged through the SSH connection where a PC acts as the Client, and the Raspberry Pi forming the ML Server. In the Client/Server setup, a Docker-based PostgreSQL container  [24]  is placed as the common storage point between the Client and server nodes. Rulex on the Raspberry Pi can operate in Standalone mode or Client/Server mode. In the latter case, a Windows 32-bit system is used as a client, where the Rulex GUI is running, and the Raspberry Pi functions as a server or ML engine.
An SSH connection  [23]  is used in case the connection is over a public or private network. After connecting to the Rulex Engine on the Raspberry Pi, remote development was used to debug the code so it can operate on both Windows 32 Bits as well as Linux 32 Bit/ 64 Bit such that it runs without any manual modification. In the process of testing, the software runs showed that some of the original C/C++ variables from the Windows 64-bit version are not compatible with 32 Bit systems. Therefore, it was necessary to make the source redundant concerning this issue. So, the flow of the code was diverted to a path or snippet specific to the running OS, which is implemented using Macros. For example, a Macros such as _WIN32 was used to detect a Windows 32-bits OS and _WIN64 for detecting Windows 64-bits.
Radar Classification The Urban Classification dataset was recorded by a short-range 24 GHz radar, based on the Infineon BGT24MTR11 RF transceiver [25], and particularly, the Distance2Go development kit by Infineon  [26]. For ML forecasts, four classes were considered: One for Humans and three vehicle classes. Namely, Car, Truck, and Motorcycle where the dataset contains 120 records. In  [27] , a multiclass tree-based classification technique was implemented to improve the prediction accuracy using this dataset. The radar data has been recorded using another separate system dedicated to feature extraction. This standalone system is composed of three parts. Firstly, A 24 GHz radar, a second Raspberry PI 3B+, and a PC running MATLAB. This second Raspberry PI was employed to connect the MATLAB station to the radar board.
The Raspberry PI collects the data from the radar, and then it sends it to MATLAB running on a PC where feature extraction is applied  [28, 29]. Below is a list of the features extracted using the radar measurements: V: The spread in the Doppler-FFT spectrum caused by the target movement. 6. V 1 : Variance of the Doppler-FFT spectrum. 7. V 2 : Standard deviation of the Doppler-FFT spectrum. 8. V 3 : Average of the Doppler-FFT spectrum. 9. RCS: Radar Cross-Section, that gives a measure for the reflectivity of the target. 10. V est : The estimated speed of the target. After extracting features using the second system, the first Client/Server setup which consists of Rulex running on a Raspberry PI is used for ML predictions. An example of a workflow in Rulex GUI running on the Raspberry is presented in Figure  2 , where there are data processing blocks followed by an LLM, and finally a confusion matrix.
Radar Classification The Urban Classification dataset was recorded by a short-range 24 GHz radar, base on the Infineon BGT24MTR11 RF transceiver [25], and particularly, the Distance2G development kit by Infineon  [26]. For ML forecasts, four classes were considered: One for Humans and three vehic classes. Namely, Car, Truck, and Motorcycle where the dataset contains 120 records. [27] , a multiclass tree-based classification technique was implemented to improve th prediction accuracy using this dataset. The radar data has been recorded using another separate system dedicated to featu extraction. This standalone system is composed of three parts. Firstly, A 24 GHz radar, second Raspberry PI 3B+, and a PC running MATLAB. This second Raspberry PI w employed to connect the MATLAB station to the radar board.
The Raspberry PI collec the data from the radar, and then it sends it to MATLAB running on a PC where featu extraction is applied  [28, 29]. Below is a list of the features extracted using the radar measurements: After extracting features using the second system, the first Client/Server setup whic consists of Rulex running on a Raspberry PI is used for ML predictions. An example of workflow in Rulex GUI running on the Raspberry is presented in Figure  2 , where the are data processing blocks followed by an LLM, and finally a confusion matrix. Moreove a block that splits data for training and testing is shown, where the ratio is 65% for trainin and 35% for testing. Figures  3  and 4  show the training and testing accuracies using LLM. In Figure  3 , Cars and Humans are classified with a rate of 100%.
Human Activity Detection Using Smartphones The Activity dataset from  [30]  consists of features that have been recorded using the Accelerometer and Gyroscope that are included in a Smartphone. The dataset is preprocessed such that it can be directly applied in Rulex since the features are composed of basic statistical operations based on the measurements. These consist of the mean, STD, variance, and others. The activity performed by a subject is divided into six classes: Laying, Standing, Sitting, Walking, Walking Upstairs, and Walking Downstairs. A subset of the original dataset was used which is reduced to 7530 samples and 560 features, excluding the subject field which identifies the person or test subject specifically. When this field is included, the accuracy is increased considerably, however, it does not consider that the Smartphone can be carried by different people.
This has been done to test the robustness of the ML forecasts and investigate the effectiveness of the present experiment. Furthermore, the dataset labels are distributed equally as shown in the histogram from Figure  5. Figures  3  and 4  show the training and testing accuracies using LLM. In Figure  3 , Cars and Humans are classified with a rate of 100%. As for Motorcycles and Trucks, they are 84. 2% and 89. 5% respectively. Figure  4  shows the testing accuracies where Cars are detected with a rate of 73. 3%, Humans at 100%, Trucks at 72. 7%, and Motorcycles were recognized with a rate of 90. 9%.
This has been done to test the robustness of the ML forecasts and investigate the effectiveness of the present experiment. Furthermore, the dataset labels are distributed equally as shown in the histogram from Figure  5. The ML forecasts for the Smartphone Activity Detection dataset are provided by Table  1 , wherein the Rulex Software, three basic ML Algorithms are implemented: LLM, K-Nearest-Neighbor (KNN), and SVM. All tests have been applied in a Client/Server arrangement with the Rulex Engine running on the Raspberry Pi. As shown in Table  1 , high testing accuracy was reached in every forecast, where most notably, in the case where SVM is applied, a near-perfect accuracy is achieved.
Brainwave Mental State Classification In  [31] , Electroencephalogram (EEG) recordings were used to predict the mental state of a subject through ML techniques. In this paper, the features from the concerned dataset are used in multiple forecasts to classify the mental into three given classes: Relaxed, Neural, and Concentrating states. Multiple Algorithms have been implemented consisting of the three basic ML Algorithms: SVM, Neural Networks and KNN, where SVM achieved the best performance. Figure  6  presents a plot of one frequency-based feature value vs. class labels, where this feature exhibits a lower value for one of the labels. Additionally, Figure  7  presents the same plot for another mean-based feature from the dataset, where results show that this feature has varying levels for each of the three classes.
This illustrates the influence on every feature on each of the labels. The ML forecasts for the Smartphone Activity Detection dataset are provided by Table  1 , wherein the Rulex Software, three basic ML Algorithms are implemented: LLM, K-Nearest-Neighbor (KNN), and SVM. All tests have been applied in a Client/Server arrangement with the Rulex Engine running on the Raspberry Pi. As shown in Table  1 , high testing accuracy was reached in every forecast, where most notably, in the case where SVM is applied, a near-perfect accuracy is achieved.
This illustrates the influence on every feature on each of the labels. In this paper, we applied forecasts using Rulex running on the Raspberry Pi and in a Client/Server setup. Regarding the dataset, a total of 2480 samples and 988 features were employed for both training and testing in a 70/30 split. The accuracies for each forecast are presented in Table  2. In this paper, we applied forecasts using Rulex running on the Raspberry Pi and in a Client/Server setup. Regarding the dataset, a total of 2480 samples and 988 features were employed for both training and testing in a 70/30 split. The accuracies for each forecast are presented in Table  2. As shown, LLM, KNN, SVM have high testing accuracies thus demonstrating the robustness of the experiment, where the most accurate forecasts were achieved using SVM with an overall accuracy of 95.
47%. In addition to applying forecasts on the edge for this dataset, we've studied the power consumption of the Raspberry Pi board by recording the elapsed time and estimating the power consumption, while comparing it with the energy consumed by an HP Laptop. The results can be viewed in Tables  3  and 4 , whereas shown for LLM and SVM, the Raspberry Pi achieves more time but less energy to perform the same task. In this paper, we applied forecasts using Rulex running on the Raspberry Pi and in a Client/Server setup. Regarding the dataset, a total of 2480 samples and 988 features were employed for both training and testing in a 70/30 split. The accuracies for each forecast are presented in Table  2. As shown, LLM, KNN, SVM have high testing accuracies thus demonstrating the robustness of the experiment, where the most accurate forecasts were achieved using SVM with an overall accuracy of 95.
47%. In addition to applying forecasts on the edge for this dataset, we've studied the power consumption of the Raspberry Pi board by recording the elapsed time and estimating the power consumption, while comparing it with the energy consumed by an HP Laptop. The results can be viewed in Tables  3  and 4 , whereas shown for LLM and SVM, the Raspberry Pi achieves more time but less energy to perform the same task. As shown, LLM, KNN, SVM have high testing accuracies thus demonstrating the robustness of the experiment, where the most accurate forecasts were achieved using SVM with an overall accuracy of 95. 47%. In addition to applying forecasts on the edge for this dataset, we've studied the power consumption of the Raspberry Pi board by recording the elapsed time and estimating the power consumption, while comparing it with the energy consumed by an HP Laptop.
Vehicle Activity Recognition A dataset for Activity Recognition of Dumpers in earth moving sites is presented in  [32]. It utilizes data taken from Smartphone sensors such as Gyroscopes and Accelerometers to record signals (while the Dumper is working) for feature extraction. An illustration of the data collection phase is presented in Figure  8 , with the Smartphone installed inside the Dumper for taking measurements. The pre-processed dataset was used to classify the state of the vehicle, whether a Dumper is in one of six states, namely: idle, driving, loading, dumping, engine-off, and unknown. Figure  9  illustrates the dispersal of the labels in the dataset where there is clear skewness in the class distribution. A subset of around 216,000 samples having just 8 features were used as a data source to apply ML training and testing with a 70/30 split.
Forecasts were applied through Rulex running on the Raspberry Pi in a Client/Server arrangement using the KNN Algorithm. The testing accuracy in confusion matrix format is presented in Figure  10 , where the overall forecast accuracy using KNN on the Edge is The pre-processed dataset was used to classify the state of the whether a Dumper is in one of six states, namely: idle, driving, loading, dumping, engine-off, and unknown. Figure  9  illustrates the dispersal of the labels in the dataset where there is clear skewness in the class distribution. A subset of around 216,000 samples having just 8 features were used as a data source to apply ML training and testing with a 70/30 split. Forecasts were applied through Rulex running on the Raspberry Pi in a Client/Server arrangement using the KNN Algorithm.
The testing accuracy in confusion matrix format is presented in Figure  10 , where the overall forecast accuracy using KNN on the Edge is 95. 27%. Furthermore, with regards to power consumption, as employed in the previous dataset, the time elapsed to perform an ML task is recorded to estimate the consumed energy. In the case of the HP laptop which consumes around 70 W, as shown in Table  3 , the time taken for KNN is 11. 82 min and the energy is 49. 63 KJ. As for the Raspberry Pi, where the power is 4 W, the time taken is 142. 4 min and the energy consumed is 34. 18 KJ. Sensors 2021, 21, 6526 10 of 16 95. 27%. Furthermore, with regards to power consumption, as employed in the previous dataset, the time elapsed to perform an ML task is recorded to estimate the consumed energy. In the case of the HP laptop which consumes around 70 W, as shown in Table  3 , the time taken for KNN is 11.
Gender Classification Gender classification can be useful for performing studies if implemented in an automated manner. In  [33] , gender detection using names, countries, and facial images is discussed where authors found that the accuracy is strongly dependent on the country, meaning that ethnicity can play a role in prediction accuracy. Classification of Gender that is based on forward-facing images is reported in  [34] , where a minimum error rate of 2. 85% is achieved. A Classifier implemented using Support 95. 27%. Furthermore, with regards to power consumption, as employed in the previous dataset, the time elapsed to perform an ML task is recorded to estimate the consumed energy. In the case of the HP laptop which consumes around 70 W, as shown in Table  3 , the time taken for KNN is 11.
Gender Classification Gender classification can be useful for performing studies if implemented in an automated manner. In  [33] , gender detection using names, countries, and facial images is discussed where authors found that the accuracy is strongly dependent on the country, meaning that ethnicity can play a role in prediction accuracy. Classification of Gender that is based on forward-facing images is reported in  [34] , where a minimum error rate of 2. 85% is achieved. A Classifier implemented using Support Vector Machines (SVM) that detects gender with a minimum error of 3. 4% is presented  [35] , where mug-shot images are used for training and testing. In practice, when implementing gender classification, facial images can be misaligned in contrast to some forward-facing datasets that are seldom used in the literature.
Therefore, authors in  [36]  apply the dropout technique and SVM to tackle this issue and classify age and gender under "in the wild " conditions. In this paper, we've implemented a novel Algorithm that converts facial images from various ethnicities, poses, zoom levels, and ages into Time-series that are generated using a radial scanning-based approach  [37]. Moreover, a Sobel filter  [38]  is used to detect the edges of an image and with the 360 • radial scan, the distance from the center (which is also determined in Algorithm 1 till every visibly detected pixel is calculated. statistical functions of this distance for every degree in the scan are computed, before generating a Time-series for every function. Finally, the Time-series are grouped to form a dataset that is used in an ML forecast.
Subsequently, As shown in Algorithm 2, radial scanning is performed on the Sobel filter's output. In Algorithm 2, the outer loop is used to scan the entire 360 • around the center with coordinates (centerx, centery), and In case a pixel is brighter than a Threshold, the distance from the center is calculated, where statistical functions (mean, median, STD, variance, maximum, and minimum) are computed for the distances of every angle. Therefore, multiple corresponding Time-series are generated, however, with different lengths for each record. Finally, these Time-series are interpolated (To make each set of Time-series equal, and to have the same number of features for every record) and grouped in one file to form a dataset applicable for ML predictions. The pseudo-code from Algorithms 1 and 2 has been implemented in the Python programming language to perform the Image-to-Timeseries pre-processing before performing ML forecasts on the Edge using Rulex.
Also, some of the photos contain part of the body of the subject. Furthermore, the people in the photos have very wide ranges of age, ranging from youthful to elderly, as well as belonging to different ethnicities while taking different poses. This is demonstrated in Figure  11 , where an example of six random female subjects is shown. The dataset consists of 2700 female photos and 2720 male photos. These photos were pre-processed using the novel algorithm developed in this paper to generate the corresponding dataset that consists of sets of Time-series. The generated dataset has been used for ML forecasts using Rulex on the Raspberry Pi. KNN and SVM were used to perform training and testing with an 80/20 split, where the results for the forecasts performed on the Edge are presented in Table  5.
As shown in Table  5 , the Image-to-Timeseries conversion Algorithm is capable of pre-processing random images (Where color is not an issue) and can be applied to various ML Algorithms to achieve high gender detection accuracy. Consequently, it can compete with previously published techniques that rely on impractical (consistent) mug-shot images for classification. Also, some of the photos contain part of the body of the subject. Furthermore, the people in the photos have very wide ranges of age, ranging from youthful to elderly, as well as belonging to different ethnicities while taking different poses. This is demonstrated in Figure  11 , where an example of six random female subjects is shown. The dataset consists of 2700 female photos and 2720 male photos. These photos were pre-processed using the novel algorithm developed in this paper to generate the corresponding dataset that consists of sets of Time-series.
The generated dataset has been used for ML forecasts using Rulex on the Raspberry Pi. KNN and SVM were used to perform training and testing with an 80/20 split, where the results for the forecasts performed on the Edge are presented in Table  5. In  [34] , the images used for gender classification were composed of people belonging to a single ethnicity using that are all forward-facing to the camera. A minimum error rate of 2. 84% (accuracy of 97. 16%) was achieved using SVM. Another case where SVM is used is reported in  [35] , where low-resolution forward-facing images are used to reach an error rate of 3. 4% (96. 6% accuracy). However, mug-shots or forward-facing photos may not be available in real-time practical situations, therefore, authors in  [36]  address this issue and attempt to determine the age and gender of random inconsistent images where the highest gender classification accuracy is 88.