Updated readme
Browse files
README.md
CHANGED
@@ -73,7 +73,7 @@ Once a year, the [DCASE community](https://dcase.community/) publishes a [challe
|
|
73 |
|
74 |
### Explore Dataset
|
75 |
|
76 |
-
![Analyze DCASE23 Task 2 with Spotlight](data/
|
77 |
|
78 |
The enrichments allow you to quickly gain insights into the dataset. The open source data curation tool Renumics Spotlight enables that with just a few lines of code:
|
79 |
|
@@ -84,9 +84,9 @@ import datasets
|
|
84 |
dataset = datasets.load_dataset("renumics/dcase23-task2-enriched", "dev", split="all", streaming=False)
|
85 |
```
|
86 |
|
87 |
-
Install Spotlight via [pip](https://packaging.python.org/en/latest/key_projects/#pip):
|
88 |
```jupyterpython
|
89 |
-
!pip install renumics-spotlight
|
90 |
```
|
91 |
|
92 |
Start exploring with a simple view that leverages embeddings to identify relevant data segments:
|
@@ -94,40 +94,37 @@ Start exploring with a simple view that leverages embeddings to identify relevan
|
|
94 |
from renumics import spotlight
|
95 |
|
96 |
df = dataset.to_pandas()
|
97 |
-
|
|
|
98 |
```
|
99 |
You can use the UI to interactively configure the view on the data. Depending on the concrete taks (e.g. model comparison, debugging, outlier detection) you might want to leverage different enrichments and metadata.
|
100 |
|
101 |
-
|
102 |
|
103 |
|
104 |
```jupyterpython
|
105 |
from renumics import spotlight
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
# todo
|
110 |
```
|
111 |
|
112 |
## Using custom model results and enrichments
|
113 |
|
114 |
When developing your custom model you want to use different kinds of information from you model (e.g. embedding, anomaly scores etc.) to gain further insights into the dataset and the model behvior.
|
115 |
|
116 |
-
Suppose you have your model's embeddings for each datapoint as a 2D-Numpy array and your anomaly score as a 1D-Numpy array
|
117 |
```jupyterpython
|
118 |
-
|
119 |
-
|
120 |
```
|
121 |
Depending on your concrete task you might want to use different enrichments. For a good overview on great open source tooling for uncertainty quantification, explainability and outlier detection, you can take a look at our [curated list for open source data-centric AI tooling](https://github.com/Renumics/awesome-open-data-centric-ai) on Github.
|
122 |
|
123 |
You can also save your view configuration in Spotlight in a JSON configuration file by clicking on the respective icon:
|
124 |
|
125 |
-
[//]: # (todo: create new image -> Spotlight widgets use column "audio" as key in this picture.)
|
126 |
-
|
127 |
![Save a data curation layout in Spotlight](data/spotlight_save_layout.png "Save a data curation layout in Spotlight")
|
128 |
|
129 |
-
|
130 |
-
|
131 |
|
132 |
## Dataset Structure
|
133 |
|
@@ -136,8 +133,6 @@ We have also set up a Github repo with interactive notebooks that highlight diff
|
|
136 |
For each instance, there is a Audio for the audio, a string for the path, an integer for the section, a string for the d1p (parameter), a string for the d1v (value),
|
137 |
a ClassLabel for the label and a ClassLabel for the class.
|
138 |
|
139 |
-
[//]: # (todo: add new data fields)
|
140 |
-
|
141 |
```
|
142 |
{'audio': {'array': array([ 0. , 0.00024414, -0.00024414, ..., -0.00024414,
|
143 |
0. , 0. ], dtype=float32),
|
@@ -158,6 +153,10 @@ a ClassLabel for the label and a ClassLabel for the class.
|
|
158 |
'ast-finetuned-audioset-10-10-0.4593-embeddings': [0.8152204155921936,
|
159 |
1.5862374305725098, ...,
|
160 |
1.7154160737991333]
|
|
|
|
|
|
|
|
|
161 |
}
|
162 |
```
|
163 |
|
@@ -176,6 +175,11 @@ The length of each audio file is 10 seconds.
|
|
176 |
- `class`: an integer as class label.
|
177 |
- `label`: an integer whose value may be either _0_, indicating that the audio sample is _normal_, _1_, indicating that the audio sample contains an _anomaly_.
|
178 |
- `ast-finetuned-audioset-10-10-0.4593-embeddings`: an `datasets.Sequence(Value("float32"))` representing audio embeddings that are generated with an [Audio Spectrogram Transformer](https://huggingface.co/docs/transformers/model_doc/audio-spectrogram-transformer#transformers.ASTFeatureExtractor).
|
|
|
|
|
|
|
|
|
|
|
179 |
|
180 |
### Data Splits
|
181 |
|
|
|
73 |
|
74 |
### Explore Dataset
|
75 |
|
76 |
+
![Analyze DCASE23 Task 2 with Spotlight](data/preview_dcase_1.png "Analyze DCASE23 Task 2 with Spotlight")
|
77 |
|
78 |
The enrichments allow you to quickly gain insights into the dataset. The open source data curation tool Renumics Spotlight enables that with just a few lines of code:
|
79 |
|
|
|
84 |
dataset = datasets.load_dataset("renumics/dcase23-task2-enriched", "dev", split="all", streaming=False)
|
85 |
```
|
86 |
|
87 |
+
Install soundfile and Spotlight via [pip](https://packaging.python.org/en/latest/key_projects/#pip):
|
88 |
```jupyterpython
|
89 |
+
!pip install renumics-spotlight soundfile
|
90 |
```
|
91 |
|
92 |
Start exploring with a simple view that leverages embeddings to identify relevant data segments:
|
|
|
94 |
from renumics import spotlight
|
95 |
|
96 |
df = dataset.to_pandas()
|
97 |
+
simple_layout = load_dataset_builder("renumics/dcase23-task2-enriched", "dev").get_layout(config="simple")
|
98 |
+
spotlight.show(df, dtype={'path': spotlight.Audio, "embeddings_ast-finetuned-audioset-10-10-0.4593": spotlight.Embedding}, layout=simple_layout)
|
99 |
```
|
100 |
You can use the UI to interactively configure the view on the data. Depending on the concrete taks (e.g. model comparison, debugging, outlier detection) you might want to leverage different enrichments and metadata.
|
101 |
|
102 |
+
In this example we focus on the valve class. We specifically look at normal data points that have high anomaly scores in both models. This is one example on how to find difficult example or edge cases:
|
103 |
|
104 |
|
105 |
```jupyterpython
|
106 |
from renumics import spotlight
|
107 |
|
108 |
+
extended_layout = load_dataset_builder("renumics/dcase23-task2-enriched", "dev").get_layout(config="extended")
|
109 |
+
spotlight.show(df, dtype={'path': spotlight.Audio, "embeddings_ast-finetuned-audioset-10-10-0.4593": spotlight.Embedding}, layout=extended_layout)
|
|
|
110 |
```
|
111 |
|
112 |
## Using custom model results and enrichments
|
113 |
|
114 |
When developing your custom model you want to use different kinds of information from you model (e.g. embedding, anomaly scores etc.) to gain further insights into the dataset and the model behvior.
|
115 |
|
116 |
+
Suppose you have your model's embeddings for each datapoint as a 2D-Numpy array called `embeddings` and your anomaly score as a 1D-Numpy array called `anomaly_scores`. Then you can add this information to the dataset:
|
117 |
```jupyterpython
|
118 |
+
df['my_model_embedding'] = embeddings
|
119 |
+
df['anomaly_score'] = anomaly_score
|
120 |
```
|
121 |
Depending on your concrete task you might want to use different enrichments. For a good overview on great open source tooling for uncertainty quantification, explainability and outlier detection, you can take a look at our [curated list for open source data-centric AI tooling](https://github.com/Renumics/awesome-open-data-centric-ai) on Github.
|
122 |
|
123 |
You can also save your view configuration in Spotlight in a JSON configuration file by clicking on the respective icon:
|
124 |
|
|
|
|
|
125 |
![Save a data curation layout in Spotlight](data/spotlight_save_layout.png "Save a data curation layout in Spotlight")
|
126 |
|
127 |
+
For more information how to configure the Spotlight UI please refer to the [documentation](https://spotlight.renumics.com).
|
|
|
128 |
|
129 |
## Dataset Structure
|
130 |
|
|
|
133 |
For each instance, there is a Audio for the audio, a string for the path, an integer for the section, a string for the d1p (parameter), a string for the d1v (value),
|
134 |
a ClassLabel for the label and a ClassLabel for the class.
|
135 |
|
|
|
|
|
136 |
```
|
137 |
{'audio': {'array': array([ 0. , 0.00024414, -0.00024414, ..., -0.00024414,
|
138 |
0. , 0. ], dtype=float32),
|
|
|
153 |
'ast-finetuned-audioset-10-10-0.4593-embeddings': [0.8152204155921936,
|
154 |
1.5862374305725098, ...,
|
155 |
1.7154160737991333]
|
156 |
+
'anomaly_score_dcase2023_task2_baseline_ae': 8.284389
|
157 |
+
'prediction_dcase2023_task2_baseline_ae': 0
|
158 |
+
'prediction_correct_dcase2023_task2_baseline_ae': 1
|
159 |
+
'anomaly_score_embedding_lof': 0.191043
|
160 |
}
|
161 |
```
|
162 |
|
|
|
175 |
- `class`: an integer as class label.
|
176 |
- `label`: an integer whose value may be either _0_, indicating that the audio sample is _normal_, _1_, indicating that the audio sample contains an _anomaly_.
|
177 |
- `ast-finetuned-audioset-10-10-0.4593-embeddings`: an `datasets.Sequence(Value("float32"))` representing audio embeddings that are generated with an [Audio Spectrogram Transformer](https://huggingface.co/docs/transformers/model_doc/audio-spectrogram-transformer#transformers.ASTFeatureExtractor).
|
178 |
+
- `anomaly_score_dcase2023_task2_baseline_ae`: a float representation of the anomaly score according to the baseline implementation
|
179 |
+
- `prediction_dcase2023_task2_baseline_ae`: an integer whose value may be either _0_, indicating that the audio sample is considered _normal_ by the baseline algorithm, _1_, indicating that the audio sample contains an _anomaly_.
|
180 |
+
- `prediction_correct_dcase2023_task2_baseline_ae`: an integer whose value may be either _0_, indicating that the baseline prediction is wrong or _1_, indicating that prediction is correct.
|
181 |
+
- `anomaly_score_embedding_lof`: a float representation of the anomaly score computed with the PyOD implementation of the Local Outlier Factor algorithm on the pre-computed embedding.
|
182 |
+
|
183 |
|
184 |
### Data Splits
|
185 |
|