How to Create a Custom Dataset for AML Model Training

How to Create a Custom Dataset for AML Model Training

Creating a robust and well-structured dataset is one of the most critical steps in training an effective machine learning model. With the AML Dashboard, users can seamlessly manage datasets for training AML models. This article provides a step-by-step guide to creating and using custom datasets with the AML Dashboard, focusing on their preparation and integration.

Background

The AML Dashboard is a web-based tool designed for interacting with the AML framework. This tutorial specifically focuses on the data collection step in the AML model training process, demonstrating how to create and load a custom dataset.

Prerequisites

Ensure you have installed the AML Dashboard using one of the following methods:

For more information, check the AML Dashboard Interfaces and AML Dashboard Usage sections.

Running the Demo

To collect data using the AML Dashboard, follow these steps to launch the required components.

Step 1: Start the Backend Server
  1. Navigate to the backend directory:

CustomDataset

  1. Load the AML-IP environment:

CustomDataset2

  1. Start the server:

CustomDataset3

Step 2: Start the AML Dashboard
  1. Navigate to the AML Dashboard frontend directory:

CustomDataset4

  1. Start the Dashboard:

CustomDataset5

  1. Access the dashboard at http://localhost:5173/.
Collecting Data

The AML Dashboard provides various options for dataset creation:

  1. Webcam-based collection
  2. Standard datasets
  3. Custom datasets

While the first two options cater to quick setups, the custom dataset feature offers unparalleled flexibility and adaptability.

Creating a Custom Dataset
Steps to Load a Custom Dataset
  1. Navigate to the Data Management Tab: Open the AML Dashboard and switch to the "Data Management" section.
  2. Select ‘Custom’: From the drop-down menu in the "Choose the model for the training set" section, select the option for "Custom."
  3. Load the Dataset: Click the "Load dataset" button. A popup will appear, prompting you to upload your dataset from the local system.

Format Requirement for Custom Datasets

The uploaded dataset must be in JSON format with a specific structure. Here's how you can prepare your dataset:

Code Example for Dataset Preparation

The following Python function saves data in the required format:

CustomDataset6

Key Points in Custom Dataset Preparation
  • Dataset Name: Always set "datasetName": "training2-set-models" for compatibility.
  • Image Representation: Each image must be a one-dimensional list of pixel values.
  • Thumbnails: The generate_data_uri function converts images into Base64-encoded PNG thumbnails.
  • Labels: Labels must be numeric.
  • Instance Count: The example limits the dataset to 100 instances for demonstration, but you can adjust this as needed.
Next steps

Custom datasets unlock the potential to tailor machine learning models to specific requirements.

By leveraging the AML Dashboard’s intuitive interface and the provided Python script, you can easily prepare and integrate custom datasets.

In the next tutorial, we will guide you through training your AML model using AML-Dashboard.

By Denisa Alexandru from eProsima

MORE INFORMATION ABOUT ALMA:

For any questions please contact This email address is being protected from spambots. You need JavaScript enabled to view it..

 

 

Logo ALMA

The ALMA project leverages AML properties to develop a new generation of interactive, human-centered machine learning systems.

Coordinator Office Address

Plaza de la Encina 10-11, Núcleo 4, 2ª Pl.
28760 Tres cantos - Madrid (España)

  • X
  • LinkedIn

EN-Funded_by_the_EU-POSThis project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 952091.