Klasifikace obrázků

Image Modeling with Keras

Ariel Rokem

Senior Data Scientist, University of Washington

Klasifikace obrázků

Image Modeling with Keras

Klasifikace obrázků: trénování

Image Modeling with Keras

Klasifikace obrázků: trénování

Image Modeling with Keras

Klasifikace obrázků: trénování

Image Modeling with Keras

Klasifikace obrázků: vyhodnocení

Image Modeling with Keras

Klasifikace obrázků: vyhodnocení

Image Modeling with Keras

Reprezentace tříd: one-hot kódování

labels = ["shoe", "dress", "shoe", "t-shirt", 
          "shoe", "t-shirt", "shoe", "dress"]
Image Modeling with Keras

Reprezentace tříd: one-hot kódování

array([[0., 0., 1.],    <= shoe
       [0., 1., 0.],    <= dress
       [0., 0., 1.],    <= shoe
       [1., 0., 0.],    <= t-shirt
       [0., 0., 1.],    <= shoe
       [1., 0., 0.],    <= t-shirt
       [0., 0., 1.],    <= shoe
       [0., 1., 0.]])   <= dress
Image Modeling with Keras

One-hot kódování

categories = np.array(["t-shirt", "dress", "shoe"])

n_categories = 3 ohe_labels = np.zeros((len(labels), n_categories))
for ii in range(len(labels)):
jj = np.where(categories == labels[ii])
ohe_labels[ii, jj] = 1
Image Modeling with Keras

One-hot kódování: testování predikcí

test
array([[0., 0., 1.], 
       [0., 1., 0.], 
       [0., 0., 1.], 
       [0., 1., 0.], 
       [0., 0., 1.],
       [0., 0., 1.],
       [0., 0., 1.],
       [0., 1., 0.]])
(test * prediction).sum()
6.0

prediction
array([[0., 0., 1.], 
       [0., 1., 0.], 
       [0., 0., 1.], 
       [1., 0., 0.], <= incorrect
       [0., 0., 1.],
       [1., 0., 0.], <= incorrect
       [0., 0., 1.], 
       [0., 1., 0.]])
Image Modeling with Keras

Pojďme si procvičit!

Image Modeling with Keras

Preparing Video For Download...