A Dataset for Assessing Worker Activities in Industrial Settings

Overview and Motivation

Industrial Internet of Things (IIoT) solutions can improve manufacturing efficiency by monitoring machine and human performance. This dataset was collected to support real-time activity recognition of meat-processing workers, thereby enabling computation of fine-grained KPIs such as idle time and throughput.

This dataset accompanies the paper “An Industrial IoT Solution for Evaluating Workers’ Performance via Activity Recognition.” It contains sensor data from wearable accelerometers and gyroscopes, recorded in a meat-processing plant. The data are labeled by experts according to seven distinct activities (e.g., waiting, slicing, cutting, etc.), allowing for applications in Human Activity Recognition in industrial settings.

Research Paper Link: https://doi.org/10.1109/icdcs.2019.00139

Key Data Characteristics

Description of Data Collection Mechanism

Figure 1: The distributed architecture of the proposed IIoT solution for worker identification and activity recognition.
Figure 1: The distributed architecture of the proposed IIoT solution for worker identification and activity recognition.

The data was collected through the architecture described in Figure 1.

A MetaWear meta sensor watchband (shown in Figure 2) was equipped with a triaxial accelerometer and a triaxial gyroscope, which were used to monitor the hand movements of workers during routine industrial activities. The MetaWear sensors were worn on both wrists of the workers in a wristwatch-like manner, to capture data for both the cutting and non-cutting hand, which enabled the recognition of symmetric and asymmetric hand movements. The sensors recorded data at 25 Hz, with each reading time-stamped for synchronisation with corresponding ground truth annotations.

Figure 2: MetaWear sensor worn on both hands (left) and worn while working (right)
Figure 2: MetaWear sensor worn on both hands (left) and worn while working (right)

Data from the sensors was transmitted via BLE (Bluetooth Low Energy) to Raspberry Pi devices installed underneath the workers’ benches, as shown in Figure 3. These edge devices were waterproof, battery-powered, and designed to function within hygiene and safety constraints of an industrial setting. The Raspberry Pi devices then forwarded the data to a central cloud server for activity learning.

Figure 3: Raspberry Pi in Packages (left) and Raspberry Pi Placement (Circled in Red) on Workbench (right)
Figure 3: Raspberry Pi in Packages (left) and Raspberry Pi Placement (Circled in Red) on Workbench (right)

Description of the Feature Engineered Dataset

The MetaWear sensors collected the acceleration and gyroscope data from the x, y, and z-axes. From this raw data, 156 features were derived (see Feature Derivation Section).

In order to capture the ground truth in a non-intrusive fashion, worker activity was captured using a high-resolution video camera. A domain expert watched the video and labelled the activities performed, which were synchronised with the collected data using the timestamps. A total of ~45 minutes of annotated data per worker was collected for four workers.

The activities labelled can be characterised as follows:

Activity Label Description Observation
Idle/Waiting 0 The worker remains stationary, awaiting the next piece of meat to arrive for processing. No piece of meat or knife is involved; hands remain still.
Knife Sharpening 1 The worker uses both hands to sharpen the cutting knife with sharpening tools. No meat is involved; only the knife and sharpening tools are used.
Slicing 2 The worker trims fat from the meat using a knife. Knife movements are primarily horizontal.
Cutting 3 The worker divides large portions of meat into smaller pieces using a knife. Knife movements are mostly vertical.
Pulling 4 The worker tears fat away from the meat using both hands. Primarily involves the use of both hands.
Reaching 5 The worker reaches out to retrieve a new piece of meat from the conveyor belt. Mainly involves the non-cutting hand (left hand).
Feeling 6 The worker touches the surface of the meat piece to detect areas requiring further trimming. Mostly involves the use of both hands.

Feature Description and Computation

From the sensors, 43 features were derived from acceleration and 35 for gyro for each hand. This gives a total of 2 x 43 + 2 x 35 = 156 features in total for both hands. Below is the name and description for each feature:

