Understand AI and ML Basics
I’m going to learn about AI and ML attacks and defense strategies. These are the stories that I have to talk about my journey in this…
I’m going to learn about AI and ML attacks and defense strategies. These are the stories that I have to talk about my journey in this pathway.
AI
This is a field of computer science that involves techniques and approaches to creating intelligent machines and applications that can perform tasks with intelligence normally associated with humans.
Includes
- understanding natural languages and images
- recognizing patterns
- Solving problems and making decisions
ML is the heart / brain of the AI. AI uses ML for its intelligence.
Types of ML
- Supervised Learning — Each data sample must have a label indicating the correct outcome. Most used type. Model learns from labeled structured data, by adjusting its internal parameters based on its error when it guesses the result.
- Unsupervised Learning — Uses clustering and other techniques to understand the underlying structure of data, identify patterns and perform anomaly detection and supervised learning.
- Reinforcement Learning — relies on an agent to behave in an environment and learn by performing certain actions, observing the results and adjusting accordingly. Used in autonomous vehicles, robotics and financial trading.
Steps that ML follows
- Data Collection
- Data pre-processing — make data processable by ML, ML only accept vectors/arrays of numerical data.
- Algorithm Selection
- Model Training
- Model Testing and Evaluation
- Model Optimization
- Deployment and Updating
While development take place in data science environments, machine learning operations (MLOps) involves adapting DevOps and data engineering to streamline and automate the ML life cycle.
Key algorithms in ML
Supervised Learning
- Linear regression — predicts a continuous output variable based on input features. Used in economics for forecasting and healthcare.
- Logistic regression — algorithm for binary classification problems and estimate the probability. Used in credit scoring and medical testing.
- Decision tree — Learns simple decision rules inferred from data features. Useful in business decision-making and customer segmentation.
- Random forest — Use multiple decision trees to prevent overfitting.
Overfitting — Undesirable ML behavior that occurs when the ML model gives accurate predictions for training data but not for new data
- Support for vector machine (SVM) — which can model complex decision boundaries and separate them. Used in bioinformatics, image recognition, and handwrite recognition for both regression and classification.
Unsupervised Learning
- K-means clustering (popular) — Uses feature similarity to find groups. Commonly used in market and image segmentation.
- Principal component analysis (PCA) — Reduces the number of input variables while retaining as much of the critical information as possible. Often find the term dimensionality reduction used in PCA because input variables or features define dimensions.
- Reinforcement Learning
- Q-Learning — An agent learns to perform action to maximize the cumulative reward it receives in a particular environment. Deep Q networks is and extension that uses neural networks.
Neural networks are a family of algorithms that can use supervised, unsupervised, or reinforcement learning.
Neural Networks and Deep Learning
Inspired by human brain biology.
Artificial Neural networks are good at processing unstructured data such as images, audio, text.
Primary blocks of ANNs
- Neurons and layers — ANNs apply parallel processing by using nodes called neurons. Neurons are organized in layers and typically there is an initial input and final output layer, and layers in between called hidden layers. Actual computation take place in these hidden layers. Inputs to each layer are derived from the outputs of the previous layer.
- Training and Weights update — In training ANN it involves adjusting weights and biases of neurons based on error. This process called backpropagation. backpropagation calculates gradients of the loss or error concerning the weights for the specific inputs and iterates using the optimization technique to update the weights and iterates to reduce the error.
- Deep Learning — Use of multiple hidden layers to enable ANNs to learn more complex features.
Ex = In image recognition while the initial layers may only learn local edge patterns, deeper layers can combine these edges to learn larger patters.
These architectures need large datasets and huge amount of computational power to perform their calculation in one step. Their operations are matrix calculations and Graphical Processing units (GPUs) are well suited for their parallel execution. In NVIDIA cards they have Compute Unified Device Architecture (CUDA) and this parallel computing API becoming a standard in accelerating the time we need to develop deep neural networks.
Different Neural network architectures
- CNNs — Mainly in image processing
- RNNs — Language modeling and speech recognition
- Transformers (BERT, GPT) — Go-model for various NLP tasks, (question answering, sentiment analysis). Unlike Bert, GPT is unidirectional, using an auto aggressive approach to predict each word in a sentence based on the words came before it.
Some of AI designed for generate content, including image, text and there are other types of AI called Generative adversarial networks (GANs) which are famous for their use in deepfake technology.