Artificial Intelligence Tutorial
Artificial Intelligence Tutorial
When we start thinking about the AI and then if you are a techie person or nontechie person then what is the very first image comes in mind that is very important.
For example when we start learning the new technology, very first we should start as very beginners and we should adopt that technology step by step because if our imagination about new technology is wrong then it is a trap where lots of techies and not techie people falls. So please be clear about what you are learning and it is important because it will make you learning step by step upward.
So before we start discussing AI we should ask a question from our self that what AI is and if found we have a correct understanding about the subject then we can move forward to go deep into it.
The easy way to understand the AI is nothing in the context of human. So I can explain an example in a simple way that how humans can react in on the basis of input or action happens in real life.
Table of Content
Artificial Intelligence Tutorial For Beginners
1. AI – Overview
What is Artificial Intelligence?
To understand AI we can take a simple function of humans is “Speaking”.
The filed if speaking, listening and understanding the different languages comes under the Speech Recognition.
So we can list out few of the Domain where AI can be a part of.
- Supply Chain.
I listed few names of a domain where AI can be a part of and I listed “Anywhere” at the end It means, “AI can be part of any domain where a machine is in use and if our machine is smart enough to act itself is the perfect example of an AI-enabled system”.
For example, we know human has a capability of reading and writing and if we develop a system or a machine which can do this job is nothing but AI-enabled system.
The subject of reading and writing the text comes under NLP (Natural Language processing).
Like this, we can understand the AI and where it can be perfect to do the job which humans can do.
For example, the human can see and recognize the different types of objects and can find the difference between objects, This is the area of computer vision and object detection.
And coming to conclusion of the overview of definition of AI then we can talk about the capability of human brain and as we know that the human brain is the only part of the body that runs the whole human body and the capability of learning, sensing, decision making, understanding the feeling and etc. are few functions of the brain and if we can make a system which can do such things, not even with the 100% accuracy then that is the example of an AI-enabled system and in simple words this is the field of AI.
“What to proceed when you want to learn AI.”
Artificial Intelligence is the bigger filed which made of different subjects.
“Machine Learning” and “Deep Learning”
You are in the correct direction if you want to learn AI and you thinking of starting the subject Machine Learning then you cross the trap and going in the correct direction.
Goals of AI:
The goals of AI means what we can achieve from an AI enable system if we develop one.
The one and only goal of AI is nothing but achieving the human intelligence in a machine so that the machine can behave or react smartly like humans and can learn to react smartly from previous inputs (data). Day by day this machine or an AI-enabled system will increase the accuracy in the result and this what the goal of an AI.
We have several programming languages that can support the AI programming in those I a listing down five of them.
“Doing programming is the same in any programing language because AI system goals never change with respect to language so we can do AI programming in the language in which we are comforted in”. But the advantages and disadvantages of the programing language for AI is also an area which is also considered before selecting the programming language.
Applications of AI:
Applications of AI will give an idea and a new way to think about AI.
- Self-driving Car.
- Speech Recognition.
- Object and pattern recognition.
- Intelligent Robots.
2. AI – Intelligent System
Intelligence is a capability of thinking, adapting, reasoning, decision making, and imagining about something where human brain neural process something.
For example: when we think about and object then one picture comes in our brain.
And the prof of this is nothing, now this time you are reading this post and……..”Dog”, “Car” and so on
So when you read the word Dog and Car there may be an image is coming in brain and that image will be which Dog you hate or like and Car you hate or like or your Dog if you have or your Car if you have but definitely one image comes in brain which is process by your brain neural network.
For another example: when a newborn baby starts learning talking and remembering there the brain of the baby starts adopting objects.
For all the human at any age, the brain neural network is not the same and there capability of thinking, adapting, reasoning, decision making, and imagining about something will be different.
“In short, the ability to understand anything on the basis of knowledge and skills which different people have is known as Intelligence.”
As we know the ability to understand anything on the basis of knowledge and skills which different people have is known as Intelligence.
So here are a different type of ability that comes under Intelligence.
Linguistic: Speaking, recognizing, and talking.
Musical: listening, understanding sounds.
Logical-mathematical: creating ideas, applying logic and solving calculations.
Spatial: remembering known or unknown things.
Bodily-kinesthetic: solving problems, manipulations.
Intra-personal: feelings, making difference between objects.
What is Intelligence Composed of?
- Decision making
- Concluding something.
The observation about every moment what we watch, read or anything which our brain remembers.
As usual, thinking about the problem and finding a way to solve it.
making an image about something happened in the past and developing the thinking for that instance or object for the future.
Communication and learning differences between languages.
Human vs Machine:
This is really interesting to understand.
Without making it complex we can understand the difference between and for that we should this exercise and that is just to read this paragraph below.
“To Understand the difference between machine and human 1ntelegence we ha\/e t0 r3ad th1s and whi1e reading a1s0 u r th1nk1ng that h0w many m1stak3s are a th3r3 1n th1s paragraph.”
After reading the above para you might be understood that how while reading your brain is understanding the numbers even and reading it properly because the reason is your brain knows the language and it is applying knowledge and skill of reading on it what you have done already in past.
If the same job will be done my machine then it happens according to the data that we feed in a machine and the algorithm that we design for understanding the language.
3. AI – Research Areas
Artificial intelligence research which is mainly looking forward to development and analysis of algorithm to perform or intelligent behavior of machine. AI research has a subfield, which is based on social factors and traditional problem. The goal of AI research includes reasoning, knowledge representation, planning, learning, natural language processing, perception and manipulation of object. Now AI research on scaling the state-of-the-art Machine Learning algorithms to large datasets towards data science.
Artificial Intelligence Applications
- Large Scale Machine Learning
- Reinforcement Learning
- Natural Language Processing
- Computer Vision
- Recommender System
- Neuromorphic Computing System
Large Scale Machine Learning:
Large Scale Machine Learning is involves large data – which is data that may have a very high number of training/test instances, features or classes.
Reinforcement Learning takes the input from environment and perform the action as output
Natural Language Processing:
Computer vision allows computers to grasp the details of pictures and the videos is goal in computer vision is to make it automate work which is performed by human.
Artificial Intelligence (AI) could be a general term that means the utilization of a laptop to model and/or replicate intelligent behavior.
RS is virtual world system which takes the consideration of user’s past history and make strong recommendation to peers.
Neuromorphic Computing System:
4. AI – Agents & Environment
In general, AI system is the combination of Agents and Environment. Agents are like human sensors that get connects with the environment. As like human touch sensors, agents of a AI system is the cameras, rays and other components that can be acted upon any sensation. In general, Agents are given by Bit strings.
Nature of Environment:
Environment is generally the place which holds the tasks that has to be done by the Agents. Each Agent has been specified with some sort of tasks without duplicates.
Fully / Partially Observable:
Some Environment are fully observable, and few are partially observable. It states that few places the understanding on the tasks aren’t clear where AI system struggle to proceed further. And it can’t always rely on the noise or the polluted sensors. It can also be a framework issue.
Static Environment vs Dynamic Environment:
If Agent is in progress, meanwhile Environment keeps changing, then it can be stated as Dynamic Environment. If the Environment is fixed and the Agent performs on top of it, then it is stated as a Static Environment.
To discuss about Agent property, lets get into Agent understanding. It states that, Agent is a task operation. To be clear, in a chess game, we need 2 agents to get the game. 1 agent isn’t sufficient to proceed. Simple as that. It can be any machine task. Like, the Washing machine is a Single agent function. Any task can be accumulated with a Single Agent or a Multi-Agent function.
Simple Reflex Agents:
Agent task is completely depending on the current percept and any other percept can’t intervene the process where the Environment is fully observable.
Model Based Reflex Agents:
It is basically the reference of real-world scenarios. It won’t directly take the input from the current percept. It goes to the history to identify the past behaviour of the action and acts upon.
Goal Based Agents:
GBA is more advanced to MBA/SA, it is because Agent is supported by the target that has to be achieved in order of any models or the modifications happening in environment.
5. AI – Popular Search Algorithms
Search Algorithms are mostly used in everyone’s life today. Without search feasibility, we can’t get one complete day. It starts in creating a deck for project proposal to final presentation of the project or a simple game like crosswords.
There are 2 types of AI search. Uninformed & informed Search. Where we have multiple search algorithms within that. We will be discussing few of those here.
Most of the Search algorithms are of a Single-Agent task in real-time. Problem Space is the actual environment were the search happens.
Space & Time Complexities:
Search has few complexities in nature, like Space complexity & Time Complexity. It is because of the search behaviour or the results demanded for.
Each search will have number of nodes depends to do the search and store the results that has to be indexed for. Same way for Time complexity, it demands time to produce results that are expected to have.
Branching Factor is the average number of sub-nodes that are being generated by the master node. If the master node consumes much memory, then the sub-nodes would be huge. It states that it will lead us to high space. i,e., High memory requirement comes in place.
Breadth – First Search:
Depth – First Search:
It is bit out of scope with BFS model, because it obeys the LIFO queue model, which may be working well for stack level job flow but fails in lot cases. It may lead to infinite on a path, where it demands a cut-off point for the depth that it has to be allowed for.
Greedy search states as its name, it looks for the nearest match of the search function and estimates it be the best result where it starts with priority queue. This is not viable, since it may land up in the infinite loop. Comparing with Greedy search, A * search is the best known for first paths search.
6. AI – Fuzzy Logic
What is Fuzzy Logic?
Ideally we determine the occurrence of any event by Yes or NO. If Yes then it is true otherwise false. In computer language the same can be interpreted by 0 and 1 wherein 1 represents true and 0 represents false. In fuzzy logic we determine the same but along with that it tells about the intermediate state like if the event is partially true or partially false. In simple terms, fuzzy logic talks about all the possible output of any event that occurs.
The fuzzy logic works on the levels of possibilities of input in order to achieve the definite output.
It has four main parts as shown
Fuzzification Module − This is the process of changing a real crisp value into a fuzzy value. This can be achieved by membership functions(fuzzifiers).
Knowledge Base – This contains decision making rules.
Inference Engine − Decision making is the primary work of fuzzy Inference engine, by using if-then conditional ways along with or/and connectors.
Defuzzification Module − It is reciprocal of fuzzification module, which converts fuzzy sets to real crisp values.
- Is Ram honest?
- Is Ram honest?
- Extremely honest
- Very honest
- Sometime honest
- Extremely dishonest
- Used to control brakes in some cases depending upon car speed, acceleration
- Used in dishwasher
- Used to control fuel injection of a car
7. AI- Natural Language Processing
Don’t we feel good ,when Alexa listens to us and gives answer , as if it has emotions and reasoning power. Is it not great, when we will talk and our machine will also talk like us. When we will text something, the machine will prepare its digital audio and rewind it back. If the machine replaces the corrupted vocal cord of humanbeing, and human will communicate his feelings to his near and dear, it ll be a wonder in the field of AI. Natural language processing is the component of AI , that converts all these story in to reality. Like Siri , Alexa, Google assistant let us make an intelligent machine to be with us to accompany us in our Day-To-Day life, in our business, in medicalscience , in social media, in intelligent net surfing .
Learning process of speaking of a 2years kid from the surrounding is similar to how human gives training to the machine to speak. While we write , talk and express our feelings, the words used, the sentiment associated with words , which word will be written for which purpose , that we, the matured fellow understands , but how machines can be. This is the challenge NLP scientist faces.
Natural Language Processing is a field of AI , for communicating with computer with the languages, that human understands. Natural language processing (NLP) comprises of three steps. One is natural language understanding (NLU) and other is natural language generation (NLG). NLU takes the input as text/audio/video, tries to understand on which context, the statement is written in text format/the sentence spoken. It derives intent and entities. Most basically , it tries to understand the sentences of input information. NLG is the process of generating natural language, by retrieving relevant content from knowledgebase , by forming a meaningful sentence , setting tone of the sentence. The last step of NLG is mapping of sentence planning to sentence structure.
NLU is the most difficult part of NLP. The ambiguity arises are lexical ambiguity, syntactical ambiguity , referential ambiguity. The operational steps followed by NLP are Lexical Analysis, then syntactic analysis, semantic analysis , discourse integration, and then pragmatic analysis.
Sentimental Analysis is one of the use cases of NLP. Sentimental analysis can be used to analyze sentiments of customers from the feedback given by them for a product , purchased online(whether a dress , some food, elcetronic gadgets)
Automatic Bot for customer response in business is another use case of NLP . The underlying process analyzes sentences posted by the customer(regarding job opportunity , regarding doctor info, regarding availability of product on online store , regarding a missing bag in airport). When there is a query from customer side, the quick response in the chat bot is due to the application of NLP. Isn’t it intersesting!!
So the next generation robots, applications won’t be working idle, we can able to visualize a virtual life present in the machine , which can understand our natural language and interact , work, as questions to us . In near future machines will interact among each other and solve a great task with out any human intervention. That ll be the golden age of AI.
8. AI- Expert Systems
What is an Expert System?
Expert systems are intelligent and smart computer programs that requires knowledge and ability to solve problems which are generally difficult/complex enough to require human or an expert intervention for their solution, expert systems have the ability to reason with knowledge of a specialist subject with the target of solving a problem.
Advantages of Expert Systems:
- They are infinitely reproducible: The fact that a human expert or a specialist can be physically present only at one place at a time, expert systems can be reproducible which allows itself to present itself to a wider audience/users to handle many problems parallelly.
- They do not discriminate- A human specialist could be swayed away by biasness depending on situations/users etc. Such biasness would not lead to a standard solution delivery irrespective of the consumers looking for solutions. An expert system thus could be limited of such biasness.
- Always available: The fact that expert systems in the form of machine intelligence is available at any time unlike a human expert limited by timings and availability serves as a big advantage for expert systems over human experts.
- They operate on peak performance: As the core of experts systems are intelligence built on machines, machines can work and generate expert solutions tirelessly.
Examples of some popular expert systems:
MYCIN: A backward chaining expert system using artificial intelligence to identify bacteria causing severe infections, recommend antibiotics based on persons body weight. It was also used for diagnosing blood clotting diseases.
PROSPECTOR: An expert system to aid geologists in mineral exploration, predicts where certain mineral deposits may be found.
DENDRAL: Hypothesize on possible molecular structure of a compound.
Components of an Expert System:
- The Knowledge Base
- Inference engine
- User Interface
The Knowledge Base
It constitutes of a database or a repository of information which contains rules about a certain subject. A
knowledgebase can be viewed as a collection of objects and their attributes.
An object is a conclusion defined by its associated rules.
An attribute is a specific quality that with its rules helps us to define an object
- is a mammal
- is domestic
- lives on land
- used as pet
- is a mammal
- is not domestic
- lives on land
- not used as a pet
Inference engine is considered as the main processing element of an expert system. It uses the information/knowledge provided or contained with the Knowledgebase and attempts to find solutions for various problems. Based on the attribute information an Inference engine will look for objects with matching attributes.
There are two Types of Inference Engines:
- Deterministic inference Engine
- Probabilistic Inference Engine
Deterministic Inference Engine:
When the rules of an inference engine have some certainty associated with them then the results/conclusions drawn in association with the rules are guaranteed to be true
For example: What happens when water is heated? It soon turns into vapor after reaching the boiling point of 100 degree Celsius.
The fact that water will turn into vapor after the boiling point is reached does not change and is a known and proven fact.
Probabilistic Inference Engine:
When there exists an uncertainty associated with the rules of an inference engine then it is termed as probabilistic inference engine.
For example if 100 students are writing an exam how many students will pass the examination?
There can be an estimate based on historical data but the estimate will not be correct every time. There is an uncertainty involved in each estimate.
A certain answer cannot be given as we are dealing with randomness.
Construction of an Inference Engine:
- Forward Chaining
- Backward Chaining
- Rule Value
Inference engine using forward Chaining:
It starts with the available data and moves forward to find more matching data points with the use of user inputs and the associated rules. It moves through a series of logical “AND” and “OR” conditions until it reaches a terminal point i.e. an object.
Backward Chaining Interence Engine:
Opposite to how the forward chaining algorithm works its way up from the object and checks through the antecedents to see if the questions are answered or if the specifications are met for that antecedent, it starts with a hypothesis from the user to confirm or deny.
Inference Engine by Rune Value:
Also known as Rule based inference engine and is an improved version of inference using backward chaining, its objective is to make choices in the direction of the objective. It follows a process of elimination which selects the next choice as the one which removes most of the possibilities and drilling down to get the correct one.
It is an interface which allows users to interact with expert systems. Generally through an interface using natural language processing. The user enter the data or the queries using in a general spoken language/ some standardized inputs, with the help of NLP the queries are converted into objects and rules which could later be used in expert systems to get expert advice/recommendation.
The end user need not be an AI/ domain expert, it is a common user looking for answers.
Desirable Characteristic of Expert Systems:
- Decent user interface
- Workable Inference engine
- Easy user interaction
- Maintenance and Expansion
- Performance on difficult or complex problems
9. AI – Robotics and Computer Vision
A machine which is capable/intelligent enough of reducing human interference in matters which require human intelligence to solve, monitor or act to a specific situation is termed as a robotic machine. Robotics provides Artificial Intelligence a body to work with so that desirable tasks can be achieved. It involves interdisciplinary approach of combining knowledge from various engineering domains like Computer Science, Mechanical, advanced Mathematical algorithms, sensor fabrication manufacturing techniques etc.
Most of the robots existing today are inspired by our surroundings and nature and are termed as bio robots.
Some characteristics of Robots:
For every decision/task a human takes we have our motor skills, speech to work towards achieving it similarly robots have a mechanical body structure which helps them to implement AI embedded in it to achieve results for certain tasks.
On board control unit:
It acts like a brain for the robot, it is a unit responsible for taking in inputs from different parts of a robot processing it and returning back the output. AI is a part of the control unit where the actual decision making process takes place.
These are used to make the control unit aware of the outside world, its primary objective is to collect real world information on pass it to the control unit.
Devices which help bring degrees of freedom between various parts and serve as connections between two parts of a robot providing mechanical movements are called as actuators, for example- motors, compressors etc.
Programs help robots in giving directions to achieve a goal, it is a part of the control unit which takes care of the internal processing, making rule-based decisions and passing conditional signals for functioning of the tasks in the form of Boolean outputs.
It refers to the type of actions which are taken by the robot to achieve the results it is destined to. Behavior can vary on how the programming is done or for what purpose a machine is made.
Types of Locomotion in Robots:
Robotic locomotion is a general name for robot’s various methods robots use to reach from one point to another.
Some common types of snake locomotion are described as below:
- Bipedal Walking
- Metachronal Motion
Limitations and scope of robotics:
In robotics some advanced machines are responsible achieving outputs for complex tasks are taught to make their own decisions. While developing a robot one thing to be kept in mind is what is the purpose and what are the limitations of a robot. All robots have certain level of scope which checks or limits the actions/decisions of a robot. The complexity of a general robot is defined by the number of actuators, limbs and sensors which are used to support the structure and provide flexibility across degrees of freedom to a robot.
The science of machines to see and make judgements is called computer vision. Using computer vision technologies machines can be made to attain a high-level understanding of input data. Unlike other methods of input data for eg. textual data for NLP or speech data for Speech recognition, computer vision deals with digital images and videos. It is an interdisciplinary approach involving concepts of Physics, Mathematics, statistics and learning theory.
One problem of computer vision may be solved with a simple statistical method but another problem may require an ensemble of machine learning algorithms. It is the study of images and videos to develop human vision capability of machines.
In recent times there has been good progress in this field, character recognition, face detection serving as some of the examples of it becoming popular of late.
Some common application of Computer vision:
- Retail (e.g. automated checkouts)
- 3D model building (photogrammetry)
- Motion capture (mocap)
- Machine inspection
- Medical imaging
- Optical character recognition (OCR)
- Fingerprint recognition and biometrics
- Automotive safety
- Match move
10. AI – Artificial Neural Networks [ANN]
Artificial Neural networks are an information processing model that is inspired by a biological neuron. i.e Brain cell of an animal. The artificial neural network is commonly abbreviated as ANN. The ANN’s are known to perform significantly better when faced with complex problems when compared to traditional algorithms.
The analogy to a biological neuron is made because the ANN has a similar connective structure consisting of nodes resembling neurons. These nodes are simply mathematical functions that can perform calculations. The output of a node is termed as node value/activation. The output of one node can be connected to other multiple nodes similar to
how a single neuron is connected to other multiple neurons.
There are two simple ANN’s :
- Feedforward ANN
- Feedback ANN
In a feedforward type of ANN, the flow of information is unidirectional. i.e A node receives input only once and will never loop or connect to a node which has already received an input.
If there are multiple layers, then a Feedforward ANN is called as Multi-layer Feedforward ANN.
Feedforward networks are usually preferred for classification and recognition tasks.
It is a technique using which the performance of a neural network model can be improved. The backpropagation changes the weights of nodes/neurons whenever it makes a correct or wrong prediction. While doing this, it ends up hitting the optimal weight number for getting a higher performing model.
Applications of Artificial neural networks
A certain type of ANN is extremely good at recognizing faces. Only the faces that are fed in as authorized ones are allowed to pass through if the facial recognition system is used for security purposes.
The automobile industry along with the transition into electrical automobiles are also extensively ramping up on driverless cars and have achieved surprising results.
A simple shallow ANN is sufficient to detect changes in a particular pattern. They are very good at detecting minute changes. For example, substandard fruits are automatically separated out of the conveyer belt by using anomaly detection.
Voice to text conversion
Many of the virtual assistants like Siri, Google assistant, etc, understand your voice commands by converting the voice into text internally. Also, you can enter text into a message box just by using your voice instead of typing the message yourself.
Text to speech conversion
Virtual assistants not only show you text but also read them out loud. This is an implementation of text to speech using ANN’s. Also, any text can be read out with a human-like voice which sounds natural and not computer generated. Google implements this by using a framework called DeepMind.
Objects in the images can be classified by training ANN. The type or class of the object is detected by the ANN.
Stock price prediction
The usage of ANN’s for stock market shifts and price predictions are a common sight nowadays. The stock market data is termed as Time series data.
Election result prediction
Even the elections results can be predicted using historical data analysis and forecasting methods.
These are just a few examples, however, the applications of ANN has no end to it.
11. AI – Issues
Artificial Intelligence (AI, Human made intelligence) or Machine Learning (ML, teaching our machine) is slowly overtaking our own intelligence, few people say it’s a gift from science and few them are not satisfied with the advance in technology.
Threat to Privacy:
Human bot or machine trained like a human can be used to bleach some security threats:
- Finger print detection can be bleached.
- Our own email can be logged in and can reply to the client.
It can create efficient technology to break password. (No more rule based process).
Threat to Human Dignity:
Human like robot can replace many industry based people:
BFSI Domain: It can replace human with NLP based email reply.
Hardware industry: As of now most part are automated and now if AI/ML pitches in then those human who are working as a supervisor in the industry will also lose their jobs.
Army/police: In army humans are used to do these jobs, if this AI/ML pitches in, then these people will also lose their jobs also.
Threat to Safety:
One machine learning topic is called Reinforcement learning. Like the machine will teach itself on its own. Then it can be a very big issue for humans:
Teaching professional: will lose jobs, as no require for teaching other human also.
Bot can be trained in a wrong fashion also. Like how humans went bad, like that if machine turns opposing their god (human) it would be end of the world itself.
Though human is improving AI Technology to help themself, but this can be used in a different fashion to effect human itself. AI/ML should be taught in a proper fashion, so that if someone is using this technology they should not use this in a wrong fashion to destroy human race.
12. AI – Terminology
Here is the list of frequently utilized terms in the domain of AI
Agents are frameworks or software programs fit for independent, intentional and thinking coordinated towards at least one objective. They are additionally called associates, specialists, bots, droids, intelligent agents, and software agents.
Robot free from external control or impact and ready to control itself autonomously.
Strategy of working backward for goal / cases of an issue.
It is the memory inside PC, which is utilized for correspondence between the collaborating master systems.
It is the piece of genuine or computational world occupied by the specialist.
Strategy of working forward for decision/solution of an issue.
It is the knowledge dependent on Trial-and-blunder, evaluations, and experimentation.
Procuring knowledge from human specialists and different resources.
It is the arrangement wherein the operator gets information about the environment.
Superseding pointless and unessential contemplations in AI systems.
It is format of on behalf of knowledge base in Expert System.
It is in the form of “IF-THEN-ELSE”.
Shell is a software..,
It helps in designing extrapolation engine, knowledge base, and user boundary of an professional system.
It is the goal the agent is attempts to complete.
A test established by Allan Turing to test the intelligence of a machine as equated to human intelligence.