Skip to main content
Back

Xi'an Jiaotong's ND-CNPFuse Beats Nine Deep Learning Models Without Any Training

A training-free spiking-neuron approach to multi-focus image fusion delivers state-of-the-art results across four benchmarks while running in 0.18 seconds on CPU.

Pro

  • ND-CNPFuse fuses multi-focus images using biologically inspired coupled neural P (CNP) spiking systems, no training required.
  • Authors derive a mathematical constraint preventing 'continuous firing' failure, enabling automatic parameter configuration across datasets.
  • Achieves state-of-the-art on four MFIF benchmarks: Lytro, MFFW, MFI-WHU, and Real-MFF.
  • Runs at 0.18 seconds per image pair on CPU in C++, beating GPU-accelerated baselines.
  • Decision maps are interpretable, generated by comparing neuron spike counts rather than black-box network outputs.
  • Code and both MATLAB and C++ implementations available at github.com/MorvanLi/ND-CNPFuse.

A team from Xi'an Jiaotong University has taken a decidedly non-mainstream route to solve a stubborn computer vision problem: fusing multiple photos taken at different focal depths into a single all-in-focus image. Instead of piling on more transformer layers or diffusion tricks, they went back to a biologically inspired spiking neural model and did the math to make it work reliably. The result, ND-CNPFuse, beats nine deep-learning baselines on four standard benchmarks without any training at all.

The boundary problem nobody has cleanly solved

Multi-focus image fusion (MFIF) aims to generate an all-in-focus image by fusing multiple images of the same scene captured at varying focal depths. The dominant strategy is to build a decision map, a per-pixel mask that says which source image is sharper at each location, then blend accordingly. Get that map wrong and you get halos, ghosting, or blurry seams around the focus boundary.

Deep learning approaches learn the decision map end-to-end, but their internal working mechanism is difficult to explain, which results in false edges and burrs in the generated decision map. Traditional transform-domain methods, meanwhile, rely heavily on manually designed fusion rules and strong prior assumptions that break on unfamiliar scenes.

Comparison of a Y-Net black-box decision map pipeline against the ND-CNP spike-matrix approach

Spiking neurons, but with actual guarantees

Coupled neural P (CNP) systems are neural computing models inspired by synchronous pulse bursts in a mammal's visual cortex. Each neuron fires binary spikes based on three internal state variables (feeding input, linking input, and a dynamic threshold), and neighboring neurons couple with each other to fire cooperatively. The intuition for fusion is clean: focused regions produce more spikes than unfocused ones, consistent with human visual perception, so counting spikes gives you a focus measure directly.

There is a catch. When CNP systems are directly applied to MFIF, neurons may suffer abnormal continuous firing, and the spike counts cannot accurately reflect the focus differences of the source images. Prior CNP-based work papered over this by hand-tuning parameters per dataset. The real contribution of this paper is a proof: the authors derive the exact inequality relating external input to the neuron's internal parameters that guarantees the neuron does not run away into continuous firing.

Once you have that constraint, parameters can be set automatically from the input image rather than tuned manually, which is why the same configuration transfers across all four benchmark datasets.

How the pipeline actually runs

ND-CNPFuse three-stage architecture: input processing, decision map generation, and fusion

The pipeline is refreshingly compact:

  1. Preprocess each source image with the sum-modified Laplacian (SML), a classic focus measure that gives the spiking neurons a richer feature signal than raw pixel intensity.
  2. Feed the two SML maps into two ND-CNP systems and iterate them for 110 steps. Each neuron accumulates a spike count; the outputs are two spike matrices.
  3. Because neurons fire cooperatively within a coupling radius, sum the spike counts inside a radius of 16 around each pixel to get a robust focus score for each source.
  4. Build the decision map by picking the source with the higher spike count at each pixel, then blend the two source images accordingly. No post-processing, no morphological cleanup.

The numbers

ND-CNPFuse was evaluated on Lytro, MFFW, MFI-WHU, and Real-MFF against nine recent methods including CCF, DB-MFIF, DeepM2CDL, TC-MoA, Mask-DiFuser, DMANet, and GIFNet across six metrics (Qabf, FMIw, SSIM, PSNR, QP, QCB). It ranks first in 23 of 24 metric-dataset combinations, coming second only on SSIM for the MFFW dataset, which contains defocus spread effects that its spike-count clarity measure handles less gracefully at low-contrast edges.

The efficiency story is arguably more interesting. Running on an Intel i5-13400 CPU, the C++ implementation processes an image pair in 0.18 seconds, beating even GPU-accelerated DMANet at 0.21s in CPU-only execution. Energy consumption comes in at 1.12 x 10^-5 J per image pair on Lytro-sized inputs.

When to reach for it, and when not to

The obvious use cases are anywhere you need clean decision maps without a training pipeline: microscopy focus stacking, macro photography, industrial inspection, and edge devices where you cannot ship a GPU. Because the method is training-free and its parameters auto-configure from the input, it generalizes to new domains without a labeled dataset.

The known weakness is defocus spread. Scenes with soft, gradual focus transitions and low-contrast edges can produce spike counts that do not cleanly separate focused from unfocused regions, which is why MFFW's SSIM is the one metric where a competitor wins. If your imagery is dominated by soft bokeh transitions rather than crisp focus/defocus boundaries, a learned model may still edge it out.

Code is available on GitHub, with the authors publishing both MATLAB and C++ implementations. The broader message here is worth taking seriously: for narrow, well-defined vision tasks, a couple of pages of neurodynamics can outperform the latest diffusion or MoE-based fusion model on both quality and latency, while producing decision maps you can actually inspect.