Feature Name Description
acc_mean_x_right Mean value of the Accelerometer signal along the x axis for the right hand over 1 second
acc_mean_y_right Mean value of the Accelerometer signal along the y axis for the right hand over 1 second
acc_mean_z_right Mean value of the Accelerometer signal along the z axis for the right hand over 1 second
acc_mean_xyz_right Mean value of the magnitude of the acceleration in the xyz-space for the right hand over 1 second
acc_mean_xy_right Mean value of the Accelerometer signal along xy-plane for the right hand over 1 second
acc_mean_yz_right Mean value of the Accelerometer signal along yz-plane for the right hand over 1 second
acc_mean_zx_right Mean value of the Accelerometer signal along zx-plane for the right hand over 1 second
acc_mean_pitch_right Mean value of the Accelerometer signal along the Pitch angle for the right hand over 1 second
acc_mean_roll_right Mean value of the Accelerometer signal along the Roll angle for the right hand over 1 second
acc_std_x_right Standard deviation of the Accelerometer signal along the x axis for the right hand over 1 second
acc_std_y_right Standard deviation of the Accelerometer signal along the y axis for the right hand over 1 second
acc_std_z_right Standard deviation of the Accelerometer signal along the z axis for the right hand over 1 second
acc_std_xyz_right Standard deviation of the magnitude of the acceleration in the xyz-space for the right hand over 1 second
acc_std_xy_right Standard deviation of the Accelerometer signal along xy-plane for the right hand over 1 second
acc_std_yz_right Standard deviation of the Accelerometer signal along yz-plane for the right hand over 1 second
acc_std_zx_right Standard deviation of the Accelerometer signal along zx-plane for the right hand over 1 second
acc_std_pitch_right Standard deviation of the Accelerometer signal along the Pitch angle for the right hand over 1 second
acc_std_roll_right Standard deviation of the Accelerometer signal along the Roll angle for the right hand over 1 second
acc_auc_x_right Area under the curve of the Accelerometer signal along the x axis for the right hand over 1 second
acc_auc_y_right Area under the curve of the Accelerometer signal along the y axis for the right hand over 1 second
acc_auc_z_right Area under the curve of the Accelerometer signal along the z axis for the right hand over 1 second
acc_auc_xyz_right Area under the curve of the magnitude of the acceleration in the xyz-space for the right hand over 1 second
acc_auc_xy_right Area under the curve of the Accelerometer signal along xy-plane for the right hand over 1 second
acc_auc_yz_right Area under the curve of the Accelerometer signal along yz-plane for the right hand over 1 second
acc_auc_zx_right Area under the curve of the Accelerometer signal along zx-plane for the right hand over 1 second
acc_auc_pitch_right Area under the curve of the Accelerometer signal along the Pitch angle for the right hand over 1 second
acc_auc_roll_right Area under the curve of the Accelerometer signal along the Roll angle for the right hand over 1 second
acc_max_x_right Maximum value of the Accelerometer signal along the x axis for the right hand over 1 second
acc_max_y_right Maximum value of the Accelerometer signal along the y axis for the right hand over 1 second
acc_max_z_right Maximum value of the Accelerometer signal along the z axis for the right hand over 1 second
acc_max_xyz_right Maximum value of the magnitude of the acceleration in the xyz-space for the right hand over 1 second
acc_max_xy_right Maximum value of the Accelerometer signal along xy-plane for the right hand over 1 second
acc_max_yz_right Maximum value of the Accelerometer signal along yz-plane for the right hand over 1 second
acc_max_zx_right Maximum value of the Accelerometer signal along zx-plane for the right hand over 1 second
acc_max_pitch_right Maximum value of the Accelerometer signal along the Pitch angle for the right hand over 1 second
acc_max_roll_right Maximum value of the Accelerometer signal along the Roll angle for the right hand over 1 second
acc_peak_x_right Number of peaks in the Accelerometer signal along the x axis for the right hand over 1 second
acc_peak_y_right Number of peaks in the Accelerometer signal along the y axis for the right hand over 1 second
acc_peak_z_right Number of peaks in the Accelerometer signal along the z axis for the right hand over 1 second
acc_peak_xyz_right Number of peaks in the magnitude of the acceleration in the xyz-space for the right hand over 1 second
acc_peak_xy_right Number of peaks in the Accelerometer signal along xy-plane for the right hand over 1 second
acc_peak_yz_right Number of peaks in the Accelerometer signal along yz-plane for the right hand over 1 second
acc_peak_zx_right Number of peaks in the Accelerometer signal along zx-plane for the right hand over 1 second
gyro_mean_x_right Mean value of the Gyroscope signal along the x axis for the right hand over 1 second
gyro_mean_y_right Mean value of the Gyroscope signal along the y axis for the right hand over 1 second
gyro_mean_z_right Mean value of the Gyroscope signal along the z axis for the right hand over 1 second
gyro_mean_xyz_right Mean value of the magnitude of the gyroscope data in the xyz-space for the right hand over 1 second
gyro_mean_xy_right Mean value of the Gyroscope signal along xy-plane for the right hand over 1 second
gyro_mean_yz_right Mean value of the Gyroscope signal along yz-plane for the right hand over 1 second
gyro_mean_zx_right Mean value of the Gyroscope signal along zx-plane for the right hand over 1 second
gyro_std_x_right Standard deviation of the Gyroscope signal along the x axis for the right hand over 1 second
gyro_std_y_right Standard deviation of the Gyroscope signal along the y axis for the right hand over 1 second
gyro_std_z_right Standard deviation of the Gyroscope signal along the z axis for the right hand over 1 second
gyro_std_xyz_right Standard deviation of the magnitude of the gyroscope data in the xyz-space for the right hand over 1 second
gyro_std_xy_right Standard deviation of the Gyroscope signal along xy-plane for the right hand over 1 second
gyro_std_yz_right Standard deviation of the Gyroscope signal along yz-plane for the right hand over 1 second
gyro_std_zx_right Standard deviation of the Gyroscope signal along zx-plane for the right hand over 1 second
gyro_auc_x_right Area under the curve of the Gyroscope signal along the x axis for the right hand over 1 second
gyro_auc_y_right Area under the curve of the Gyroscope signal along the y axis for the right hand over 1 second
gyro_auc_z_right Area under the curve of the Gyroscope signal along the z axis for the right hand over 1 second
gyro_auc_xyz_right Area under the curve of the magnitude of the gyroscope data in the xyz-space for the right hand over 1 second
gyro_auc_xy_right Area under the curve of the Gyroscope signal along xy-plane for the right hand over 1 second
gyro_auc_yz_right Area under the curve of the Gyroscope signal along yz-plane for the right hand over 1 second
gyro_auc_zx_right Area under the curve of the Gyroscope signal along zx-plane for the right hand over 1 second
gyro_max_x_right Maximum value of the Gyroscope signal along the x axis for the right hand over 1 second
gyro_max_y_right Maximum value of the Gyroscope signal along the y axis for the right hand over 1 second
gyro_max_z_right Maximum value of the Gyroscope signal along the z axis for the right hand over 1 second
gyro_max_xyz_right Maximum value of the magnitude of the acceleration in the xyz-space for the right hand over 1 second
gyro_max_xy_right Maximum value of the Gyroscope signal along xy-plane for the right hand over 1 second
gyro_max_yz_right Maximum value of the Gyroscope signal along yz-plane for the right hand over 1 second
gyro_max_zx_right Maximum value of the Gyroscope signal along zx-plane for the right hand over 1 second
gyro_peak_x_right Number of peaks in the Gyroscope signal along the x axis for the right hand over 1 second
gyro_peak_y_right Number of peaks in the Gyroscope signal along the y axis for the right hand over 1 second
gyro_peak_z_right Number of peaks in the Gyroscope signal along the z axis for the right hand over 1 second
gyro_peak_xyz_right Number of peaks in the magnitude of the acceleration in the xyz-space for the right hand over 1 second
gyro_peak_xy_right Number of peaks in the Gyroscope signal along xy-plane for the right hand over 1 second
gyro_peak_yz_right Number of peaks in the Gyroscope signal along yz-plane for the right hand over 1 second
gyro_peak_zx_right Number of peaks in the Gyroscope signal along zx-plane for the right hand over 1 second
acc_mean_x_left Mean value of the Accelerometer signal along the x axis for the left hand over 1 second
acc_mean_y_left Mean value of the Accelerometer signal along the y axis for the left hand over 1 second
acc_mean_z_left Mean value of the Accelerometer signal along the z axis for the left hand over 1 second
acc_mean_xyz_left Mean value of the magnitude of the acceleration in the xyz-space for the left hand over 1 second
acc_mean_xy_left Mean value of the Accelerometer signal along xy-plane for the left hand over 1 second
acc_mean_yz_left Mean value of the Accelerometer signal along yz-plane for the left hand over 1 second
acc_mean_zx_left Mean value of the Accelerometer signal along zx-plane for the left hand over 1 second
acc_mean_pitch_left Mean value of the Accelerometer signal along the Pitch angle for the left hand over 1 second
acc_mean_roll_left Mean value of the Accelerometer signal along the Roll angle for the left hand over 1 second
acc_std_x_left Standard deviation of the Accelerometer signal along the x axis for the left hand over 1 second
acc_std_y_left Standard deviation of the Accelerometer signal along the y axis for the left hand over 1 second
acc_std_z_left Standard deviation of the Accelerometer signal along the z axis for the left hand over 1 second
acc_std_xyz_left Standard deviation of the magnitude of the acceleration in the xyz-space for the left hand over 1 second
acc_std_xy_left Standard deviation of the Accelerometer signal along xy-plane for the left hand over 1 second
acc_std_yz_left Standard deviation of the Accelerometer signal along yz-plane for the left hand over 1 second
acc_std_zx_left Standard deviation of the Accelerometer signal along zx-plane for the left hand over 1 second
acc_std_pitch_left Standard deviation of the Accelerometer signal along the Pitch angle for the left hand over 1 second
acc_std_roll_left Standard deviation of the Accelerometer signal along the Roll angle for the left hand over 1 second
acc_auc_x_left Area under the curve of the Accelerometer signal along the x axis for the left hand over 1 second
acc_auc_y_left Area under the curve of the Accelerometer signal along the y axis for the left hand over 1 second
acc_auc_z_left Area under the curve of the Accelerometer signal along the z axis for the left hand over 1 second
acc_auc_xyz_left Area under the curve of the magnitude of the acceleration in the xyz-space for the left hand over 1 second
acc_auc_xy_left Area under the curve of the Accelerometer signal along xy-plane for the left hand over 1 second
acc_auc_yz_left Area under the curve of the Accelerometer signal along yz-plane for the left hand over 1 second
acc_auc_zx_left Area under the curve of the Accelerometer signal along zx-plane for the left hand over 1 second
acc_auc_pitch_left Area under the curve of the Accelerometer signal along the Pitch angle for the left hand over 1 second
acc_auc_roll_left Area under the curve of the Accelerometer signal along the Roll angle for the left hand over 1 second
acc_max_x_left Maximum value of the Accelerometer signal along the x axis for the left hand over 1 second
acc_max_y_left Maximum value of the Accelerometer signal along the y axis for the left hand over 1 second
acc_max_z_left Maximum value of the Accelerometer signal along the z axis for the left hand over 1 second
acc_max_xyz_left Maximum value of the magnitude of the acceleration in the xyz-space for the left hand over 1 second
acc_max_xy_left Maximum value of the Accelerometer signal along xy-plane for the left hand over 1 second
acc_max_yz_left Maximum value of the Accelerometer signal along yz-plane for the left hand over 1 second
acc_max_zx_left Maximum value of the Accelerometer signal along zx-plane for the left hand over 1 second
acc_max_pitch_left Maximum value of the Accelerometer signal along the Pitch angle for the left hand over 1 second
acc_max_roll_left Maximum value of the Accelerometer signal along the Roll angle for the left hand over 1 second
acc_peak_x_left Number of peaks in the Accelerometer signal along the x axis for the left hand over 1 second
acc_peak_y_left Number of peaks in the Accelerometer signal along the y axis for the left hand over 1 second
acc_peak_z_left Number of peaks in the Accelerometer signal along the z axis for the left hand over 1 second
acc_peak_xyz_left Number of peaks in the magnitude of the acceleration in the xyz-space for the left hand over 1 second
acc_peak_xy_left Number of peaks in the Accelerometer signal along xy-plane for the left hand over 1 second
acc_peak_yz_left Number of peaks in the Accelerometer signal along yz-plane for the left hand over 1 second
acc_peak_zx_left Number of peaks in the Accelerometer signal along zx-plane for the left hand over 1 second
gyro_mean_x_left Mean value of the Gyroscope signal along the x axis for the left hand over 1 second
gyro_mean_y_left Mean value of the Gyroscope signal along the y axis for the left hand over 1 second
gyro_mean_z_left Mean value of the Gyroscope signal along the z axis for the left hand over 1 second
gyro_mean_xyz_left Mean value of the magnitude of the acceleration in the xyz-space for the left hand over 1 second
gyro_mean_xy_left Mean value of the Gyroscope signal along xy-plane for the left hand over 1 second
gyro_mean_yz_left Mean value of the Gyroscope signal along yz-plane for the left hand over 1 second
gyro_mean_zx_left Mean value of the Gyroscope signal along zx-plane for the left hand over 1 second
gyro_std_x_left Standard deviation of the Gyroscope signal along the x axis for the left hand over 1 second
gyro_std_y_left Standard deviation of the Gyroscope signal along the y axis for the left hand over 1 second
gyro_std_z_left Standard deviation of the Gyroscope signal along the z axis for the left hand over 1 second
gyro_std_xyz_left Standard deviation of the magnitude of the acceleration in the xyz-space for the left hand over 1 second
gyro_std_xy_left Standard deviation of the Gyroscope signal along xy-plane for the left hand over 1 second
gyro_std_yz_left Standard deviation of the Gyroscope signal along yz-plane for the left hand over 1 second
gyro_std_zx_left Standard deviation of the Gyroscope signal along zx-plane for the left hand over 1 second
gyro_auc_x_left Area under the curve of the Gyroscope signal along the x axis for the left hand over 1 second
gyro_auc_y_left Area under the curve of the Gyroscope signal along the y axis for the left hand over 1 second
gyro_auc_z_left Area under the curve of the Gyroscope signal along the z axis for the left hand over 1 second
gyro_auc_xyz_left Area under the curve of the magnitude of the acceleration in the xyz-space for the left hand over 1 second
gyro_auc_xy_left Area under the curve of the Gyroscope signal along xy-plane for the left hand over 1 second
gyro_auc_yz_left Area under the curve of the Gyroscope signal along yz-plane for the left hand over 1 second
gyro_auc_zx_left Area under the curve of the Gyroscope signal along zx-plane for the left hand over 1 second
gyro_max_x_left Maximum value of the Gyroscope signal along the x axis for the left hand over 1 second
gyro_max_y_left Maximum value of the Gyroscope signal along the y axis for the left hand over 1 second
gyro_max_z_left Maximum value of the Gyroscope signal along the z axis for the left hand over 1 second
gyro_max_xyz_left Maximum value of the magnitude of the acceleration in the xyz-space for the left hand over 1 second
gyro_max_xy_left Maximum value of the Gyroscope signal along xy-plane for the left hand over 1 second
gyro_max_yz_left Maximum value of the Gyroscope signal along yz-plane for the left hand over 1 second
gyro_max_zx_left Maximum value of the Gyroscope signal along zx-plane for the left hand over 1 second
gyro_peak_x_left Number of peaks in the Gyroscope signal along the x axis for the left hand over 1 second
gyro_peak_y_left Number of peaks in the Gyroscope signal along the y axis for the left hand over 1 second
gyro_peak_z_left Number of peaks in the Gyroscope signal along the z axis for the left hand over 1 second
gyro_peak_xyz_left Number of peaks in the magnitude of the acceleration in the xyz-space for the left hand over 1 second
gyro_peak_xy_left Number of peaks in the Gyroscope signal along xy-plane for the left hand over 1 second
gyro_peak_yz_left Number of peaks in the Gyroscope signal along yz-plane for the left hand over 1 second
gyro_peak_zx_left Number of peaks in the Gyroscope signal along zx-plane for the left hand over 1 second

The features were derived as follows:

Firstly, for acceleration

Let:

a x , a y , a z be the acceleration components along the x, y, and z axes.

a x y z = a x 2 + a y 2 + a z 2 be the total acceleration magnitude.

a x y = a x 2 + a y 2 be the XY-plane acceleration magnitude.

a x z = a x 2 + a z 2 be the XZ-plane acceleration magnitude.

a y z = a y 2 + a z 2 be the YZ-plane acceleration magnitude.

N is the number of samples per second.

t represents time.

D represents the dimension or plane of the feature (x, y, z, xy, xz, yz, xyz)

S represents the side (Right/Left).

Thus, features can be denoted as: Feature_D_S

For accelerations, we can use the following formulae to derive the features:

Mean

acc_mean_D_S = 1 N i = 1 N a D ( i )

Where i represents the index of an acceleration sample over a second.

Standard deviation

acc_std_D_S = 1 N i = 1 N ( a D (i) μ D ) 2

Where μ D is acc_mean_D_S

Area Under Curve

acc_auc_D_S = i = 1 N a D (i) Δ t

Max

acc_max_D_S = max ( a D (i) )

Peak

This counts the number of peaks in the second.

acc_peak_D_S = i = 2 N - 1 𝔹 ( a D ( i ) > a D ( i 1 ) a D ( i ) > a D ( i + 1 ) )

Where 𝔹 is a Boolean indicator function that returns 1 when true and 0 when false.

We can derive the gyro features as follows.

Let:

g x , g y , g z be the angular velocity components along the x, y, and z axes.

g x y z = g x 2 + g y 2 + g z 2 be the total angular velocity magnitude.

g x y = g x 2 + g y 2 be the XY-plane angular velocity magnitude.

g x z = g x 2 + g z 2 be the XZ-plane angular velocity magnitude.

g y z = g y 2 + g z 2 be the YZ-plane angular velocity magnitude.

N is the number of samples per second.

t represents time.

D represents the dimension or plane of the feature (x, y, z, xy, xz, yz, xyz)

S represents the side (Right/Left).

For gyroscope data, the following formulae can be used to derive the features:

Mean

gyro_mean_D_S = 1 N i = 1 N g D ( i )

Standard deviation

gyro_std_D_S = 1 N i = 1 N ( g D (i) μ D ) 2

Where μ D is gyro_mean_D_S

Area Under Curve

gyro_auc_D_S = i = 1 N g D (i) Δ t

Max

gyro_max_D_S = max ( g D (i) )

Peak

This counts the number of peaks in the second.

gyro_peak_D_S = i = 2 N - 1 𝔹 ( g D ( i ) > g D ( i 1 ) g D ( i ) > g D ( i + 1 ) )

