{"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/ethical-lens-curbing-malicious-usages-of-open","title":"Ethical-Lens: Curbing Malicious Usages of Open-Source Text-to-Image Models","arxiv_id":"2404.12104","date":"2024-04-18","proceeding":null,"authors":["Yuzhu Cai","Sheng Yin","Yuxi Wei","Chenxin Xu","Weibo Mao","Felix Juefei-Xu","Siheng Chen","Yanfeng Wang"],"abstract":"The burgeoning landscape of text-to-image models, exemplified by innovations such as Midjourney and DALLE 3, has revolutionized content creation across diverse sectors. However, these advancements bring forth critical ethical concerns, particularly with the misuse of open-source models to generate content that violates societal norms. Addressing this, we introduce Ethical-Lens, a framework designed to facilitate the value-aligned usage of text-to-image tools without necessitating internal model revision. Ethical-Lens ensures value alignment in text-to-image models across toxicity and bias dimensions by refining user commands and rectifying model outputs. Systematic evaluation metrics, combining GPT4-V, HEIM, and FairFace scores, assess alignment capability. Our experiments reveal that Ethical-Lens enhances alignment capabilities to levels comparable with or superior to commercial models like DALLE 3, ensuring user-generated content adheres to ethical standards while maintaining image quality. This study indicates the potential of Ethical-Lens to ensure the sustainable development of open-source text-to-image tools and their beneficial integration into society. Our code is available at https://github.com/yuzhu-cai/Ethical-Lens.","url_abs":"https://arxiv.org/abs/2404.12104v2","url_pdf":"https://arxiv.org/pdf/2404.12104v2.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":"ethical-lens-curbing-malicious-usages-of-open","repo_url":"https://github.com/yuzhu-cai/ethical-lens","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2404.12104","atlas_url":"https://app.syntology.ai/?focus=2404.12104","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.12104"}},"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/yuzhu-cai/ethical-lens","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":2,"unverified":3},"by_repo_kind":{"official":{"samples":5,"ran":2,"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":"fc4e94fe5babb7de","entry":"read_json_files","repo":"yuzhu-cai/ethical-lens","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/yuzhu-cai/ethical-lens/blob/HEAD/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fc4e94fe5babb7de"}},{"code_sha256_prefix":"5247f5a2a3f56a5b","entry":"set_cfg","repo":"yuzhu-cai/ethical-lens","repo_kind":"official","path":"infer.py","file_url":"https://github.com/yuzhu-cai/ethical-lens/blob/HEAD/infer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5247f5a2a3f56a5b"}},{"code_sha256_prefix":"42fce2fdd0a67e0c","entry":"build_evaluator","repo":"yuzhu-cai/ethical-lens","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/yuzhu-cai/ethical-lens/blob/HEAD/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"42fce2fdd0a67e0c"}},{"code_sha256_prefix":"24593f50348a6380","entry":"build_generator","repo":"yuzhu-cai/ethical-lens","repo_kind":"official","path":"generate.py","file_url":"https://github.com/yuzhu-cai/ethical-lens/blob/HEAD/generate.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"24593f50348a6380"}},{"code_sha256_prefix":"1d3fefc527b9ca00","entry":"generate","repo":"yuzhu-cai/ethical-lens","repo_kind":"official","path":"generate.py","file_url":"https://github.com/yuzhu-cai/ethical-lens/blob/HEAD/generate.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1d3fefc527b9ca00"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}