The possibilities of machine learning and artificial intelligence seem endless. But people have this idea that ML and AI are generally reserved for brilliant data scientists, Python wizards, and PhD statisticians who eat Markov Decision Processes for breakfast.
That's a misconception. Machine learning needn't be hard and it's available for everyone. This article will introduce a few projects to show you how easy it can be to experiment (and have fun) with AI and ML.
Let's Talk About TensorFlow
TensorFlow is an open-source machine learning platform for everyone, and it's one of the most popular ways to build an ML project. It's great for handwritten digit classification, image recognition, sentiment analysis, flaw detection, speech recognition, and even self-driving cars.
import * as tf from "@tensorflow/tfjs"
To give you an idea of what you can build with TensorFlow.js, here are a few ML projects built with it.
Let's Make it Easier: Pre-Trained Models
If you don't want to build everything from scratch with TensorFlow.js, you can use a pre-trained TensorFlow.js model. Find a list of pre-trained models here. You can pick from many different scenarios: classifying images, detecting objects, determining the toxicity of a text, and more.
Let's say you want to extract some information about an image. Well, you can do that with only a few lines of code:
import * as mobilenet from '@tensorflow-models/mobilenet'; const img = document.getElementById('img'); // Load the model. const model = await mobilenet.load(); // Classify the image. const predictions = await model.classify(img); console.log(predictions);
One Step Easier Still: APIs
What's even easier than pre-trained models is just using an API. I'll list a few examples of cool APIs that you can plug into your AI/ML project.
TeleportHQ built a computer-vision API that's specifically trained for detecting atomic UI elements from pictures of hand-drawn wireframes. It's quite magical:
This could be an excellent tool for prototyping a website or even for generating codebases on the fly. Yes, you can use their API on your own project. The only requirement and limitation is your imagination.
Microsoft Azure Cognitive Services
Microsoft Azure Cognitive Services provide a vast array of APIs for different needs. All you need to do is send a request to their API for it to return JSON data from one of its models. They have trained models for image recognition, face detection, text recognition, and much more.
Have a look at this demo (takes a while to load) and the corresponding code. It uses Microsoft Azure's API to transform what's in the image into text. A dog sitting in the grass, in the below example. Imagga in particular is great for image categorization and tagging. Check out a demo of it here.
Nvidia's vid2vid project allows you to generate human motions from poses, like so:
Keep in mind that the output isn't a real human! This is both amazing and scary (deep-fake videos are already a big thing online). The point here is that it's very easy to experiment with advanced ML models without deeply understanding how it all works underneath the hood.
AI and ML needn't be scary. You definitely shouldn't be held back from starting your first AI/ML project because of the perceived complexity of it. Sure, underneath the hood it's complex, but so is everything if you really break it down.
TensorFlow, TensorFlow.js, and the numerous APIs freely available make it very easy to get started with artificial intelligence and machine learning. If you're an X-Teamer and want to learn about machine learning, don't forget that you can use your Unleash+ budget to pay for some of the courses!