Skip to content

sidneyshafer/zumi-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zumi Obstacle Classification

A Machine Learning project written with Python in Jupyter Notebook to instruct Zumi to classify two objects using the k-NN and Logistic Regression algorithms.

Zumi Website: https://www.robolink.com/products/zumi

This project trains Zumi with a soft toy and plastic cup.

Download all files and follow instructions in the Juypter Notebook file (zumi-final-code.ipynb)

zumi-final-code Jupyter Notebook Details & Instructions

Classifying Objects Using Pickled Data Files

The project can be run two different ways to classify objects:

  1. Classify obstacles without noise
  2. Classify obstacles with noise

1. Classify obstacles without noise

  1. Under Data Collection, run the first cell of code. image

  2. Run the second cell of code. image

  3. Under Data Collection - collect data without noise, run the first cell. image

  4. DO NOT run the cells under Data Augmentation - collect data with noise.

  5. Under Storing & Visualizing Data, run the first cell to visualize the data points. image

  6. Under Plotting Data, run both cells to visualize the data on a 2D and 3D graph.

  7. Under Implementing & Training k-NN and Logistic Regression, run both code cells to train the machine learning models.

  8. Run the code cell under Hyperparameter Tuning to determine the best value for k.

  9. Run the code cell under Confusion Matrix to generate a confusion matrix for each model.

  10. Under Cross-Validation with cross_val_score, run the cell to implement k-fold cross validation.

  11. The section under Real-time Decision Making allows Zumi to react in real-time to a classified object.

    a. Place Zumi in front of an object (i.e. a soft toy, plastic cup, or any other object you wish to classify).

    b. Run the first cell to define the react_to_obstacle function.

    c. Run the second cell to define the classify_obstacle function - this function will classify the object.

  12. Run the cell under Evaluation to check the accuracy of the k-NN and Logistic Regression models.

2. Classify obstacles with noise

  1. Under Data Collection, run the first and second cells of code.

  2. DO NOT run the cells under Data Collection - collect data without noise.

  3. Only run the first cell (image below) under Data Augmentation - collect data with noise. DO NOT run the second cell. image

  4. Under Storing & Visualizing Data, run the first cell to visualize the data points.

  5. Under Plotting Data, run both cells to visualize the data on a 2D and 3D graph.

  6. Under Implementing & Training k-NN and Logistic Regression, run both code cells to train the machine learning models.

  7. Run the code cell under Hyperparameter Tuning to determine the best value for k.

  8. Run the code cell under Confusion Matrix to generate a confusion matrix for each model.

  9. Under Cross-Validation with cross_val_score, run the cell to implement k-fold cross validation.

  10. The section under Real-time Decision Making allows Zumi to react in real-time to a classified object.

    a. Place Zumi in front of an object (i.e. a soft toy, plastic cup, or any other object you wish to classify).

    b. Run the first cell to define the react_to_obstacle function.

    c. Run the second cell to define the classify_obstacle function - this function will classify the object.

  11. Run the cell under Evaluation to check the accuracy of the k-NN and Logistic Regression models.


Data Collection

NOTE: You will need a fully operational Zumi to gather sensor reading data for this section.

The project can be run two different ways to collect data points for classifying objects:

  1. Collect data points without adding noise.
  2. Collect data points with augmentation (add noise).

1. Collect data points without adding noise

  1. Under Data Collection, run the first and second cells of code.

  2. Under Data Collection - collect data without noise, run the first cell of code.

  3. DO NOT run the first cell under Data Augmentation - collect data with noise.

  4. ONLY Run the second cell and follow the instructions:

    NOTE: Place Zumi in front of an obstacle (either a soft toy or plastic cup) to collect sensor readings. image

  5. Repeat Step 4 until you have the desired amount of data points.

  6. After Data Collection is complete, execute the rest of the code cells in the notebook (as described in the sections above).

2. Collect data points with augmentation (add noise)

  1. Under Data Collection, run the first and second cells of code.

  2. DO NOT run the cell under Data Collection - collect data without noise.

  3. Run the first cell under Data Augmentation - collect data with noise.

    a. This code opens the zumi_data_noise.pkl file. image

  4. Then, run the second cell and follow the instructions:

    NOTE: Place Zumi in front of an obstacle (either a soft toy or plastic cup) to collect sensor readings. image

  5. Repeat Step 4 until you have the desired amount of data points.

  6. After Data Collection is complete, execute the rest of the code cells in the notebook (as described in the sections above).

About

A Machine Learning project with Python in Jupyter Notebook that instructs a Zumi robot to classify objects using k-NN and Logistic Regression algorithms.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published