{"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/the-impact-of-uniform-inputs-on-activation","title":"The Impact of Uniform Inputs on Activation Sparsity and Energy-Latency Attacks in Computer Vision","arxiv_id":"2403.18587","date":"2024-03-27","proceeding":null,"authors":["Andreas Müller","Erwin Quiring"],"abstract":"Resource efficiency plays an important role for machine learning nowadays. The energy and decision latency are two critical aspects to ensure a sustainable and practical application. Unfortunately, the energy consumption and decision latency are not robust against adversaries. Researchers have recently demonstrated that attackers can compute and submit so-called sponge examples at inference time to increase the energy consumption and decision latency of neural networks. In computer vision, the proposed strategy crafts inputs with less activation sparsity which could otherwise be used to accelerate the computation. In this paper, we analyze the mechanism how these energy-latency attacks reduce activation sparsity. In particular, we find that input uniformity is a key enabler. A uniform image, that is, an image with mostly flat, uniformly colored surfaces, triggers more activations due to a specific interplay of convolution, batch normalization, and ReLU activation. Based on these insights, we propose two new simple, yet effective strategies for crafting sponge examples: sampling images from a probability distribution and identifying dense, yet inconspicuous inputs in natural datasets. We empirically examine our findings in a comprehensive evaluation with multiple image classification models and show that our attack achieves the same sparsity effect as prior sponge-example methods, but at a fraction of computation effort. We also show that our sponge examples transfer between different neural networks. Finally, we discuss applications of our findings for the good by improving efficiency by increasing sparsity.","url_abs":"https://arxiv.org/abs/2403.18587v1","url_pdf":"https://arxiv.org/pdf/2403.18587v1.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":"the-impact-of-uniform-inputs-on-activation","repo_url":"https://github.com/and-mill/2024-sponge-example-analysis","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.18587","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.18587"}},"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/and-mill/2024-sponge-example-analysis","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":6,"unverified":1},"by_repo_kind":{"official":{"samples":7,"ran":6,"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":"c7eddb15308d2a6f","entry":"clamp_image","repo":"and-mill/2024-sponge-example-analysis","repo_kind":"official","path":"utils/image_utils.py","file_url":"https://github.com/and-mill/2024-sponge-example-analysis/blob/HEAD/utils/image_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c7eddb15308d2a6f"}},{"code_sha256_prefix":"844bf7275aaceb30","entry":"l2_norm","repo":"and-mill/2024-sponge-example-analysis","repo_kind":"official","path":"original_sponge_examples_code/density_recorder.py","file_url":"https://github.com/and-mill/2024-sponge-example-analysis/blob/HEAD/original_sponge_examples_code/density_recorder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"844bf7275aaceb30"}},{"code_sha256_prefix":"7642d9f39e9d01d9","entry":"nonzero_func","repo":"and-mill/2024-sponge-example-analysis","repo_kind":"official","path":"original_sponge_examples_code/density_recorder.py","file_url":"https://github.com/and-mill/2024-sponge-example-analysis/blob/HEAD/original_sponge_examples_code/density_recorder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7642d9f39e9d01d9"}},{"code_sha256_prefix":"ce85d0262c94935d","entry":"nonzero_func_batch","repo":"and-mill/2024-sponge-example-analysis","repo_kind":"official","path":"original_sponge_examples_code/density_recorder.py","file_url":"https://github.com/and-mill/2024-sponge-example-analysis/blob/HEAD/original_sponge_examples_code/density_recorder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ce85d0262c94935d"}},{"code_sha256_prefix":"e76c9d43a82815f4","entry":"rand_images","repo":"and-mill/2024-sponge-example-analysis","repo_kind":"official","path":"utils/image_utils.py","file_url":"https://github.com/and-mill/2024-sponge-example-analysis/blob/HEAD/utils/image_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e76c9d43a82815f4"}},{"code_sha256_prefix":"053183d583c90546","entry":"scale_tensor","repo":"and-mill/2024-sponge-example-analysis","repo_kind":"official","path":"utils/image_utils.py","file_url":"https://github.com/and-mill/2024-sponge-example-analysis/blob/HEAD/utils/image_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"053183d583c90546"}},{"code_sha256_prefix":"aa7224e2da4f7c08","entry":"get_model","repo":"and-mill/2024-sponge-example-analysis","repo_kind":"official","path":"utils/model_utils.py","file_url":"https://github.com/and-mill/2024-sponge-example-analysis/blob/HEAD/utils/model_utils.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":"aa7224e2da4f7c08"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}