Closed mesarcik closed 1 year ago
Predict frequency band and polarisation for each patch
Class | AUROC | AUPRC | F1 |
---|---|---|---|
oscillating_tile | 0.8274 | 0.8877 | 0.8777 |
electric_fence | 0.2860 | 0.4553 | 0.6686 |
data_loss | 0.5732 | 0.6357 | 0.6985 |
lightning | 0.3430 | 0.4748 | 0.6447 |
strong_radio_emitter | 0.6264 | 0.2634 | 0.3708 |
1) Trying to determine the effects of Multi-class/single-class 2) The differences in performance between representations learnt from resnet, vae with and without training 3) The effect of evaluation metric on performance measurement
reconstruct_distances
is working correctlyAnomaly Type | AUROC | AUPRC | F1 |
---|---|---|---|
oscillating_tile | 0.1715 | 0.6866 | 0.8780 |
electric_fence | 0.8257 | 0.9395 | 0.8852 |
data_loss | 0.4460 | 0.6216 | 0.7984 |
lightning | 0.5778 | 0.6737 | 0.8147 |
strong_radio_emitter | 0.3396 | 0.5647 | 0.7899 |
solar_storm | 0.9457 | 0.9018 | 0.9800 |
intergrate()
, make sure its reassmbling all patches correctlyAnomaly | Pixel-mean | VAE-dist | Res-dist | Freq-dev | Supervised | Location prediction (patch size 64x64) |
---|---|---|---|---|---|---|
oscillating_tile | 0.1891 | 0.5793 | 0.7972 | 0.7296 | 0.4669 | 0.71428 |
electric_fence | 0.2914 | 0.2988 | 0.3799 | 0.3647 | 0.4669 | - |
data_loss | 0.4867 | 0.6491 | 0.6335 | 0.7034 | 0.4669 | 0.6691 |
lightning | 0.6714 | 0.6515 | 0.6595 | 0.6568 | 0.4816 | 0.7062 |
strong_radio_emitter | 0.7112 | 0.7689 | 0.8151 | 0.7647 | 0.9252 | 0.8575 |
solar_storm | 0.7989 | 0.9355 | 0.5860 | 0.9295 | 0.5498 | 0.8211 |
The radio spectrograms are quite different to images
For small patch sizes i think its pretty hard to detect neighburs
below is an example for 64 patch sizes
Here is for 32
Its quite clear that for these example it is very hard to determine which neighbour matches to each query.
I have now increased the patch size and it seems that the position prediciton is now working
I now need to change the frequency encoder to work for varying patchsizes.
Anomaly | Location prediction (original training data) | Location prediction (modified training data) | VAE |
---|---|---|---|
oscillating_tile | 0.71428 | 0.91612 | 0.90123 |
electric_fence | 0.2885 | 0.90196 | 0.8956 |
data_loss | 0.6763 | 0.95384 | 0.953846 |
lightning | 0.71225 | 0.976870 | 0.97297 |
strong_radio_emitter | 0.83727 | 0.98795 | 0.987991 |
solar_storm | 0.9006 | 1.0 | 0.97350 |
There a few possible reasons for this: 1) The training set and testing set of non-anomalous data are vastly different (badly labelled) 2) We are overfitting to the training data, so that the unseen, non-anomalous training data is incorrectly represented
A note on the differnece in performance between the VAE and location predictor
Anomaly | Location prediction | VAE |
---|---|---|
oscillating_tile | 0.9006 | 0.7515 |
electric_fence | 0.5664 | 0.4554 |
data_loss | 0.8761 | 0.78758 |
lightning | 0.8539 | 0.77378 |
strong_radio_emitter | 0.9449 | 0.8861 |
solar_storm | 1.0 | 0.92358 |
Anomaly | Untrained | Trained |
---|---|---|
oscillating_tile | 0.791367 | 0.698795 |
data_loss | 0.672432 | 0.714545 |
lightning | 0.673568 | 0.695421 |
strong_radio_emitter | 0.838039 | 0.844560 |
solar_storm | 0.262452 | 0.860681 |
Parameter | Description |
---|---|
c | clip amount of the training data |
p | patch size |
lambda | regularisation scaling factor |
l | embedding dimension |
m | number of layers of MLP |
j | jitter amount |
r | rolll amount |
M | backbone network (resnet15, resnet50, ViT) |
The oscillating tile class is brining the overall average down, if we remove it then it appears that the randomly initialised model performs slightly better in some cases 🤔
Note: the KNN based result is evaluated on all the test data, whereas the fine-tuned model are evaluted on the remaining test data
Class | SSL + KNN | SSL + Fine-tuning | Random init + Fine-tuning |
---|---|---|---|
oscillating_tile | 0.7596 | 0.5454 | 0.4687 |
data_loss | 0.6100 | 0.77419 | 0.76546 |
lightning | 0.8022 | 0.8316 | 0.6655 |
strong_radio_emitter | 0.8414 | 0.8210 | 0.8283 |
solar_storm | 0.78287 | 0.9897 | 0.9847 |
mean | 0.7606 | 0.7964 | 0.7464 |
Class | SSL + KNN | SSL + Fine-tuning | Random init + Fine-tuning |
---|---|---|---|
oscillating_tile | 0.7826 | ||
data_loss | 0.7104 | ||
lightning | 0.8089 | ||
strong_radio_emitter | 0.9133 | ||
solar_storm | 0.9898 | ||
mean | 0.8410 |
Class | # Misclassified samples |
---|---|
oscillating_tile | 2 |
data_loss | 91 |
lightning | 54 |
strong_radio_emitter | 13 |
solar_storm | 0 |
data.py
file so that the testdata_loader
is able to hold all anomalous classeseval.py
class evaluate each class separately as well as the multi-class detection scenario eval.py
not load each anomalous class separately.I saw a trend after cleaning about 1000 samples from the normal data class that the performance of our models dropped
In order to validate this I ran an experiment to check what the performance difference is when using less training data (shown below)
It is clear that less training data = lower performance
Furthermore if we look at the convergence of the position based loss of these models, they are not converging in the new iteration of the dataset (previous validation loss was 0.95 it is currently between 0.75 - 0.8)
[ ] What about Augmentation?
Class | # Samples | % Contamination |
---|---|---|
training data (normal) | 2533 | - |
test data (normal) | 800 | - |
Total data | ~6500 | - |
data_loss | 413 | 6% |
electric_fence | 62 | 1% |
lightning | 327 | 5% |
oscillating_tile | 57 | 1% |
real_high_noise | 869 | 13% |
solar_storm | 147 | 2% |
strong_radio_emitter | 1334 | 20% |
Name | # Samples |
---|---|
1 Subband observations | ~2000 |
Unknown data (not normal, but no characterised anomaly) | ~1500 |
Normal | ~3500 |
Anomalies | ~3000 |
Unlabelled | ~2000 |
I think we need to subsample anomalous classes to obtain reason anomaly-normal splits.
There is a clear trend in
Dataset information
Dataset overview
1) Note, these values are changing as more corrections are made to each class _2) Note, the class labels are not necessarily correct, for examples, what I labelled strong radio emitter is an A-team source in the sidelobes__
Labelling interface/the way things are plotted
I make use of Jorrit's code to produce the "Adder Plots"
We use only the magintude spectrum but for all 4 polarisations
Each plot is normalised based on the 1st and 99th percentile across a given sap
To improve dynamic range, a 3rd degree polynomial is fit to the each time slice (1 subband) and then the polynomial is divided through to decrease the dynamic range issues
NOTE the code was written in python2.7 and there is a bug in its such that the station numbers do not correspond to the correct baseline.
Example:
The domain that we labelled in (with polynomial normalisation)
Unprocessed data
Potential directions
Option 1:
Option 2:
Option 3: