Artificial  Intelligence in Food Science

AmjadChaudhary3 8 views 22 slides Oct 24, 2025
Slide 1
Slide 1 of 22
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22

About This Presentation

Artificial  Intelligence in Food Science


Slide Content

Artificial  Intelligence in Food Science Lecturer: Mr. Muhammad Amjad Raza Email: [email protected]  بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ

What is Machine Learning? Machine learning is a branch of artificial intelligence (AI) and computer science which focuses on the use of data and algorithms to imitate the way that humans learn, gradually improving its accuracy.

Applications of Machine Learning Machine learning is a buzzword for today's technology, and it is growing very rapidly day by day. We are using machine learning in our daily life even without knowing it such as Google Maps, Google assistant, Alexa, etc.

Features of Machine Learning Machine learning uses data to detect various patterns in a given dataset. It can learn from past data and improve automatically. It is a data-driven technology. Machine learning is much similar to data mining as it also deals with the huge amount of the data.

Classification of Machine Learning Supervised learning Unsupervised learning Reinforcement learning

Supervised Learning Supervised learning is the types of machine learning in which machines are trained using well "labelled" training data, and on basis of that data, machines predict the output.

Supervised Learning (continued) Classification: Classification algorithms are used when the output variable is categorical, which means there are two classes such as Yes-No, Male-Female, True-false, etc. Example: Decision Tree, K-Nearest Neighbours , Naïve Bayes. Regression: Regression algorithms are used if there is a relationship between the input variable and the output variable. It is used for the prediction of continuous variables, such as Weather forecasting, Market Trends, etc. Example: Linear Regression, Logistic Regression.

Supervised Learning in Healthcare Classification Examples (Predicting a Category): Disease Diagnosis: Training a model on patient data (symptoms, lab results, genetic markers) to predict if a patient has a specific disease like cancer, diabetes, or heart disease. The output is a category: "Disease" or "No Disease." Medical Imaging Analysis: Using a dataset of thousands of labeled X-rays to train a model that can classify new images as showing signs of pneumonia or not. Hospital Readmission Risk: Predicting whether a patient is at high, medium, or low risk of being readmitted to the hospital within 30 days based on their medical history and current condition. Regression Examples (Predicting a Continuous Value): Predicting Length of Stay: Using patient data like age, severity of illness, and type of surgery to predict the exact number of days they will likely stay in the hospital. Estimating Blood Glucose Levels: Forecasting a diabetic patient's future blood sugar levels based on their diet, insulin dosage, and physical activity.

Unsupervised Learning Unsupervised learning is a type of machine learning in which models are trained using unlabeled dataset and are allowed to act on that data without any supervision. The goal of unsupervised learning is to find the underlying structure of dataset, group that data according to similarities, and represent that dataset in a compressed format.

Unsupervised Learning in Healthcare Clustering Examples (Grouping Similar Data): Patient Segmentation: Grouping patients with similar characteristics or health conditions to identify different patient populations. This can help hospitals create personalized care plans or targeted public health programs without pre-defined categories. Discovering Genetic Patterns: Analyzing genomic data to cluster individuals with similar genetic markers. This can help researchers discover new subtypes of diseases that weren't previously known. Association Examples (Finding Relationships): Identifying Comorbidities: Analyzing patient health records to discover which diseases or symptoms frequently occur together. For example, an association rule might find that patients with diabetes often have a high risk of developing kidney disease.

Reinforcement Learning Reinforcement learning is a feedback-based learning method, in which a learning agent gets a reward for each right action and gets a penalty for each wrong action. The agent learns automatically with these feedbacks and improves its performance. In reinforcement learning, the agent interacts with the environment and explores it. The goal of an agent is to get the most reward points, and hence, it improves its performance.

Reinforcement Learning in Healthcare Dynamic Treatment Regimes (DTRs): Developing optimal treatment plans for chronic diseases like cancer or HIV. An RL agent learns the best sequence of drug dosages and timings by observing a patient's response over time. The "reward" is a positive health outcome (like tumor reduction), and the model adjusts its strategy to maximize this reward. Robotic Surgery: Training surgical robots in a simulated environment to perform complex procedures. The robot learns through trial and error, receiving rewards for precise and efficient movements, ultimately helping to improve surgical accuracy.