Where 𝔹 is a Boolean indicator function that returns 1 when true and 0 when false.

Data Download

Direct Downloads:

[Download Class 3 Dataset CSV File]

[Download Class 7 Dataset CSV File]

GitHub Repository:

git clone https://github.com/DigitalInnovationLab/mpp_dataset.git

Sample Models

3-Activity No Preprocessing:

Model Accuracy F1 Score
Logistic Regression 0.902 0.891
Decision Tree 0.906 0.903
Random Forest 0.921 0.913
K-Nearest Neighbors 0.912 0.906
Support Vector Machine 0.916 0.912
Neural Network 0.899 0.894

3-Activity No PCA:

Model Accuracy F1 Score
Logistic Regression 0.808 0.808
Decision Tree 0.899 0.898
Random Forest 0.968 0.968
K-Nearest Neighbors 0.895 0.889
Support Vector Machine 0.981 0.981
Neural Network 0.974 0.974

3-Activity Full Preprocessing:

Model Accuracy F1 Score
Logistic Regression 0.746 0.746
Decision Tree 0.873 0.872
Random Forest 0.960 0.960
K-Nearest Neighbors 0.912 0.908
Support Vector Machine 0.972 0.972
Neural Network 0.954 0.954

7-Activity No Preprocessing:

Model Accuracy F1 Score
Logistic Regression 0.684 0.605
Decision Tree 0.684 0.602
Random Forest 0.709 0.626
K-Nearest Neighbors 0.681 0.615
Support Vector Machine 0.702 0.617
Neural Network 0.580 0.586

