Wrap models in prediction interface to use in application

We need to conveniently call AI models from software applications to bring them to users and get their full benefit. Even though AI is making headlines it’s impact in many fields of business, industry, and medicine have been low relative to the investment leading to low Return on Investment (ROI). Part of the reason isContinue reading “Wrap models in prediction interface to use in application”

Train and compare models

Setting up model training as a function taking a model parameter allows us to try and compare different model architectures. Here we train a linear based model: model = sensor_classification.LinearModel(input_dim=X_train.shape[1] * X_train.shape[2], output_dim=len(np.unique(y_train))) val_df = sensor_classification.train_gesture_classification(model, X_train, X_val, y_train, y_val) And a convolution based model: model = sensor_classification.ConvModel(input_dim=(X_train.shape[1], X_train.shape[2]), output_dim=len(np.unique(train_y))) val_df = sensor_classification.train_gesture_classification(model, X_train, X_val,Continue reading “Train and compare models”

Splitting data

Data collected for AI model training and testing models gets randomly split into Training, Validation, and Testing datasets. Visualization confirms or spots problems in the datasets. See test. See plot method. Training is used to adjust AI models first. Validation is used to check the model during training. Testing data is used after the modelContinue reading “Splitting data”

Preprocess time series measurement windows into multidimensional tensors

The accelerometer data has four measurement columns and 160 time series measurement rows roughly captures a single motion. ax (m/s^2) ay (m/s^2) az (m/s^2) aT (m/s^2) Accelerometer column measurements. We will preproceess the data into tensors with 4 columns and 160 rows by the number of samples collected. See notebook. cols: [‘ax (m/s^2)’, ‘ay (m/s^2)’,Continue reading “Preprocess time series measurement windows into multidimensional tensors”

Check gesture measurements for normal motion and clean training data

Beginning and end measurements aren’t showing the standard gesture measurements because it takes time to start the recording then start moving the smartphone recording device. This again emphasizes the importance of visualizing training data as many data collection systems will have non-standard artifacts of the data collection. We want to remove these extreme low orContinue reading “Check gesture measurements for normal motion and clean training data”

Multiple measures and windows

Multiple measurements are recorded for each gesture. Test code. Function call. The measures captured here are acceleration in different directions: ax (m/s^2) ay (m/s^2) az (m/s^2) aT (m/s^2) Accelerometer measurements. Looking at a single measure like x, we can see a single measure may not differentiate gestures. The multi measure plots above look much moreContinue reading “Multiple measures and windows”

Ground truth label encoding

The ground truth label names of gestures ([‘rock’, ‘supination’, ‘scoop’, ‘shake’, ‘circle’]) are strings. The model training needs numeric labels so that the error of in-training models’ predictions can be calculated when comparing predictions to ground truths. The ground truth labels are converted into numbers (array([1, 4, 2, 3, 0])). Though a simple conversion fromContinue reading “Ground truth label encoding”

Normalizing measurement data

Measurements with different ranges should be normalized to similar ranges. Measurements of similar ranges will contribute equally to training models. If measurements are left at different ranges they may not contribute equally to the model. A common normalization is to transform each measurement to a mean of 0 and and standard deviation of 1 byContinue reading “Normalizing measurement data”

Loading and visualizing sensor data

After collecting sensor data we need to read the data into running software to work with it. The pandas toolkit contains tools for reading in data. recording = pd.read_csv(recording_path) see As a first step visualizing the data is important to understand what we’ve collected. Matplotlib can be used to visualize data in line plots. a[x][y].plot(col_data)Continue reading “Loading and visualizing sensor data”

Collecting sensor data for model training

AI on IoT is created by training models to react to sensor data from IoT devices. We need to collect training, validation, and testing sensor data from an IoT device. We’ll start with smart phones which have many sensors and are commonly available. From a smart phone search for “sensor data collector” on Google PlayContinue reading “Collecting sensor data for model training”

Design a site like this with WordPress.com
Get started