Boundary Aware Multi-Focus Image Fusion Using Deep Neural Network

Haoyu Ma, Juncheng Zhang, Shaojun Liu, Qingmin LiaoICME 2019 · DOI

Abstract

Since it is usually difficult to capture an all-in-focus image of a 3D scene directly, various multi-focus image fusion methods are employed to generate it from several images focusing at different depths. However, the performance of existing methods is barely satisfactory and often degrades for areas near the focused/defocused boundary (FDB). In this paper, a boundary aware method using deep neural network is proposed to overcome this problem. (1) Aiming to acquire improved fusion images, a 2-channel deep network is proposed to better extract the relative defocus information of the two source images. (2) After analyzing the different situations for patches far away from and near the FDB, we use two networks to handle them respectively. (3) To simulate the reality more precisely, a new approach of dataset generation is designed. Experiments demonstrate that the proposed method outperforms the state-of-the-art methods, both qualitatively and quantitatively.

Introduction

When capturing a 3D scene, the limited depth-of-field of modern cameras often prevents all objects from being in focus simultaneously. Multi-focus image fusion addresses this by merging multiple images of the same scene, each focused at different depths, into a single "all-in-focus" composite. While traditional methods like wavelet transforms and modern Convolutional Neural Networks (CNNs) have made strides, they frequently struggle at the Focused/Defocused Boundary (FDB). These transition areas often suffer from blurring, ringing, or "blocking" artifacts because standard algorithms treat "easy" patches (entirely focused or defocused) and "hard" patches (containing the boundary) identically.

Methodology

The proposed framework introduces a "divide and conquer" strategy to handle the complexities of the FDB. The system is divided into three primary stages: initial score map generation, boundary-aware refinement, and post-processing.

The proposed boundary-aware fusion framework illustrating the dual-network refinement strategy.

1. Initial Score Map Generation

Unlike "siamese" architectures that process source images separately, this method utilizes a 2-channel network. By concatenating patches from two source images into a single input, the network can directly learn relative defocus information. This approach is more effective than calculating absolute blurriness for isolated images. The backbone of this stage is a ResNet-56, which provides the depth necessary for complex feature extraction without the degradation issues found in shallower CNNs.

The 2-channel image patch generation process used to extract relative defocus information.

2. Boundary-Aware Refinement

This stage is the core innovation of the paper. The system calculates an average focus score for each patch. If a patch's score falls between 0.2 and 0.8, it is classified as being "near the boundary." These challenging patches are routed to a specialized Boundary Refinement Net. Patches far from the boundary are considered clear-cut and bypass this specialized refinement, ensuring that the "easy" data does not wash out the specialized learning required for the "hard" boundary data.

3. Post-Processing and Fusion

Final score maps undergo simple binarization and small-region removal to create a "decision map." This map dictates pixel-wise selection from the source images to produce the final fused result.

Realistic Dataset Generation

The authors identified that standard synthetic datasets fail to accurately simulate real-world boundaries. To address this, they proposed a new generation method combining the Alpha Matting dataset (for foreground objects with complex edges like hair and fur) and the COCO 2017 dataset (for backgrounds). By applying Gaussian blurs to these layers and merging them based on ground-truth masks, they generated over 2.2 million realistic training samples that better prepare the network for complex real-world photography.

Experimental Results

The model was evaluated against six state-of-the-art methods using 24 widely recognized image pairs, including the Lytro dataset.

  • Quantitative Performance: The proposed method achieved the highest scores across four key objective metrics: $Q_{MI}$, $Q_G$, $Q_Y$, and $Q_{CB}$. Notably, it scored 1.2002 on the Mutual Information ($Q_{MI}$) metric, outperforming top traditional methods like DSIFT.
  • Qualitative Performance: Visual analysis of benchmark images (such as "clock" and "grid") revealed sharper edges and significantly fewer artifacts around thin structures compared to previous CNN-based approaches.
  • Ablation Study: Comparisons between versions with and without the refinement stage confirmed that the boundary-specific network is essential for achieving superior fusion quality.

Conclusion and Future Work

By focusing specifically on the Focused/Defocused Boundary and utilizing a 2-channel input strategy, this method sets a new standard for multi-focus image fusion. While the ResNet-56 architecture provides high accuracy, future work may explore even deeper networks or larger patch sizes to further enhance performance, alongside investigating how to handle potential image registration errors in handheld photography.

Summary updated

BibTeX
@inproceedings{ma2019boundary,
  author = {Haoyu Ma and Juncheng Zhang and Shaojun Liu and Qingmin Liao},
  title = {{Boundary Aware Multi-Focus Image Fusion Using Deep Neural Network}},
  booktitle = {ICME},
  year = {2019},
  doi = {10.1109/icme.2019.00201},
}
Figure