Prosthetic Limbs and Machine Learning


Grant and I presenting our project

1. Summary and Introduction

Figure 1. Example signal data of bicep muscle flexion detected by EMG (rectified data model)

2. Procedure of Mechanical Aspect

Figure 2. Sketch of the palm of hand to note the measurements, wire flow, and general design of hand taken from personal notebook.
Figure 3. Final version of the palm of the hand to hold two servos and wire pulley mechanics

3. Electrical Aspect and Machine Learning

Figure 4. Schematic of the electromyogram (EMG) used onboard the hand
Figure 5. Machine learning pipeline from movement to classification for EMG signal data


Movement Detection

Feature and Labels Extraction

Dimensionality Reduction

def extract_data(filename):labels=[]
for line in open(filename):
row = line.split(',')
#fvecs.append([float(x) for x in row[1]])
#fvecs_np = np.matrix(fvecs).astype(np.float32)
fvecs_np = emg_health[:,0]
labels_np = np.array(labels).astype(dtype=np.uint8)
labels_onehot = (np.arange(5) == labels_np[:, None]).astype(np.float32)return fvecs_np, labels_onehotif __name__ == '__main__':
run = extract_data(emg)


class ELMRegressor():
def __init__(self, n_hidden_units):
self.n_hidden_units = n_hidden_units
def fit(self, X, labels):
X = np.column_stack([X, np.ones([X.shape[0], 1])])
self.random_weights = np.random.randn(X.shape[1], self.n_hidden_units)
G = np.tanh(
self.w_elm = np.linalg.pinv(G).dot(labels)
def predict(self, X):
X = np.column_stack([X, np.ones([X.shape[0], 1])])
G = np.tanh(
## Linear Discrim Analysis
def LDA:
lda = LinearDiscriminantAnalysis(n_discriminants=2), y_train)
X_lda = lda.transform(X)
## Spectral Regress Discrim Analysis
def SRDA:
srda = mlpy.Srda()
srda.compute(X-train, y_train)
srda.predict(X_train) # predict srda model on train data
srda.realpred # real-valued prediction
mysrda.weights(X_train, y_train) # compute weights on training data

4. Results

Figure 6. Final working product with proper muscle receiving and servo coordination

5. Conclusion

Figure 7. Our proposed design against the designs of other hands in the market and currently being built (graph had been cited from Mahdi Elsayed Hussein, 3D Printed Myoelectric Prosthetic Arm)

Final Remark



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Muhammad Umar Ali

I am an undergraduate student studying biomedical engineering at the University of British Columbia. Check out and my GitHub for more!