Libraries Used Flashcards

1
Q

matplotlib.pyplot as plt

A

Used for creating visualizations in Python, like graphs and charts. I used it to plot training and validation accuracy and loss over the epochs. It also helped me visualize predictions and the confusion matrix. This helps to understand the model’s performance in a clear way.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

numpy as np

A

numpy is a library for numerical calculations, particularly working with arrays. I used numpy to process input images. EX. I converted image files to numpy arrays and increased their dimensions for processing. This helps it be compatible with my ML framework, tensorflow (and regular Python lists aren’t compatible)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

tensorflow as tf

A

TensorFlow is a machine learning framework for building and training deep learning models. It supports Keras, a Python neural network library. I used it to define and train the neural network, tf.Sequential, load the trained EfficientNetB2 model for transfer learning. Preprocessing images and manage datasets with TensorFlow utilities and evaluate the model. Also handle predictions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

from tensorflow.kwras, import Sequential, layers

A

Provide utilities for defining neural network architectures and adding layers to the model. The Sequential API was used to define the model step by step and add lagers like Dense, Dropout, and GlobalAverafePooling2D to customize the final architecture for classification

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Dense, Dropout, and GlobalAveragePooling2D

A

Building blocks for creating the deep learning models. These layers are important and are the main components of my model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

GlobalAveragePooling2D

A

It reduces the spatial dimensions of the features Maps. It specifically calculates the average of the inputs height and width dimensions. 1. Takes an input with specified number of dimensions, downsample the input by merging small clusters of features into larger ones and, calculates average values of each feature map, returns the average value as output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Dense Layer

A

A fully connected layer with its preceding layer. So basically, the preceeding layer outputs a matrix. It changes the dimension of the vectors by using every neuron.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Dropout

A

Reduces overfitting by randomly dropping neurons during training. It helps prevent the network from becoming too dependent on certain nodes. It encourages the network to learn generalized features.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

From tensorflow.kwras.applications.efficientnet import EfficientNetB2

A

EfficientNetB2 - a pretrained CNN (convolutional neural network made for performance and efficiency.

EfficientNetB2 - It’s good because I can leverage its transfer learning and use its pre-trained weights on ImageNet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

from tensorflow.keras.applications.efficientnet import preprocess_input

A

A utility to normalize images. It is made to normalize and match the EfficientNet’s pre-trained model expectations
It ensures the images’ pixel values are scaled correctly [-1, 1] from the standard RGB format

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Confusion Matrix

A

Matrix that visualize how well a model classifies things. It helps identify which classes are being misclassified.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Classification Report - Precision

A

Tells you how many of the predicted instances of positives were actually correct. High precision means the model avoids false positives

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Classification Report - Recall

A

Measures how many of the actual positives are correctly predicted (amount). High recall indicates the model avoids false negatives

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

F-1 score

A

The mean of Precision and recall. It includes both of them in one measure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Support

A

Tells you how many samples from each class were evaluated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Macro average

A

Mean of metrics across all classes

17
Q

Weighted average

A

Mean weighted by the number of instances in each class. Unlike the macro average, which doesn’t take the number of instances into account.

18
Q

Early Stopping

A

A callback that stops training when the validation loss stops improving. It helps prevent overfitting and saves time by stopping the training when the model performance doesn’t improve.

19
Q

Path (from pathlib)

A

Utility yo define and manage my paths in a very clear way. The path function helps to create a path here for the testing, training, and validation directories

20
Q

From PIL (Python Imaging Library) import Image

A

Use PIL to open and preprocess the test images in the preprocess_image function. This makes sure the images are resized and converted into arrays for predictions.

21
Q

Import random

A

A module used to generate random numbers or sample items randomly. I used it to randomly select images from the test datadet for visualizations. This helps showcase the model’s predictions in an unbiased way.