Skip to main content
. 2025 Aug 1;25(15):4751. doi: 10.3390/s25154751
Algorithm 1 Dual-path adversarial denoising network training procedure
  • Input:

    Clean image set X={x1,…,xn}.

    Noisy image set Y={y1,…,yn} (unpaired).

    Hyper-parameters: α, τD, τG, λgp, ksize, batch_size, epochs, early_stop_patience

  •  Parameters

    :

    θD — Denoiser (Dual-UNet) parameters.

    θG — Generator (UNet-G) parameters.

    θP — Discriminator (PatchGAN) parameters.

  • Output:

    Trained denoiser D(x′;θD) with minimal noise and maximum detail preservation

  • 1:

    Randomly initialize θD, θG, θP

  • 2:

    Pre-compute Gaussian kernel K=get_gausskernel(ksize,C=3)

  • 3:

    for epoch =1 to epochs do

  • 4:

        for mini-batch =1to ⌈|X|/batch_size⌉ do

  • 5:

            /* 1. Sample data */

  • 6:

            {x}← Random batch from X

  • 7:

            {y}← Random batch from Y (same size)

  • 8:

            {z}←N(0,1) noise map same spatial size as x

  • 9:

            /* 2. Forward passes */

  • 10:

            x^←y−D(y;θD)                                                                     ▹ Denoised image

  • 11:

            y˜←G(concat(x,z);θG)                                                          ▹ Synthetic noisy image

  • 12:

            /* 3. Update Discriminator P */

  • 13:

            LP←αP(x^,y;θP)−P(x,y;θP)+(1−α)P(x,y˜;θP)−P(x,y;θP)+λgp·gradient_penalty

  • 14:

            θP←θP−ηP∇θPLP

  • 15:

            if mini-batch mod num_critic =0 then

  • 16:

               /* 4. Update Denoiser D */

  • 17:

               LD←−(1−α)P(x^,y;θP)+τD∥x^−x∥1

  • 18:

               θD←θD−ηD∇θDLD

  • 19:

               /* 5. Update Generator G */

  • 20:

               LG←−αP(x,y˜;θP)+τG∥GF(y˜−x)−GF(y−x)∥1

  • 21:

               θG←θG−ηG∇θGLG

  • 22:

            end if

  • 23:

        end for

  • 24:

        /* 6. Early stopping check */

  • 25:

        val_loss ← MAE on validation set

  • 26:

        if val_loss has not improved for early_stop_patience epochs then

  • 27:

            break

  • 28:

        end if

  • 29:

    end for

  • 30:

    return  D(x′;θD)