> For the complete documentation index, see [llms.txt](https://sharinghub-eng.kittenbot.hk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sharinghub-eng.kittenbot.hk/programming-platforms/kittenblock/kittenblock-functions-and-features/kittenbot-extensions/machine-learning/machine-learning-5-feature-extraction.md).

# Machine Learning 5 Feature Extraction

### Loading the extension for Machine Learning 5

```
The Video Sensing extension is also used in this tutorial.
```

Open up the extension page.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/add.png)

Select Video Sensing, Machine Learning 5 and the Pen extension.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/add2.png)

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml28.png)

New programming blocks will be added.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml6.png)

If your computer has a low specification(e.g. lacks a discrete GPU), its performance maybe enhanced by using CPU mode.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml14.png)

### Feature Extraction

#### Example 1: Rock Paper Scissors

Turn on the camera and initialize the feature extractor

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml15.png)

Teach the program to recognize the background.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml16.png)

Teach the program to recognize rock.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml17.png)

Then teach the program to recognize paper and scissors.

The program is now able to recognize these gestures.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml18.png)

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml19.png)

The trained model can be saved as a json file for use in other programs.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml20.png)

We can load a model from before.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml21.png)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sharinghub-eng.kittenbot.hk/programming-platforms/kittenblock/kittenblock-functions-and-features/kittenbot-extensions/machine-learning/machine-learning-5-feature-extraction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
