Artificial Intelligence 简明教程
Artificial Intelligence - Neural Networks
人工智能中的另一个研究领域神经网络,其灵感源自人体神经系统的自然神经网络。
Yet another research area in AI, neural networks, is inspired from the natural neural network of human nervous system.
What are Artificial Neural Networks (ANNs)?
首台神经计算机的发明者罗伯特·海希特-尼尔森博士将神经网络定义为 −
The inventor of the first neurocomputer, Dr. Robert Hecht-Nielsen, defines a neural network as −
Basic Structure of ANNs
人工神经网络的想法基于这样的信念:通过建立正确的连接,可以用硅和电线来模仿人脑的工作方式,就像活动中的 neurons 和 dendrites 一样。
The idea of ANNs is based on the belief that working of human brain by making the right connections, can be imitated using silicon and wires as living neurons and dendrites.
人脑由 860 亿个被称为 neurons. 的神经细胞组成。它们通过 Axons. 与其他数千个细胞相连。来自外部环境的刺激或来自感觉器官的输入被树突接受。这些输入会产生电脉冲,这些脉冲会迅速通过神经网络传播。然后神经元可以将消息发送到其他神经元来处理问题,或者不将其转发。
The human brain is composed of 86 billion nerve cells called neurons. They are connected to other thousand cells by Axons. Stimuli from external environment or inputs from sensory organs are accepted by dendrites. These inputs create electric impulses, which quickly travel through the neural network. A neuron can then send the message to other neuron to handle the issue or does not send it forward.
人工神经网络由多个 nodes 组成,它们模仿人脑的生物 neurons 。神经元通过链接相互连接,并相互交互。节点可以获取输入数据并在数据上执行简单运算。这些运算的结果会传递给其他神经元。每个节点的输出被称为它的 activation 或 node value. 。
ANNs are composed of multiple nodes, which imitate biological neurons of human brain. The neurons are connected by links and they interact with each other. The nodes can take input data and perform simple operations on the data. The result of these operations is passed to other neurons. The output at each node is called its activation or node value.
每个链接都与 weight. 相关联,人工神经网络具有学习能力,这种学习能力可以通过改变权重值来实现。下图显示了一个简单的人工神经网络 −
Each link is associated with weight. ANNs are capable of learning, which takes place by altering weight values. The following illustration shows a simple ANN −
Types of Artificial Neural Networks
有两种人工神经网络拓扑 − FeedForward 和 Feedback.
There are two Artificial Neural Network topologies − FeedForward and Feedback.
FeedForward ANN
在此人工神经网络中,信息流是单向的。一个单元向另一个单元发送信息,而它不会从该单元接收任何信息。没有反馈环路。它们用于模式生成/识别/分类。它们的输入和输出是固定的。
In this ANN, the information flow is unidirectional. A unit sends information to other unit from which it does not receive any information. There are no feedback loops. They are used in pattern generation/recognition/classification. They have fixed inputs and outputs.
Working of ANNs
在所示拓扑图中,每个箭头表示两个神经元之间的连接,并指示信息的流动路径。每个连接都有一个权重,这是一个整数,用于控制两个神经元之间的信号。
In the topology diagrams shown, each arrow represents a connection between two neurons and indicates the pathway for the flow of information. Each connection has a weight, an integer number that controls the signal between the two neurons.
如果网络生成“良好或理想”的输出,则无需调整权重。但是,如果网络生成“不良或不理想”的输出或错误,则系统将为了改进后续结果而改变权重。
If the network generates a “good or desired” output, there is no need to adjust the weights. However, if the network generates a “poor or undesired” output or an error, then the system alters the weights in order to improve subsequent results.
Machine Learning in ANNs
人工神经网络能够学习并且需要进行训练。有几种学习策略 -
ANNs are capable of learning and they need to be trained. There are several learning strategies −
-
Supervised Learning − It involves a teacher that is scholar than the ANN itself. For example, the teacher feeds some example data about which the teacher already knows the answers. For example, pattern recognizing. The ANN comes up with guesses while recognizing. Then the teacher provides the ANN with the answers. The network then compares it guesses with the teacher’s “correct” answers and makes adjustments according to errors.
-
Unsupervised Learning − It is required when there is no example data set with known answers. For example, searching for a hidden pattern. In this case, clustering i.e. dividing a set of elements into groups according to some unknown pattern is carried out based on the existing data sets present.
-
Reinforcement Learning − This strategy built on observation. The ANN makes a decision by observing its environment. If the observation is negative, the network adjusts its weights to be able to make a different required decision the next time.
Back Propagation Algorithm
这是训练或学习算法。它通过示例进行学习。如果您向算法提交网络将要执行操作的示例,它将更改网络的权重,以便在完成训练后针对特定的输入生成所需的输出。
It is the training or learning algorithm. It learns by example. If you submit to the algorithm the example of what you want the network to do, it changes the network’s weights so that it can produce desired output for a particular input on finishing the training.
反向传播网络非常适合简单的模式识别和映射任务。
Back Propagation networks are ideal for simple Pattern Recognition and Mapping Tasks.
Bayesian Networks (BN)
这些是用于表示一组随机变量之间的概率关系的图形结构。贝叶斯网络也称为 Belief Networks 或 Bayes Nets. BNs 推理不确定的域。
These are the graphical structures used to represent the probabilistic relationship among a set of random variables. Bayesian networks are also called Belief Networks or Bayes Nets. BNs reason about uncertain domain.
在这些网络中,每个节点表示具有特定命题的随机变量。例如,在医学诊断域中,节点“癌症”表示患者患有癌症的命题。
In these networks, each node represents a random variable with specific propositions. For example, in a medical diagnosis domain, the node Cancer represents the proposition that a patient has cancer.
连接节点的边表示这些随机变量之间的概率依赖性。如果两个节点中有一个正在影响另一个,则必须按照效果的方向直接连接它们。变量之间的关系强度由与每个节点关联的概率来量化。
The edges connecting the nodes represent probabilistic dependencies among those random variables. If out of two nodes, one is affecting the other then they must be directly connected in the directions of the effect. The strength of the relationship between variables is quantified by the probability associated with each node.
BN 中的弧上只有一个约束,即您不能仅仅通过遵循有向弧而返回到一个节点。因此,BN 被称为有向无环图 (DAG)。
There is an only constraint on the arcs in a BN that you cannot return to a node simply by following directed arcs. Hence the BNs are called Directed Acyclic Graphs (DAGs).
BN 能够同时处理多值变量。BN 变量由两个维度组成 -
BNs are capable of handling multivalued variables simultaneously. The BN variables are composed of two dimensions −
-
Range of prepositions
-
Probability assigned to each of the prepositions.
考虑离散随机变量的有限集 X = {X1, X2, …,Xn},其中每个变量 Xi 可以从有限集 Val(Xi) 中取值。如果从变量 Xi 到变量 Xj 有一个有向链接,则变量 Xi 将成为变量 Xj 的父节点,显示变量之间的直接依赖性。
Consider a finite set X = {X1, X2, …,Xn} of discrete random variables, where each variable Xi may take values from a finite set, denoted by Val(Xi). If there is a directed link from variable Xi to variable, Xj, then variable Xi will be a parent of variable Xj showing direct dependencies between the variables.
BN 的结构非常适合于结合先验知识和观察到的数据。BN 可用于学习因果关系并了解各种问题域,以及预测未来事件,即使在数据缺失的情况下也是如此。
The structure of BN is ideal for combining prior knowledge and observed data. BN can be used to learn the causal relationships and understand various problem domains and to predict future events, even in case of missing data.
Building a Bayesian Network
知识工程师可以构建贝叶斯网络。知识工程师在构建它时需要采取一些步骤。
A knowledge engineer can build a Bayesian network. There are a number of steps the knowledge engineer needs to take while building it.
Example problem - 肺癌。一名患者一直患有呼吸急促。他去看医生,怀疑自己患有肺癌。医生知道,除了肺癌之外,患者还有可能患上多种其他疾病,例如结核病和支气管炎。
Example problem − Lung cancer. A patient has been suffering from breathlessness. He visits the doctor, suspecting he has lung cancer. The doctor knows that barring lung cancer, there are various other possible diseases the patient might have such as tuberculosis and bronchitis.
Gather Relevant Information of Problem
Gather Relevant Information of Problem
-
Is the patient a smoker? If yes, then high chances of cancer and bronchitis.
-
Is the patient exposed to air pollution? If yes, what sort of air pollution?
-
Take an X-Ray positive X-ray would indicate either TB or lung cancer.
Identify Interesting Variables
Identify Interesting Variables
知识工程师试图回答以下问题:
The knowledge engineer tries to answer the questions −
-
Which nodes to represent?
-
What values can they take? In which state can they be?
现在,让我们考虑仅具有离散值的节点。此变量一次必须采用其中一个值。
For now let us consider nodes, with only discrete values. The variable must take on exactly one of these values at a time.
Common types of discrete nodes are −
Common types of discrete nodes are −
-
Boolean nodes − They represent propositions, taking binary values TRUE (T) and FALSE (F).
-
Ordered values − A node Pollution might represent and take values from {low, medium, high} describing degree of a patient’s exposure to pollution.
-
Integral values − A node called Age might represent patient’s age with possible values from 1 to 120. Even at this early stage, modeling choices are being made.
肺癌示例中可能的节点和值 −
Possible nodes and values for the lung cancer example −
Node Name |
Type |
Value |
Nodes Creation |
Polution |
Binary |
{LOW, HIGH, MEDIUM} |
|
Smoker |
Boolean |
{TRUE, FASLE} |
Lung-Cancer |
Boolean |
{TRUE, FASLE} |
X-Ray |
Binary |
Create Arcs between Nodes
Create Arcs between Nodes
网络拓扑应捕获变量之间的定性关系。
Topology of the network should capture qualitative relationships between variables.
例如,什么导致患者患有肺癌?- 污染和吸烟。然后从节点 Pollution 和节点 Smoker 添加指向节点 Lung-Cancer 的弧线。
For example, what causes a patient to have lung cancer? - Pollution and smoking. Then add arcs from node Pollution and node Smoker to node Lung-Cancer.
类似的,如果患者患有肺癌,那么 X 射线结果将为正。然后从节点 Lung-Cancer 添加弧线,指向节点 X-Ray。
Similarly if patient has lung cancer, then X-ray result will be positive. Then add arcs from node Lung-Cancer to node X-Ray.
Specify Topology
Specify Topology
根据惯例,BN 的布局使得弧线从上向下指向。节点 X 的父节点集合由 Parents(X) 给出。
Conventionally, BNs are laid out so that the arcs point from top to bottom. The set of parent nodes of a node X is given by Parents(X).
节点 Lung-Cancer 具有两个父节点(原因或起因):Pollution 和 Smoker,而 Smoker 节点是 X-Ray 节点的 ancestor 。类似地,X-Ray 是节点 Lung-Cancer 的子节点(后果或影响),以及节点 Smoker 和 Pollution 的 successor 。
The Lung-Cancer node has two parents (reasons or causes): Pollution and Smoker, while node Smoker is an ancestor of node X-Ray. Similarly, X-Ray is a child (consequence or effects) of node Lung-Cancer and successor of nodes Smoker and Pollution.
Conditional Probabilities
Conditional Probabilities
现在量化相连节点之间的关系:此过程通过为每个节点指定一个条件概率分布来完成。由于此处仅考虑离散变量,因此采用 Conditional Probability Table (CPT). 形式
Now quantify the relationships between connected nodes: this is done by specifying a conditional probability distribution for each node. As only discrete variables are considered here, this takes the form of a Conditional Probability Table (CPT).
首先,对于每个节点,我们需要查看父节点值的各种可能组合。这种组合被称为父集的 instantiation 。对于父节点值的每个不同实例,我们需要指定子节点将采用的概率。
First, for each node we need to look at all the possible combinations of values of those parent nodes. Each such combination is called an instantiation of the parent set. For each distinct instantiation of parent node values, we need to specify the probability that the child will take.
例如,肺癌节点的父节点是污染和吸烟。它们采用可能的取值 = {(H,T),(H,F),(L,T),(L,F)}。CPT 指定对于这四个案例中的每一个案例,癌症的概率分别为 <0.05,0.02,0.03,0.001>。
For example, the Lung-Cancer node’s parents are Pollution and Smoking. They take the possible values = { (H,T), ( H,F), (L,T), (L,F)}. The CPT specifies the probability of cancer for each of these cases as <0.05, 0.02, 0.03, 0.001> respectively.
每个节点都将具有如下关联的条件概率 −
Each node will have conditional probability associated as follows −
Applications of Neural Networks
它们可以执行对于人类来说很容易但对于机器来说很难的任务 −
They can perform tasks that are easy for a human but difficult for a machine −
-
Aerospace − Autopilot aircrafts, aircraft fault detection.
-
Automotive − Automobile guidance systems.
-
Military − Weapon orientation and steering, target tracking, object discrimination, facial recognition, signal/image identification.
-
Electronics − Code sequence prediction, IC chip layout, chip failure analysis, machine vision, voice synthesis.
-
Financial − Real estate appraisal, loan advisor, mortgage screening, corporate bond rating, portfolio trading program, corporate financial analysis, currency value prediction, document readers, credit application evaluators.
-
Industrial − Manufacturing process control, product design and analysis, quality inspection systems, welding quality analysis, paper quality prediction, chemical product design analysis, dynamic modeling of chemical process systems, machine maintenance analysis, project bidding, planning, and management.
-
Medical − Cancer cell analysis, EEG and ECG analysis, prosthetic design, transplant time optimizer.
-
Speech − Speech recognition, speech classification, text to speech conversion.
-
Telecommunications − Image and data compression, automated information services, real-time spoken language translation.
-
Transportation − Truck Brake system diagnosis, vehicle scheduling, routing systems.
-
Software − Pattern Recognition in facial recognition, optical character recognition, etc.
-
Time Series Prediction − ANNs are used to make predictions on stocks and natural calamities.
-
Signal Processing − Neural networks can be trained to process an audio signal and filter it appropriately in the hearing aids.
-
Control − ANNs are often used to make steering decisions of physical vehicles.
-
Anomaly Detection − As ANNs are expert at recognizing patterns, they can also be trained to generate an output when something unusual occurs that misfits the pattern.