Model-free estimation of the Cramer-Rao bound for deep-learning imaging in complex media

The provided code is designed for benchmarking the performance of artificial neural networks (ANNs) for estimating the position of a target hidden behind a dynamic scattering medium, such as a suspension of TiO₂ nanoparticles in glycerol. These code performs Fisher Information (FI) estimation and image processing to assess the precision limits of the ANN models and to compare them to the Cramér-Rao bound (CRB), which sets the ultimate limit for precision in estimation. The goal is to determine whether deep-learning imaging systems can approach this theoretical limit when applied to complex media.

The code and the datastets are organized in the following way:

Estimation of the Cramer-Rao Bound Dataset
│
├── obj_shape_data  
│   ├── 250mg_20ml_bigger_obj
│   ├── 250mg_20ml_cross
│   ├── 250mg_20ml_normal_obj
│   └── 250mg_20ml_small_obj
│
├── OD_data
│   ├── 000_no_sc
│   ├── 100mg_20ml
│   ├── 150mg_20ml
│   ├── 200mg_20ml
│   └── 250mg_20ml
│
├── raw_data_example
│
├── ANN_data_processing.py
├── estimation_of_FI.py
├── FI_estimation_synthetic.ipynb
├── functions.py
├── models.py
└── raw_data_processing.py

Datasets:
obj_shape_data folder contains the datasets for different sizes/shapes of the scattering target.
OD_data folder contains the datasets for different optical densities of the scattering medium, behind which the scattering target is hidden.
raw_data_example contains an example of raw camera frames for the 150mg_20ml dataset.
Each dataset folder contains the following files:
static.npy - original 128x128 speckles with the scatterer fixed in the middle of the field of veiw and varying disorder
x_tr.npy - resampled 32x32 speckles generated by synthetically shifthing the image of a static scatterer located in the middle of the image in a random (uniform) way.
y_tr.npy - coordinates of the scatterer shifts from the previous file normalized to -1 to 1
x_tr.npy - resampled 32x32 speckles of the scatterer being physically moved in a square grid pattern. 
x_tst_same.npy - resampled 32x32 speckles generated by synthetically shifthing the image of a static scatterer located in the middle of the image in the same grid pattern as for x_tr.npy data (this is for used bias correction)


Code:
raw_data_processing.py
An example of handling raw data frames. This code filters the background and prepares the resampled datasets described above.

ANN_data_processing.py 
The code of ANN scatterer position estimation from the speckle frames. 

estimation_of_FI.py
FI calculation for the datasets described above. 

FI_estimation_synthetic.ipynb
FI calculation for a synthetic dataset example used in the introduction (Fig2 of the manuscript).

functions.py
supplementary file for estimation_of_FI.py

models.py
supplementary file for ANN_data_processing.py