issues
search
e-shen2022
/
APCS_Blog
Apache License 2.0
0
stars
10
forks
source link
Backend Progress
#48
Open
e-shen2022
opened
1 year ago
e-shen2022
commented
1 year ago
Read comments for line by line explanations
Import Packages
Numpy to save image data in arrays
Tensorflow and keras to create and train model
Train data
Resize image input to fit dimensions for NN training
Specify number of images per batch, and how many batches model will train
Converts images to grayscale
Creating the CNN model
Sequential model where layers increase in complexity of what pattern can recognize
Adds convolutional layers to detect local patterns
Add pooling layers to downsample data to look at small areas of image
Dropout layer to regularize data and prevent overfitting
Flatten layer to reshape to 1D array to prepare for connecting all layers
Dense layer to connect all layers, last layer specifies 7 neurons which is 7 different possible emotion outputs
Compiling the model for training
Prepare model for training by defining how it will measure loss, update its weights, and evaluate its prediction performance
Save learned parameters in model.h5 for graphical user interface
Read comments for line by line explanations