CNF:ML Data Denoise: Difference between revisions
Pthomadakis (talk | contribs) |
Pthomadakis (talk | contribs) |
||
| (33 intermediate revisions by 3 users not shown) | |||
| Line 12: | Line 12: | ||
'''Tesla V100 GPU''' | '''Tesla V100 GPU''' | ||
== 3D Input == | |||
=== Single Track === | |||
{| | |||
| style="width: 20px" | Example noisy input: | |||
| style="width: 20px" |Example correct output: | |||
|- | |||
| [[File:cnf_ml_denoise_3d_noisy.png]] | |||
| [[File:cnf_ml_denoise_3d.png]] | |||
|} | |||
[[File:cnf_ml_cnnv2_arch.png]] | |||
4x6 Kernels | |||
{| class="wikitable | |||
! Epochs | |||
! Training loss | |||
! Validation loss | |||
! Training Time | |||
! Inference Time | |||
! Train/Val Loss Plot | |||
! Example Case | |||
|- | |||
| 20 | |||
| 0.000064 | |||
| 0.00007 | |||
| 7822 | |||
| 0.00087 | |||
| [[File:cnf_ml_cnn_v2_train_val_loss_3d.png|480px]] | |||
| [[File:cnf_ml_cnn_v2_cnn_denoised_3d.png]] | |||
|} | |||
=== Different Noise === | |||
{| | |||
| style="width: 20px" | Example noisy input: | |||
| style="width: 20px" | Example correct output: | |||
|- | |||
| [[File:cnf_ml_denoise_3d_noisy2.png]] | |||
| [[File:cnf_ml_denoise_3d2.png]] | |||
|} | |||
{| | |||
| | |||
{| class="wikitable | |||
! Noisy | |||
! Correct | |||
! Denoised | |||
|- | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex1.png]] | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex1_cor.png]] | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex1_denoise.png]] | |||
|- | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex2.png]] | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex2_cor.png]] | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex2_denoise.png]] | |||
|- | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex3.png]] | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex3_cor.png]] | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex3_denoise.png]] | |||
|} | |||
| | |||
{| class="wikitable | |||
! Noisy | |||
! Correct | |||
! Denoised | |||
|- | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex4.png]] | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex4_cor.png]] | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex4_denoise.png]] | |||
|- | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex5.png]] | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex5_cor.png]] | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex5_denoise.png]] | |||
|- | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex6.png]] | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex6_cor.png]] | |||
|[[File:cnf_ml_denoise_3d_noisy2_ex6_denoise.png]] | |||
|} | |||
|} | |||
[[File:cnf_ml_denoise_3d_noisy2_hits_hist.png]] | |||
[[File:cnf_ml_denoise_3d_noisy2_noise_hist.png]] | |||
=== 250 Tracks === | |||
{| | |||
| style="width: 20px" | Example noisy input: | |||
| style="width: 20px" | Example correct output: | |||
|- | |||
| [[File:cnf_ml_denoise_3d_250_noisy2.png]] | |||
| [[File:cnf_ml_denoise_3d_250_2.png]] | |||
|} | |||
==== Data Augmentation ==== | |||
The given dataset for 250 tracks only consists of 1000 data points. This hurts the ability of the network to learn. | |||
To overcome this limitation we augment the dataset with synthetic data points by using random combinations of the 1 track dataset tracks. | |||
{| | |||
| | |||
{| class="wikitable | |||
! Noisy | |||
! Correct | |||
! Denoised | |||
|- | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex1.png]] | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex1_cor.png]] | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex1_denoise.png]] | |||
|- | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex2.png]] | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex2_cor.png]] | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex2_denoise.png]] | |||
|- | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex3.png]] | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex3_cor.png]] | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex3_denoise.png]] | |||
|} | |||
| | |||
{| class="wikitable | |||
! Noisy | |||
! Correct | |||
! Denoised | |||
|- | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex4.png]] | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex4_cor.png]] | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex4_denoise.png]] | |||
|- | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex5.png]] | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex5_cor.png]] | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex5_denoise.png]] | |||
|- | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex6.png]] | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex6_cor.png]] | |||
|[[File:cnf_ml_denoise_3d__250_noisy2_ex6_denoise.png]] | |||
|} | |||
|} | |||
[[File:cnf_ml_denoise_3d__250_noisy2_hits_hist.png]] | |||
[[File:cnf_ml_denoise_3d__250_noisy2_noise_hist.png]] | |||
{| class="wikitable | |||
! Epochs | |||
! Training loss | |||
! Validation loss | |||
! Training Time | |||
! Inference Time | |||
! Train/Val Loss Plot | |||
|- | |||
| 20 | |||
| 0.065 | |||
| 0.064 | |||
| 1300 | |||
| 0.000645 | |||
| [[File:cnf_ml_cnn_v2_train_val_loss_3d_250.png|480px]] | |||
|} | |||
=== Z Plane Quantization === | |||
==== Quantization Process ==== | |||
# Establish an array of Z ranges (must have an odd size) | |||
# The number of added planes between each base plane is equal to the truncated half size of the Z range array | |||
# Iterate hitlist activations | |||
## Get the plane, ring, and pad numbers | |||
## Offset the plane number to ignore added planes | |||
## Offset the plane number by the difference of the center index of the Z ranges array from the index of the range the Z value belongs | |||
{| | |||
! style="text-align: center; border-style: solid solid none solid;" | No Quantization | |||
(10 planes) | |||
! style="text-align: center; border-style: solid solid none none;"| Quantization | |||
(21 planes) | |||
! style="text-align: center; border-style: solid solid none none;"| Quantization | |||
(32 planes) | |||
! style="text-align: center; border-style: solid solid none none;"| Quantization | |||
(43 planes) | |||
|- | |||
|style="text-align: center; border-style: none solid solid solid;"| Z Ranges: | |||
{} | |||
|style="text-align: center; border-style: none solid solid solid;"| Z Ranges: | |||
{(-20, -1.5), (-1.5, 1.5), (1.5, 21)} | |||
|style="text-align: center; border-style: none solid solid none;"| Z Ranges: | |||
{(-20, -10), (-10, -1.5), (-1.5, 1.5), (1.5, 10), (10, 21)} | |||
|style="text-align: center; border-style: none solid solid none;"| Z Ranges: | |||
{(-20, -15), (-15, -10), (-10, -1.5), (-1.5, 1.5), (1.5, 10), (10, 15), (15, 21)} | |||
|- | |||
| style="text-align: center; vertical-align:top;"| [[File:CNF_3D_NO_QUANTIZATION.png]] | |||
| style="text-align: center; vertical-align:top;"| [[File:CNF_3D_QUANTIZATION_21.png]] | |||
| style="text-align: center; vertical-align:top;"| [[File:CNF_3D_QUANTIZATION_32.png]] | |||
| style="text-align: center; vertical-align:top;"| [[File:CNF_3D_QUANTIZATION_43.png]] | |||
|} | |||
==== Results ==== | |||
{| | |||
| | |||
{| class="wikitable | |||
! Noisy | |||
! Correct | |||
! Denoised | |||
|- | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex1.png]] | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex1_cor.png]] | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex1_denoise.png]] | |||
|- | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex2.png]] | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex2_cor.png]] | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex2_denoise.png]] | |||
|- | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex3.png]] | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex3_cor.png]] | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex3_denoise.png]] | |||
|} | |||
| | |||
{| class="wikitable | |||
! Noisy | |||
! Correct | |||
! Denoised | |||
|- | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex4.png]] | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex4_cor.png]] | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex4_denoise.png]] | |||
|- | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex5.png]] | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex5_cor.png]] | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex5_denoise.png]] | |||
|- | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex6.png]] | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex6_cor.png]] | |||
|[[File:cnf_ml_denoise_3d__250_24p_noisy2_ex6_denoise.png]] | |||
|} | |||
|} | |||
[[File:cnf_ml_denoise_3d__250_24p_noisy2_hits_hist.png]] | |||
[[File:cnf_ml_denoise_3d__250_24p_noisy2_noise_hist.png]] | |||
{| class="wikitable | |||
! Epochs | |||
! Training loss | |||
! Validation loss | |||
! Training Time | |||
! Inference | |||
! Train/Val Loss Plot | |||
|- | |||
| 10 | |||
| 0.021 | |||
| 0.022 | |||
| 1784 | |||
| 0.003 | |||
| [[File:cnf_ml_cnn_v2_train_val_loss_3d_250_24p.png|480px]] | |||
|} | |||
== 2D Input == | |||
Example noisy input: | Example noisy input: | ||
| Line 298: | Line 551: | ||
[[File:4.noise_histogram_mult23.png|480px]] | [[File:4.noise_histogram_mult23.png|480px]] | ||
[[File:5.noise_histogram_mult23.png|480px]] | [[File:5.noise_histogram_mult23.png|480px]] | ||
'''Train on new 2-3 tracks and test on multitrack V2''' | |||
{| class="wikitable | |||
! Epochs | |||
! Training loss | |||
! Validation loss | |||
! Training Time | |||
! Inference Time | |||
! Train/Val Loss Plot | |||
! Example Case | |||
! Valid Hits Histogram | |||
! Noise Added Histogram | |||
|- | |||
| 20 | |||
| 0.0043 | |||
| 0.003 | |||
| 517.2 | |||
| 0.0003 | |||
| [[File:cnn_ae_train_val_mult_loss_more_V2_new_multitrack.png|480px]] | |||
| [[File:cnf_ml_cnn_denoised_mult2_3_track_V2_new_multitrack.png|480px]] | |||
| [[File:cnf_ml_cnn_denoised_histogram_10_train_test_mult2_3_track_V2_new_multitrack.png|480px]] | |||
| [[File:cnf_ml_cnn_denoised_noise_histogram_10_train_test_mult2_3_track_V2_new_multitrack.png|480px]] | |||
|} | |||
[[File:cnf_ml_cnn_v2_hits_histogram_multitrack_new_seg0.png|380px]] | |||
[[File:cnf_ml_cnn_v2_hits_histogram_multitrack_new_seg1.png|380px]] | |||
[[File:cnf_ml_cnn_v2_hits_histogram_multitrack_new_seg2.png|380px]] | |||
[[File:cnf_ml_cnn_v2_hits_histogram_multitrack_new_seg3.png|380px]] | |||
[[File:cnf_ml_cnn_v2_hits_histogram_multitrack_new_seg4.png|380px]] | |||
[[File:cnf_ml_cnn_v2_hits_histogram_multitrack_new_seg5.png|380px]] | |||
[[File:0.noise_histogram_multitrack_new.png|480px]] | |||
[[File:1.noise_histogram_multitrack_new.png|480px]] | |||
[[File:2.noise_histogram_multitrack_new.png|480px]] | |||
[[File:3.noise_histogram_multitrack_new.png|480px]] | |||
[[File:4.noise_histogram_multitrack_new.png|480px]] | |||
[[File:5.noise_histogram_multitrack_new.png|480px]] | |||
'''Train on new 2-3 tracks and test on old 2-3 tracks V2''' | '''Train on new 2-3 tracks and test on old 2-3 tracks V2''' | ||
| Line 395: | Line 687: | ||
| [[File:ae_cnn_denoised_1.png|360px]] | | [[File:ae_cnn_denoised_1.png|360px]] | ||
| [[File:ae_cnn_denoised_1_V2.png|360px]] | | [[File:ae_cnn_denoised_1_V2.png|360px]] | ||
| [[File:ae_cnn_denoised_1_V2_new.png|360px]] | |||
|- | |- | ||
| [[File:ae_noisy_2.png|360px]] | | [[File:ae_noisy_2.png|360px]] | ||
| Line 401: | Line 694: | ||
| [[File:ae_cnn_denoised_2.png|360px]] | | [[File:ae_cnn_denoised_2.png|360px]] | ||
| [[File:ae_cnn_denoised_2_V2.png|360px]] | | [[File:ae_cnn_denoised_2_V2.png|360px]] | ||
| [[File:ae_cnn_denoised_2_V2_new.png|360px]] | |||
|- | |- | ||
| [[File:ae_noisy_3.png|360px]] | | [[File:ae_noisy_3.png|360px]] | ||
| Line 407: | Line 701: | ||
| [[File:ae_cnn_denoised_3.png|360px]] | | [[File:ae_cnn_denoised_3.png|360px]] | ||
| [[File:ae_cnn_denoised_3_V2.png|360px]] | | [[File:ae_cnn_denoised_3_V2.png|360px]] | ||
| [[File:ae_cnn_denoised_3_V2_new.png|360px]] | |||
|- | |- | ||
| [[File:ae_noisy_1m.png|360px]] | | [[File:ae_noisy_1m.png|360px]] | ||
| Line 445: | Line 740: | ||
* train network with multi-track data and evaluate performance on multi-track testing sample. | * train network with multi-track data and evaluate performance on multi-track testing sample. | ||
* put on the web site architecture of the network and try with a little deeper architecture (4032->2016->1008->336 -> 224 -> 336 -> 1008 -> 2016 -> 4032) | * put on the web site architecture of the network and try with a little deeper architecture (4032->2016->1008->336 -> 224 -> 336 -> 1008 -> 2016 -> 4032) | ||
=== Work Plan (November 17 === | |||
* Provide workflow for testing, given input image write out the truth and AI inferred image | |||
* Write software to create an image from AI inferred image and Truth image to reconstruct better truth, by filling in missing pieces in AI produced image from truth image when the points are close | |||
* Evaluate efficiency of reconstructing the truth image and noisiness of resulting image. Also make graph now much noise was removed from original image. | |||
* Start working with Hall-C data. much bigger input and evaluate efficiency of cleaning noise | |||
* at the first stage noise has to be added to the Hall-C data for training, it can start with one track sample, then 250 track sample. | |||
= Resources = | = Resources = | ||
Latest revision as of 21:51, 4 December 2020
This page will be updated about the machine learning data de-noising effort.
Problem
Traditional tracking algorithms are computationally intensive, especially for high luminosity experiments with multi-track final states where all combinations of segments in drift chambers have to be considered for firing best track candidates. At high luminosity the number of random segments (unrelated to the tracks) are increasing and as a result the number of possible combinations also increases, making the whole process longer.
Goal
Use Deep Learning Autoencoders that are trained on noisy tracks to produce the original track without the noise.
Results
Hardware specs:
Tesla V100 GPU
3D Input
Single Track
| Example noisy input: | Example correct output: |
|
|
| Epochs | Training loss | Validation loss | Training Time | Inference Time | Train/Val Loss Plot | Example Case |
|---|---|---|---|---|---|---|
| 20 | 0.000064 | 0.00007 | 7822 | 0.00087 |
|
Different Noise
| Example noisy input: | Example correct output: |
|
|
|
|
250 Tracks
| Example noisy input: | Example correct output: |
|
|
Data Augmentation
The given dataset for 250 tracks only consists of 1000 data points. This hurts the ability of the network to learn. To overcome this limitation we augment the dataset with synthetic data points by using random combinations of the 1 track dataset tracks.
|
|
| Epochs | Training loss | Validation loss | Training Time | Inference Time | Train/Val Loss Plot |
|---|---|---|---|---|---|
| 20 | 0.065 | 0.064 | 1300 | 0.000645 |
Z Plane Quantization
Quantization Process
- Establish an array of Z ranges (must have an odd size)
- The number of added planes between each base plane is equal to the truncated half size of the Z range array
- Iterate hitlist activations
- Get the plane, ring, and pad numbers
- Offset the plane number to ignore added planes
- Offset the plane number by the difference of the center index of the Z ranges array from the index of the range the Z value belongs
Results
|
|
| Epochs | Training loss | Validation loss | Training Time | Inference | Train/Val Loss Plot |
|---|---|---|---|---|---|
| 10 | 0.021 | 0.022 | 1784 | 0.003 |
2D Input
Example noisy input:
Example correct input:
Both the MLP and CNN networks used relu activation for all hidden layers and sigmoid for the output. Binary cross-entropy was used as the loss function and Adam as the optimizer.
Multilayer Perceptrons
| Training loss | Validation loss | Training Time | Inference Time | Train/Val Loss Plot | Example Case | Valid Hits Histogram | Noise Added Histogram |
|---|---|---|---|---|---|---|---|
| 0.0018 | 0.0219 | 298 | 0.000182 |
|
Convolutional Networks
Train and test on single track
Train and test on single track V2
| Epochs | Training loss | Validation loss | Training Time | Inference Time | Train/Val Loss Plot | Example Case | Valid Hits Histogram | Noise Added Histogram |
|---|---|---|---|---|---|---|---|---|
| 12 | 0.00048 | 0.00085 | 204 | 0.00024 |
|
Per segment histograms:
Train and test on multiple tracks V2
| Epochs | Training loss | Validation loss | Training Time | Inference Time | Train/Val Loss Plot | Example Case | Valid Hits Histogram | Noise Added Histogram |
|---|---|---|---|---|---|---|---|---|
| 20 | 0.0029 | 0.0030 | 683 | 0.0002 | File:Cnf ml cnn denoised mult track v2.png |
Train on single and test on multiple tracks
| Epochs | Validation loss | Inference Time | Example Case | Valid Hits Histogram | Noise Added Histogram |
|---|---|---|---|---|---|
| 50 | 0.027 | 0.00012 | |||
| 100 | 0.024 | 0.000125 |
Train and test on multiple tracks
| Epochs | Training loss | Validation loss | Training Time | Inference Time | Train/Val Loss Plot | Example Case | Valid Hits Histogram | Noise Added Histogram |
|---|---|---|---|---|---|---|---|---|
| 50 | 0.00537 | 0.00505 | 0.0001 | File:Cnf ml cnn denoised mult track.png |
Train and test on multiple tracks with more kernels
| Epochs | Training loss | Validation loss | Training Time | Inference Time | Train/Val Loss Plot | Example Case | Valid Hits Histogram | Noise Added Histogram |
|---|---|---|---|---|---|---|---|---|
| 50 | 0.0041 | 0.0040 | 943 | 0.0001 | File:Cnf ml cnn denoised mult track more.png |
Train on multiple and test on 2-3 tracks
Correct Track:
Noisy Input Track:
| Epochs | Validation loss | Inference Time | Example Case | Valid Hits Histogram | Noise Added Histogram |
|---|---|---|---|---|---|
| 50 | 0.0078 |
|
Train on multiple and test on 2-3 tracks V2
| Epochs | Validation loss | Inference Time | Example Case | Valid Hits Histogram | Noise Added Histogram |
|---|---|---|---|---|---|
| 20 | 0.0010 | 0.0007 |
|
Train on new 2-3 tracks and test on multitrack V2
| Epochs | Training loss | Validation loss | Training Time | Inference Time | Train/Val Loss Plot | Example Case | Valid Hits Histogram | Noise Added Histogram |
|---|---|---|---|---|---|---|---|---|
| 20 | 0.0043 | 0.003 | 517.2 | 0.0003 | File:Cnn ae train val mult loss more V2 new multitrack.png | File:Cnf ml cnn denoised mult2 3 track V2 new multitrack.png |
Train on new 2-3 tracks and test on old 2-3 tracks V2
| Epochs | Training loss | Validation loss | Training Time | Inference Time | Train/Val Loss Plot | Example Case | Valid Hits Histogram | Noise Added Histogram |
|---|---|---|---|---|---|---|---|---|
| 20 | 0.0043 | 0.0045 | 517.2 | 0.0003 |
|
Train on multiple and test on 2-3 tracks with more kernels
| Epochs | Validation loss | Inference Time | Example Case | Valid Hits Histogram | Noise Added Histogram |
|---|---|---|---|---|---|
| 50 | 0.0075 | 0.0008 |
|
Examples
Work Plan
- create a histogram comparing how many points in the reconstructed image match points in the ground truth
- create a histogram comparing how many points in reconstructed image are noise (are not in the original image)
- try network (trained with one track) with new data set that contains more than one track, and provide example plots for presentation
- create the efficiency and noise plots for the multi-track data sample reconstruction.
- train network with multi-track data and evaluate performance on multi-track testing sample.
- put on the web site architecture of the network and try with a little deeper architecture (4032->2016->1008->336 -> 224 -> 336 -> 1008 -> 2016 -> 4032)
Work Plan (November 17
- Provide workflow for testing, given input image write out the truth and AI inferred image
- Write software to create an image from AI inferred image and Truth image to reconstruct better truth, by filling in missing pieces in AI produced image from truth image when the points are close
- Evaluate efficiency of reconstructing the truth image and noisiness of resulting image. Also make graph now much noise was removed from original image.
- Start working with Hall-C data. much bigger input and evaluate efficiency of cleaning noise
- at the first stage noise has to be added to the Hall-C data for training, it can start with one track sample, then 250 track sample.
Resources
https://userweb.jlab.org/~gavalian/Documents/NN_Vary_Width_Depth%20(Nguyen).pdf









































































































































