Showing posts with label Artificial Intelligence. Show all posts
Showing posts with label Artificial Intelligence. Show all posts

Build Your First Nueral Network: Basic Image Classification Using Keras

image Classification using keras img

Image classification is one of the most important problem to solve in machine learning. It can provide vital solutions to a variety of computer vision problems, such as face recognition, character recognition, object avoidance in autonomous vehicles and many others. Convolutional Neural Network (CNN), since its inception has been used for image classification and other computer vision problems. It is called convolutional neural network because of convolutional layer. Keras is a high level library which provides an easy way to get started with machine learning and neural networks. It will be used here to implement CNN to classify handwritten digits of MNIST dataset.

Image Classification is  a process to determine which of the given classes an input image belongs to. CNNs represent a huge breakthrough in image classification. In most cases, CNN outperforms other image classification methods and provides near to human-level accuracy. CNN models do not simply spit the class name the input image belongs to, rather it gives a list of probabilities. Each entry in the list shows the likelihood that the input image belong to a certain class. For example, if we have two classes in a dataset of "cats and dogs" images, a CNN model gives us two probabilities. One to show the likelihood or probability of the input image to belong to "dog" class and the other depicts the the probability that the image might belong to "cat" class.

There are four basic parts of any neural network model. 
  1. Network architecture 
  2. Loss function 
  3. Optimizer
  4. Regularizer.

1. Network architecture

Network architecture refers to the organization of layers in the network and the structure of each layer. It also shows the connectivity between the node of one layer to the nodes of next layer. A node is like a basic functional unit used repeatedly in a layer. A CNN model usually has convolutional layers, pooling layers, dropout layers and fully connected layers.

Convolutional layers extract different features, also called activations or feature maps, from images at different levels while pooling layer down samples and summarizes these features. Dropout out layer is a regularization technique which prevents model to overfit the training data.

2. Loss function

Loss function, also called cost function, calculates the cost of the network during each iteration in training phase. Cost or loss of a neural network refers to the difference between actual output and output predicted by the model. It tells how good the network performed during that iteration. The purpose of the training phase is to minimize this loss value. The only way to minimize loss value meaningfully is to change weights in each layer of the network. It is done with the help of optimizer.
Examples of loss functions include Mean Squared Error and Cross-Entropy loss which give best performance at classification problems.

3. Optimizer

An optimizer is basically an optimization algorithm which helps to minimize or maximize an objective function. In neural networks it is used to find minima of the loss function. Based on the loss value and existing weights, gradients are calculated which tell us in which direction (positive or negative) to update the weights and the amount by which the weights are supposed to change. These calculated gradients are propagated back throughout the network by optimizer.
There are different types of optimizers. Few of the popular optimizers are Adam and different variations of Gradient Decent algorithm. Each of these is suitable for different scenarios. However, Adam (adaptive momentum) is widely used for classification problems due to its speed and accuracy in finding local minima of the loss function.

4. Regularizer

Regularizer is not a mandatory component of a neural network but it is a good practice to use one because it prevent model from overfitting. Overfitting means larger generalization error. An overfit model performs extremely accurate on training data. However, it performs poorly on the data that is has never seen before.  There are different regularization techniques such as dropout, L1 and L2 regularization. To prevent our model overfit training data, we will add a dropout layer to it.

That's enough for theory. Let's see the code stepwise.

1. Import keras library:

import keras

2. Load MNIST dataset:

Keras provides an easy to use API to download the basic datasets like: MNIST, Cifar10, Cifar100, Fashion MNIST. It will take just two lines to load the entire dataset in local memory.

mnist = keras.datasets.mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()

3. Define some global variables

batch_size = 200
epochs=5
input_shape = [-1, 28,28,1]

4. Pro-process data

In pre-processing, we will only normalize images, convert labels to categorical format (also called one-hot encoding), and reshape images. Normalization brings pixel values in the range of 0-1. It is not necessary but it helps to improve accuracy. However, labels need to be converted to categorical format, because there are 10 classes in MNIST and as we have discussed in introductory section above, CNN gives a list of probabilities.
x_test = x_test/255.0
x_train = x_train/255.0
 
MNIST labels are single digits ranging from 0-9. In one-hot encoding, each digit is converted to an array of 10 values having 1 only at the digit itself as index of the array. For example 2 is converted to [0,0,1,0,0,0,0,0,0,0] and 3 is converted to [0,0,0,1,0,0,0,0,0,0,0].
One-hot encoding actually tells the model that for instance for an image of digit 3, you should give maximum probability at 3rd index. It sounds a little hard but keras has a utils module which saves us time.

