GroceryNet
Moloti Nakampe
Unknown
GroceryNet at the Edge ...learn more
Project status: Under Development
HPC, Internet of Things, Artificial Intelligence
Intel Technologies
Intel Opt ML/DL Framework,
Movidius NCS,
Intel CPU
Overview / Usage
Introduction According to World Health Organization, “Africa’s health depends on improved nutrition a profound shift from communicable to noncommunicable diseases (NCDs) is under way in many parts of the African Region. Globally, NCDs are estimated to kill 38 million people each year and they threaten progress towards the UN Millennium Development Goals and influence the post-2015 development agenda. The four main types of NCDs are cardiovascular diseases (like heart attacks and stroke), cancers, chronic respiratory diseases (such as chronic obstructed pulmonary disease and asthma) and diabetes.” Automatic food recognition is emerging as an important topic due to the increasing demand for better dietary and nutritional assessment tools. We propose the use of GroceryNet as an assessment tool for grocery detection, in order to speed up the process of analyzing diet and nutrition. Real-time grocery detection using GroceryNet. GroceryNet is a fine tuned CaffeNet model, which is a replication of AlexNet. CaffeNet has a slight computational advantage to AlexNet. The Max-Pooling precedes the Local Response Normalization (LRN) so that LRN takes less compute and memory. We call the fine-tuned model GroceryNet, since it exploits CaffeNet in order to recognize grocery items. Training GroceryNet is based on ImageNet Dataset. For Inference at the edge we integrate Intel Movidius VPUs to drive the demanding workloads of GroceryNet at ultra-low power. By coupling highly parallel programmable compute with workload-specific hardware acceleration, and co-locating these components on a common intelligent memory fabric, Movidius achieves a unique balance of power efficiency and high performance for GroceryNet.
Methodology / Approach
Fine-tuning takes an already learned model, adapts the architecture, and resumes training from the
already learned model weights.
ILSVRC-2014 DET Dataset are visually very similar to the IILSVRC-2012 Dataset, on which the
bvlc_reference_caffenet was trained. Since that model works well for object category classification,
we’d like to use this architecture for our grocery classifier. We also only have 15,000 images to train
on, so we’d like to start with the parameters learned on the 1,000,000 ImageNet images, and fine-tune
as needed. We provide the weights argument to the caffe train command, the pretrained weights and
load into our model, matching layers by name.
Because we are predicting 21 classes instead of a 200, we need to change the last layer in the model.
Therefore, we exclude the softmax layer of CaffeNet, which is composed of 21 classes.
We will also decrease the overall learning rate base_lr in the solver prototxt, but boost the lr_mult on
the newly introduced layer. The idea is to have the rest of the model change very slowly with new data,
but let the new layer learn fast.Even though reusing weights and biases in CaffeNet, however, we still
need to refine the trained parameters for extracting features in some way. As a result, we did not
eliminate learning rate of every layers, but fortify training the last fully connected layer 10x than other
layers. Instead, the initial learning rate decreases to 0.001 so that GroceryNet can rely on the original
CaffeNet's parameters.
Based on the GroceryNet classification accuracy in testing validation dataset there exists fast
convergence, surprisingly with just an epoch due to derivation of parameters from CaffeNet. That been
said there still exists the potential of over-fitting, thus we need to keep monitoring the trend of training
loss. From our experiments, 45,000 iterations are probed to test the extent of available classification in
the current setting. Our model may identify 21 grocery item classes in 76.2% accuracy1.
GroceryNet at the Edge
Using the Intel Movidius Neural Compute stick, and an off the shelf Raspberry Pi 3 and Pi Cam we
have created GroceryNet. Our AI is trained to detect grocery items and able to track the grocery items.
Intel® MovidiusTM VPUs drive the demanding workloads of GroceryNet at ultra-low power. By
coupling highly parallel programmable compute with workload-specific hardware acceleration, and co-
locating these components on a common intelligent memory fabric, Movidius achieves a unique
balance of power efficiency and high performance for GroceryNet.
We use Intel Movidius Neural Compute SDK tools for profiling, tuning, and compiling the fine tuned
CeffeNet deep neural network (DNN) model:
•
We used mvNCProfile command line tool to compileGroceryNet for use with the Intel®
MovidiusTM Neural Compute SDK (Intel® MovidiusTM NCSDK), runs the network on a
connected neural compute device, and outputs text and HTML profile reports.
The profiling data contains layer-by-layer statistics about the performance of the
grocerynetwork. This is helpful in determining how much time is spent on each layer to narrow
down potential changes to the network to improve the total inference time.
Technologies Used
Raspberry Pi
Pi Camera
Intel Movidius NCS
Intel Core i7 based Host Machine
Repository
https://github.com/TebogoNakampe/GroceryNet