Slide 7 source links:
1. Diagram
2. Diagrams
3. Book
Slide 25:
1. GitHub
2. Blog
3. Flowcharts
Digital Takeaway:
Image Classification with HPCC GNN on Cloud
Summer 2021
New JIRA Tickets I opened:
I created to summarize the findings of my internship regarding steps to process and classify images with HPCC GNN. In the future, anyone wishing to use their own images to train the GNN model can refer to this.
With the MobileNetV2 model, 224x224x3 images, and 5 epochs, I ran various number of thor slaves with default CPU and memory to evaluate differences in accuracy and timing.
# of Thor Slaves (with default CPU and Memory) | End Time (Total Cluster Time) |
1 | *error-terminated |
2 | *error-terminated |
4 (default # of thor slaves) | 28:12 Second trial: 28:13 |
8 | Failed Second trial: Failed Third trial: still failed Reason why it failed the third time: not enough memory Reason why it failed the first 2 times: the gnncarina resource group on Azure must be set to selected networks, so each time I create a new aks cluster, I must add the network |
Since only 4 thor slaves were compatible under default settings, I manually changed the CPU to 8 and the memory to 16G.
It is expected that more thor slaves = shorter running time
# of Thor Slaves (with 8 CPU and 16G Memory) | End Time (Total Cluster Time) |
1 | 1:38:12 |
2 | 48:10 ^^ 1 vs 2 epochs |
As I continued working with the HPCC GNN model, I began creating a README.md file to document the steps so that later on, I could turn it into “instructions” for someone to recreate my project.
So far, the README.md file outlines how to setup Kubernetes, use AKS created by others, complete the Azure storage setup, create the storage account and shares, deploy HPCC, spray data, and change the number of thor slaves.
Dataset size: 4839 images
I changed the model name in Jupyter Notebook to popular image classification models.
List of models: https://keras.io/api/applications/
MobileNetV2
InceptionResNetV2
So, I tested a different link for the same model and it worked
NASNetMobile
EfficientNet_V2
bit
Ultimately, the MobileNet V2 model I originally used was the most time-efficient at 37 to 48 seconds for each epoch. All of the models reached 100% accuracy on the first epoch.
JIRA: HPCC-26359
Create storage account secret error on Mac
After trying to run the create-secret.sh file with the command ./create-secret.sh, an error came up saying “exactly one NAME is required, got 2”.
JIRA: ML-496
While experimenting with different models to see how changing the model affects the accuracy/time taken, I got this error message for all of the EfficientNet models: “TypeError: ‘numpy.float64’ object cannot be interpreted as an integer.”
Following Lili and Roger’s advice, I changed the code from UNSIGNED1 (which is 1 byte) to UNSIGNED4 (4 bytes). Previously, the maximum was 255 images before the model wouldn’t run anymore. Today, I tested 256 images and it successfully worked.
The next step was to spray all 4,000+ images and run the model with the complete dataset.
With 4,839 images and 4 thor slaves, the model took 1 hour and 13 minutes to run 20 epochs, reaching 100% accuracy on the student images after 2 epochs. When I tested 5 epochs, the training used 31 minutes and 22 seconds. Next week, I will keep retraining the model to see if/how much the speed increases when continuously processing the same images.
This was a huge step for this internship project and the HPCC GNN model as it can now process exponentially more images for multiple purposes.
The main priority this week has been communicating with other LexisNexis employees to fix the GNN Model 255 images constraint. As of right now, we are examining issues in the code itself rather than Azure/the cloud. While working on that, I have also been testing different models (besides the TensorFlow Transfer Learning one) to see what changes it will reflect on the accuracy percentages. Overall, the TensorFlow Models run smoothly on Jupyter Notebook with consistently high accuracy rates.
With the GNN HPCC Model image count limitation, I would only be able to train 255 out of close to 5,000 student/non-student images. Even with this limitation, I will still be able to bring it past the “proof of concept” stage by running the full dataset successfully on Jupyter Notebook using the Transfer Learning Model. However, ideally, the HPCC model will be processing the images on the cloud. Fixing the 255 image limitation will open the doors for more practical applications of the HPCC GNN model in the future even beyond the scope of my internship project, which makes it a top priority for this week.
Based on the TensorFlow Transfer Learning Model, I created a condensed version that is shorter, but fits the same purpose.
Since the first time I used this model, the accuracy has always reached 100% after the first epoch. I was curious as to what would happen if I added a new image with a different background to see if it would lower the accuracy, but it didn’t change.
Then, I ran the condensed model with animal images first, then the student images so that it “retrains” the model. The animal images were processed more quickly (since there are significantly fewer images), and the accuracy took 3 epochs to reach 100%. After this, I tested my student images again but it still reached 100% accuracy after 41 seconds in the first epoch.