cabouman / svmbir

Fast code for parallel or fan beam tomographic reconstruction
BSD 3-Clause "New" or "Revised" License
19 stars 8 forks source link

Regularization Parameter Tuning #82

Closed cabouman closed 5 months ago

cabouman commented 3 years ago

Our new default parameter generate reasonable reconstructions, which is great. But in my experience, the default parameters tend to be consistently too blurry.

I propose the following changes to the defaults:

In auto_sigma_x change: sigma_x = 0.1 * sharpness * np.average(sino, weights=indicator) / (num_channels * delta_channel) to sigma_x = 0.2 * sharpness * np.average(sino, weights=indicator) / (num_channels * delta_channel)

And in auto_sigma_y change: def auto_sigma_y(sino, weights, snr_db=30.0): to def auto_sigma_y(sino, weights, snr_db=35.0):

This will increase the sharpness a bit, and also increase the assumed default SNR.

Please give feedback. Charlie

sjkisner commented 3 years ago

Charlie, What data have you experiment with? The TEM results are on the noisy side with the original defaults.

cabouman commented 3 years ago

Not much, so I defer to your input. So maybe the snr_db=30 is fine. Should we change the scaling for sigma_x, or is that fine too?

BTW, you are doing limited tilt angle/sparse view, so that might be a little different.

sjkisner commented 3 years ago

Yes, the TEM data is sparse and limited angle so it's a more extreme case. I just wouldn't rely too heavily on the demo data because it's noiseless and was generated with the same forward model. We have another small microCT data set that we can test, and I'll try on some of the newer nano-CT data from AFRL.

cabouman commented 3 years ago

OK, I have a wild idea. What if we change auto_sigma_x from: sigma_x = 0.1 *sharpness * np.average(sino, weights=indicator) / (num_channels * delta_channel) to sigma_x = 0.2 * (2**sharpness) * np.average(sino, weights=indicator) / (num_channels * delta_channel)

Then sharpness takes any real value with

The problem with the current sharpness is that you have to keep doubling it, and I'm also afraid people will set it to be less than zero and get screwball results.

sjkisner commented 3 years ago

I like the +/- range for sharpness.

cabouman commented 3 years ago

OK, I made two big changes.

Now the default value is sharpness=0.0.

I changed the meaning of the sharpness parameter in auto_sigma_x by putting in: sigma_x = 0.2 * (2**sharpness) * np.average(sino, weights=indicator) / (num_channels * delta_channel)

And I changed the auto_sigma_y routine to better handle resolution scaling by putting in: sigma_y = rel_noise_std * signal_rms * (delta_pixel / delta_channel)

So now the default value of sharpness=0.0, and hopefully, this will provide better parameter estimates for different reconstruction resolutions.

cabouman commented 3 years ago

Please give feedback on the default parameter estimates.

Remember, sharpness=0.0 is now the default regularization.

cabouman commented 3 years ago

I propose we have two basic parameters for controlling regularization:

sharpness [default 0.0]: Controls the overall regularization level edginess [default 0.0]: Controls the sensitivity to edges

The value of sigma_x is already set, and T can be set by

T = 2**(-edginess-sharpness)

The advantage of this is that as you raise sharpness, the united value of the threshold T \sigma_x will remain constant.