ShuffleNet-V2 Trained on ImageNet Competition Data

Identify the main object in an image

Released in 2018, this model features pointwise group convolutions and bottleneck-like structures. A "channel shuffle" operation is introduced to enable information flow between different groups of channels and improve accuracy.

Number of layers: 243 | Parameter count: 2,294,784 | Trained size: 10 MB |

Training Set Information

Performance

Examples

Resource retrieval

Get the pre-trained net:

In[1]:=

The prediction is an Entity:

In[4]:=

An object outside the list of the ImageNet classes will be misidentified:

In[6]:=
EntityValue[
 NetExtract[
   NetModel["ShuffleNet-V2 Trained on ImageNet Competition Data"], "Output"][["Labels"]], "Name"]
Out[7]=
extractor = NetDrop[NetModel[
   "ShuffleNet-V2 Trained on ImageNet Competition Data"], -2]
Out[8]=

Visualize convolutional weights

Extract the weights of the first convolutional layer in the trained net:

In[11]:=
weights = NetExtract[
   NetModel["ShuffleNet-V2 Trained on ImageNet Competition Data"], {1,
     "Weights"}];

Show the dimensions of the weights:

In[12]:=

Transfer learning

Use the pre-trained model to build a classifier for telling apart images of sunflowers and roses. Create a test set and a training set:

In[14]:=
tempNet = NetDrop[NetModel[
   "ShuffleNet-V2 Trained on ImageNet Competition Data"], -2]
Out[16]=
TargetDevice -> "GPU" for training on a GPU):

In[18]:=

Net information

Inspect the number of parameters of all arrays in the net:

In[20]:=
Information[
 NetModel["ShuffleNet-V2 Trained on ImageNet Competition Data"], "ArraysElementCounts"]
Out[20]=
Information[
 NetModel["ShuffleNet-V2 Trained on ImageNet Competition Data"], "ArraysTotalElementCount"]
Out[21]=
Information[
 NetModel["ShuffleNet-V2 Trained on ImageNet Competition Data"], "LayerTypeCounts"]
Out[22]=
Information[
 NetModel["ShuffleNet-V2 Trained on ImageNet Competition Data"], "SummaryGraphic"]
Out[23]=

Get the size of the ONNX file:

In[25]:=
ResourceObject[
  "ShuffleNet-V2 Trained on ImageNet Competition Data"]["ByteCount"]
Out[26]=
NetEncoder and

Requirements

Wolfram Language 12.3 (May 2021) or above

Resource History

Reference

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant