{"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/approximating-cnns-with-bag-of-local-features-1","title":"Approximating CNNs with Bag-of-local-Features models works surprisingly well on ImageNet","arxiv_id":"1904.00760","date":"2019-03-20","proceeding":"ICLR 2019 5","authors":["Wieland Brendel","Matthias Bethge"],"abstract":"Deep Neural Networks (DNNs) excel on many complex perceptual tasks but it has\nproven notoriously difficult to understand how they reach their decisions. We\nhere introduce a high-performance DNN architecture on ImageNet whose decisions\nare considerably easier to explain. Our model, a simple variant of the\nResNet-50 architecture called BagNet, classifies an image based on the\noccurrences of small local image features without taking into account their\nspatial ordering. This strategy is closely related to the bag-of-feature (BoF)\nmodels popular before the onset of deep learning and reaches a surprisingly\nhigh accuracy on ImageNet (87.6% top-5 for 33 x 33 px features and Alexnet\nperformance for 17 x 17 px features). The constraint on local features makes it\nstraight-forward to analyse how exactly each part of the image influences the\nclassification. Furthermore, the BagNets behave similar to state-of-the art\ndeep neural networks such as VGG-16, ResNet-152 or DenseNet-169 in terms of\nfeature sensitivity, error distribution and interactions between image parts.\nThis suggests that the improvements of DNNs over previous bag-of-feature\nclassifiers in the last few years is mostly achieved by better fine-tuning\nrather than by qualitatively different decision strategies.","url_abs":"http://arxiv.org/abs/1904.00760v1","url_pdf":"http://arxiv.org/pdf/1904.00760v1.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":"approximating-cnns-with-bag-of-local-features-1","repo_url":"https://github.com/wielandbrendel/bag-of-local-features-models","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"approximating-cnns-with-bag-of-local-features-1","repo_url":"https://github.com/rui-yan/CS229-bagnet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"approximating-cnns-with-bag-of-local-features-1","repo_url":"https://github.com/rui-yan/CS229-final-project","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"approximating-cnns-with-bag-of-local-features-1","repo_url":"https://github.com/osmr/imgclsmob","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mxnet","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/1904.00760","atlas_url":"https://app.syntology.ai/?focus=1904.00760","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1904.00760"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/rui-yan/CS229-bagnet","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/osmr/imgclsmob","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/rui-yan/CS229-final-project","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/wielandbrendel/bag-of-local-features-models","reach":null}],"summary":{"ran_fixture":3,"ran_draft_wrong":1},"by_repo_kind":{"official":{"samples":3,"ran":3,"repositories":1},"listed":{"samples":1,"ran":1,"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":4,"samples":[{"code_sha256_prefix":"63f8bbd18c04f99c","entry":"bagnet17","repo":"wielandbrendel/bag-of-local-features-models","repo_kind":"official","path":"bagnets/pytorchnet.py","file_url":"https://github.com/wielandbrendel/bag-of-local-features-models/blob/HEAD/bagnets/pytorchnet.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"63f8bbd18c04f99c"}},{"code_sha256_prefix":"2e100d24dc70cd05","entry":"bagnet33","repo":"wielandbrendel/bag-of-local-features-models","repo_kind":"official","path":"bagnets/pytorchnet.py","file_url":"https://github.com/wielandbrendel/bag-of-local-features-models/blob/HEAD/bagnets/pytorchnet.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"2e100d24dc70cd05"}},{"code_sha256_prefix":"d28a991529a804f4","entry":"bagnet9","repo":"wielandbrendel/bag-of-local-features-models","repo_kind":"official","path":"bagnets/pytorchnet.py","file_url":"https://github.com/wielandbrendel/bag-of-local-features-models/blob/HEAD/bagnets/pytorchnet.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"d28a991529a804f4"}},{"code_sha256_prefix":"d709ebf6acfd307f","entry":"train_model","repo":"rui-yan/CS229-bagnet","repo_kind":"listed","path":"run_bagnet33.py","file_url":"https://github.com/rui-yan/CS229-bagnet/blob/HEAD/run_bagnet33.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d709ebf6acfd307f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}