Unit-AI Model Lifecycle
Unit-AI Model Lifecycle
MODEL LIFECYCLE
Learning Outcomes
Lifecycle
. Stages of AI Model
n005e vouwant to bake a cake. How do you go about it? Let us look at the steps.
Step 5: Take the cake out of the oven. Let it cool and then cut it into square pieces. Enjoy!
Feedback Phase II
Problem Scoping
Before beginning to build a solution, it is critical to first understand the
Business limitations assist you in realizing the required solution's problem description and business limitations.
quality and
Scenarios. Assume you are developing a version of "Google Translate". You will ternms. Consider the following two
think of the following:
What are the commercial constraints?
Your model must be capable of
feasible.
comprehending text data. The end result should be linguistically correct as
iii. Minor mistakes are tolerable.
jV. Fora better user experience, the result should be
shown in milliseconds.
Scopinga problem is difficult because we need to have a deeper understanding of it so that the image gets clearer
as we attempt to solve it. As a result, we employ the 4Ws Problem Canvas toassist us in identifying the important
factors associatedwith the problem.
Using the 4Ws problem canvas the problem statement can be formulated as follows:
The [the stakeholders] Who
have a problem that [issue, need] What
when/while [situation/location] Where
A
good solution using Al would [solution benefit] Why
Hence. in the future, whenever there is a need to look at the foundation of the problem again, we can take a look at
the Problem Statement Template to understand its key elements.
Experiential Learning
Video Session
Scan the QR code or visit the following link to watch the video: 4Ws of Problem Scoping in Al Project
Cycle | The 4Ws Canvas Aiforkids
https://www.youtube.com/watch?v= qFolxZPt9Ho
After watching the video, answer the following question:
What you learned from this video?
Modelling
Every Al model relies on the ability to quantitatively characterise the relationship between parameters. Thus, when
we talk about constructing Al models, we are referring to the mathematical approach to data analysis.
Modelling is the process through which several models based on graphical data can be constructed and even
tested for advantages and disadvantages. ML engineers go through multiple models to determine the best model
configuration. Hence, the design phase is an iterative process. Hyperparameter fine-tuning provided by most ML
frameworks helps to narrow down the number of feasible solutions. These approaches assess performance for many
configurations,compare them, and inform of the best ones.
It is vital to the success of the Al project that all of the various individuals engaged have proper access to data,
tools, and processes to collaborate across different phases of modelcreation. During this stage, you must assess the
various Al development platforms as given below:
Open languages: Python, R, and Scala
Open frameworks: Scikit-learn is the most popular, XGBoost, TensorFlow.
Approaches and techniques: Classic ML techniques from regression, Reinforcement Learning, Generative
adversarial networks (GAN) framework
Productivity- increasing capacities: Visual modelling (graphic representation of objects), Automated Machine
Learning (AutoAl) to help with feature engineering, selection of appropriate algorithm and hyperparameter
optimization
Tools to help in the development process: DataRobot, H,0, Watson Studio, Azure ML Studio, Sagemaker,
Anaconda, etc.
Various Al development platforms provide substantial documentation to assist
the Al platform chosen, you must go to the following web pages for this development teams. Depending
docurmentation:
Microsoft Azure AI Platform
Google Cloud AI Platform
IBM Watson Developer platform
BigML
Infosys Nia resources
Evaluation
Once a model has been created and trained, it must be properly tested to calculate the model's efficiency and
nerformance. As a result, the model is evaluated using Testing Data (which was extracted from the acquired dataset
during the Data Acquisition stage) and the model's efficiency is assessed.
The set of measurements will differ depending on the problem you're working on. For regression problem, for
example. MSE or MAE are commonly used. On the other hand, for a balanced dataset, accuracy may be a useful
choice for evaluating a classification model. Imbalanced sets necessitate the use of more advanced metrics. In such
instances, the F1 SCore is useful.
Aseparate validation dataset is used for evaluation during training. It monitors how well our model gerneralises,
avoiding bias and overfitting.
There are a few other things considered during this stage too:
The volume of test data can be huge,which provides data complexities.
Human biases in picking test data might have anegative impact on the testing phase; thus, data validation is
critical.
The testing team should put the Al and ML algorithms through rigorous testing while maintaining model
validity and keeping successful learning ability, and algorithm efficacy in mind.
As the system may deal with sensitive data, regulatory compliance and security testing are essential.
Also, due to the sheer volume of data, performance testing is critical.
If the Al solution requires data from other systems, systems integration testing is critical.
Allrelevant subsets of training data, ie., the data you will use to train the Alsystem, should be included in test
data.
models.
The team involved in testing must develop test suites to aid in the validation of the ML
Brainy Fact
Training Dataset vs Test Dataset vs Validation Dataset
was utilised to fit the model.
The training dataset is the set of data that
evaluation of a model's fit on the training
Validation Dataset: A subset of data used to offer an unbiased
validation dataset is incorporated into
dataset while tuning model hyperparameters. As prohciency of the
increasingly biased.
the model setup, the evaluation becomes
on the training dataset is referred
The sample of data used to offer an unbiased evaluation of a hnalmodel fht data in it haenae
sometimes known as a holdout data set if the
toas the test dataset. The test data set is
cross-validation).
been used in training (for example, in
Another useful technique would be to gather samples that were incorrectly processed by the
model to determine
the root cause reasons for why this occurred and then use this
information to retrain the model to make it moro
robust to SUch data. Such constant research can assist you in better
your current model isn't prepared for.
understanding any unforeseen occurrences that
Experiential Learning
Video Session
Scan the QR code or visit the following link to
watch the video: The Machine Learning Lifecycle
nttps /www.youtube.com/watch?v=ZmBUnJ7IGvO
After watching the video, answer the
following question:
What do you mean by binary RANGE
At aGlance
The Al model cycle provides the
The AI model cycle basically right framework to guide us to our goals.
modelling, consists of the phases: problem
In problem evaluation, deployment and feedback. scoping, data acquisition, data
exploration,
scoping,we
Data is collected from a specify the problem we want to solve.
After examining the pattern, variety of trusted and genuine
the type of model to be sources.
Modelling is the process
even tested for through which several modelscreated is
determined.
advantages and based on graphical data can
ML engineers go
The design phase through
disadvantages.
multiple models to
be constructed and
is an
After the modelling is iterative process.
determine the best model
complete,
Finally, after the evaluation, you need to test your confiquration.
The 4Ws Problem Canvas the model cycle is completed model and you
with the test data.
can deploy the Al
In Al helps identify key factors model at the client site.
modelling, data is divided into
Training data must be authentic and two related to the problem.
After the modelling is parts-training
is used to
teach
and testing data.
the machine.
The deployed model'scomplete, testing data is used to validate the Al
required by the business. performance is monitored to ensure
that it model. to
continues function at the level
142 | Touchpad Artificial Intelligence-XIl
.AiQuiz
A
Tick () the correct option.
l., The design phase is an process and includes many steps like data
a set of models, etc. collection, cleaning, running
a algorithmic b. recursion
c. iterative
d. algebraic
2. Which of the following is NOT an Al development platform?
Google Cloud
b. EVA
IBM Watson
d. BigML
3 During the stage, the various AI development platforms like Scikit-learn,
are evaluated. Watson Studio etc.
a Scoping
b. Acquire
rDesign
d. Deployment
4 Which of the following is the last stage of an AI model life cycle?
a. Design b. Problem Scoping
c. Testing d. Deployment
5. Assertion (A): Test data should contain all relevant subsets of training data.
Reason (R): By using similar data for training and testing, the effects of data inconsistencies are reduced and
a better understanding of the model's properties can be gained.
a. Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation of Assertion (A).
OOOO
b. Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct explanation of Assertion (A).
C Assertion (A) is true, but Reason (R) is false.
w7. Which of the followingstage of Al model life cycle is referred by the statement "Collecting data from various
reliable and authentic sources"?
The
block in the 4Ws problem canvas refers to the setting in which the stakeholders experience
v8.
this problem.
b. What
a. Who
C. Where d. Why
[CBSE, 2022]
a. Project scoping b. Production
c. Design d. Deployment in production
w15. Which of the followingdo not fallunder problem scoping? [CBSE, 20221
Desire outcome of the project
C. Data acquisition
8 b. Anticipate key resources and steps
d.
[CBSE, 2022]
a. TensorFlow b. Azure ML Studio
v17. During
Anaconda 8 d. Sagemaker
phase, you need to evaluate the various Al development platforms. [CBSE, 2022]
a. Analysis b. Design
. Productivity d. Implementing
18. Which of the following open-source languages is best suited for building an Al model? [CBSE, 2022)
a. C++ b. Visual Basic
c. Python d Java
19. The following are the objectives of the testing team in Al modeling: [CBSE, 2022]
() Model Validation (i) Successful Learnability
(ii) Accurate Results (iv) Algorithm Effectiveness
Choose the correct option:
a. (). (ii) and (ii) b. () and (ii)
Artificial Intelligence-XII
144 | Touchpad
20. During phase, you need to evaluate the various Al development
platforms. [CBSE, 2022]
a Design b. Requirement analysis
C Development d.
Testing
Competency Based Questions
B.
i Consider the following statements containing anassertion and areason:
1 Assertion (A): Before beginning to build a solution, it is critical to first understand the problem description
and business limitations.
Reason (R): Business limitations assist you in realizing the required solution's quality and terms.
2 Assertion (A): The Alproject cycle provides the right framework to guide us to our goals.
Reason (R): Alproject cycle is an iterative process.
3 Assertion (A): Once a model has been created and trained, it can be deployed without evaluation.
Reason (R): The model can be evaluated using Testing Data and the model's efficiency can be assessed.
4
Assertion (A): During "Exploratory Data Analysis", the initial insights gained help to get an understanding of
the data and later on, help inalgorithm selection, metrics choice, etc.
Reason (R): The quality of the data beingused by the Al model does not affect the model.
5 Assertion (A): Aseparate validation dataset isused for evaluation during training.
Reason (R): The team involved in testing must develop test suites to aid in the validation of the ML models.
Select the appropriate option for the statements given above:
a Both A and R are true and R is the correct explanation of A
b Both A and R are true and R is not the correct explanation of A
C. A is true but R is false
d A is False but R is true
ii. Which of the following statements is/are INCORRECT. [CBSE Sample Paper, 2022]
The volume of test data can be large, which presents complexities.
i) Your testing team should test the Al and ML algorithms keeping model validation, successful learn ability.
and algorithm effectiveness in mind.
ii) Test data should include all irrelevant subsets of training data, i.e., the data you will use for training the AI
system.
a None of the Below b. ii)
C iii) d. i), ii) & ii)
ii,.Which of the following statements are true for the testing stage of building an Almodel? [CBSE, 2022]
i) The volume of test data cannot be large.
iD) Human biases in selecting test data can adversely impact testing.
i) Data validation is not needed.
iv) Regulatory compliance testing and security testing are important.
Choose correct option:
a. () and (i) b. (i), (i) and (ii)
C. (ii) and (iv) d. () and (iv)
iy Assertion (A): Test data should include all relevant subsets of training data
[CBSE, 2022]
Reason (R): Subset data is the data used for training an Al model
a. Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation of Assertiorn (A
b. Both Assertion (A) and Reasorn (*) are true, but Reason (R) is not the correct explanation of
Assertion (A).
b 0 (u) and ()
d 0 ) and (v)
V N N s e r that
h m validate Vour ML models Under which stage
A NUNIIs the twestatvnnt tall
|C8SE 2022)
b Scopng
d Requrement Analysis
Exercise.
Solved Questions
in the blanks
Numan b s l t i tst data can nthe imt
Nan enanle of detrietal ettrts that can ocur over time on the Al model
may be a setul choie tor evaluating a classification model.
$Usn t OtUs n ienting the inytant factosassociated with the problem
The nital insights gaed help to get an undestanting of the data and later on help in algonthm selexton
INArtanteienoe
4
D Short answer type questions.
What is the purpose of Data Ixploaton
Ans. After qathering data, procosses uh a,
data cleaning to locate missing
values,
eliminating worthless data (eroneoIN sample ad
nortorming basi statistical analyis such as outlies), and
comparing different propeties of the data set,drawing qapl1s (or any other Viual
understanding of the data and
which elements are more later on, help in
are caried out he teesentateo)
iilial inghts qained help te
al
essential and what the alqoithm
qel
selection, neties hole, ete Itis useul to atu
2 During which stage of the Al model cyde
overall trend of the data i see
process? should we take cate of Al Ethics? What
Ans Durng the are the challenge, to this
development the Al model(modelling phase),care
data, instructions,
of
etc. which shoutd be taken that
the country. There are two provides protection of all liberties for all citizens as perthe programer is nluding
second is being able to find main challenges-One is qetting access to
high
the fundanental rights of
skilled who can develop reliable quality and standardized datasets and
List 4 that should beprogrammers
3
Ans, " The
considerations kept in mind during the
testing phase.
and high quality rmahirne,
volume of test data can be huge,
Human biases in picking test data mightwhich provides data complexities
is critical. have a negative impact on the testing phase, thus,
data validation
The testing team should put the Al
and ML algorithrns through
validity and keeping successful learning rigorous testing while naintaining model
Also, due to the sheer volume of data, ability, and algorithm efficacy in mind.
4
Explain the terms overfitting, performance testing is critical.
underfitting and perfect fit in
Ans.
Overfitting: Amodel is overfitted when it is trained withterms of model testing.
a lot of data. The
data correctly as there are too many
details. To avoid overfitting, model model does not categorize the
Underfitting: It usually happens when we have less data to build an complexity must be reduced
algorithm does not fit the data well enough. To avoid accurate model. The Al model or the
toget better results. underfitting, the training period nust be increased
Perfect fit: When our model is able to predict with
good
happens with correct set of allthe hyperparameters. accuracy on both testingand val1dation data This
5 Create a
4W Project Canvas for the following:
It makes no difference whether you are in
the driver's or
hours. Long, never-ending lines and blasting horns are a passenger's seat. We've all been stuck in trafic tor
that our modes of mobility have advanced regular occurrence in any metropolis. Despite the fact
significantly in recent years, our traffic
struggledto keep up with the increase in the number of cars. Al, on the other managenent systerns have
a solution tothis problem. Siemens hand, has the potential to provide
Mobility has developed a prototype of a monitoring system that
artificial intelligence (A) viasurveillance cameras placed along the rails.
employs
inreal time and sendthe data toa control centre, where Cameras detect the nurnber of vehcies
algorithms compute traffic density The system adiusts
the sequence of traffic lights on the roads based on this information
Ans.
OUR (stakeholders] People stranded in traffic jams WHO
HAS/HAVEPROBLEM THAT [issue, problem, needj traftic jams cause inconvenience to publr WuAY
WHEN/WHILE lcontext, situation] poor traffic management
queues, reduced productivity, delays, wastagecauses
of
long traffic WHERE
fuel
pollution and air
AN IDEAL SOLUTION Ibenefit of solution to them] An effective A
detect the number of vehicles on road and thus solution that will WHY
the sequence of traffic lights. compute/control
Model Lifecycle | 147
Unsolved Questions
A. Fill in the blanks.
is the process through which several models based on graphical data can be constructed
even tested for advantages and disadvantages.
We can use the to assist us in identifying the important factors associated with the probles
Two sources of authentic data are and
4
All relevant subsets of training data should be included in the
5 The block in 4W Problem Canvas refers to the
stakeholders.
B. State whether the following
statements are true or false.
1 The model is evaluated usingTesting Data and
the model's efficiency is assessed.
2
During the data exploration stage, you must assess the
3
various Al development platforms.
Data Acquisition stage is also called
4
'Exploratory Data Analysis'.
The data collection and data
exploration stages consume the most time.
5 If we need to create an AI
project, the AI model cycle offers us a
help quide us towards our aim. suitable structure that can
C.
Short answer type questions.
1
Describe the purpose of the following steps of
the Al model cycle:
Data Exploration
b. Modelling
2
What do you understand by the
term
3
Why is evaluation of an AI 'Deployment'?
model important? Explain.
4
What is Problem Scoping in Al
5
Create a 4W Project Canvas for
model cycle? Explain with an
the example.
The following:
COVID-19 outbreak has
presented significant concerns to
communities worldwide. A quick, public health,
in the fight
against COVID-19. dependable, widely available, and economical governments, and medical
Computer vision models are now
COVID-Net, developed
chest radiography
by Darwin Al in
Canada, is most assisting in the diagnostic approach is
rapid diagnosis of critical
pictures. For COVD-19 widely used COVID-19.
percent accuracy. diagnosis, the COVID-Netfor detecting COVID-19 instances using
computer vision model obtained 92.4
Ai In Life
"f you fail to plan, you plan to fail " All of us Life Skills & Values
and share it with your class. have heard this
statement at least
once in our life.
Prepare a speech
One ofthe
most important part of any problemsolving process is to analyse data. But, is that step really necessary
and share with your class.
Prepare a speech
SubjectEnrichment
FA Lab
Cycle | Life
Scan the ORcode or visit the following link to watch the video: Data Science Life
Simplilearn
Cvcle Of AData Science Project| Data Science Tutorial |
https//www.youtube.com/watch?v=4Cp6PkBKqX4&t=14s
Then do the following task:
System for your Organization.
Youhave been asked to develop a Smart Employee Management
do the foliowing for developing this system -
1.
Set Goals
2.
Identify the Stakeholders
3. Identify the existing measures
4.
Identify the ethical concerns
5.
Identify the data needs
6.
Identify the data sources
Visualise mock data
7.
Answers 10. b
8. C 9. d
6. d 7. a
5. a 19. d 20. a
AI Quiz 3. C
4. d 16. a 17. b 18. c
A. 1. c 2. b 15. c
13. c 14. d
11. d 12. a 5. b
4. C
2. b 3. d Vi. C
B. i. 1. a V. a
iv. b
ii. C iii. C
4. 4Ws Problem Canvas 5. ExploratoryData Analysis
3. accuacy
Exercise 2. Model deterioration 4. True 5. True
3.False
A. 1. testing
2. True 5. d
B 1. False 4. a
3. b Model Lifecycle 149
2. C
C. 1. e