►
Description
Learn how to use ML.NET to perform transfer leaning from the Inception model built in Tensorflow.
Code - https://github.com/jwood803/MLNetExamples/blob/master/MLNetExamples/TransferLearning/Program.cs
Doc - https://docs.microsoft.com/en-us/dotnet/machine-learning/tutorials/image-classification
Inception model download - https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip
Contact:
Twitter: https://twitter.com/JWood/
Blog: https://jonwood.co/
Gear used (affiliate links):
Mic - https://amzn.to/2YEXtxI
Mouse - https://amzn.to/2ZtASoQ
A
Hey
everyone,
so
Annette
is
quite
a
bit
versatile
if,
especially,
if
you've
seen
other
videos
on
all
the
stuff
that
they
can
do.
But
not
only
can
you
create
your
own
machine
learning
pipelines.
You
can
also
use
tensorflow,
deep
learning
models
to
make
predictions
and
that's
what
we're
going
to
do
in
this
video
we'll
use
a
pre,
trained,
tensor
flow
model
and
perform
transfer
learning
within
in
Lynette.
A
So
real,
quick
and
neat
Microsoft
documentation
for
what
we're
about
to
do
here
and
just
a
little
bit
of
graphic
here
just
to
show
what
all
this
is
doing.
So
when
you
call
mo
net,
you
use
this
tensor
flow
package
and
what
what
that
does
is
that
it
reads
from
the
pre
trained
model
that
you
will
need
to
download
and
include
in
your
project
here.
So
it
reads
from
that
and
it
does
everything
in
there
and
then
within
a
mod
net.
A
That's
already
been
pre
trained
to
solve
a
similar
problem
to
what
you
want,
and
essentially
it
just
takes
that
model
and
reuses
parts
of
it
to
build
the
new
model
that
you
want.
So
the
inception
model
is
an
image
classifier.
So
we're
going
to
use
that
to
classify
some
more
images,
so
first,
I'm
another
net
package
using
1.3.1
here
and
then,
since
we're
doing
tensor
flow,
we're
gonna
be
reading
a
tensor
flow
model.
A
And
for
our
data,
we
are
going
to
load
in
the
labels
file,
so
we'll
just
reload
from
text
file
and
we
need
to
create
an
input,
schema
class
here
and
I'll
name
that
image
data
not
clear
dad
and
in
just
a
bit
and
that's
gonna-
be
labels
that
CSV
and
a
separator
there's
going
to
be
a
comma
there's,
no
header
on
it.
So
the
default
has
header
is
already
false,
so
I'll
create
this
class
here.
A
A
A
The
next
we'll
do
the
transforms
or
reload
in
our
images-
and
this
comes
in
from
that
image
analytics
package
that
we
downloaded
and
I'll
map
that
to
a
column
called
input
and
then
the
image
folder.
It's
gonna
be
images
that
we
have
here
in
our
solution.
Input,
column
name
is
going
to
be
the
image
path,
and
so
I
can
just
use
the
name
of
for
the
image
path
property
that
we
created
on
the
image
data.
A
That's
gonna,
replace
that
input,
output,
content
that
we
have
up
here
and
the
next.
We
need
to
do
image
with
an
image
height
and
to
help
us
with
a
few
of
those
settings
here.
I'm
gonna
at
another
class
do
inception
settings
for
the
exception
model
and
it's
actually
gonna
be
a
struct.
So
it's
a
value
type
instead
of
a
reference
type
that
we
get
with
a
class.
So
first
is
an
image
height
which
would
be
224
and
then
we'll
do
the
same
thing
for
the
image
width
and
they
would
need
a
mean
value.
A
What
you
do
is
117-
and
this
is
all
from
that
documentation,
page
and
I'll-
link
to
that
in
the
description.
So
you
can
follow
that
as
well
and
we'll
give
it
a
scale
of
1.
Now
we
do
a
channels
list
I
set
that
equal
to
true
I
back
in
our
resize
image.
Transform
here
when
used
the
exception
settings
to
do
the
width
and
height
of
our
image.
There
you
want
to
resize
to
and
the
input
column
is
gonna,
be
input
as
well.
This
is
gonna
be
from
this
transform.
A
We
input
into
this
transform,
but
we
also
output
the
same
name
as
input,
and
next
we
need
to
extract
the
pixels
from
the
images.
So
we
can
train
all
those
another
transform
is
called
extract,
pixels,
so
the
alpha
colon,
a
I'm
going
to
continue
outputting
as
input,
and
it
will
set
the
interleave
pixel
colors
to
that
channels
list.
So
it
said
that
true
and
we
do
to
offset
the
image
using
that
mean
value
alright.
So
next
we
actually
load
in
our
tensor
flow
model
and
almost
forgot.
A
We
have
this
model
folder
here
and
after
you
download
the
inception
model
you
give
these
couple
of
fouls.
All
you
need.
Are
the
label
strings
text
file
and
a
PD
file
just
move
those
over
and
make
sure
they
get
copied
over
when
you
build
so
to
load
it
in?
We
did
context
of
model
that
blowed
tensorflow
model
and
from
here
we'll
just
give
the
path
of
what
the
model
is.
A
It's
going
to
be
a
soft
max
to
free
activation
and
no
tools
out
there,
where
you
can
pass
in
this
file
and
you
can
get
the
name
so
the
the
actual
input
and
upload
layers
and
then
the
input
when
do
another
already
here
and
just
put
input
since
that's
what
we're
giving
it
from
here
and
it
will
say,
add
match
dimensions
to
true
all
right.
So
that's
all
the
other
things
we
need
to
do
for
the
images
and
the
tensor
flow
model.
A
Next,
we
will
append
on
the
multi-class
classification
trainer
and
we'll
do
the
maximum
entropy
trainer
here.
Did
a
label
name
is
labeled
key,
since
we
mapped
it
to
from
categorical
to
a
numerical
value
up
here
and
we'll
give
this
same
call
name,
since
this
is
what
comes
back
from
the
tensor
flow
model,
we'll
get
that
as
the
future
column
name
and
then
one
more
thing
to
do
for
the
pipeline
is
need
to
do
another
transform
week,
vert
map
key
to
value
and
we'll
bring
out
the
predicted
label
value
and
the
three
dated
label.
A
Alright,
that's
all
for
our
pipeline,
so
record
our
model
from
it
about
fitting
with
our
data
that
creates
the
model
forest,
and
so
we
can
next
is
create
our
image
data,
and
to
do
that,
we
can
do
file,
read
all
blogs
from
our
label
file,
and
then
we
use
some
link
here
to
split
all
the
columns
so
that
separates
it
all
out.
Then
next
we
will
for
each
of
those
items
we'll
create
a
new
image
data
object.
A
We
did
the
image
path
when
they
passed
bomb
and
from
here
we're
gonna,
start
off
and
environment
that
current
director,
given
the
images
path
and
then
it'll
be
the
first
item
from
the
split
here.
That's
gonna
be
the
path
from
there
need
to
create
a
data
field
from
that
image.
Data
so
do
context,
data
that
load
from
innumerable
just
do
the
image
data
and
they
can
infer
what
type
that
is.
Next,
we
can
create
our
predictions,
a
new
model
that
transform
on
that
image,
data
view
and.
A
A
Then
I'll
do
a
float
of
array,
Padre
called
score
and
a
string
predicted
label
value,
which
is
just
the
name
that
we
used
up
here
to
get
items
from
the
predicted
label
to
predicted
label
value
and
this.
What
this
does
is
that,
since
we
mat
from
categorical
to
numerical
up
here,
if
we're
doing
the
opposite
from
mapping
from
numerical
to
categorical
appearance,
so
we
can
get
the
extreme
representation
of
our
labels.
A
So
the
image
prediction
here
and
they
give
you
the
predictions
totally
use-
tell
not
to
use
the
road
objects
and
ignore
some
columns.
True
thanks,
we
can
evaluate
our
model,
see
how
well
it
goes.
We
do
model
that
transform
on
our
data,
our
original
data
here
from
the
label
file
and
you
get
our
metrics.
A
You
need
a
context,
multi-class
classification,
that
evaluate
give
it
the
Federation
predictions,
give
it
a
label,
column,
name
of
the
label
key
and
then
a
predicted
call
name
of
predicted
label
and
with
those
predictions
we
can
write
out
the
metric
everyone
to
look
at
generally
for
image
classification
or
just
multi-class
classification.
You
look
at
the
log
laws
and
the
log
walls
needs
to
be
as
close
to
zero
for
for
more
accurate
predictions.
So
do
read
on
so
it
doesn't
disappear
on
me.
So
let's
go
ahead
and
run
this
and
see
what
we
get
so.
A
A
Engine
Mary
puts
the
image,
data
and
I
output,
the
image
prediction,
and
we
just
pass
it
in
the
model
and
we
can
create
a
single
prediction
by
doing
prediction
function
that
predict
and
we
give
it
a
new
image
data
and
we
give
the
image
path.
Your
path
come
back,
it'll
be
the
same
as
before:
do
it
environment,
I,
current
directory
images
and
we'll
do
that
second
cup
image,
and
then
we
write
out
the
prediction
to
do
image
when
Jews
path,
I
give
filename
on
the
image
path
that
we
gave
it.
A
That
was
predicted.
As
with
the
predicted
label
value,
we
get
the
label
makers
predicted
as
and
we
can
say,
with
the
score
of
I'm
used
to
score
and
that's
gonna,
be
remember,
that's
an
array
of
floats,
so
we
just
get
the
max
I
had
him
a
net.
That's
gonna
be
a
score.
It
was
predicted
label
value.
So
we
run
that
again.
You
know
soak
up
to
what's
with
the
predicted
as
a
cup
to
score
of
66
percent.