IDENTIFY BUSSINESS
PROBLEM
Model istrained on a dataset to recognize patterns,make predictions,or to
take actions without being explicity programmed to perform a task.
WHAT IS MODEL?
HOW MODEL IS PREPARED?
COLLECT REVELANT
DATA
PREPARE DATA BUILD DATA
TEST DATA
DEPLOY
GOVERN
3.
Identify Bussiness Problem: First step of your model development, define the business problem you are looking to
solve.
collect the Data : Machine learning models are only as accurate as the data fed to them, it becomes crucial to identify
the right data to ensure model accuracy and relevance.
Prepare the Data : Data preparation depends on what kind of data you need. The data collected in the previous
step need not be in the same form, the same quality, or the same quantity as required. ML engineers spend a
significant amount of time cleaning the data and transforming it into the required format.
Build the Data : In this stage, ML engineers choose important features, pick the right algorithm, and train the
model. They test and improve it by adjusting settings until it works well.
Test the Data : In this step, the model is tested with different data sets to ensure it works well in the real world. If it
performs poorly, improvements like better data, a different algorithm, or more training are needed.
Deployment : In this step, the model is checked against business goals and key metrics. If it meets the
requirements, it is deployed, and its performance is continuously monitored and improved over time.
Model governance : Model adapts to changes in data, technology, or business needs without losing accuracy.
Continuous monitoring and updates help maintain reliable performance over time.
4.
SUPERVISED LEARNING:
DEFINATION: Themodel learns from labeled data, where the input and desired output are provided.
ADVANTAGES: Accurate predictions, easy to understand and implement.
DISADVANTAGES: Requires labeled data, can be biased if data is not representative.
Example:
Predicting customer churn (whether a
customer will leave a service) based on
demographics, usage patterns, and past
interactions. The training data includes
information about customers who churned
and those who didn't.
TYPES OF MODELS
5.
UNSUPERVISED LEARNING:
DEFINATION: Themodel learns from unlabeled data, identifying patterns and structures without
explicit guidance..
ADVANTAGES: Can discover hidden patterns, useful for data exploration and clustering.
DISADVANTAGES: Results can be subjective, requires careful interpretation.
Example: Segmenting customers into different groups
based on their purchasing history. The model identifies
groups of customers with similar buying habits without
knowing their demographics or other information.
6.
Reinforcement LEARNING:
DEFINATION: Themodel learns through trial and error, receiving rewards or penalties for its
actions.
ADVANTAGES: Can learn complex tasks, adapts to changing environments.
DISADVANTAGES: Requires a well-defined environment, can be computationally expensive.
Example: Training a game-playing AI.
The AI plays the game repeatedly, learning
which actions lead to winning (rewards) and
which lead to losing (penalties), eventually
becoming proficient at the game.
7.
DEEP LEARNING:
DEFINATION: Asubset of machine learning that uses artificial neural networks with multiple layers
to extract higher-level features from data.
ADVANTAGES: Can learn complex patterns, achieves high accuracy in various tasks.
DISADVANTAGES: Requires large amounts of data, can be computationally expensive and difficult
to interpret.
Example: Natural Language Processing
(NLP) tasks like machine translation. Deep
learning models can translate text from one
language to another with high accuracy,
learning the complex relationships between
words and phrases.
8.
NLP(NATURAL LANGUAGE PREPROCESSING):
DEFINATION:Focuses on enabling computers to understand and process human language.
ADVANTAGES: Enables chatbots, language translation, sentiment analysis, and more.
DISADVANTAGES: Can be challenging to handle
nuances in language, requires large datasets.
Example: Building a chatbot that can understand
and respond to customer inquiries. The NLP model
must understand the meaning behind the customer's
questions to provide relevant answers.
9.
COMPUTER VISION MODELS
DEFINATION:Focuses on enabling computers to "see" and interpret images and videos.
ADVANTAGES: Enables object detection, image recognition, and other vision-related tasks.
DISADVANTAGES: Requires large datasets, can be
computationally expensive.
Example: Medical image analysis.
Computer vision models can analyze medical images
(X-rays, MRIs) to detect anomalies and
assist doctors in diagnosis.
10.
FINE-TUNED MODELS
Fine-tuning isthe process of adapting a pre-trained AI model to perform
better on a specific task or dataset. Instead of training a model from scratch,
fine-tuning refines an existing model by exposing it to specialized data.
Key Features of Fine-tuned models:
• Pre-Trained Base Model – Starts with a general AI model trained on vast data.
• Task-Specific Training – Further trains on domain-specific data (e.g., medical,
legal, customer service).
• Better Performance – Improves accuracy, relevance, and efficiency for specialized
tasks.
• Reduces Training Time & Cost – Uses less computational power than training from
scratch.
• Customization & Adaptability – Allows companies to create AI tailored to
their needs.
11.
LLM (LARGE LANGUAGEMODELS)
Large Language Models (LLMs) are AI models trained on massive amounts of text
data to understand, generate, and process human-like language. They use deep
learning techniques, primarily transformers, to predict and generate text, answer
questions, translate languages, and even write code.
Key Features of LLMs:
• Natural Language Understanding (NLU) – Understands and interprets text like a human.
• Text Generation – Generates coherent, context-aware responses.
• Context Retention – Remembers past interactions in conversations.
• Multilingual Support – Works in multiple languages.
• Code Generation & Debugging – Assists in writing and fixing code.
12.
MODEL TYPE COMMONMETRICS EVALUATION TECHNIQUES CONSIDERATIONS
Classification
Accuracy, Precision, Recall,
F1-score, AUC-ROC,
Confusion Matrix
Hold-out validation, Cross-
validation, Stratified k-fold
(for imbalanced datasets)
Class imbalance, Cost of
misclassification (e.g., false
positives vs. false negatives),
Bias in data
Regression
Mean Squared Error (MSE),
Root Mean Squared Error
(RMSE), R-squared, Mean
Absolute Error (MAE)
Hold-out validation, Cross-
validation
Outliers in data, Non-linear
relationships between features
and target
NLP (e.g., Text
Classification,
Sentiment
Analysis)
Accuracy, Precision, Recall, F1-
score, Perplexity (for language
models), BLEU/ROUGE (for
machine translation
/summarization)
Hold-out validation, Cross-
validation, Specific NLP
evaluation datasets
Handling nuances of language,
Contextual understanding
HOW TO MEASURE THE PERFORMANCE OF AI MODELS?
13.
MODEL TYPE COMMONMETRICS EVALUATION TECHNIQUES CONSIDERATIONS
Computer
Vision (e.g.,
Image
Classification,
Object
Detection)
Accuracy, Precision,
Recall, F1-score,
Intersection over Union
(IoU), Mean Average
Precision (mAP)
Hold-out validation,
Cross-validation, Image-
specific evaluation
datasets
Data augmentation,
Computational cost of
processing images/videos
Reinforcement
Learning
Cumulative reward,
Average reward per
episode, Success rate
Simulation
environments, Real-
world testing (if feasible)
Defining appropriate reward
functions, Exploration-
exploitation trade-off
Generative Models
(e.g., GANs, VAEs)
Inception Score (IS),
Fréchet Inception
Distance (FID), Visual
inspection of generated
samples
No single universally
accepted metric, often
involves human
evaluation
Evaluating the quality and
diversity of generated content
14.
Healthcare Applications:
✔ DiseaseDiagnosis (AI-based medical imaging, early disease detection)
✔ Drug Discovery (AI-assisted research for new medicines)
✔ Patient Monitoring (Wearable health trackers, AI chatbots for health advice)
🛠 AI Techniques Used:
✔ Deep Learning (CNNs, RNNs) – Image & speech processing
✔ Natural Language Processing (NLP) – AI chatbots for healthcare
✔ Reinforcement Learning – Drug discovery & simulations
Indian Tools:
• Niramai (AI for breast cancer detection)
• Qure.ai (AI-powered radiology diagnosis)
• Sigtuple (AI for blood and urine analysis)
Global Tools:
• IBM Watson Health (AI-driven medical
insights)
• Google DeepMind (AI for drug discovery)
• PathAI (AI-powered pathology diagnosis)
APPLICATIONS OF AI
15.
Finance & Banking:
Applications:
✔Fraud Detection (AI for cybersecurity & transaction monitoring)
✔ Credit Scoring & Risk Assessment (AI-driven loan approvals)
✔ Automated Trading & Robo-Advisors
🛠 AI Techniques Used:
✔Machine Learning (Decision Trees, Random Forests) – Credit risk analysis
✔ Anomaly Detection – Fraud detection
✔ Reinforcement Learning – AI trading bots
Indian Tools:
• ZestMoney (AI-based credit scoring)
• Razorpay AI (Fraud detection & payment
automation)
• Bank AI Chatbots (HDFC's EVA, SBI’s SIA)
Global Tools:
• FICO AI (Credit risk analysis)
• KAI Banking (Kasisto) (Conversational AI for
banking)
• Darktrace (AI-driven fraud detection)
16.
Retail & E-Commerce
️🛍️
✔ Personalized Shopping (AI recommendations, virtual assistants)
✔ Inventory Management (AI-powered stock prediction)
✔ Chatbots for Customer Support
🛠 AI Techniques Used:
✔ Collaborative Filtering & Deep Learning – Personalized recommendations
✔ Predictive Analytics – Demand forecasting
✔ Computer Vision – Smart checkout (Amazon Go)
Indian Tools:
• Flipkart AI (Personalized product
recommendations)
• Haptik AI (AI chatbot for customer service)
• GoFrugal (AI-driven inventory management)
Global Tools:
• Amazon Personalize (AI for product
recommendations)
• Shopify AI (Smart e-commerce automation)
• Salesforce Einstein AI (AI-powered customer
insights)
17.
Education 🎓
✔ AITutors & Learning Assistants (Smart learning platforms)
✔ Automated Grading & Student Analytics
✔ Personalized Learning Paths
🛠 AI Techniques Used:
✔ Natural Language Processing (NLP) – AI-based tutoring
✔ Reinforcement Learning – Adaptive learning systems
✔ Sentiment Analysis – AI-powered student feedback
Indian Tools:
• Byju’s AI (Adaptive learning
platform)
• Vedantu AI (AI-based live tutoring)
• iNeuron.ai (AI-driven tech
Global Tools:
• Google Read Along (AI for language
learning)
• Carnegie Learning (AI-powered
personalized
18.
Agriculture 🌾:
✔ CropMonitoring & Yield Prediction
✔ AI for Soil & Weather Analysis
✔ Automated Farming (Drones, Robotics)
🛠 AI Techniques Used:
✔ Computer Vision & Drones – Crop monitoring
✔ Geospatial Analysis – Predicting soil health
✔ Machine Learning Regression Models – Yield prediction
Indian Tools:
• Fasal AI (AI-driven precision farming)
• CropIn (AI-powered farm management)
• AgNext (AI for quality assessment of
crops)
Global Tools:
• John Deere AI (Automated AI-powered tractors)
• Taranis (AI for pest and disease detection)
• Blue River Technology (AI-powered crop
spraying)
19.
Transportation & Automotive🚗
✔ Autonomous Vehicles & Self-Driving Tech
✔ AI-powered Traffic Management & Route Optimization
✔ Fleet Management & Logistics AI
🛠 AI Techniques Used:
✔ Reinforcement Learning – Self-driving car models
✔ Lidar & Computer Vision – Object detection in roads
✔ AI-powered Route Optimization – Traffic prediction
Indian Tools:
• Ola AI (AI for ride optimization)
• LogiNext AI (AI-based logistics tracking)
• Ather Energy AI (AI-powered smart electric
vehicles)
Global Tools:
• Tesla Autopilot (AI for self-driving cars)
• Waymo AI (Autonomous vehicle technology)
• Uber AI (Ride optimization & demand
prediction)
20.
Government & SmartCities
️ 🏙️
✔ AI-powered Surveillance & Public Safety
✔ Smart Traffic & Infrastructure Planning
✔ Automated Citizen Services & Governance
🛠 AI Techniques Used:
✔ Computer Vision – Surveillance & traffic management
✔ Facial Recognition – Identity verification
✔ AI-based Simulation Models – Smart city planning
Indian Tools:
• Aadhaar AI (AI-driven identity verification)
• Crime Mapping AI (AI for predictive policing)
• Bhashini AI (AI-powered language translation
for governance)
Global Tools:
• Palantir AI (AI for government intelligence)
• Clearview AI (Facial recognition for law
enforcement)
• Alibaba City Brain (AI for smart city traffic
management)
21.
Open-source AI modelscome with powerful capabilities, but they also pose security
risks that must be addressed.
Major Security Risks:
• Adversarial Attacks – Malicious inputs can fool AI models (e.g., altering
images to trick facial recognition).
• Data Poisoning – Attackers inject biased or harmful data to manipulate AI
outputs.
• Model Inversion Attacks – Hackers can extract sensitive training data from AI
models.
• Backdoor Attacks – Attackers implant hidden instructions, making the model
behave maliciously under certain triggers.
• Bias & Ethical Concerns – Open models can inherit biases, leading to unfair
decisions.
⚠️SECURITY RISKS IN OPEN SOURCE AI MODELS
22.
To mitigate securityrisks, developers and organizations must implement robust
safety measures:
• Adversarial Defense Techniques – Use robust training methods like adversarial
training to prevent manipulation.
• Secure & Trusted Data Sources – Ensure only high-quality, verified datasets are
used.
• Model Encryption & Access Controls – Protect AI models using encryption and
strict access policies.
• Regular Security Audits & Red Teaming – Conduct ethical hacking tests to find
vulnerabilities.
• Bias & Fairness Audits – Implement fairness checks to reduce AI biases.
• Explainability & Transparency – Use interpretable AI techniques to track and
understand decisions.
️
🛡️SAFETY MEASURES FOR SECURE AI MODELS
DOCUMENTATION(DOCS)
Library Main Use
Transformers------------------>Load pre-trained models
Datasets-------------------------> Load & process datasets
Tokenizers-----------------------> Tokenize text for NLP models
Accelerate------------------------->Multi-GPU training
Diffusers---------------------------> Text-to-image generation
PEFT---------------------------> Efficient fine-tuning
Evaluate---------------------> Model evaluation
Hugging Face Hub-------->Store & share ML models
Inference Endpoints-------> Deploy APIs
Optimum----------------------->Model optimization
Spaces----------------------->Deploy AI demos
TGI---------------------------> Optimize text generation
31.
TRANSFORMERS
✅ Usage:
• Loadpre-trained NLP models (e.g., BERT, GPT, T5)
• Perform tasks like text classification, summarization, translation, etc.
Example: Text Generation using GPT-2
from transformers import pipeline
# Load GPT-2 model
generator = pipeline("text-generation", model="gpt2")
# Generate text
result = generator("Once upon a time", max_length=30)
print(result)
output:- [{'generated_text': 'Once upon a time, in a faraway land, there was a little girl who
loved to explore the woods.'}]
33.
Datasets
✅ Usage:
• Loadand preprocess large NLP datasets
• Supports PyTorch, TensorFlow, and JAX
Example: Load a dataset
from datasets import load_dataset
# Load the IMDb movie reviews dataset
dataset = load_dataset("imdb")
# Print an example
print(dataset["train"][0])
output :- {'text': 'This movie was amazing! ...', 'label': 1}
34.
Tokenizers
✅ Usage:
• Efficienttokenization for text
• Works with Transformer models
Example: Tokenize text with BERT
from transformers import AutoTokenizer
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Tokenize text
tokens = tokenizer("Hello, how are you?", padding=True, truncation=True)
print(tokens)
output:- {'input_ids': [101, 7592, 1010, 2129, 2024, 2017, 102], 'attention_mask': [1, 1, 1, 1, 1, 1,
1]}
35.
Accelerate
✅ Uses:
Simplifies multi-GPUand multi-device training.
Enables efficient distributed training.
Works with deep learning frameworks like PyTorch.
from accelerate import Accelerator # Initialize accelerator
accelerator = Accelerator()
# Use the accelerator in training
model, optimizer, data_loader = accelerator.prepare(model, optimizer,
data_loader)
36.
Diffusers
✅ Uses:
• Providespre-trained models for diffusion-based generative AI (e.g., Stable Diffusion).
• Used for text-to-image, image-to-image, and video generation.
• Supports fine-tuning of generative models.
from diffusers import StableDiffusionPipeline # Load pre-trained Stable Diffusion
model
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
# Generate an image from text
image = pipe("A fantasy landscape with castles and dragons").images[0] # Save image
image.save("generated_image.png")
37.
PEFT(ParameterEfficientFine-Tuning)
✅ Uses:
Efficient fine-tuningof large language models.
Reduces memory and computational cost.
Supports LoRA, Adapter, and other efficient training methods.
from peft import LoraConfig
# Define LoRA configuration
config = LoraConfig(r=16, lora_alpha=32, lora_dropout=0.05)
38.
Evaluate
✅ Uses:
Provides metricsfor evaluating NLP models. Includes accuracy,
BLEU, ROUGE, perplexity, etc.
Supports easy integration with datasets and transformers.
import evaluate
# Load accuracy metric
accuracy = evaluate.load("accuracy") # Compute accuracy
result = accuracy.compute(references=[1, 0, 1], predictions=[1, 0, 0])
print(result)
Output = {'accuracy': 0.666}
39.
TextGenerationInference
✅ Uses:
Optimized inferencefor large-scale text generation models.
Supports OpenAI's GPT-style models.
Provides fast inference with quantization and optimizations.
Example:ServeaGPTModelwithTG
text-generation-launcher--model-idbigscience/bloom
40.
HuggingFaceHub
✅Uses:
Centralized repository forML models, datasets, and applications.
Allows sharing and collaboration.
Provides model versioning and storage.
from huggingface_hub import HfApi
api = HfApi()
api.create_repo("my-new-model")
EXAMPLE :
41.
InferenceEndpoints
✅Uses:
Deploys ML modelsas API endpoints. Supports scalable cloud-based inference.
Allows low-latency predictions.
import requests
API_URL = "https://api-inference.huggingface.co/models/facebook/bart-large-cnn"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.post(API_URL, json={"inputs": "Hugging Face is an AI company
that creates NLP tools."})
print(response.json())
42.
Optimum
✅ Uses:
Optimizes deeplearning models for hardware like GPUs, TPUs, and
specialized AI chips.
Works with ONNX, TensorRT, and OpenVINO for better efficiency.
Reduces inference time and energy consumption.
from optimum.onnxruntime import ORTModelForSequenceClassification #
Load optimized model
model = ORTModelForSequenceClassification.from_pretrained("bert-base-
uncased")
TGI(TextGenerationInference)
✅ Uses:
High-performance inferencefor large text generation
models. Optimized for deployment in production.
Works with Hugging Face models like GPT, LLaMA, and
BLOOM.
Example: Serve a GPT Model with TG
text-generation-launcher --model-id bigscience/bloom
45.
HubLibraries
✅ Uses:
• Listsall official and community-supported Hugging Face
libraries. Includes transformers, datasets, diffusers, and
more.