Issue with CTF correction in IsoNet2 refine

41 views
Skip to first unread message

rui wang

unread,
Apr 24, 2026, 9:39:05 AMApr 24
to IsoNet

Hi,

I ran into a problem when using CTF correction during the refine stage in IsoNet2.

When I enable CTF correction (using the network option,default parameters ), the predicted tomograms come out completely black, and the generated CTF also looks empty. If I turn off CTF correction, everything seems to run normally.

My tomograms were reconstructed using AreTomo2 with WBP. I also tried both the original tomograms and deconvolved ones, but the behavior is the same in both cases.

The training itself doesn’t crash, but the results are consistently blank whenever CTF correction is enabled. I’m wondering if this could be related to missing or incorrectly loaded CTF parameters (e.g. defocus or tilt information), but I’m not sure how to check that within IsoNet2. Has anyone seen something similar, or has suggestions on what might be going wrong? 

Thanks in advance for any help.

Best,

Rui Wang

question.png

:::

Somaye Badieyan

unread,
Apr 24, 2026, 11:52:28 AMApr 24
to rui wang, IsoNet
Hi Rui,

Sorry, I don’t have an answer, but I just wanted to say what a coincidence; I was about to send the exact same issue to the group and ask for help resolving it: black tomograms after refinement with CTF-corrected tomograms. My full tomograms were aligned and reconstructed directly in IMOD (Etomo, SIRT mode) and look high quality.

Here is an example of the steps I followed in IsoNet2 for a single tomogram. Tomogram and map all look fine just before refinement step: 

isonet.py prepare_star --full tomograms_full --pixel_size 8.48 --tilt_min -51 --tilt_max 51 -ac 0.07 --defocus "[19554]"

isonet.py deconv tomograms.star --snrfalloff 0.5 --deconvstrength 0.5 --output_dir deconv

isonet.py make_mask tomograms.star --density_percentage 35 --std_percentage 20 --input_column rlnDeconvTomoName --patch_size 6 --z_crop 0.15

isonet.py refine tomograms.star --method isonet2 --cube_size 128 --epochs 50 --mw_weight 200 --noise_level 0.1 --CTF_mode network --bfactor 200 --gpuID 0,1,2,3

Thanks for any help
Somaye

--
You received this message because you are subscribed to the Google Groups "IsoNet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isonet+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isonet/bc5cb6b6-2279-44ea-87d3-9e223bff5a15n%40googlegroups.com.

YUNTAO LIU

unread,
Apr 24, 2026, 7:02:23 PMApr 24
to Somaye Badieyan, rui wang, IsoNet
Hi Somaye and Rui,

I wonder if you open the tomogram.star whether the defocus column is correct?
the correct one should look like the following

"
# Created by the starfile Python package (version 0.5.6) at 15:09:27 on 26/11/2025


data_

loop_
_rlnIndex #1
_rlnTomoName #2
_rlnTomoReconstructedTomogramHalf1 #3
_rlnTomoReconstructedTomogramHalf2 #4
_rlnPixelSize #5
_rlnDefocus #6
_rlnVoltage #7
_rlnSphericalAberration #8
_rlnAmplitudeContrast #9
_rlnMaskBoundary #10
_rlnMaskName #11
_rlnTiltMin #12
_rlnTiltMax #13
_rlnBoxFile #14
_rlnNumberSubtomo #15
_rlnCorrectedTomoName #16
1       averaged_tomos/TS_01_EVN_full.mrc       tomograms_split/EVN/TS_01_EVN.mrc       tomograms_split/ODD/TS_01_ODD.mrc       5.400000        39057   300     2.700000        0.100000        None    None -60      60      None    600.000000      None
2       averaged_tomos/TS_03_EVN_full.mrc       tomograms_split/EVN/TS_03_EVN.mrc       tomograms_split/ODD/TS_03_ODD.mrc       5.400000        14817   300     2.700000        0.100000        None    None -60      60      None    600.000000      None
3       averaged_tomos/TS_43_EVN_full.mrc       tomograms_split/EVN/TS_43_EVN.mrc       tomograms_split/ODD/TS_43_ODD.mrc       5.400000        25241   300     2.700000        0.100000        None    None -60      60      None    600.000000      None
4       averaged_tomos/TS_45_EVN_full.mrc       tomograms_split/EVN/TS_45_EVN.mrc       tomograms_split/ODD/TS_45_ODD.mrc       5.400000        29776   300     2.700000        0.100000        None    None -60      60      None    600.000000      None
5       averaged_tomos/TS_54_EVN_full.mrc       tomograms_split/EVN/TS_54_EVN.mrc       tomograms_split/ODD/TS_54_ODD.mrc       5.400000        15463   300     2.700000        0.100000        None    None -60      60      None    600.000000      None
"
If you can change the code, you can add debug_matrix in the following location in the IsoNet/models/train.py and see what the debug_ctf_xx.mrc looks like. 

        with tqdm(total=total_steps, unit=" batch", disable=(rank!=0),desc=f"Epoch {epoch+1}") as progress_bar:
            # have to convert to tensor because reduce needed it
            average_loss = torch.tensor(0, dtype=torch.float).to(rank)
            average_inside_loss = torch.tensor(0, dtype=torch.float).to(rank)
            average_outside_loss = torch.tensor(0, dtype=torch.float).to(rank)

            for i_batch, batch in enumerate(train_loader):  
                x1, x2, gt, mw, ctf, wiener, noise_vol = process_batch(batch)
                debug_matrix(ctf, filename=f"{training_params['output_dir']}/debug_ctf_{i_batch}.mrc")