7-Activity No PCA:

Model Accuracy F1 Score
Logistic Regression 0.633 0.624
Decision Tree 0.781 0.779
Random Forest 0.949 0.949
K-Nearest Neighbors 0.873 0.840
Support Vector Machine 0.956 0.955
Neural Network 0.907 0.905

7-Activity Full Preprocessing:

Model Accuracy F1 Score
Logistic Regression 0.488 0.473
Decision Tree 0.756 0.750
Random Forest 0.946 0.946
K-Nearest Neighbors 0.876 0.847
Support Vector Machine 0.944 0.941
Neural Network 0.848 0.845

Using Raw Data and Deep Learning Models

Data Preparation Workflow
Data Preparation Workflow

Data Segmentation

The dataset was segmented using a sliding window technique with a fixed window size of 30 (by observation, roughly the number of samples per second) and a stride of 15. This method increased the number of training examples without altering the underlying data distribution. Each window captures a local temporal pattern, and the overlap ensures smooth transitions between segments.

Dataset Handling

The raw dataset consisted of synchronised accelerometer and gyroscope signals (by timestamp) collected from both hands. Therefore, each worker would have four data files (acceleration right, acceleration left, gyro right, gyro left), which were later merged on timestamps to the closest signal within a certain tolerance. Each signal channel was standardised using StandardScaler, and windowed sequences were reshaped to a uniform shape of (samples, time_steps, features). The dataset was split into training and test sets using an 80:20 ratio, which was used across all models for fair comparison.

