{"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/cell-graph-transformer-for-nuclei","title":"Cell Graph Transformer for Nuclei Classification","arxiv_id":"2402.12946","date":"2024-02-20","proceeding":null,"authors":["Wei Lou","Guanbin Li","Xiang Wan","Haofeng Li"],"abstract":"Nuclei classification is a critical step in computer-aided diagnosis with histopathology images. In the past, various methods have employed graph neural networks (GNN) to analyze cell graphs that model inter-cell relationships by considering nuclei as vertices. However, they are limited by the GNN mechanism that only passes messages among local nodes via fixed edges. To address the issue, we develop a cell graph transformer (CGT) that treats nodes and edges as input tokens to enable learnable adjacency and information exchange among all nodes. Nevertheless, training the transformer with a cell graph presents another challenge. Poorly initialized features can lead to noisy self-attention scores and inferior convergence, particularly when processing the cell graphs with numerous connections. Thus, we further propose a novel topology-aware pretraining method that leverages a graph convolutional network (GCN) to learn a feature extractor. The pre-trained features may suppress unreasonable correlations and hence ease the finetuning of CGT. Experimental results suggest that the proposed cell graph transformer with topology-aware pretraining significantly improves the nuclei classification results, and achieves the state-of-the-art performance. Code and models are available at https://github.com/lhaof/CGT","url_abs":"https://arxiv.org/abs/2402.12946v1","url_pdf":"https://arxiv.org/pdf/2402.12946v1.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":"cell-graph-transformer-for-nuclei","repo_url":"https://github.com/lhaof/cgt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"classification-1","task_name":"Classification"},{"task_slug":"nuclei-classification","task_name":"Nuclei Classification"}],"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":"graph-transformer","method_name":"Graph Transformer"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"lapeigen","method_name":"LapEigen"},{"method_slug":"laplacian-pe","method_name":"Laplacian PE"},{"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=2402.12946","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.12946"}},"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/lhaof/CGT","reach":{"status":"ok"}}],"summary":{"ran":6,"unverified":4},"by_repo_kind":{"official":{"samples":10,"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":10,"samples":[{"code_sha256_prefix":"c746aab94c030ee1","entry":"bilinear_interpolation","repo":"lhaof/CGT","repo_kind":"official","path":"models/CGT/bilinear.py","file_url":"https://github.com/lhaof/CGT/blob/HEAD/models/CGT/bilinear.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":"c746aab94c030ee1"}},{"code_sha256_prefix":"aaf58366ac53cb6c","entry":"eig","repo":"lhaof/CGT","repo_kind":"official","path":"models/CGT/algos.py","file_url":"https://github.com/lhaof/CGT/blob/HEAD/models/CGT/algos.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":"aaf58366ac53cb6c"}},{"code_sha256_prefix":"34c757a96922d1f6","entry":"get_array_value","repo":"lhaof/CGT","repo_kind":"official","path":"models/CGT/bilinear.py","file_url":"https://github.com/lhaof/CGT/blob/HEAD/models/CGT/bilinear.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":"34c757a96922d1f6"}},{"code_sha256_prefix":"be6bea42d689b3f1","entry":"interpolate","repo":"lhaof/CGT","repo_kind":"official","path":"models/CGT/bilinear.py","file_url":"https://github.com/lhaof/CGT/blob/HEAD/models/CGT/bilinear.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":"be6bea42d689b3f1"}},{"code_sha256_prefix":"e21da4ba3aeb7919","entry":"lap_eig","repo":"lhaof/CGT","repo_kind":"official","path":"models/CGT/algos.py","file_url":"https://github.com/lhaof/CGT/blob/HEAD/models/CGT/algos.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":"e21da4ba3aeb7919"}},{"code_sha256_prefix":"a17cf7de69cc2b7c","entry":"process","repo":"lhaof/CGT","repo_kind":"official","path":"models/CGT/post_proc.py","file_url":"https://github.com/lhaof/CGT/blob/HEAD/models/CGT/post_proc.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":"a17cf7de69cc2b7c"}},{"code_sha256_prefix":"dc1329d9e5dd3eec","entry":"convert_to_single_emb","repo":"lhaof/CGT","repo_kind":"official","path":"models/CGT/query2label.py","file_url":"https://github.com/lhaof/CGT/blob/HEAD/models/CGT/query2label.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":"dc1329d9e5dd3eec"}},{"code_sha256_prefix":"f3a9656c0f11f020","entry":"infer_step","repo":"lhaof/CGT","repo_kind":"official","path":"models/CGT/run_desc.py","file_url":"https://github.com/lhaof/CGT/blob/HEAD/models/CGT/run_desc.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":"f3a9656c0f11f020"}},{"code_sha256_prefix":"2f4c495b7d47dc55","entry":"train_step","repo":"lhaof/CGT","repo_kind":"official","path":"models/CGT/run_desc.py","file_url":"https://github.com/lhaof/CGT/blob/HEAD/models/CGT/run_desc.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":"2f4c495b7d47dc55"}},{"code_sha256_prefix":"e5360de2ad18b9bc","entry":"valid_step","repo":"lhaof/CGT","repo_kind":"official","path":"models/CGT/run_desc.py","file_url":"https://github.com/lhaof/CGT/blob/HEAD/models/CGT/run_desc.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":"e5360de2ad18b9bc"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}