--
Best Regards,
Yuntao Liu,  Postdoc.

California NanoSystem Institute
University of California Los Angeles

Somaye Badieyan

unread,
Apr 24, 2026, 9:52:25 PMApr 24
to YUNTAO LIU, rui wang, IsoNet
Hi Yuntao,

As shown in the command line I included in my previous email, I used the full tomograms rather than paired even/odd tomograms. Therefore, I did not apply the denoising method. Instead, I used deconvoluted tomograms, and during refinement I used:

--method isonet2 rather than:
--method isonet2-2n2

Here I have also included the header of tomogram.star file below for your reference:

Best,
Somaye

data_

loop_
_rlnIndex #1
_rlnTomoName #2
_rlnTomoReconstructedTomogramHalf1 #3
_rlnTomoReconstructedTomogramHalf2 #4
_rlnPixelSize #5
_rlnDefocus #6
_rlnVoltage #7
_rlnSphericalAberration #8
_rlnAmplitudeContrast #9
_rlnDeconvTomoName #10
_rlnMaskBoundary #11
_rlnMaskName #12
_rlnTiltMin #13
_rlnTiltMax #14
_rlnBoxFile #15
_rlnNumberSubtomo #16
_rlnCorrectedTomoName #17
1       tomograms-full/square11-2_ts_010_rec.mrc        None    None    8.480000        12554   300     2.700000        0.070000        ./deconv/square11-2_ts_010_rec.mrc      None    mask-35-20-6/square11-2_ts_010_rec_mask.mrc     -51     51      None    3000    isonet_maps/corrected_epochs50_isonet2_unet-medium_square11-2_ts_010_rec.mrc

YUNTAO LIU

unread,
Apr 24, 2026, 10:53:31 PMApr 24
to Somaye Badieyan, rui wang, IsoNet

In theory, with and without denoise both goes through the same code the only difference is x1=x2 in your case. Is there any abnormal thing in the loss like a NaN?

I do not have this problem before but I will try to reproduce the problem


Best Regards,
Yuntao Liu,  Postdoc.

California NanoSystem Institute
University of California Los Angeles

rui wang

unread,
Apr 25, 2026, 12:33:15 AMApr 25
to IsoNet

Thanks for your reply!

I did observe abnormal behavior in the loss — it  turns into NaN during training (please see the attached figure).

One important finding is that when I disable the CTF network correction, the training becomes completely normal and the loss stays stable. This suggests the issue is likely related to the CTF correction branch.

I also have a hypothesis: could it be that the tomograms reconstructed by AreTomo2 are not fully compatible with the CTF correction module in IsoNet2? 

question2.png

Best,

Rui Wang

Somaye Badieyan

unread,
Apr 25, 2026, 5:32:27 PM (14 days ago) Apr 25
to rui wang, YUNTAO LIU, IsoNet
I observed a similar issue, with NaNs arising in the loss during training. And consistent with Rui’s observation, disabling the CTF network correction resolves the issue, resulting in stable training behavior.

Reply all
Reply to author
Forward
0 new messages