Wolfram.com
WolframAlpha.com
WolframCloud.com
Wolfram Language
Example Repository
Ready-to-use examples for the Wolfram Language
Primary Navigation
Categories
Astronomy
Audio Processing
Calculus
Cellular Automata
Chemistry
Complex Systems
Computer Science
Computer Vision
Control Systems
Creative Arts
Data Science
Engineering
Finance & Economics
Finite Element Method
Food & Nutrition
Geography
Geometry
Graphs & Networks
Image Processing
Life Sciences
Machine Learning
Mathematics
Optimization
Physics
Puzzles and Recreation
Quantum Computation
Signal Processing
Social Sciences
System Modeling
Text & Language Processing
Time-Related Computation
Video Processing
Visualization & Graphics
Alphabetical List
Submit a New Resource
Learn More about
Wolfram Language
Related Pages
Related Symbols
NetModel
NetExtract
NetChain
NetMapOperator
NetDrop
NetDecoder
NetTrain
NetJoin
DropoutLayer
SoftmaxLayer
ClassifierMeasurements
Related Categories
Machine Learning
Audio Processing
Classify the ESC-50 Audio Dataset
Use transfer learning to retrain an audio classifier
Example Notebook
Open in Cloud
Download Notebook
Download the
ESC-50 dataset
, a labeled collection of 2000 environmental audio recordings:
I
n
[
1
]
:
=
a
r
c
h
i
v
e
=
U
R
L
D
o
w
n
l
o
a
d
[
"
h
t
t
p
s
:
/
/
g
i
t
h
u
b
.
c
o
m
/
k
a
r
o
l
d
v
l
/
E
S
C
-
5
0
/
a
r
c
h
i
v
e
/
m
a
s
t
e
r
.
z
i
p
"
]
;
d
i
r
=
F
i
l
e
N
a
m
e
J
o
i
n
[
{
$
T
e
m
p
o
r
a
r
y
D
i
r
e
c
t
o
r
y
,
"
E
S
C
5
0
"
}
]
;
E
x
t
r
a
c
t
A
r
c
h
i
v
e
[
a
r
c
h
i
v
e
,
d
i
r
]
;
Import the metadata. The files are five-second-long recordings organized into 50 semantic classes:
I
n
[
2
]
:
=
m
e
t
a
D
a
t
a
=
M
a
p
A
s
s
o
c
i
a
t
i
o
n
T
h
r
e
a
d
[
r
a
w
M
e
t
a
d
a
t
a
〚
1
〛
M
a
p
A
t
[
F
i
l
e
@
F
i
l
e
N
a
m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
r
e
a
k
i
n
g
,
d
o
o
r
_
w
o
o
d
_
c
r
e
a
k
s
,
l
a
u
g
h
i
n
g
}
Start with the original
A
u
d
i
o
I
d
e
n
t
i
f
y
network:
I
n
[
6
]
:
=
n
e
t
=
N
e
t
M
o
d
e
l
[
"
W
o
l
f
r
a
m
A
u
d
i
o
I
d
e
n
t
i
f
y
V
1
T
r
a
i
n
e
d
o
n
A
u
d
i
o
S
e
t
D
a
t
a
"
,
"
S
i
z
e
"
"
S
m
a
l
l
"
]
;
Construct a feature extractor net by chopping the classifier layers and adding additional layers:
I
n
[
7
]
:
=
m
a
i
n
N
e
t
=
N
e
t
E
x
t
r
a
c
t
[
n
e
t
,
{
1
,
"
N
e
t
"
}
]
;
f
e
a
t
u
r
e
E
x
t
r
a
c
t
o
r
=
N
e
t
C
h
a
i
n
[
{
N
e
t
M
a
p
O
p
e
r
a
t
o
r
[
N
e
t
D
r
o
p
[
m
a
i
n
N
e
t
,
-
3
]
]
,
A
g
g
r
e
g
a
t
i
o
n
L
a
y
e
r
[
M
a
x
,
1
]
,
F
l
a
t
t
e
n
L
a
y
e
r
[
]
}
,
"
I
n
p
u
t
"
n
e
t
〚
"
I
n
p
u
t
"
〛
]
O
u
t
[
7
]
=
N
e
t
C
h
a
i
n
I
n
p
u
t
p
o
r
t
:
e
x
p
r
e
s
s
i
o
n
O
u
t
p
u
t
p
o
r
t
:
v
e
c
t
o
r
(
s
i
z
e
:
1
2
8
0
)
D
a
t
a
n
o
t
i
n
n
o
t
e
b
o
o
k
.
S
t
o
r
e
n
o
w
Construct a simple linear classifier network that will be attached to the feature extractor:
I
n
[
8
]
:
=
c
l
a
s
s
i
f
i
e
r
=
N
e
t
C
h
a
i
n
[
{
D
r
o
p
o
u
t
L
a
y
e
r
[
.
3
]
,
1
0
2
4
,
R
a
m
p
,
5
0
,
S
o
f
t
m
a
x
L
a
y
e
r
[
]
}
,
"
O
u
t
p
u
t
"
N
e
t
D
e
c
o
d
e
r
[
{
"
C
l
a
s
s
"
,
c
l
a
s
s
e
s
}
]
]
O
u
t
[
8
]
=
N
e
t
C
h
a
i
n
u
n
i
n
i
t
i
a
l
i
z
e
d
I
n
p
u
t
p
o
r
t
:
a
r
r
a
y
O
u
t
p
u
t
p
o
r
t
:
c
l
a
s
s
Instead of retraining the full net and specifying a
L
e
a
r
n
i
n
g
R
a
t
e
M
u
l
t
i
p
l
i
e
r
s
option in
N
e
t
T
r
a
i
n
to train only the classification layers, you can precompute the results of the feature extractor net and train the classifier. This avoids redundant evaluation of the full net:
I
n
[
9
]
:
=
t
r
a
i
n
〚
A
l
l
,
1
〛
=
f
e
a
t
u
r
e
E
x
t
r
a
c
t
o
r
[
t
r
a
i
n
〚
A
l
l
,
1
〛
]
;
Train the classifier network using
N
e
t
T
r
a
i
n
:
I
n
[
1
0
]
:
=
t
r
a
i
n
e
d
C
l
a
s
s
i
f
i
e
r
=
N
e
t
T
r
a
i
n
[
c
l
a
s
s
i
f
i
e
r
,
t
r
a
i
n
,
V
a
l
i
d
a
t
i
o
n
S
e
t
S
c
a
l
e
d
[
.
0
5
]
,
M
a
x
T
r
a
i
n
i
n
g
R
o
u
n
d
s
6
0
]
O
u
t
[
1
0
]
=
N
e
t
C
h
a
i
n
I
n
p
u
t
p
o
r
t
:
v
e
c
t
o
r
(
s
i
z
e
:
1
2
8
0
)
O
u
t
p
u
t
p
o
r
t
:
c
l
a
s
s
D
a
t
a
n
o
t
i
n
n
o
t
e
b
o
o
k
.
S
t
o
r
e
n
o
w
Join the feature extractor network and the trained classifier using
N
e
t
J
o
i
n
:
I
n
[
1
1
]
:
=
f
i
n
a
l
N
e
t
=
N
e
t
J
o
i
n
[
f
e
a
t
u
r
e
E
x
t
r
a
c
t
o
r
,
t
r
a
i
n
e
d
C
l
a
s
s
i
f
i
e
r
]
O
u
t
[
1
1
]
=
N
e
t
C
h
a
i
n
I
n
p
u
t
p
o
r
t
:
e
x
p
r
e
s
s
i
o
n
O
u
t
p
u
t
p
o
r
t
:
c
l
a
s
s
D
a
t
a
n
o
t
i
n
n
o
t
e
b
o
o
k
.
S
t
o
r
e
n
o
w
Using
C
l
a
s
s
i
f
i
e
r
M
e
a
s
u
r
e
m
e
n
t
s
, compute the accuracy on the test data and plot the confusion matrix of the worst four classes:
I
n
[
1
2
]
:
=
c
m
=
C
l
a
s
s
i
f
i
e
r
M
e
a
s
u
r
e
m
e
n
t
s
[
f
i
n
a
l
N
e
t
,
t
e
s
t
]
;
c
m
[
"
A
c
c
u
r
a
c
y
"
]
O
u
t
[
1
2
]
=
0
.
9
1
5
I
n
[
1
3
]
:
=
c
m
[
"
C
o
n
f
u
s
i
o
n
M
a
t
r
i
x
P
l
o
t
"
4
]
O
u
t
[
1
3
]
=
See Also
Wolfram AudioIdentify V1 Trained on AudioSet Data
Related Symbols
NetModel
NetExtract
NetChain
NetMapOperator
NetDrop
NetDecoder
NetTrain
NetJoin
DropoutLayer
SoftmaxLayer
ClassifierMeasurements
Publisher Information
Contributed by:
Wolfram Staff