Skip to content

In this tutorial, lets get some insights on 'Building Artificial Intelligence using Machine Learning'.

Artificial Intelligence

Artificial Intelligence refers to machines imitating human-like mental functions (cognitive functions), allowing them to perform tasks such as perceiving, learning, reasoning, decision-making, and problem-solving.

Cognitive Functions

Let us understand the congitive functions.

Perceiving

Perceiving is the ability to be aware of, organise, and interpret information from the environment through sensors like cameras, mic, LiDAR, or touch sensors and making it available for remaining cognitive functions.

Do you know?

To build machines or AI systems with the capability to smell and taste is a considerably more complex task that is still in the research phase. Olfactory sensors and gustatory sensors are employed to detect and identify smells and tastes, respectively.

Learning

Learning refers to the process of acquiring knowledge, skills, or patterns and updating the existing knowledge in the form of parameters (states) or models based on the new information available.

Reasoning

Reasoning is the ability to reach conclusions based on available information and predefined rules or models.

Decision Making

Decision making is the process of selecting the most appropriate action or response based in the learning and reasoning. Decision making can be either rational or irrational, and it can be based on explicit or tacit knowledge and beliefs

Problem Solving

Problem solving is the process of finding effective solutions to specific challenges or obstacles by identifying the problem, searching and evaluating potential solutions, and implementing the best action.

Decision Making Vs Problem Solving

Problem solving is about generating new ideas or solutions, whereas decision making involves choosing the best option among existing ideas or alternatives.

Language skill

The process of understanding and using language may also be considered as a separate cognitive function.

Approaches

The cognitive functions may be performed either by Rule-based, Data-driven, Heuristic-based or Analytical or approach or combination of all these approaches.

  1. Rule-based - based on clear and set rules or conditions.
  2. Data-driven - by studying and analysing data.
  3. Heuristic-based - using 'mental shortcuts' without having to carefully consider all possible options.
  4. Analytical - by carefully studying all available information, which may include numbers, expert opinions, and formal evaluation processes.

Note

The boundaries between these approaches can sometimes be flexible, as they are all connected. This classification is simply for understanding and organizing the concepts.

Machines are capable of emulating all of these approaches, although they may not replicate the depth of human capability. While machines can perform advanced data analysis and statistical processing, they do so using algorithms and predefined procedures, rather than employing human-like analytical reasoning. However, machines can mimic rule-based, heuristic, and data-driven approaches much more effectively than humans.

Tasks

There are numerous tasks that require intelligence, and consequently, cognitive functions.

Machines can be programmed (using algorithms) to execute cognitive functions based on rules and heuristics, and they excel when the required intelligence is at a low level or is repetitive.

There are two kinds of tasks that require a high level of intelligence: discriminative tasks and creative tasks.

  • Understanding and interpreting human language from text or speech - Natural Language Processing
  • Image recognition (identifying objects or patterns in images), object tracking (following the movement of objects in videos), and image segmentation (dividing an image into meaningful segments) - Computer Vision
  • Inspecting products for defects, measuring dimensions, reading labels or barcodes, and guiding robots in assembly lines - Machine Vision
  • Path planning, object manipulation, and decision-making based on sensory input - Robotics, autonomous vehicles
  • Creating/writing text in a human-like manner - Translation, Q&A, summarization
  • Converting audio signals into text - Automatic Speech Recognition
  • Engaging in conversation like a human, narrating stories with emotion
  • Describing images/videos/music in text, or generating images/videos/music based on the description
  • Discovering new drugs
  • Creating new music compositions

For these tasks, a data-driven or analytical approach is preferred. The machines have limited ability to perform the analytical approach, but they can excel at the data-driven approach due to their capacity to process large quantities of data.

The data-driven approach constitutes the cornerstone in Machine Learning when constructing Artificial Intelligence.

Artificial Neural Networks

One method of machine learning involves utilising Artificial Neural Networks, which are designed to mimic the neural network of humans. They are primarily trained using a data-driven approach.

An Artificial Neural Network consists of simulated neurons, which are called nodes. Each node is connected to other nodes via links, similar to biological connections, and they form a 'graph'. Nodes that perform the same function are grouped into layers. Graphs can have different types of 'wiring' or connections based on their configuration. The overall structure and functioning of an Artificial Neural Network constitute its model.

We can also categorize cognitive functions as discriminative and generative. Depending on the function for which we train the network, we obtain either a discriminative model or a generative model.

Discriminative

The regression and classification functions are loosely referred to as discriminative.

Node

A node serves as the fundamental unit in artificial neural networks. It processes input data through various mathematical operations like addition, multiplication, and activation functions such as sigmoid or ReLU, ultimately yielding an output. The specific mathematical operations carried out depend on the network's architecture and its intended purpose.

Here is the mathematical operations used by different networks.

\(y_t = f(\sum_{i=1}^{n} w_i \cdot x_{ti} + b)\)

Where,

  • \(y_t\) is the output at time step \(t\).
  • \(f\) is the activation function.
  • \(n\) is the number of input connections.
  • \(w_i\) are the weights of the connections.
  • \(x_{ti}\) are the inputs at time step \(t\).
  • \(b\) is the bias term.

\(h_t = f(\sum_{i=1}^{n} (W_{hx_i} \cdot x_{ti}) + \sum_{j=1}^{m} (W_{hh_j} \cdot h_{t-1j}) + b_h)\)

\(y_t = g(\sum_{k=1}^{p} (W_{yk} \cdot h_{tk}) + b_y)\)

Where,

  • \(h_t\) is the hidden state at time step \(t\).
  • \(x_{ti}\) is the input at time step \(t\) and feature \(i\).
  • \(f\) is the activation function for the hidden state.
  • \(n\) is the number of input features.
  • \(W_{hx_i}\) is the weight associated with input \(i\) at time step \(t\).
  • \(m\) is the number of input features.
  • \(W_{hh_j}\) is the weight associated with the previous hidden state feature \(j\).
  • \(b_h\) is the bias term for the hidden state.
  • \(y_t\) is the output at time step \(t\).
  • \(h_{tk}\) is the hidden state at time step \(t\) and feature \(k\).
  • \(p\) is the number of output features.
  • \(W_{yk}\) is the weight associated with hidden state feature \(k\) for output \(y_t\).
  • \(b_y\) is the bias term for the output.
  • \(g\) is the output activation function.
\[y_{ijk} = f\left(\sum_{m=1}^{M} \sum_{n=1}^{N} \sum_{p=1}^{P} (w_{mnpk} \cdot x_{i+m-1, j+n-1, p}) + b_k\right)\]

Where,

  • \(y_{ijk}\) is the output at spatial position \((i, j)\) for filter \(k\).
  • \(f\) is the activation function.
  • \(M\) is the width of the filter.
  • \(N\) is the height of the filter.
  • \(P\) is the depth of the filter (number of input channels).
  • \(w_{mnpk}\) are the weights of the filter for filter \(k\).
  • \(x_{i+m-1, j+n-1, p}\) are the input values.
  • \(b_k\) is the bias term for filter \(k\).

The bias and weight matrices / convolutional filters are trainable parameters.

Trainable Parameters

Trainable parameters are initialized before training and updated while training as part of learning.

Activation Function