Optimal Weighted Convolution for Classification and Denosing

Simone Cammarasana, Giuseppe Patanè
5/30/2025
14 citations
cs.CV

Official code: cammarasana123/weightedConvolution2.0 (61 stars, Python, GPL-3.0, last commit 2026-01-28). 1 more implementation below.

Abstract

We introduce a novel weighted convolution operator that enhances traditional convolutional neural networks (CNNs) by integrating a spatial density function into the convolution operator. This extension enables the network to differentially weight neighbouring pixels based on their relative position to the reference pixel, improving spatial characterisation and feature extraction.

Show full abstract

The proposed operator maintains the same number of trainable parameters and is fully compatible with existing CNN architectures. Although developed for 2D image data, the framework is generalisable to signals on regular grids of arbitrary dimensions, such as 3D volumetric data or 1D time series. We propose an efficient implementation of the weighted convolution by pre-computing the density function and achieving execution times comparable to standard convolution layers. We evaluate our method on two deep learning tasks: image classification using the CIFAR-100 dataset [KH+09] and image denoising using the DIV2K dataset [AT17]. Experimental results with state-of-the-art classification (e.g., VGG [SZ15], ResNet [HZRS16]) and denoising (e.g., DnCNN [ZZC+17], NAFNet [CCZS22]) methods show that the weighted convolution improves performance with respect to standard convolution across different quantitative metrics. For example, VGG achieves an accuracy of 66.94% with weighted convolution versus 56.89% with standard convolution on the classification problem, while DnCNN improves the PSNR value from 20.17 to 22.63 on the denoising problem. All models were trained on the CINECA Leonardo cluster to reduce the execution time and improve the tuning of the density function values. The PyTorch implementation of the weighted convolution is publicly available at: https://github.com/cammarasana123/weightedConvolution2.0.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
cammarasana123/weightedConvolution2.0Official61PythonGPL-3.02026-01-28
cammarasana123/weightedConvolutionOfficial4PythonGPL-3.02025-06-13
GPL-3.0

Weighted Convolution 2.0

612PythonMay 21, 202510 months agoGPL-3.0
GPL-3.0

Convolution for 2D and 3D images with density function

40PythonApr 17, 20251 years agoGPL-3.0

Similar Papers

Cite this paper

@article{cammarasana2025optimal,
  title  = {Optimal Weighted Convolution for Classification and Denosing},
  author = {Simone Cammarasana and Giuseppe Patanè},
  year   = {2025},
  eprint = {2505.24558},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.24558v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.24558.svg)](https://codeofpaper.com/paper/2505.24558)

Discussion