IANN - Lab Manual - GEC
IANN - Lab Manual - GEC
IANN - Lab Manual - GEC
Laboratory Manual
for
Certificate
Place: __________
Date: __________
Preface
Main motto of any laboratory/practical/field work is for enhancing required skills as well as
creating ability amongst students to solve real time problem by developing relevant competencies
in psychomotor domain. By keeping in view, GTU has designed competency focused outcome-
based curriculum for engineering degree programs where sufficient weightage is given to
practical work. It shows importance of enhancement of skills amongst the students and it pays
attention to utilize every second of time allotted for practical amongst students, instructors and
faculty members to achieve relevant outcomes by performing the experiments rather than having
merely study type experiments. It is must for effective implementation of competency focused
outcome-based curriculum that every practical is keenly designed to serve as a tool to develop
and enhance relevant competency required by the various industry among every student. These
psychomotor skills are very difficult to develop through traditional chalk and board content
delivery method in the classroom. Accordingly, this lab manual is designed to focus on the
industry defined relevant outcomes, rather than old practice of conducting practical to prove
concept and theory.
By using this lab manual students can go through the relevant theory and procedure in advance
before the actual performance which creates an interest and students can have basic idea prior to
performance. This in turn enhances pre-determined outcomes amongst students. Each experiment
in this manual begins with competency, industry relevant skills, course outcomes as well as
practical outcomes (objectives). The students will also achieve safety and necessary precautions
to be taken while performing practical.
This manual also provides guidelines to faculty members to facilitate student centric lab activities
through each experiment by arranging and managing necessary resources in order that the
students follow the procedures with required safety and necessary precautions to achieve the
outcomes. It also gives an idea that how students will be assessed by providing rubrics.
Artificial Neural Networks have become a fundamental component of modern machine learning
and artificial intelligence, enabling the development of sophisticated models for tasks such as
image recognition, natural language processing, and more. This lab manual is intended to provide
a hands-on and practical approach to understanding the foundations, principles, and applications
of artificial neural networks. It serves as a comprehensive guide for students.
Disclaimer: This lab manual includes information and content from various books and websites.
The authors of these books are acknowledged and credited within the relevant sections of the
manual. While every effort has been made to represent their ideas and theories accurately, any
errors are unintentional. Including these sources does not imply endorsement or affiliation with
the authors or their publishers. This laboratory manual is only for free education purposes
without any commercial use.
Introduction to Artificial Neural Network (3160315)
The following industry relevant competency are expected to be developed in the student by
undertaking the practical work of this laboratory.
1. Practical work can help students gain a deeper understanding of the components and
operation of medical devices, including sensors, control systems, power supplies, and
communication protocols.
2. Students can learn how to read and interpret technical documentation, including
schematics, wiring diagrams, and software code, to troubleshoot problems and
diagnose faults in medical devices.
3. Practical work can help students become familiar with a range of testing and
measurement equipment, including multimeters, oscilloscopes, signal generators, and
power analyzers, which are commonly used in medical device testing and
troubleshooting.
4. Students can develop practical skills in soldering and desoldering, which are essential
for repairing and replacing components in medical devices.
5. Practical work can help students gain an understanding of safety regulations and
standards that apply to medical devices, including electrical safety, electromagnetic
compatibility, and risk management.
• Student shall develop the habits of evolving more ideas, innovations, skills etc. apart from
those included in scope of manual.
• Student shall refer technical magazines and data books.
• Student should develop a habit of submitting the experimentation work as per the schedule
and s/he should be well prepared for the same.
Here are some general rubrics that can be applied to study practicals:
• Knowledge and Understanding: This rubric assesses the student's ability to understand and
apply theoretical concepts related to the practical.
• Technical Skills: This rubric evaluates the student's ability to use laboratory equipment and
perform practical tasks accurately and effectively.
• Data Analysis: This rubric assesses the student's ability to collect, organize, and analyze
data obtained from the practical.
• Communication: This rubric evaluates the student's ability to effectively communicate the
practical results, including written reports, presentations, and discussions.
• Safety: This rubric assesses the student's adherence to safety procedures and protocols
during the practical.
• Time Management: This rubric evaluates students’ ability to manage their time effectively
during the practical, including setting priorities and meeting deadlines.
• Collaboration: This rubric assesses the student's ability to work effectively in a team during
the practical.
Index
(Progressive Assessment Sheet)
Date of Date of Assessme Sign. of
Page
Sr. No. Objective(s) of Experiment perform submiss nt Teacher Remarks
No.
ance ion Marks with date
Institute Vision
To be a premier engineering institution, imparting quality education for innovative solutions
relevant to society and environment
Institute Mission
❖ To develop human potential to its fullest extent so that intellectual and innovative engineers can
emerge in a wide range of professions.
❖ To advance knowledge and educate students in engineering and other areas of scholarship that
will best serve the nation and the world in future.
❖ To produce quality engineers, entrepreneurs and leaders to meet the present and future needs of
society as well as environment.
Vision
❖ To play a pivotal role in promoting human health through the best of current and future
technologies from the field of engineering and medical science to bridge the gap between
medicine and engineering.
Mission
❖ To serve the fundamental principles of engineering to human health care and well- being for
medical industries, health care providers, governmental agencies, and academic entities.
❖ To create a linkage between content generation, research in critical areas and imparting
education for integrating our knowledge with the advancements in Hospitals and Industries.
❖ To obtain and maintain the competitive edge in the hospitals and industries, for identification
and nurturing of talent and learning in academic entities
Program Outcomes (PO)
Engineering Graduates will be able to:
2. Poblem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics,
natural sciences, and engineering sciences.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities
with an understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to
the professional engineering practice.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
11. Project management and finance: Demonstrate knowledge and understanding of the engineering
and management principles and apply these to one’s own work, as a member and leader in a
team, to manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.
PSOs and PEOs of the department
PEO-2: To have ability to use their problem solving skills and multidisciplinary perspectives to
understand and advance scientific discoveries and technological innovations across professional
and disciplinary boundaries with the highest professional and ethical standards.
PEO-3: To possess technical and practical skills to identify, formulate, and solve open-ended
problems with medical relevance, including the design of devices, systems, and processes to
improve human health.
PEO-5: Work professionally in one or more of the following areas: biomedical electronics,
medical instrumentation, biomedical signal processing, rehabilitation engineering, and neuro
engineering.
Relevant CO:
Objectives:
• Understand basics of biological neural network and extension of it as Artificial Neural
network
• Understand the role and application of neural networks in engineering
Theory:
Introduction
Artificial Neural Networks (ANNs) are computational models inspired by the structure and function
of the human brain. They consist of interconnected nodes, or artificial neurons, organized into
layers. Typically, ANNs have an input layer, one or more hidden layers, and an output layer. Each
connection between neurons has a weight that modulates the information flow. ANNs are used for
many tasks, including pattern recognition, image and speech recognition, natural language
processing, and more. During training, ANNs learn by adjusting the weights of connections to
minimize the difference between their predictions and actual target values, often using algorithms
like backpropagation. This process allows ANNs to generalize from the training data and make
predictions on unseen examples. ANNs have gained significant prominence in machine learning
and artificial intelligence due to their ability to handle complex, non-linear relationships and adapt
to various tasks. They are the foundational technology behind deep learning, enabling
breakthroughs in areas like computer vision, speech recognition, and autonomous systems.
A biological neuron, also known as a nerve cell, is the fundamental building block of the nervous
system and plays a crucial role in transmitting electrical and chemical signals throughout the body.
The structure of a typical biological neuron can be described in several key components:
1. Cell Body (Soma): The cell body is the central part of the neuron and contains the nucleus, which
houses the cell's genetic information. It integrates signals received from dendrites and, based on this
input, decides whether to generate an output signal.
2. Dendrites: Dendrites are branching extensions that extend from the cell body. They serve as the
input regions of the neuron, receiving electrical signals from other neurons and relaying them to the
cell body. Dendrites contain numerous synapses, which are specialized junctions where chemical
communication occurs with other neurons.
3. Axon: The axon is a long, slender projection that extends from the cell body. It is responsible for
transmitting the electrical signals, called action potentials, away from the cell body and toward the
axon terminals. The myelin sheath, a fatty insulating layer, can surround the axon, which helps in
faster signal transmission.
4. Axon Terminals (Synaptic Terminals):At the end of the axon, there are specialized structures
called axon terminals. These terminals form synapses with the dendrites or cell bodies of other
neurons, where the transfer of signals takes place through chemical neurotransmitters.
5. Synaptic Cleft: The small gap between the axon terminal of one neuron and the dendrites or cell
body of another neuron is known as the synaptic cleft. It's where the chemical transmission of
signals occurs from one neuron to another.
6. Myelin Sheath: Some neurons are enveloped by a myelin sheath, which is produced by
specialized cells called Schwann cells in the peripheral nervous system. The myelin sheath acts as
an insulator, helping to speed up the transmission of electrical signals along the axon.
7. Nodes of Ranvier: In myelinated neurons, the axon is periodically interrupted by small gaps
called nodes of Ranvier. These nodes play a crucial role in facilitating the rapid "jumping" of the
action potential along the axon.
Biological neurons are highly specialized and work together in complex networks to process
information, transmit electrical signals, and ultimately control various functions within the body,
including sensory perception, motor control, and cognitive processes.
1. Input Layer: The initial layer of the network that receives input data. Each neuron in this layer
represents a feature or input variable. The number of neurons in this layer depends on the
dimensionality of the input data.
2. Hidden Layers: These intermediate layers, placed between the input and output layers, process
the information. They consist of neurons that apply weighted sums and activation functions to their
inputs. ANNs can have one or multiple hidden layers, which enable them to capture complex
patterns and relationships within the data.
3. Output Layer: The final layer that produces the network's predictions or outputs. The number of
neurons in this layer depends on the task, e.g., one neuron for binary classification, multiple neurons
for multiclass classification or regression.
4. Neurons: Each neuron, or node, computes a weighted sum of its inputs, applies an activation
function, and passes the result to the next layer. Common activation functions include sigmoid,
ReLU, and softmax.
5. Weights and Biases: Parameters associated with each connection between neurons, determining
the strength and direction of signal propagation. These are learned during training to optimize the
network's performance.
This layered structure and the connections between neurons enable ANNs to learn complex
mappings and perform various tasks, from image recognition to natural language processing.
𝑛𝑒𝑡 = ∑ 𝑤𝑖 𝑥𝑖 + 𝑏 = 𝑤1 𝑥! + 𝑤2 𝑥2 + ⋯ + 𝑤𝑛 𝑥𝑛 + 𝑏
𝑖=1
The neuron behaves as an activation or mapping function f(net) to produce an output y which can
be expressed as:
𝑛
𝑦 = 𝑓(𝑛𝑒𝑡) = 𝑓 (∑ 𝑤𝑖 𝑥𝑖 + 𝑏)
𝑖=1
Where f is called the neuron activation function or the neuron transfer function. Activation functions
are functions used in a neural network to compute the weighted sum of inputs and biases, which is
in turn used to decide whether a neuron can be activated or not.
Application areas of ANN can be technically divided into the following categories:
Classification and diagnostic: ANN have been applied in the field of diagnosis in medicine,
engineering and manufacturing by correct association between input patterns representing some
forms of abnormal behaviour with the corresponding disease or fault type. An example is fault
diagnosis of electrical motors
Pattern recognition: ANN have been successfully applied in recognition of complex patterns such
as: speech recognition, handwritten character recognition and a lot of other application in the area
of image processing.
Modelling: A neural network is a powerful data modelling tool that is able to capture and represent
complex input/output relationships. The true power and advantage of neural networks lies in their
ability to represent both linear and non-linear relationships and in their ability to learn these
relationships directly from the data being modelled. The purpose of the neural network is to create
a model that correctly maps the input to the output using historical data so that the model can then
be used to produce the output when the desired output is unknown.
Forecasting and prediction: ANN have shown high efficiency as predictive tool by looking at the
present information and predict what is going to happen. Estimation and Control: ANN have been
powerfully applied in the field of automatic control in system identification, adaptive control,
parameter estimation and optimization and many other applications in this field.
2. Compare Biological Neural network and Artificial Neural Network for following
parameters: Processing, Size, Learning, Fault Tolerance & Storage.
Conclusion:
Reference:
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 2
Relevant CO:
Objectives:
Theory:
Fig 1. Simple Neural network with one input and one output.
Three distinct functional operations take place in this example neuron. First, the scalar input p is
multiplied by the scalar weight w to form the product wp, again a scalar. Second, the weighted input
wp is added to the scalar bias b to form the net input n. (In this case, you can view the bias as shifting
the function f to the left by an amount b. The bias is much like a weight, except that it has a constant
input of 1.) Finally, the net input is passed through the transfer function f, which produces the scalar
output a. The names given to these three processes are: the weight function, the net input function
and the transfer function.
Simple Network with multiple input:
Fig 2 Simple Neural network with multiple input and one output.
Here the input vector p is represented by the solid dark vertical bar at the left. The dimensions of p
are shown below the symbol p in the figure as R × 1. (Note that a capital letter, such as R in the
previous sentence, is used when referring to the size of a vector.) Thus, p is a vector of R input
elements. These inputs post multiply the single-row, R-column matrix W. As before, a constant 1
enters the neuron as an input and is multiplied by a scalar bias b. The net input to the transfer
function f is n, the sum of the bias b and the product Wp. This sum is passed to the transfer function
f to get the neuron’s output a, which in this case is a scalar. Note that if there were more than one
neuron, the network output would be a vector.
𝑊𝑝 = 𝑤1,1 ∗ 𝑝1 + 𝑤1,2 ∗ 𝑝2 + ⋯ + 𝑤1,𝑅 ∗ 𝑝𝑅
Implementation of basic neural network:
To implement new custom network MATLAB provides “network” function. The details of function
is provided below.
Net = network (numInputs, numLayers, biasConnect, inputConnect, layerConnect,
outputConnect)
If we provide create net object without any argument it will return following network.
net = network
net =
Neural Network
numInputs: 0
numLayers: 0
numOutputs: 0
numInputDelays: 0
numLayerDelays: 0
numFeedbackDelays: 0
numWeightElements: 0
sampleTime: 1
connections:
biasConnect: []
inputConnect: []
layerConnect: []
outputConnect: []
subobjects:
functions:
adaptFcn: (none)
adaptParam: (none)
derivFcn: 'defaultderiv'
divideFcn: (none)
divideParam: (none)
divideMode: 'sample'
initFcn: 'initlay'
performFcn: 'mse'
performParam: .regularization, .normalization
plotFcns: {}
plotParams: {1x0 cell array of 0 params}
trainFcn: (none)
trainParam: (none)
To create a network with one input, we can provide the parameters as in following manner.
net = network;
net.numInputs = 1;
net.numLayers = 1;
net.inputConnect=1;
net.biasConnect=1;
net.outputConnect=1;
view(net)
To create a network with multiple input, we can provide the parameters as in following manner.
net = network;
net.numInputs = 4;
net.numLayers = 1;
net.inputConnect=[1 1 1 1];
net.biasConnect=1;
net.outputConnect=1;
view(net)
To create a network with multiple input and hidden layer. We can provide the parameters as in
following manner.
net = network;
net.numInputs = 4;
net.numLayers = 3;
net.inputConnect=[1 1 1 1;0 0 0 0;0 0 0 0];
net.layerConnect=[0 0 0;1 0 0;0 1 0];
net.biasConnect=[1;1;1];
net.outputConnect=[0 0 1];
net.layers{1}.size = 4;
net.layers{2}.size = 3;
net.layers{3}.size=4;
net.layers{1}.transferFcn = 'purelin';
net.layers{2}.transferFcn = 'tansig';
net.layers{3}.transferFcn = 'logsig';
view(net)
In order to provide transfer function to different layer of network following instruction can be used
otherwise by default linear activation function (purelin) is utilized.
net.layers{1}.transferFcn = 'purelin';
Exercise:
1. Create a shallow network for 5 inputs, 3 layers and 1 output with all layers having linear
activation function.
2. Create a shallow network for 6 inputs and 5 layers with 1 output, with 1st 2 layers having
linear, next 2 layers having sigmoidal and last layer having log activation function.
Conclusion:
Reference:
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 3
Relevant CO:
Objectives:
• Understand various Network architecture
• Understand Network terminologies for implementing of Artificial Neural network
Theory:
Introduction
• Network Architectures
• Learning/Training
• Types of Learning
• Artificial Neural Network Terminologies
o Weights
o Threshold
Exercise –
1. Which activation function are better suited for nonlinear classification. Justify your answer.
2. Explain the advantages of linear activation functions.
Conclusion:
Reference:
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 4
Relevant CO:
Objectives:
Theory:
Introduction
1. Generate the output of logic AND function using MATLAB program and compared response
with mathematical solution.
2. Generate OR function using MATLAB Program
3. Generate the output of ANDNOT function using MATLAB Program
4. Generate XOR function using MATLAB Program.
Conclusion:
Reference:
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 5
Relevant CO:
Objectives:
• To acquire a comprehensive understanding of Perceptron network, and to successfully
implement and apply them in practical scenarios
Theory:
Exercises –
1. Write a MATLAB program for perceptron net for an AND function with bipolar inputs and
targets.
2. Write a MATLAB program for perceptron net for an AND function with binary inputs and targets.
3. Write a MATLAB program for perceptron net for an OR function with binary inputs and bipolar
targets.
Conclusion:
Reference:
• Introduction to Neural Networks using MATLAB 6.0 - S.N.Sivanandam, S.Sumathi, S. N.
Deepa, TMH, 2006
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 6
Introduction to Hebb Net and Develop logical function using MATLAB for
Hebb Networks
Date:
Relevant CO:
Objectives:
• To acquire a comprehensive understanding of Hebb network, and to successfully implement
and apply them in practical scenarios
Theory:
Exercises –
1. Develop MATLAB program to implement AND function using Hebbian learning rule (Use bipolar
input and output)
2. Develop MATLAB program to implement ANDNOT function using Hebbian learning rule (Use
binary input and bipolar output)
Conclusion:
Reference:
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 7
Relevant CO:
Objectives:
• To acquire a comprehensive understanding of Adaline and Madaline networks, and to
successfully implement and apply them in practical scenarios.
Theory:
• Develop an adaline network for ANDNOT function with bipolar inputs and targets using
MATLAB Program. (Initial weights and bias - 0.2 and learning rate – 0.2, upto 4 epoch)
• Develop an adaline network for OR function with bipolar inputs and targets using
MATLAB Program. (Initial weights and bias - 0.2 and learning rate – 0.2, upto 5 epoch)
• Architecture of Madaline
• Steps of MRI and MRII Algorithm
Exercises –
1. Write a MATLAB program to generate XOR function for bipolar inputs and targets using Madaline
network.
2. Write a MATLAB program to generate AND function for bipolar inputs and targets using Madaline
network.
Conclusion:
Reference:
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 8
Relevant CO:
Objectives:
• To comprehensively understand backpropagation networks and successfully implement and
apply them in practical scenarios.
Theory:
• Training Algorithm
Exercises –
• Write a MATLAB code for XOR function with momentum factor using back propagation
Algorithm.
• Write a MATLAB code for XOR function bipolar input and output with momentum factor
using back propagation Algorithm.
Conclusion:
Reference:
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 9
Relevant CO:
Objectives:
• To comprehensively understand memory networks and successfully implement and apply
them in practical scenarios.
Theory:
• Write a MATLAB code to calculate the weights for the following patterns using hetero
association neural net for mapping four input vectors to two output vectors.
S1 S2 S3 S4 T1 T2
1 1 0 0 1 0
1 0 1 0 1 0
0 1 1 0 0 1
0 1 1 0 0 1
• Write a MATLAB code to calculate the weights matrix of an auto-associative net to store
the vector (1 1 -1 -1). Test the network's response by presenting the same pattern and
recognize whether it is a known vector or unknown.
• Write a MATLAB code to store the vector (-1 -1 -1 -1) & (-1 -1 1 1) in an associative net.
Find the weight matrix. Test the response with (1 1 1 1) as input.
• Write a MATLAB code to find the weight matrix in bipolar form the bi-directional
associative memory network based on the following binary input output pairs.
S(1) = (1 1 0 1) T1 = (1 0)
S(2) = (1 0 1 0) T2 = (0 1)
Conclusion:
Reference:
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 10
Relevant CO:
Theory:
NNTOOL Introduction:
To Start NNTOOL in MATLAB, write nntool in command window. Once NNTOOL is started
the GUI will appear as shown in below figure.
To start network training, open the network by using open button as shown figure 4.
Figure 4- Viewing network in GUI
Conclusion:
Reference:
Rubrics 1 2 3 4 5 Total
Marks
Bio-Medical Engineering
Lab Manuals
are prepared by
Prof. B. H. Mehta
Assistant Professor
Biomedical Engineering,
L.D. College of Engineering, Ahmedabad
Branch Coordinator
Prof. Mitul B. Patel
Assistant Professor
Biomedical Engineering,
Govt. Engineering College Gandhinagar
Committee Chairman
Dr N M Bhatt
Professor of Mechanical Engineering
L. E. College, Morbi