y_train = keras.utils.to_categorical(y_train)
y_test = keras.utils.to_categorical(y_test)

CNN consider number of channels too in convolution operations and MNIST image are provided in 28x28 format. All these images are grayscale and it has only one channel so we will convert it to [-1, 28, 28, 1]. -1 here means that reshape all the images in array.
If you don't understand, don't worry about it—Legendary Andrew Ng
x_train = x_train.reshape(input_shape)
x_test = x_test.reshape(input_shape)

5. Build model

Here is where we define our network architecture. Keras' Sequential model API is pretty easy to understand. It creates a model but stacking layers over each other in the order they are provided. All we need to do it to create an object of Sequential class and add layers to it using add method. There is also an option to add layers at the constructor but I prefer to use add method. It gives a clue how the input pass through the network.

model = keras.Sequential()
model.add(keras.layers.Conv2D(6, (3,3), activation=keras.activations.relu,  
input_shape=[28,28,1]))
model.add(keras.layers.MaxPool2D())
model.add(keras.layers.Conv2D(16, (3,3), activation=keras.activations.relu))
model.add(keras.layers.MaxPool2D())
model.add(keras.layers.Conv2D(120, (3,3), activation=keras.activations.relu))
model.add(keras.layers.Flatten())
model.add(keras.layers.Dense(84, activation=keras.activations.relu))
model.add(keras.layers.Dropout(0.5))
model.add(keras.layers.Dense(10, activation=keras.activations.softmax))

Remember what is an optimizer and loss function? We definitely need optimizer to update weights and loss function to calculate the cost or loss of the network during training phase.
optimizer = keras.optimizers.adam()
model.compile(optimizer=optimizer, loss=keras.losses.categorical_crossentropy,
metrics=['accuracy'])

6. Training

Our model is now ready to enter the training phase. We will call fit function and provide the training data we want our model to fit. There are some other information needed such as batch size, number of epochs and verbose.
model.fit(x_train, y_train, batch_size, epochs, 1)

7. Testing

Once, all the epochs are completed and the training phase ends we evaluates our model to know how good it is at classification.

results = model.evaluate(x_test, y_test, batch_size, 0)
print('{}: {:.2f}, {}: {:.2f}'.format(model.metrics_names[0], results[0],\
model.metrics_names[1], results[1]))

8. Save trained model

In order to use the trained model next time for classification, it needs to be saved because it is insane to retrain a model each time we need it to use.

model.save('model.h5')

To use the already trained and saved model, it is loaded using keras' load_model function. If you have a saved model, you don't need step 5 and 6.

new_model = keras.models.load_model('model.h5')

