Skip to main content
. 2025 Oct 30;11(11):382. doi: 10.3390/jimaging11110382
Algorithm 1 CMAWRNet Image Restoration Algorithm
Require: Input image I∈0,1W×H×3
Ensure: Restored image Iclean
  1. Initialization: Set parameters γt,γs,γ, and patch size Ω

  2. Compute guidance map: G←∇Iγt ⊳ Equation (5)

  3. Compute structure map: S0←1Ω∑i,j∈Ω∇Ii,jγs ⊳ Equation (6)

  4. Compute texture component: T0←I⊘S0 ⊳ Since I=S0∘T0

  5. Refine components using DNet:

  6. S←DNetS0 ⊳ Refined structure

  7. T←DNetT0 ⊳ Refined texture

  8. Clean components:

  9. Sclean←TNet-HS ⊳ Clean structure component

  10. Tclean←TNet-ST ⊳ Clean texture component

  11. Estimate latent variable from structure:

  12. M←Conv1x1Sclean

  13. S~clean←M∘Sclean

  14. S^clean←Scleanγ ⊳ Gamma correction

  15. Compute attention maps using FNet:

  16. MS←σW2SReLUW1SSclean,I

  17. MT←σW2TReLUW1TTclean,I

  18. Fuse components:

  19. Sfused←MS⊗Sclean

  20. Tfused←MT⊗Tclean

  21. Iclean←Sfused∘Tfused

  22. return Iclean