 Hello everyone, welcome to the Pictoblox machine learning environment tutorial series. In this tutorial, we are going to learn about image classification. It is one of the machine learning model types which can be trained in Pictoblox. Image classification is used for classifying images into different classes based on their characteristics. For example, classifying whether the image has a cat or a dog. Assign whether I am wearing a mask or not. In this example, we are going to make a mask and detector in Pictoblox. Here Pictoblox will identify three conditions. Person is wearing a mask, person is not wearing a mask and person is wearing the mask improperly. Let's get started. Open Pictoblox and select the block coding environment. Go to the machine learning environment by selecting the open ml environment option under the file tab. As we are training our models in Python, it is important that we have the required dependencies. In order to download these dependencies, simply click on the gear icon on the top right of the screen and select the download dependencies option. This will download and update the dependencies required to train the model. Click on the create new project option to initialize your project. Type an appropriate name of the project and select the image classifier as the model type. Click on the create project button and you will see the image classifier window. When you are greeted with the image classifier window, you will see two classes. Class 1 and class 2 made for you by default. Let's understand what a class is. Class is basically the category in which the model classifies the images. Like for dog images, you have a different class called dog and for all the cat images are added under the class name cat. Coming back to the project. Edit the first class name to mask on. There are three ways in which you can add data to your project. Using your device webcam to click image samples, use the upload button to upload images from your device and using the upload classes from folder button to import an entire data set. For this example, we will take the images from the camera. Click on the hold to record button to capture the with mask images. You will need at least 20 images to train the class. For this example, you can take 200 photos with different head orientations. If you want to delete any image, hover over it and click on the delete button. Once uploaded, you will be able to see the images in the class. Rename class 2 as mask off and take the samples from the webcam. Click the add class button and you shall see a new class. Training the class to mask wrong. As a thumb rule, you should try to add an equal number of images in every class. Large variations in data can be a problem by training the model. Training is where the classifier extracts features from the added data and trains a model to recognize the images in the classes. This way, the model will be able to classify unseen images as per the classes provided. Use the advanced tab to alter the hyperparameters of the model. In the image classifier, you can play around with epochs, bath size and learning rate. Do note that learning rate is an extremely sensitive hyperparameter and can greatly affect the performance of your model. Picto blocks gives you an option to train the image classification in both JavaScript and Python. Just flick the switch on top of the training box to cycle between the two. Training the model might take some time. Keep a check on the accuracy graph while training is done. You can view a comprehensive report of your model performance in the trained report. The trained report consists of the accuracy and loss curve of the model, the confusion matrix of the model and the true positives, false negatives and false positives for each class. Once training is complete, it's time to test our model on alien data. The model trains itself on the images we provide, but a model is only useful if it can classify alien data just as well as it classifies the training data. This is where model testing comes into play. You can test the images here. Much like training, testing can be done either by a device's webcam or by uploading data from your device. Start the camera and test the model. Now click on the export model button on the top right of the testing box and Picto blocks will load your model into the block coding environment. Observe how we have blocks for the model we just trained on the block palette. You can click on the open recognition window block and test the model's working. Add the when flag click block and the forever block into the scripting area and snap them together. Now, add a turn video on stage with transparency block above the forever block. Select on and zero as transparency. This will make the camera feed show up on the stage. Drag and drop the if block inside the forever block. Then add the analyze image form block above the if block and select the web camera as feed. Then add the is identified class block in the condition space. Select the class as mask on. From the looks palette add a save block inside the if block. Write the message thank you for wearing the mask properly. Duplicate the if block and snap it below the first if block. Select the class as mask off. Change the text in the block to say please wear the mask. Now duplicate the if block and snap it below the first if block. Select the class as mask wrong. Change the text in the block to say please wear the mask properly. The script is now complete. Click the green flag to run the script. There you have it. You just use the image classification to make your very own mask detection project.