Note: In this post, I have skipped some details to make things easy to understand. However, we will see those details in upcoming posts.
If you have any issue with the code, feel free to ask in the comments. I will try to reply instantly.

    How Computers Understand Human Language?

    How Computers Understand Human Language?

    Photo by Alex Knight on Unsplash
    Natural languages are the languages that we speak and understand, containing large diverse vocabulary. Various words have several different meanings, speakers with different accents and all sorts of interesting word play. But for the most part human can roll right through these challenges. The skillful use of language is a major part what makes us human and for this reason the desire for computers that understand or speak human language has been around since they were first conceived. This led to the creation of natural language processing or NLP.
    Natural Language Processing is a disciplinary field combining computer science and linguistics. There is an infinite number of ways to arrange words in a sentence. We can't give computers a dictionary of all possible sentences to help them understand what humans are blabbing on about. So, an early and fundamental NLP problem was deconstructing sentences into small pieces which could be more easily processed.
    In school you learned about nine fundamental types of English words.
    1.     Nouns
    2.     Pronouns
    3.     Articles
    4.     Verbs
    5.     Adjective
    6.     Adverbs
    7.     Prepositions
    8.     Conjunctions
    9.     Interjections
    These are all called parts of speech. There are all sorts of sub-categories too like singular vs. plural nouns and superlative vs. comparative adverbs but we are not going into that. Knowing a word’s type is definitely useful, but unfortunately there are a lot of words that have multiple meanings like rose and leaves which can be used as nouns or verbs.
    A digital dictionary alone is not enough to resolve this ambiguity so computers also need to know some grammar. Fro this, phrase structure rules were developed which encapsulate the grammar for a language. For example in english there's a rule that says a sentence can be comprised of a noun phrase followed by verb phrase. Noun phase can be an article like “the” followed by a noun or they could be an adjective followed by a noun. And you can make rules like this for an entire language. Then using these rules it is fairly easy to construct was called parse tree which not only tag every word with a likely part of speech but also reveals how the sentence is constructed.
    The smaller chunks of data allow computers more easily access, process and respond to information. Equivalent processes are happening every time you do a voice search like ‘where is the nearest pizza’. The computer can recognize this is a ‘where’ question, knows that you want the noun ‘pizza’ and the dimension you care about is the ‘nearest’. The same process applies to “what is the biggest giraffe?” or “who sang thriller?” By treating language almost like legos, computers can be quite adept at natural language tasks. They can also answer questions and also process commands like ‘set alarm for to 2:20’. But as you have probably experienced they fail when you start getting fancy and they can no longer parse the sentence correctly or capture your intent.
    I shall also mention that phrase structure rules and similar methods that codify language can be used by computers to generate natural language text. This works well when data is stored in a web of semantic information where entities are linked to one another in meaning for relationships, providing all the ingredient you need to craft informational sentences.
    These two processes, parsing and generating text are fundamental components of natural language chat bots. Chat bot is a computer program that chat with you. Early chat bots were primarily rule based where experts would encode hundred of rules mapping what a user might say, to how a program should reply. But this was difficult to maintain and limited the possible sophistication.
    A famous early example was Eliza, created in the mid 1960 at MIT. This was a chatbot that took on the role of a therapist and used basic syntactic rules to identify content in written exchanges, which it would turn around and ask the user about. Some times it felt very much like human-human communication but sometimes it would make simple and even comical mistakes. Chat bots today are more advanced. It has come a long way in the last fifty years and can be quite convincing today.
    Simultaneous innovation in the algorithms for processing natural language is moving from hand crafty rules to machine learning techniques that could lead automatically from existing data sets of human language. Today the speech recognition systems with the best accuracy are using deep learning.

    Related Read: Deep Learning: A Quick Overview

    Supervised, Unsupervised and Reinforcement Learning

    supervised vs unsupervised vs reinforcement learning

    What's The Difference Between Supervised, Unsupervised and Reinforcement Learning?

    Machine learning models are useful when there is huge amount of data available, there are patterns in data and there is no algorithm other than machine learning to process that data. If any of these three conditions are not satisfied, machine learning models are most likely to under-perform.
    Machine learning algorithms find patterns in data and try to learn from it as much as it can. Based on the type of data available and the approach used for learning, machine learning algorithms are classified in three broad categories.
    1. Supervised learning
    2. Unsupervised learning
    3. Reinforcement learning
    An abstract definition of above terms would be that in supervised learning, labeled data is fed to ML algorithms while in unsupervised learning, unlabeled data is provided. There is a another learning approach which lies between supervised and unsupervised learning, semi-supervised learning. Semi supervised learning algorithms are given partially labeled data.
    Reinforcement learning however is a different type of learning which is based on a reward system. ML model/algorithm is rewarded for each decision it makes during training phase. Reward could be positive as encouragement for a right decision or negative as a punishment for wrong decision.
    Let's have a look each of these terms in detail with examples.

    What is supervised learning?

    Suppose you are present in maths class (yes, maths class. If you don't like maths, you shouldn't be here) and you are given with a problem and its related data and you are asked to solve it for available data. You make an attempt and come up with a wrong answer. Your teacher is a noble person. He/She does not evaluate your solution but show you the correct answer. You compare it with your answer, try to identify where you have made mistakes and try to correct it. You are math class, of course you will get many problems to solve and the process continues.
    Same is the case with supervised learning. The data is provided with its labels. Labels are the expected output of the input data which are provided by human. In above example, the correct answer the teacher give you is a label in that case. It is also called actual output.
    In supervised learning, each instance in the dataset is labeled with its actual output. Learning algorithm has to find a way to come up with exactly the same or a closely related answer. For example a labeled dataset of vehicle images, each image would have the name of the vehicle in the image. A car image would be tagged with "car", bus image with "bus" and so on.
    If you are thinking how a huge amount of data is labeled, visit Amazon Mechanical Turk. It is a program hosted by Amazon in which people are paid for data labeling tasks.

    How does the supervised learning approach works?

    When a machine learning model process an instance from the dataset and calculates the output for that instance. It is called predicted output. Predicted output is then compared with the label of the instance of dataset. Label is also called actual output. If you have understood the math class example then you might be able to guess the next step. Make a guess.
    The next step as you might have guessed is to find the difference between the actual output and predicted output and change the solution accordingly. The illustration below will you understand the process more.
    supervised learning
    supervised learning
     Supervised learning examples:
    • Classification 
    • Regression

    What is unsupervised learning?

    Suppose you are sitting in exam hall and you are given with a problem to solve. Unlike math class, this time you have the problem and input data but you do not have the correct answer. You just solve the problem your way. You have no idea whether you answer is correct or not or how wrong it is.
    Same is the case with unsupervised learning. In this learning approach, unlabeled data is given to a machine learning model. There is no actual or expected output. The only output in this case would be the predicted output which the model produces itself. So, the difference between the supervised and unsupervised learning is that in supervised learning, labeled data is provided and in unsupervised learning, unlabeled is handed to the model.
    unsupervised learning
    unsupervised learning
     Unsupervised learning examples:
    • Clustering
    • Pattern and sequence mining
    • Image segmentation.

    Reinforcement learning

    How do we teach kids? We ask them to do something, when they are done we reward them somehow for good results and punish them otherwise. The reward could be anything like a chocolate bar or just verbal encouragement. Operant Conditioning is the word used for this type of learning in biology.
    However, in deep learning we call this type of learning approach reinforcement learning. As in the beginning, kids have no idea of how to do a task. They learn from experience. They are more likely to repeat the behavior they are rewarded for and avoid the behavior they are punished for.
    Similarly, deep learning models initially have no idea how to perform a task. In reinforcement learning, the model is rewarded or punished each time it makes a correct or wrong prediction during training time.

    How does reinforcement learning works?

    Although, this type of learning is close to how human and animals learn but to implement it in computers, we use game theory. In game theory we have a set of states that player could be in, a set of actions that player could take to reach to another state and the rewards or points to for each state action pair. We will not go into details here how reinforcement learning works but just grab the point game theory is used in reinforcement learning. Of-course there are other methods too but they are similar to game theory.

    Artificial Intelligence Vs Machine Learning Vs Deep Learning

    artificial intelligence vs machine learning vs deep learning

    Artificial Intelligence Vs Machine Learning Vs Deep Learning

    Artificial intelligence, deep learning and machine learning are often confused with each other. These terms are used interchangeably but do they do not refer to the same thing. These terms are closely related to each other which makes it difficult for beginners to spot differences among them. The reason I think of this puzzle is that AI is classified in many ways. It is divided into subfields with respect to the tasks AI is used for such as computer vision, natural language processing, forecasting and prediction, with respect to the type of approach used for learning and the type of data used.
    Subfields of Artificial Intelligence have much in common which makes it difficult for beginners to clearly differentiate among these areas. Different approaches of AI can process similar data to perform similar tasks. For example Deep learning and SVM both could be used for object detection task. Both have pros and cons. In some cases Machine Learning is the best choice while sometimes Neural Networks outperforms Machine Learning algorithms.
    Here, we will make an attempt to define each of these terms and highlight similarities and dissimilarities with the help of examples.

    Artificial Intelligence

    Artificial Intelligence for short AI is a broad term used for any concept or technique which brings some sort of intelligence to a computer. Computer here means anything which has the capability to store and process data. In many writings, the word machine is used. However, they refer to the same thing.
    Artificial intelligence spans a wide range of machine intelligence. It refers to the intelligence that machine uses to play a game against a human, to translate one human language to another, to recognize things in a scene, to classify emails as Spam or not Spam, to drive car, auto pilot of a plain and you name it.

    Machine Learning

    Machine learning is a sub field of Artificial Intelligence. It includes the study of algorithms that brings intelligence to computer systems without any explicitly specified rules. Unlike obsolete expert systems which works on predefined if then rules, machine learning finds patterns in the data and makes decisions by itself. Finding patterns in data by a Machine Learning algorithm is called learning. Huge amount of data is required to teach a machine to perform a specific task. Here blends big data with machine learning. If there is no big data, there is no machine learning.
    One of the most important point to remember about machine learning is that researchers or developers are required to specify learnable features in data which is a tedious task. ML algorithm does not perform well on raw data. Extracting learnable features from raw data is called feature extraction which is a crucial task to be done.
    Machine learning algorithms include SVM, Random Forest, Decision Tree, Bayesian Network etc.

    Deep Learning

    Deep Learning is considered as a sub field of Machine Learning by many but I think it is a sub field of Artificial Intelligence. It is like a sibling to ML rather than a child. Although, in deep learning a machine learns from data and take decisions based on its knowledge as it does in Machine Learning but its learning process is completely different from Machine Learning approaches.
    Deep Learning takes input data in its raw format and decides itself which features are important enough to learn. Deep Learning models perform the feature selection process by itself thats why it is also called feature learning.
    Similar to machine learning, deep learning is nothing without huge amount of data. However, we do not need to worry about learnable features and patterns in the data. It finds important features and learn by itself.
    Deep Learning uses Neural Network which are inspired by biological neurons. Although, neural networks does not perform as well as biological neurons do but they mimic their functionality up to some extent.

    Conclusion

    You can think of Artificial Intelligence as it is the earth and Machine Learning and Deep Learning are two subcontinents which are not separated by a clear line. The border is blurry. Of course their are other subcontinents too which are also part of the earth. I think it does not matter if you can differentiate different fields of AI or not. What matters most is that whether you can solve a problem by using Artificial Intelligence or not. AI looks like a mess at the beginning but it is not what most people think it is.
    artificial intelligence vs machine learning vs deep learning artificial intelligence vs machine learning artificial intelligence vs machine learning vs deep learning

    Unsupervised Singing Voice Conversion: Facebook's AI Can Convert Your Voice Into Any Other Singer's Voice

    Unsupervise-singing-voice-conversion-img
    unsplash-logoJason Rosewell

    You might have heard of the miracles artificial intelligence is doing these days. From movie recommendation on Netflix to Sophia, the robot, from intelligent humanoids in video games to super intelligent Google Assistant, artificial intelligence is dominating most aspects of our lives. It has an impact on our present and future in either way.
    Continuing the pursuit to a technology intensive future, Facebook in collaboration with Tel Aviv University published their new research last week on arxiv.org (Unsupervised Singing Voice Conversion). Researchers at Facebook have trained an intelligent machine which can instantly convert audio of one singer to voice of another singer. You check the sample results here. All that is needed is to record a song in own "beautiful" voice and feed the file to the machine. AI will never disappoint you. The results will astound you.

     

    Summary of the work

    According to authors of the work,
    Our approach could lead, for example, to the ability to free oneself from some of the limitations of one’s own voice. The proposed network is not conditioned on the text or on the notes [and doesn’t] require parallel training data between the various singers, nor [does it] employ a transcript of the audio to either text … or to musical notes … While existing pitch correction methods … correct local pitch shifts, our work offers flexibility along the other voice characteristics.
    It is clearly mentioned in the manuscript that no transcription technique is used. i.e. no song -> text and text -> song conversion.

      

    Datasets used:

    Two datasets are used and both are publicly available.
    1. Stanford’s Digital Archive of Mobile Performances (DAMP) corpus
    2. National University of Singapore’s Sung and Spoken Corpus (NUS-48E)

    Data Augmentation:

    Four data augmentation techniques are used.
    1. Audio file is played in forward direction
    2. Played in reverse direction
    3. Multiply raw file signals by -1 and played forward
    4. Multiply raw file signals by -1 and played reverse
    Authors have explained that when the signal is played in forward and backward, the energy spectrum remains the same.
    The network comprises of a CNN encoder, Google's WaveNet decoder and a classifier. The network is trained an unsupervised manner. Two techniques are used for training.
    1. Back translation
    2. Mixup technique

    1. Back translation:

    Back translation is a technique which is used for Natural Language Processing. This technique is used in translating text in one language to another. If their is no representation for an input in the target language, the input is represented by a unique symbol during training using Automatic Machine Translation (AMT). The training pair, the input with its corresponding symbol is then used to translate back from target language to source language.

     

    2. Mixup technique:

    As the name suggests, in mixup technique various unique virtual pairs of input are created by shuffling the input. e.g For learning a functino y=f(x), additional virtual samples are created from 2 samples (x1, y1) + (x2, y2) = (x', y'). It is actually a data augmentation technique.

    According to the authors,
    Our contributions are: (i) the first method, as far as we know, to perform an unsupervised singing voice conversion, where the target singer is modeled from a different song, (ii) demonstrat-ing the effectiveness of a single encoder and a conditional de-coder trained in an unsupervised way, (iii) introducing a two-
    phase training approach in unsupervised audio translation, in which backtranslation is used in the second phase, (iv) introduc-ing backtranslation of mixup (virtual) identities, (v) suggesting a new augmentation scheme for training in a data efficient way.

     

    Results:

    The generated results are evaluated by a classifier and human reviewers to judge on scale of 1-5 the similarity of generated voices to the target singing voice. Reviewers alloted a scale of 4 on average while the classifier found that the reconstructed samples and generated samples were identified with almost the same accuracy.

     Don't forget to share your thoughts with us in the comments below.

    Deep Learning: A Quick Overview

    Deep Learning: drone
    Photo by William Stitt on Unsplash

    This photo is from 1980, and the reason why we are dwelling into history is that neural networks along with deep learning have been around for quite some time. They have started picking up now and impacting the world right now, but if you look back into the 80s you will realize that even though they computers weren’t invented in 60s and 70s they really caught on to a trend and got the wind in 80, So people started talking about them a lot. There was done a lot of research in that area and everybody thought that deep learning or neural networks this new thing that is going to impact the world and is going to change everything and will solve all the world problems. And then it kind of slowly died for the next decade. So what happened why didn’t the neural networks survived and not change the world? The reason was they were not just good enough, they are not that good at predicting things, and not that good at modeling or they were not a good invention or is there any other reason. So actually there is another reason and the reason is in front of us is the fact that technology was not up to the right standard to facilitate the neural network.


    In order for neural networks and deep learning to work properly you need two things, one is you need Data and you need a lot of  Data and other is you need a processing power you need a strong computer to process that Data and facilitate the neural network’s. So let's have a look at how data or storage of data has evolved over the years, here we got three years in the above image, how does storage look back in 1956 there is the hard drive and that is 5MB hard drive been transporting to some other place. A company had to pay 2500$ of those days’ dollars to just to rent it not buy it and just for one month.
    After that in 1980, the situation improved a little bit, so you have 10MB for 3500$ and was still very expensive and has only 10MB and can store only one pic of nowadays.
    And today in 2017 we have got 256GB for 150$ which can fit on your finger. If we compare these years across the board and before even taking price and size to consider, just take compare the capacity from 1956 to 1980 the capacity increased about double and then from the 1980s to 2017 it increased about 25600x times. And the length of the period is not that much but a huge jump in technological progress.
    Here we have a chart of hard drive cost per gigabyte (USD).


    Over the years this going to go even further right now scientist are even looking into using DNA for storage. From 10 to 20 years from now, everybody is going to use DNA storage if we go in this direction. Here are some stats.

    So all of this brings us to what is deep learning?

    here is the image of Geoffery Hinton and is known as the God Father of deep learning and he did research on deep learning in the 80s and he has done lots of work on Deep learning and published lots of research papers he now works in Google.
    The idea behind deep learning is to look at the human brain, how the human brain operates. because human brain seems to be a very powerful tool in this planet for learning and adapting skills and applying it if the computer can copy that then we can just leverage what natural selection had already decided for us for all that algorithm.
    So in the brain, we have neurons and us hundred of billions of neuron in the human brain and each neuron is connected with thousands of neurons with its neighbor. In below pic, this is what it looks like.

    This is an actual section of the human brain this is called the cerebellum.and is responsible for balance so you can see there are billion and billion of neurons so that is what we are going to recreate.
    So how do we create this on the computer?

    In the above image: We will create an artificial structure called an artificial neural network. Where we have nodes or neurons, so we are going to have some neuron for input values. Which will take some input values in the input layer and we will have an output layer which will show the predicted result. And in between, we have hidden layers so before giving output it will go through billion and billions of neurons before it gives us output, so this is the whole concept behind it so we are going to model the brain. so we need this hidden layer. the input layer neurons are connected to hidden layer neurons and hidden layers neuron is then connected to output layers neurons.
    So why is it called deep learning?
    Now, we take this to next level we separate the input and output layers and we have not just one hidden layer, we have lots of lots hidden layers, and then we connect everything just like the human brain. Interconnect everything and that’s how input values are processed through all hidden layer just like the human brain and then we have output value. Now we are talking about deep learning.



    7 Awesome Examples of Computer Vision


    Computer vision examples
    Photo by David Travis on Unsplash

    Though early experiments in computer vision started from the 1950s and it was initially put to use to distinguish between handwritten and typed text from the 1970s. Today the applications for computer vision have increased exponentially. In this article, we will share with you some of the recent implementation trends of computer vision.

    What's Computer Vision (CV)?

    Computer vision is the use of computers which process visual data and then make conclusions from it or gain understanding about the situation and the surroundings. One of the factors behind the growth of computer vision is the amount of data today which we use subsequently to train and improve computer vision machines.
    We have a bulk amount of visual data in the form of images and videos produced by built-in cameras of our phones alone. However, while visual data can include photos and videos, it can also get information from other sources and detectors. Besides with the massive amount of visual information (over 3 billion pictures are shared online every day), the computing ability requires to examine the information is now accessible and cheaper. Since the field of computer vision has raised with new hardware and algorithms so has the accuracy rates for item identification. In under a decade, today's systems have attained 99 percent accuracy  from 50 percent making them more accurate than humans at quickly reacting to the visual input signal.

    How Can Computer Vision Work?

    One of the main components to understanding all of the capabilities of artificial intelligence is to provide machines the power of vision. To emulate eyesight, analyze and process, machines will need to acquire and comprehend graphics. The growth in achieving this landmark was created learning procedure made possible. It starts with a dataset with advice which aids the system to learn a particular topic. If the goal is to detect videos of cats as it was for Google in 2012, the dataset used by the neural networks should get videos and images with cats as well as examples without cats. Each image needs to be tagged with metadata that indicates the right answer.
    When a neural network operates through signals and data it has found a picture using a kitty; it is the feedback that is received regarding if it was correct or not that helps it improve. Networks are currently using pattern recognition to differentiate distinct pieces of an image. Rather than a programmer specifying the attributes which make like having a tail and whiskers, a cat, the machines learn in the millions of pictures.

    7 Awesome Examples of Computer Vision

     Imagine all the things human sight allows and you can begin to recognize the endless applications for computer vision.

    1. Self-Driving Vehicle

    Computer vision is essential to empower self-driving cars. Manufacturers like Tesla, BMW, Volvo, and Audi use detectors, lidar, radar, and detectors to obtain images so that their automobiles can detect lane markings items, signs and traffic signals to safely drive.

    2. Google Translate app

    All you have to do is to read signs in a language that you don't understand and to point your cellphone's camera towards and let the Google Translate app tell you exactly what it means in your favorite language immediately. This is, using optical character recognition to see the image and augmented reality to overlay an accurate translation.

    3. Facial recognition

    China is definitely on the cutting edge of using facial recognition technology, and they use it for police work, payment portals, security checkpoints at the airport and even to dispense toilet paper and prevent theft of the paper at Tiantan Park in Beijing, among many other applications.

    4. Healthcare

    Considering that 90 percent of all medical data is picture based, there are various applications for computer vision in medication. From allowing new medical diagnostic methods to analyze X-rays, mammography and other scans to monitoring patients to identify issues sooner and assist with surgery. Our health care institutions and professionals and patients will benefit from computer vision now and much more in the future as its rolled out in healthcare.

    5. Profession sports monitoring

    Ball and puck monitoring on sports has been common for a While now, but personal computer vision is also helping play and strategy analysis, player ratings, and performance, and to track the brand sponsorship visibility in sports broadcasts

    6. Agriculture

    At CES 2019, John Deere featured a semi-autonomous combine harvester that uses artificial intelligence and computer vision to examine grain quality since it gets to discover the perfect route through the plants and harvest. There’s also a possibility for computer vision to identify weeds so that herbicides can be sprayed directly on them instead of on the crops. This is expected to reduce the number of herbicides by 90 percent.

    7. Manufacturing 

    Computer vision is helping producers operate more intelligently and effectively in various ways. Maintenance is only one example where equipment is monitored to intervene prior to a breakdown could lead to expensive downtime. Packaging and product quality are monitored, and defective products can also be reduced with computer vision.
    There is already a huge amount of applications for technology and computer vision is still young. As machines and people continue to associate, the workforce that is human will be freed up to focus on tasks because the machines will automate processes that rely on picture recognition.

    Where Is Artificial Intelligence Leading The World? To The END?


    Less than 100 years old Artificial intelligence (AI), born in the middle of 20th century is ruling over the world. If you think it is not then I would say it is about to rule. It is also said that AI is 5000 years old but who cares. I will go with the younger one.

    AI made its way all along from symbolic AI of good old fashioned artificial intelligence to future predicting models and expert systems. It is everywhere, in agriculture, in health, education, finance, media, music, marketing, HR, games, security, and over and beneath the tides of oceans and in the silent space and everywhere you can think of. All I am trying is just to say that AI is ubiquitous Period.

    Researchers have made fascinating breakthroughs with breakneck speed but they are still striving to make milestones. AI is no more confined only to Hollywood, it is a reality now. The question is how
    this reality would come to us? As a curse or as a blessing?

    Max Hawkin, a software engineer, consciously submitted his will to his AI powered app. The app decides for him where to go, what to eat, who to meet, and even where to get which tattoo and the list continues.

    "When the computer chose a location I would live there for roughly a month. Once there, the computer chose places to go, people to meet, and things to do within the selected city." Hawkin
    Is this a way to escape from the panic of choosing one among many and making a decision or it is the beginning of AI realm?

    Here is another story. 20 people die each day waiting for a transplant in US. Today over 100, 000 people need transplantation but only 54% of 95% adults who can donate organs are donating. You can see a big margin of waiting area in the chart given below. They need more donors to fill that waiting area. Someone thought why not to use technology?
    Organ shortage chart-see full report here.

    Are you familiar with bio printing? If not, it is a term used for creating real human organs using 3D printers that could be implanted in human, like in real living human. Isn’t it awesome? Of course it is. Computers can now create your body parts. It is time to get over the shortage of implantable organs and save lives like a super hero. They do not need donors (as much as they needed them before).

    But what is the order side of the coin? Computers can now create real human organs which can be assembled to make a new real humanoid. What is the guarantee that super intelligent computers of the future won’t create its own army? An army with artificial intelligence. You might argue that AI cannot beat human intelligence because human mind is a much more complex structure than an electronic machine. This is correct for but keep reading. I am sure you will change your mind. I mark this point as extraction point. We will return to it.

    Gorge Church, an American geneticist, molecular engineer and chemist has been working with his crew on gene therapy. They are growing brain tissues from human stem cells. Stem cells are found everywhere in the body and have the ability to replicate. These are the cells which fill the injuries and heel the broken bones. They remain inactive, in non-dividing state until activated by a stimulus.


    The project is known as Brain Initiative, started by Obama administration to get better understanding of brain functioning and to discover mysteries of brain disorders like Parkinson’s and Alzheimer’s. The end goal of the project is to replace the dead brain cells with human cultivated living cells.


    “The largest structures we’ve made are on the order of half a billion cells, which is larger than a mouse brain. It’s not really a macho size thing yet; it’s just exploiting the ability to get flow through capillaries. We can now get most of the major cell types of the brain. We can make oligodendrocytes, which wrap the myelin sheath that insulates neural connections. We can make endothelial cells, which is really critical, because if you don’t have endothelium, you don’t have capillaries. We’re trying to make larger, more complex organoids that have good blood flow.” Church.
    Brain in plate. Brain organoids grown by Gorge McDonald Church.

    He was asked “are there applications of these brain organoids to Artificial Intelligence?” In reply to this he said that the human brain is pretty far ahead of silicon-based computing systems except for specialized tasks like information retrieval or math or chess …

    Well, a computer playing chess or mining information from a pictures and draw certain perceptions was a fiction in previous century which is a reality now. Today’s fictions are tomorrow’s reality. I am sure our grandchildren or our children if not us will read the headlines one day that brain organoids are implanted in an AI body and it is now like a real living creature. I hope they won’t start with Homo sapiens immediately, they would create AI pets or sex toys first but sky is the limit and there is no sky (the blueish in the morning and the reddish in the evening that you see is just a reflection of light in atmosphere).

    Well, a computer playing chess or mining information from a pictures and draw certain perceptions was a fiction in previous century which is a reality now. Today’s fictions are tomorrow’s reality. I am sure our grandchildren or our children if not us will read the headlines one day that brain organoids are implanted in an AI body and it is now like a real living creature. I hope they won’t start with Homo sapiens immediately, they would create AI pets or sex toys first but sky is the limit and there is no sky (the blueish in the morning and the reddish in the evening that you see is just a reflection of light in atmosphere).

    Translate