Skip to content

Commit 04c35b9

Browse files
committed
report: Touchups in results
1 parent c3a759e commit 04c35b9

File tree

10 files changed

+134
-101
lines changed

10 files changed

+134
-101
lines changed

TODO.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,24 @@ Feedback needed
77

88
### Draft 3
99

10-
Results
1110

12-
- Use Strided-DS-24 as chosen model (confusion matrix etc), instead of auto "best"
13-
- Finish Discussion and Conclusion
14-
- Make plots a bit prettier
11+
### Final 1
1512

1613
Abstract
1714

1815
- Write it!
1916
- Send to OK for feedback
2017

21-
### Draft 4
18+
Report
19+
20+
- Add short captions to figures, so List of Figures looks nice
21+
22+
Reprod
23+
24+
- Tag a branch for submitted thesis
25+
- Upload models to GH
26+
- Results are from git commit `b49efa5dde48f9fd72a32eff4c751d9d0c0de712`
27+
- Include perftools Python script in appendix?
2228

2329
Materials
2430

@@ -28,24 +34,14 @@ Background
2834

2935
- Make missing images
3036

31-
Report
3237

33-
- Add short captions to figures, so List of Figures looks nice
38+
### Draft 5
3439

3540
Results
3641

3742
- Include error analysis
3843
- Plot performance of models relative to fold
3944

40-
Reprod
41-
42-
- Tag a branch for submitted thesis
43-
- Upload models to GH
44-
- Results are from git commit `b49efa5dde48f9fd72a32eff4c751d9d0c0de712`
45-
- Include perftools Python script in appendix?
46-
47-
### Draft 5
48-
4945
Add Acknowledgements?
5046

5147
- Kristian
@@ -59,7 +55,7 @@ Final
5955
Do they explain the figure setup/contents OK?
6056
Short captions for the table of contents.
6157
Remove dots at the end. 2.2, 2.6, 2.16 etc
62-
- Double check refering style
58+
- Check references all valid
6359
- Do a spell checking pass
6460
- Do a grammar checking pass. LanguageTool + Grammarly
6561
- Fix Github link, to be to final branch

microesc/report.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
'danger': [ 'gun_shot' ],
2121
}
2222

23-
def plot_confusion(cm, classnames, normalize=False, percent=False):
23+
def plot_confusion(cm, classnames, normalize=False, percent=False, figsize=(6,5)):
2424

2525
fmt = '.2f'
2626
if normalize:
@@ -29,14 +29,16 @@ def plot_confusion(cm, classnames, normalize=False, percent=False):
2929
cm = cm_normalize(cm)*100
3030
fmt = ".1f"
3131

32-
fig, ax = plt.subplots(1, figsize=(10,8))
33-
seaborn.heatmap(cm, annot=True, ax=ax, fmt=fmt);
32+
fig, ax = plt.subplots(1, figsize=figsize)
33+
seaborn.heatmap(cm, annot=True, ax=ax, fmt=fmt, cmap='viridis');
3434

3535
ax.set_xlabel('Predicted labels')
3636
ax.set_ylabel('True labels')
37-
ax.set_title('Confusion Matrix')
3837
ax.xaxis.set_ticklabels(classnames, rotation=60)
3938
ax.yaxis.set_ticklabels(classnames, rotation=0)
39+
40+
fig.tight_layout()
41+
4042
return fig
4143

4244
def cm_normalize(cm):
@@ -309,7 +311,9 @@ def save(fig, name):
309311

310312

311313
classnames = urbansound8k.classnames
312-
best = df.sort_values('test_acc_mean', ascending=False).head(1).iloc[0]
314+
#best = df.sort_values('test_acc_mean', ascending=False).head(1).iloc[0]
315+
best = df[df.nickname == 'Stride-DS-24'].iloc[0]
316+
print('Selecting', best.nickname)
313317

314318
confusion_matrix = numpy.mean(best.confusions_test, axis=0)
315319
fig = plot_confusion(confusion_matrix, classnames, percent=True)

report/plot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ def model_table(data_path):
3030

3131
table = pandas.DataFrame()
3232
table['Accuracy (%)'] = df.accuracy*100
33-
table['MACC / second'] = [ "{}M".format(int(v/1e6)) for v in df.macc_s ]
34-
table['Model parameters'] = [ "{}k".format(int(v/1e3)) for v in df.params ]
33+
table['MACC / second'] = [ "{} M".format(int(v/1e6)) for v in df.macc_s ]
34+
table['Model parameters'] = [ "{} k".format(int(v/1e3)) for v in df.params ]
3535
#table['Data augmentation'] = df.augmentation
3636
table = table.sort_values('Accuracy (%)', ascending=False)
3737
#table['Time resolution (ms)'] = (df.t_step*1000).astype(int)
3838

39-
return table.to_latex()
39+
return table.to_latex(column_format='lrrr')
4040

4141
def plot_models(data_path, figsize=(12,4), max_params=128e3, max_maccs=4.5e6):
4242
df = logmel_models(data_path)

report/plots/urbansound8k-existing-models-logmel.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\begin{tabular}{lrll}
1+
\begin{tabular}{lrrr}
22
\toprule
33
{} & Accuracy (\%) & MACC / second & Model parameters \\
44
name & & & \\

report/pyincludes/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def downsample_from_name(name):
4646
'FLASH': strformat("{:d} kB", (df.flash_usage/1024).astype(int)),
4747
}, index=df.index)
4848

49-
out = table.to_latex(header=True, index=False)
49+
out = table.to_latex(header=True, index=False, column_format='lrrllrrr')
5050
print(out)
5151

5252
outpath = sys.argv[1]

report/pyincludes/models.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\begin{tabular}{lllrrlll}
1+
\begin{tabular}{lrrllrrr}
22
\toprule
33
Model & Downsample & Convolution & L & F & MACC & RAM & FLASH \\
44
\midrule

report/references.bib

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ @article{BarcelonaNoiseMonitoring2018
296296

297297

298298

299-
@article{MAIJALA2018258,
299+
@article{SourceClassificationSensors,
300300
title = "Environmental noise monitoring using source classification in sensors",
301301
journal = "Applied Acoustics",
302302
volume = "129",
@@ -577,7 +577,6 @@ @article{SONYC2019
577577
author = "Bello, Juan P. and Silva, Claudio and Nov, Oded and Dubois, R. Luke and Arora, Anish and Salamon, Justin and Mydlarz, Charles and Doraiswamy, Harish",
578578
doi = "10.1145/3224204",
579579
title = "SONYC: A System for Monitoring, Analyzing, and Mitigating Urban Noise Pollution",
580-
abstract = "Noise is unwanted or harmful sound from environmental sources, including traffic, construction, industrial, and social activity. Noise pollution is one of the topmost quality-of-life concerns for urban residents in the U.S., with more than 70 million people nationwide exposed to noise levels beyond the limit the U.S. Environmental Protection Agency (EPA) considers harmful.12 Such levels have proven effects on health, including sleep disruption, hypertension, heart disease, and hearing loss.5,11,12 In addition, there is evidence of harmful effects on educational performance, with studies showing noise pollution causing learning and cognitive impairment in children, resulting in decreased memory capacity, reading skills, and test scores.",
581580
number = "2",
582581
month = "Feb",
583582
volume = "62",

0 commit comments

Comments
 (0)