-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathst_page_03.py
43 lines (33 loc) · 2.42 KB
/
st_page_03.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#--------------------
# Author : Serge Zaugg
# Description : some info
#--------------------
import streamlit as st
c00, c01 = st.columns([0.6, 0.4])
with c00:
with st.container(border=True) :
st.subheader("Short methods")
st.markdown('''
The training set consists of 900 mp3 recording from Northern Europe that were downloaded from xeno-canto.
The mp3s were down-sampled to 24'000 sps, then cut in 1.0 seconds pieces and transformed to spectrograms resulting in 6714 grey-scale images of 128 x 1152 pixels (freq x time).
These images were used to train convolutional auto-encoders (CAE) under a de-noising regime with PyTorch.
The encoder weights were saved to be used later for feature extraction.
The test set (shown here) comes from 571 mp3 recordings from South-Western Europe taken from xeno-canto.
The recordings were down-sampled to 24'000 sps, cut into shorter 0.2 seconds pieces, and transformed to spectrograms.
This gave 60'560 grey-scale mini-images of 128 x 256 pixels (freq x time).
These images were piped through the pre-trained encoder to obtain a feature matrix (60'463 rows x 256 columns)
The 256 columns correspond to the dim of the latent vector in the CAE, not the 256 time-pixels of the images ;-)
The feature matrix can be interactively dim-reduced with UMAP to the final matrix, e.g. to 60'463 x 32.
The final matrix can be interactively processed with DBSCAN and the mini-images can be plotted grouped by clusters.
''')
st.subheader("Short discussion")
st.markdown('''
* Audio files were sequentially cut into pieces without any selection.
* This is challenging because many pieces contain only nuisance sounds or background noise.
* In some cases, consistent patterns coming from different mp3 recordings are clustered together.
* To be continued ...
''')
st.subheader("Links")
st.page_link("https://pytorch.org", label="PyTorch")
st.page_link("https://umap-learn.readthedocs.io", label="UMAP")
st.page_link("https://scikit-learn.org/stable/modules/generated/sklearn.cluster.DBSCAN.html", label="DBSCAN")