Amazon SageMaker GroundTruth (Object Detection)
Published: 2022-04-23 14:32:03

Now let’s talk more about the object detection algorithm and we will begin with the bees dataset. Some of the images in the dataset, that we will be working on, is licensed under the CC0 license and are provided on this website. 

Object detection is a **supervised learning algorithm** in that it expects inputs as images and annotations. Now, this dataset contains images of bees, however, we need to provide annotations to these images in the form of boundary boxes. 

**Annotated image Example:**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/um8r2vc9vrnq9vektlk9.png)

**Private labeling workforce:**
We will take an example of how to use a private labeling workforce to label your dataset.

**Step 1:** Search for Amazon SageMaker in the search bar.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f3k4a5dqa6fnp0iw4l8b.png)

---


**Step 2:** Choose Labelling jobs from Amazon Sagemaker’s Ground Truth, press **Create labelling jobs**.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z1min4br6c4o9ngy2wi6.png)


---


**Step 3:** You need to **create a new S3 bucket** and call it for example “bees-dataset-bucket” which is the name we are going to use.

---



**Step 4:** Name the labelling job, use either of Automated data setup (if you have the images dataset in a folder, Sagemaker makes the input manifest file for you) or manual data setup option (provide the input manifest file). We are going to use the **Automated data setup** option and our data resides in bees-dataset-bucket/input_dataset/ . Specify the **output location** and choose data type “Image”.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/brssxtgm2vhpo89lnnpq.png)


---


Example of the input manifest file created automatically by Sagemaker:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/boe8ie69rh2fqztj3knp.png)

---



**Step 5:** We will create a new IAM role which will provide the labelling job access to our “bees-dataset-bucket”.  
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/skj28mo6sk832irwqz7a.png)

---



**Step 6:** Press Complete data setup to create the input manifest file from the dataset. For illustration, we will choose **Random sample** to randomly sample 1% of the data (500 image) so we will only have (5) images to sample. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x39i0bgvh7qau4vgo7ut.png)

---



**Step 7:** Choose **bounding box**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xish0opocxgat59gf0dc.png)

---



**Step 8:** Choose **Private** under Worker types, fill in team name, employees’ emails, organization name, contact detail.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0q7y3lfajgz67nzkhvad.png)




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/064pqfpi17tsdmxhq625.png)


---



**Step 9:** You need to fully discuss the labelling job and add a good and a bad example for clarification, click Create.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqzla3ukhgwaz07qcars.png)

---



**Step 10:** Your employers will then receive this email:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oy15yczl5lllopnxtimt.png)


---



**Step 11:** Each employer now will perform this task:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ufotqtijv2cgquo2k0jp.png)
 
 

---



**Resources:**

Amazon Sagemaker ground truth: [(https://docs.aws.amazon.com/sagemaker/latest/dg/sms-workforce-management-public.html)]
[(https://docs.aws.amazon.com/sagemaker/latest/dg/sms-workforce-management-vendor.html)]
[(https://docs.aws.amazon.com/sagemaker/latest/dg/sms-workforce-private.html)]
[(https://aws.amazon.com/blogs/machine-learning/create-high-quality-instructions-for-amazon-sagemaker-ground-truth-labeling-jobs/)]