Essential Pre-Modeling Data Preparation

Processing, Wrangling, and Visualizing Data Data is at the center of everything around us, be it finance, supply chains, medical science, space exploration, communication, and what not. We have generated 90% of the world’s data in just the last few years and this is just the beginning. Rightly, data is being termed as the oil of the 21st Century. Everything digital has data at its core in some form or the other. Data is generated at various rates by numerous sources across the globe in numerous formats.

Data Methodologies Data collection: To understand different data retrieval mechanisms for different data types Data description: To understand various attributes and properties of the data collected Data wrangling : To prepare data for consumption in the modeling steps Data visualization: To visualize different attributes for sharing results, better understanding, and so on

Data Collection Data collection is where it all begins. Data collection takes a formal and better form once the problem statement is defined, and the project gets underway. Data must be present in different formats, shapes, and sizes. Its omnipresence/ ubiqouity also means that it exists in systems such as legacy machines (say mainframes), web (say web sites and web applications), databases, flat files, sensors, mobile devices, and so on. Data Formats JSON CSV XML SQL Web

Dataset Numeric : This is simplest of the data types available. It is also the type that is directly usable and understood by most algorithms. Numeric data represents scalar information about entities being observed. Text: Data comprising of unstructured, alphanumeric content is one of most common data types. Textual data when representing human language content contains implicit grammatical structure and meaning. This type of data requires additional care and effort for transformation and understanding. Categorical : This data type stands in between the numeric and text. Categorical variables refer to categories of entities being observed. For instance, hair color being black, brown, blonde and red or economic status as low, medium, or high. The values may be represented as numeric or alphanumeric.

Data Wrangling Data wrangling or data munging is the process of cleaning, transforming, and mapping data from one form to another to utilize it for tasks such as analytics, summarization, reporting, visualization, and so on. Data Scientists end up spending 80% of their time in data processing and wrangling Let’s now begin our wrangling/munging process and understand various methods/tricks to clean, transform, and map our dataset to bring it into a useable form. The first and the foremost step usually is to get a quick peak into the number of records/rows, the number of columns/attributes, column/attribute names, and their data types. The following snippet provides the details on row counts, attribute counts, and details. print("Number of rows::", df.shape [0]) print("Number of columns::", df.shape [1] ) print("Column Names::", df.columns.values.tolist ()) print("Column Data Types::\n", df.dtypes )

Filtering Data Filtering is a sort of cleaning the dataset. Cleaning a dataset involves tasks such as removing/handling incorrect or missing data, handling outliers, and so on. 3 Cleaning also involves standardizing attribute column names to make them more readable, intuitive, and conforming to certain standards for everyone involved to understand.

Typecasting Typecasting or converting data into appropriate data types, is an important part of cleanup and wrangling in general. Different platforms and systems handle each data type differently and thus getting the right data type is important.

Data Visualization Once you’ve got yourself a nice cleaned dataset, the next step is Exploratory Data Analysis (EDA). EDA is the process of figuring out what the data can tell us, and we use EDA to find patterns, relationships, or anomalies to inform our subsequent analysis. While there are an almost overwhelming number of methods to use in EDA, one of the most effective starting tools is the pairs plot (also called a scatterplot matrix). A pairs plot allows us to see both distribution of single variables and relationships between two variables. Pair plots are a great method to identify trends for follow-up analysis and, fortunately, are easily implemented in Python

Different types of analysis There are different types of analysis as mentioned below. Univariate : In univariate analysis we will be using a single feature to analyze almost of its properties. Bivariate : When we compare the data between exactly 2 features then it is called bivariate analysis. Multivariate: Comparing more than 2 variables is called as Multivariate analysis. The below are the list of plot. Scatter plot Pair plot Box plot Violin plot Distribution plot Joint plot Bar chart Line plot
Tags