Implementation Details

All models were implemented using TensorFlow 2.0 and Keras. Training was performed using the Adam optimiser with an initial learning rate of 0.001 and the ‘categorical_crossentropy’ loss function. The batch size was set to 64, and each model was trained for 100 epochs. Different tolerances were considered, with a 0.01 and 0.02 tolerance being used.

We implemented and compared four neural network architectures designed to classify sensor-based time-series data. The models operate on fixed-length windows of multi-channel sensor inputs (accelerometer and gyroscope signals), processed through convolutional and recurrent layers.

Baseline CNN-LSTM

This model architecture comprised two convolutional layers (64 and 128 filters), each followed by max pooling, an LSTM layer with 100 units, and two dense layers (50 and 7 units) with a dropout of 0.5 before classification. The model was trained with Adam optimiser and sparse categorical cross-entropy loss for 100 epochs using a batch size of 64.

CNN with Attention

This model modifies the baseline by incorporating a self-attention mechanism immediately after the LSTM output. Instead of feeding the entire output sequence directly into dense layers, the model computes a learned weighted sum over the LSTM outputs using a trainable attention layer. The attention vector is then concatenated with the global LSTM output and passed through a dense layer before classification.

CNN with Cross Attention

As an exploration of the bilateral nature of the data (left and right hand signals), this architecture introduces a cross-attention mechanism between two separate CNN-LSTM pipelines. Each input branch processes data from one hand using its own convolutional and recurrent layers. After the LSTM stage, the two streams interact via a cross-attention mechanism, where each stream attends to the other’s output sequence. This enables the model to learn contextual relationships and interdependencies between the two hands. The attended outputs are concatenated and passed through shared dense layers to produce the final prediction.

CNN without Max Pooling

To assess the effect of temporal resolution loss due to pooling, this model removes all max-pooling layers from the cross-attention model and uses global pooling.

Model Accuracy (Tolerance = 0.01) Accuracy (Tolerance = 0.02)
CNN-LSTM Basic 0.795 0.726
CNN-LSTM (Attention) 0.765 0.777
CNN-LSTM (Cross-Attention) 0.810 0.739
CNN-LSTM (No Max Pooling) 0.846 0.807
Model Accuracy (Tolerance = 0.01) Accuracy (Tolerance = 0.02)
CNN-LSTM Basic 0.944 0.924
CNN-LSTM (Attention) 0.922 0.925
CNN-LSTM (Cross-Attention) 0.949 0.941
CNN-LSTM (No Max Pooling) 0.955 0.951

Download

GitHub Link: Models and Raw Data