{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/dilated-convolution-with-learnable-spacings","title":"Dilated convolution with learnable spacings","arxiv_id":"2112.03740","date":"2021-12-07","proceeding":null,"authors":["Ismail Khalfaoui-Hassani","Thomas Pellegrini","Timothée Masquelier"],"abstract":"Recent works indicate that convolutional neural networks (CNN) need large receptive fields (RF) to compete with visual transformers and their attention mechanism. In CNNs, RFs can simply be enlarged by increasing the convolution kernel sizes. Yet the number of trainable parameters, which scales quadratically with the kernel's size in the 2D case, rapidly becomes prohibitive, and the training is notoriously difficult. This paper presents a new method to increase the RF size without increasing the number of parameters. The dilated convolution (DC) has already been proposed for the same purpose. DC can be seen as a convolution with a kernel that contains only a few non-zero elements placed on a regular grid. Here we present a new version of the DC in which the spacings between the non-zero elements, or equivalently their positions, are no longer fixed but learnable via backpropagation thanks to an interpolation technique. We call this method \"Dilated Convolution with Learnable Spacings\" (DCLS) and generalize it to the n-dimensional convolution case. However, our main focus here will be on the 2D case. We first tried our approach on ResNet50: we drop-in replaced the standard convolutions with DCLS ones, which increased the accuracy of ImageNet1k classification at iso-parameters, but at the expense of the throughput. Next, we used the recent ConvNeXt state-of-the-art convolutional architecture and drop-in replaced the depthwise convolutions with DCLS ones. This not only increased the accuracy of ImageNet1k classification but also of typical downstream and robustness tasks, again at iso-parameters but this time with negligible cost on throughput, as ConvNeXt uses separable convolutions. Conversely, classic DC led to poor performance with both ResNet50 and ConvNeXt. The code of the method is available at: https://github.com/K-H-Ismail/Dilated-Convolution-with-Learnable-Spacings-PyTorch.","url_abs":"https://arxiv.org/abs/2112.03740v4","url_pdf":"https://arxiv.org/pdf/2112.03740v4.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"dilated-convolution-with-learnable-spacings","repo_url":"https://github.com/k-h-ismail/convnext-dcls","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"dilated-convolution-with-learnable-spacings","repo_url":"https://github.com/k-h-ismail/dilated-convolution-with-learnable-spacings-pytorch","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"dilated-convolution-with-learnable-spacings","repo_url":"https://github.com/rabihchamas/dcls-gradcam-eval","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"object-detection","task_name":"Object Detection"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"}],"methods":[{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"dcls","method_name":"DCLS"},{"method_slug":"dilated-convolution","method_name":"Dilated Convolution"}],"datasets_introduced":[],"methods_introduced":[{"slug":"dcls","name":"DCLS","full_name":"Dilated convolution with learnable spacings"}],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2112.03740","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2112.03740"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/k-h-ismail/convnext-dcls","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/rabihchamas/dcls-gradcam-eval","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/k-h-ismail/dilated-convolution-with-learnable-spacings-pytorch","reach":null}],"summary":{"unverified":3},"by_repo_kind":{"official":{"samples":3,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"486310d4868bfc14","entry":"ConstructKernel2d","repo":"k-h-ismail/dilated-convolution-with-learnable-spacings-pytorch","repo_kind":"official","path":"DCLS/construct/modules.py","file_url":"https://github.com/k-h-ismail/dilated-convolution-with-learnable-spacings-pytorch/blob/HEAD/DCLS/construct/modules.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"486310d4868bfc14"}},{"code_sha256_prefix":"0ed3a6e3cbaf0a87","entry":"Dcls2d","repo":"k-h-ismail/dilated-convolution-with-learnable-spacings-pytorch","repo_kind":"official","path":"DCLS/construct/modules.py","file_url":"https://github.com/k-h-ismail/dilated-convolution-with-learnable-spacings-pytorch/blob/HEAD/DCLS/construct/modules.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0ed3a6e3cbaf0a87"}},{"code_sha256_prefix":"2865e866b18d5444","entry":"_DclsNd","repo":"k-h-ismail/dilated-convolution-with-learnable-spacings-pytorch","repo_kind":"official","path":"DCLS/construct/modules.py","file_url":"https://github.com/k-h-ismail/dilated-convolution-with-learnable-spacings-pytorch/blob/HEAD/DCLS/construct/modules.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2865e866b18d5444"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}