Deep Learning is fundamentally changing everything around us. A lot of people think that you need to be an expert to use power of deep learning in your applications. However, that is not the case.
In my previous article, I discussed 6 deep learning applications which a beginner can build in minutes. It was heart-warming for me to see hundreds of readers getting motivated by it. So I thought of following up from my previous article with a few more applications of deep learning. If you missed out on my previous article, I would suggest you should go through it.
In this article, we will learn how to build applications like automatic image tagging, apparel recommendation, music generation using deep learning and many more. And you will be able to build any of these applications with in minutes!
P.S. The article assumes, you know the basics of Python. If not, just follow this tutorial and then you can start from here again.
1. Applications using existing APIs
2. Open Sourced Applications
3. Other Notable Resources
Image tagging is one of the first applications of deep learning that showed breakthrough results. Unlike textual data, an image is a lot harder to comprehend for a machine. The machine requires a deeper understanding of the pixel data. Therefore we use image tagging to essentially summarize the image and tell us which categories the image and its underlying objects belong to.
That’s why we use image tagging to essentially summarize the image. This tells us which categories the image belongs to and what are its underlying objects.
Below is an example of predicted tags given to an image which was found through deep learning.
Now, let us look at how to build the above tagging feature for every image using an API provided by Clarifai.
Requirements and Specifications
pip install clarifai
clarifai config
Here, you will be asked to provide your Client ID and Client Secret respectively. You can find these on the developer page itself.
from clarifai.rest import ClarifaiApp app = ClarifaiApp() app.tag_files(['<your_image>.jpg'])
Then run the code by
python application.py
You will get an output as follows
{
"status": {
"code": 10000,
"description": "Ok"
},
"outputs": [
{
"id": "ea68cac87c304b28a8046557062f34a0",
"status": {
"code": 10000,
"description": "Ok"
},
"input": {
"id": "ea68cac87c304b28a8046557062f34a0",
"data": {
"image": {
"url": "https://samples.clarifai.com/metro-north.jpg"
}
}
},
"data": {
"concepts": [
{
"id": "ai_HLmqFqBf",
"name": "train",
"app_id": null,
"value": 0.9989112
},
...
This is a json output showing a response of the prediction. Here, you can find the relevant tags in outputs->data-> concept->name .
Recommendation systems are becoming a great asset day by day. As the number of products is increasing, intelligently targeting specific consumers who would be willing to buy the product is essential. Deep Learning can help us in this genre too!
I am not a fashion buff, but I have seen people “waste” so much time choosing which clothes to wear. How great would it be if we could have an artificial agent know our preferences and suggest us the perfect outfit!
Fortunately, with deep learning this is possible.
You can find a demo of this application here.
The official article describes this in more detail. Now let’s find out how can you build this recommender system at your end.
Requirements and Specifications
pip install indicoio
import indicoio from indicoio.custom import Collection indicoio.config.api_key = 'YOUR_API_KEY'
And at the end, replace the part ‘if __name__ == “__main__”‘ with below code
if __name__ == "__main__": train = generate_training_data("clothes_match_labeled_data_1.txt") collection = Collection("clothes_collection_1") for sample in tqdm(train): print sample collection.add_data(sample) collection.train() collection.wait()
And run this code by
python main.py
You will get an output like this
{u'label1': 0.0183739774, u'label2': 0.8100245667, u'label3': 0.1102390038, u'label4': 0.060105865800000005, u'label5': 0.0012565863}
which shows the probability of match as shown in the example above.
Music generation is one of the coolest applications of deep learning. If this application is used meticulously, it can bring breakthroughs in the industry.
Music, just like most of the things in nature, is harmonic. It has patterns which our mind catches and makes sense of. These patterns of music can be taught to a computer and then can be used to create new music rhythms. This is the formula behind music generation.
This open source application was built keeping in mind this concept. Below is an example of what it could generate.
Now let’s look at how we can replicate the results!
Requirements:
First, install Theano. Note that you have to install the bleeding edge version of Theano, which is required for this. You can find the installation instructions here.
Then install Keras by the below code
pip install keras
You would have to change backend of Keras from tensorflow to Theano. Follow the instructions given here.
The final dependency is of Music21. For installation, refer this link.
python generator.py 128
Although censorship is indeed a controversial topic, it is still a vital component for filtering out offensive adult content from the viewers. The inventors of this application focused on filtering out one of the main type of NFSW content, identification of pornographic images. A score is returned, which shows the intensity of NFSW, which can be used to filter out images above a certain threshold.
Below shows the images and their corresponding NFSW score as given by the application.
Let’s look at how to build one such application
Requirements:
docker build -t caffe:cpu https://raw.githubusercontent.com/BVLC/caffe/master/docker/standalone/cpu/Dockerfile
docker run --volume=$(pwd):/workspace caffe:cpu python ./classify_nsfw.py --model_def nsfw_model/deploy.prototxt --pretrained_model nsfw_model/resnet_50_1by2_nsfw.caffemodel <your_image>.jpg
We often see in movies that when you zoom in to an image, you can view even the finest detail which can be used to catch a criminal or get a crucial evidence.
In reality, this is not the case.When you zoom in, the image often gets blurry and not much can be seen. To cope up with this (and to make the dream a reality), we can use deep learning to increase the resolution of an image, which can help us to get clarity on zooming in.
This application is the depiction of the same. Here is its sample output.
Now let’s look at how to build this
Requirements
alias enhance='function ne() { docker run --rm -v "$(pwd)/`dirname ${@:$#}`":/ne/input -it alexjc/neural-enhance ${@:1:$#-1} "input/`basename ${@:$#}`"; }; ne'
enhance --zoom=1 --model=repair <your_image>.jpg
Deep learning constantly amazes me. With countless applications in the making, the race for making use of this technology is becoming rampant in the industry. Before signing off, I would like to mention some of the resources which might be inspirational to you.
You can also look at the video below for some use cases where deep learning can be used to enrich our lives. Enjoy!
I hope you enjoyed reading this article. Deep Learning continues to fascinate everyone including top data scientists across the globe. These are few of the interesting applications I wanted to share with you. If you happen to know any other deep learning application, do share it with me in the comments section.
If you come across any queries while building these applications at your end. Post your questions below & I’ll be happy to answer them.
Awesome article. Python is a great language to get started coding with and anyone can get started with all the free resources and ebooks available everywhere
Yup! I can't wait to see what all can we build using python
Its was a awesome article i get a lot of knowledge about Python..
Thanks Saurabh
Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
Thanks abiya