{"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/oapt-offset-aware-partition-transformer-for","title":"OAPT: Offset-Aware Partition Transformer for Double JPEG Artifacts Removal","arxiv_id":"2408.11480","date":"2024-08-21","proceeding":null,"authors":["Qiao Mo","Yukang Ding","Jinhua Hao","Qiang Zhu","Ming Sun","Chao Zhou","Feiyu Chen","Shuyuan Zhu"],"abstract":"Deep learning-based methods have shown remarkable performance in single JPEG artifacts removal task. However, existing methods tend to degrade on double JPEG images, which are prevalent in real-world scenarios. To address this issue, we propose Offset-Aware Partition Transformer for double JPEG artifacts removal, termed as OAPT. We conduct an analysis of double JPEG compression that results in up to four patterns within each 8x8 block and design our model to cluster the similar patterns to remedy the difficulty of restoration. Our OAPT consists of two components: compression offset predictor and image reconstructor. Specifically, the predictor estimates pixel offsets between the first and second compression, which are then utilized to divide different patterns. The reconstructor is mainly based on several Hybrid Partition Attention Blocks (HPAB), combining vanilla window-based self-attention and sparse attention for clustered pattern features. Extensive experiments demonstrate that OAPT outperforms the state-of-the-art method by more than 0.16dB in double JPEG image restoration task. Moreover, without increasing any computation cost, the pattern clustering module in HPAB can serve as a plugin to enhance other transformer-based image restoration methods. The code will be available at https://github.com/QMoQ/OAPT.git .","url_abs":"https://arxiv.org/abs/2408.11480v2","url_pdf":"https://arxiv.org/pdf/2408.11480v2.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":"oapt-offset-aware-partition-transformer-for","repo_url":"https://github.com/qmoq/oapt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"image-restoration","task_name":"Image Restoration"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2408.11480","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.11480"}},"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":"deterministic:regex_extraction","url":"https://github.com/QMoQ/OAPT","reach":{"status":"ok"}}],"summary":{"ran":6,"unverified":5},"by_repo_kind":{"official":{"samples":11,"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":11,"samples":[{"code_sha256_prefix":"a0a9dee5557b1557","entry":"calculate_weights_indices","repo":"QMoQ/OAPT","repo_kind":"official","path":"oapt/matlab_functions.py","file_url":"https://github.com/QMoQ/OAPT/blob/HEAD/oapt/matlab_functions.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a0a9dee5557b1557"}},{"code_sha256_prefix":"2a78a7db11a55ede","entry":"cubic","repo":"QMoQ/OAPT","repo_kind":"official","path":"oapt/matlab_functions.py","file_url":"https://github.com/QMoQ/OAPT/blob/HEAD/oapt/matlab_functions.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2a78a7db11a55ede"}},{"code_sha256_prefix":"f9d4c247328f3337","entry":"get_image_paths","repo":"QMoQ/OAPT","repo_kind":"official","path":"oapt/models/utils_image.py","file_url":"https://github.com/QMoQ/OAPT/blob/HEAD/oapt/models/utils_image.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f9d4c247328f3337"}},{"code_sha256_prefix":"c6ed12ec55cbdc95","entry":"imresize","repo":"QMoQ/OAPT","repo_kind":"official","path":"oapt/matlab_functions.py","file_url":"https://github.com/QMoQ/OAPT/blob/HEAD/oapt/matlab_functions.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c6ed12ec55cbdc95"}},{"code_sha256_prefix":"226f6afcd57ff476","entry":"is_image_file","repo":"QMoQ/OAPT","repo_kind":"official","path":"oapt/models/utils_image.py","file_url":"https://github.com/QMoQ/OAPT/blob/HEAD/oapt/models/utils_image.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"226f6afcd57ff476"}},{"code_sha256_prefix":"95067518dc16b3e5","entry":"reorder_image","repo":"QMoQ/OAPT","repo_kind":"official","path":"oapt/models/myb_model.py","file_url":"https://github.com/QMoQ/OAPT/blob/HEAD/oapt/models/myb_model.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"95067518dc16b3e5"}},{"code_sha256_prefix":"3984b3ec31e90ef0","entry":"patches_from_image","repo":"QMoQ/OAPT","repo_kind":"official","path":"oapt/models/utils_image.py","file_url":"https://github.com/QMoQ/OAPT/blob/HEAD/oapt/models/utils_image.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3984b3ec31e90ef0"}},{"code_sha256_prefix":"a648a03a952822c0","entry":"reduce_loss","repo":"QMoQ/OAPT","repo_kind":"official","path":"oapt/losses/loss_util.py","file_url":"https://github.com/QMoQ/OAPT/blob/HEAD/oapt/losses/loss_util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a648a03a952822c0"}},{"code_sha256_prefix":"07e474d3f11470e5","entry":"to_y_channel","repo":"QMoQ/OAPT","repo_kind":"official","path":"oapt/models/myb_model.py","file_url":"https://github.com/QMoQ/OAPT/blob/HEAD/oapt/models/myb_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"07e474d3f11470e5"}},{"code_sha256_prefix":"1ba39317ea81871a","entry":"weight_reduce_loss","repo":"QMoQ/OAPT","repo_kind":"official","path":"oapt/losses/loss_util.py","file_url":"https://github.com/QMoQ/OAPT/blob/HEAD/oapt/losses/loss_util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1ba39317ea81871a"}},{"code_sha256_prefix":"cf63f8afc13f62a7","entry":"weighted_loss","repo":"QMoQ/OAPT","repo_kind":"official","path":"oapt/losses/loss_util.py","file_url":"https://github.com/QMoQ/OAPT/blob/HEAD/oapt/losses/loss_util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cf63f8afc13f62a7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}