{"notes":[{"id":"text-detection/tcm","category":"text-detection","legacyPath":"text-detection/2302-tcm","legacySlug":"2302-tcm","legacyPaths":[],"title":"TCM","subtitle":"Some rejoice while others grieve","author":"Z. Yuan","paperDate":"2023-02-28","publishedOn":"2024-12-01","paperTitle":"Turning a CLIP Model into a Scene Text Detector","paperUrl":"https://arxiv.org/abs/2302.14338","bibliography":{"title":"Turning a CLIP Model into a Scene Text Detector","authors":["Wenwen Yu","Yuliang Liu","Wei Hua","Deqiang Jiang","Bo Ren","Xiang Bai"],"url":"https://arxiv.org/abs/2302.14338","pdfUrl":"https://arxiv.org/pdf/2302.14338","codeUrl":null,"preprint":{"id":"2302.14338","submittedOn":"2023-02-28","url":"https://arxiv.org/abs/2302.14338"},"publication":{"venue":"CVPR","year":2023,"kind":"conference","url":"https://arxiv.org/abs/2302.14338"},"citation":"@misc{textdetectiontcm2023,\n  title = {{Turning a CLIP Model into a Scene Text Detector}},\n  author = {Wenwen Yu and Yuliang Liu and Wei Hua and Deqiang Jiang and Bo Ren and Xiang Bai},\n  year = {2023},\n  eprint = {2302.14338},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/2302.14338}\n}\n","citationPath":"/content/papers/citations/text-detection/tcm.42a1580d5734.bib"},"thumbnail":{"src":"/content/papers/assets/02cf80f702356c5f93f515ead3f00635f6ad0eb098975452c21e8e9d23fd1a2e.jpg","width":1224,"height":712},"locale":"en","path":"/content/papers/en/text-detection/tcm.0db614c48919.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"clip","text":"CLIP","depth":3},{"id":"multimodal-neurons","text":"Multimodal Neurons","depth":3},{"id":"so-what-should-we-do","text":"So What Should We Do?","depth":3},{"id":"solving-the-problem","text":"Solving the Problem","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":3},{"id":"language-prompt-generator","text":"Language Prompt Generator","depth":3},{"id":"text-encoder","text":"Text Encoder","depth":3},{"id":"visual-prompt-generator","text":"Visual Prompt Generator","depth":3},{"id":"instancelanguage-matching","text":"Instance–Language Matching","depth":3},{"id":"training-strategy","text":"Training Strategy","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"integration-with-existing-methods","text":"Integration with Existing Methods","depth":3},{"id":"pretrained-clip-backbone","text":"Pretrained CLIP Backbone","depth":3},{"id":"effectiveness-of-model-components","text":"Effectiveness of Model Components","depth":3},{"id":"ablation-experiment-on-vg-and-lgs-generalization-performance","text":"Ablation Experiment on VG and LG's Generalization Performance","depth":3},{"id":"frozen-encoder-experiment","text":"Frozen Encoder Experiment","depth":3},{"id":"increasing-training-data","text":"Increasing Training Data","depth":3},{"id":"increasing-parameter-count","text":"Increasing Parameter Count","depth":3},{"id":"impact-of-auxiliary-loss","text":"Impact of Auxiliary Loss","depth":3},{"id":"cross-dataset-generalization","text":"Cross-Dataset Generalization","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{"example---language-matching":"instancelanguage-matching"},"guide":null,"relatedReading":[{"id":"multimodality/clip","relation":"referenced","topic":""},{"id":"model-tuning/coop","relation":"referenced","topic":""},{"id":"model-tuning/cocoop","relation":"referenced","topic":""}]},{"id":"multimodality/clip","category":"multimodality","legacyPath":"multimodality/2103-clip","legacySlug":"2103-clip","legacyPaths":["multi-model/2021/clip"],"title":"CLIP","subtitle":"Breaking the Dimensional Barrier","author":"Z. Yuan","paperDate":"2021-02-26","publishedOn":"2024-04-04","paperTitle":"Learning Transferable Visual Models From Natural Language Supervision","paperUrl":"https://arxiv.org/abs/2103.00020","bibliography":{"title":"Learning Transferable Visual Models From Natural Language Supervision","authors":["Alec Radford","Jong Wook Kim","Chris Hallacy","Aditya Ramesh","Gabriel Goh","Sandhini Agarwal","Girish Sastry","Amanda Askell","Pamela Mishkin","Jack Clark","Gretchen Krueger","Ilya Sutskever"],"url":"https://arxiv.org/abs/2103.00020","pdfUrl":"https://cdn.openai.com/papers/Learning_Transferable_Visual_Models_From_Natural_Language.pdf","codeUrl":"https://github.com/openai/CLIP","preprint":{"id":"2103.00020","submittedOn":"2021-02-26","url":"https://arxiv.org/abs/2103.00020"},"publication":{"venue":"ICML","year":2021,"kind":"conference","url":"https://proceedings.mlr.press/v139/radford21a.html"},"citation":"@misc{multimodalityclip2021,\n  title = {{Learning Transferable Visual Models From Natural Language Supervision}},\n  author = {Alec Radford and Jong Wook Kim and Chris Hallacy and Aditya Ramesh and Gabriel Goh and Sandhini Agarwal and Girish Sastry and Amanda Askell and Pamela Mishkin and Jack Clark and Gretchen Krueger and Ilya Sutskever},\n  year = {2021},\n  eprint = {2103.00020},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/2103.00020}\n}\n","citationPath":"/content/papers/citations/multimodality/clip.a63b118c04c7.bib"},"thumbnail":{"src":"/content/papers/assets/03a0527e167fb49905db2879fecd0e0b7b140cb837e239778ffa7f83f02e25ef.jpg","width":1726,"height":622},"locale":"en","path":"/content/papers/en/multimodality/clip.f9c727d9ae23.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"the-solution","text":"The Solution","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":3},{"id":"large-scale-dataset","text":"Large-Scale Dataset","depth":3},{"id":"training-details","text":"Training Details","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"zero-shot-learning","text":"Zero-Shot Learning","depth":3},{"id":"are-the-representations-any-good","text":"Are the Representations Any Good?","depth":3},{"id":"is-clip-truly-generalizable","text":"Is CLIP Truly Generalizable?","depth":3},{"id":"human-vs-machine","text":"Human vs. Machine","depth":3},{"id":"overlap-in-data","text":"Overlap in Data","depth":3},{"id":"limitations","text":"Limitations","depth":2},{"id":"ethical-concerns","text":"Ethical Concerns","depth":3},{"id":"conclusion","text":"Conclusion","depth":2},{"id":"key-contributions","text":"Key Contributions:","depth":3},{"id":"future-directions","text":"Future Directions:","depth":3}],"anchorAliases":{"match-the-text-before-trying-to-write-it":"model-architecture","four-hundred-million-pairs-and-a-sizable-training-bill":"large-scale-dataset","experimental-results-and-discussion":"discussion","strong-zero-shot-results-depend-on-the-task-and-the-baseline":"zero-shot-learning","distribution-shift-figure-13s-strength-and-figure-14s-warning":"is-clip-truly-generalizable","humans-overlapping-data-and-use-boundaries":"human-vs-machine"},"guide":null,"relatedReading":[{"id":"model-tuning/coop","relation":"next","topic":"Adapting image-text models with prompts"},{"id":"multimodality/flip","relation":"comparison","topic":"Scaling and accelerating image-text pretraining"},{"id":"multimodality/florence","relation":"comparison","topic":"Scaling and accelerating image-text pretraining"}]},{"id":"model-tuning/coop","category":"model-tuning","legacyPath":"model-tuning/2109-coop","legacySlug":"2109-coop","legacyPaths":[],"title":"CoOp","subtitle":"Whispering in the Wind","author":"Z. Yuan","paperDate":"2021-09-02","publishedOn":"2024-11-20","paperTitle":"Learning to Prompt for Vision-Language Models","paperUrl":"https://arxiv.org/abs/2109.01134","bibliography":{"title":"Learning to Prompt for Vision-Language Models","authors":["Kaiyang Zhou","Jingkang Yang","Chen Change Loy","Ziwei Liu"],"url":"https://arxiv.org/abs/2109.01134","pdfUrl":"https://arxiv.org/pdf/2109.01134","codeUrl":null,"preprint":{"id":"2109.01134","submittedOn":"2021-09-02","url":"https://arxiv.org/abs/2109.01134"},"publication":{"venue":"International Journal of Computer Vision","shortVenue":"IJCV","year":2022,"kind":"journal","url":"https://doi.org/10.1007/s11263-022-01653-1"},"citation":"@misc{modeltuningcoop2021,\n  title = {{Learning to Prompt for Vision-Language Models}},\n  author = {Kaiyang Zhou and Jingkang Yang and Chen Change Loy and Ziwei Liu},\n  year = {2021},\n  eprint = {2109.01134},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/2109.01134}\n}\n","citationPath":"/content/papers/citations/model-tuning/coop.27fdb87fd425.bib"},"thumbnail":{"src":"/content/papers/assets/86ecd435ec6fa318673f5754231fe34217c79955e473b560d3ef270366b2aa5d.jpg","width":1224,"height":564},"locale":"en","path":"/content/papers/en/model-tuning/coop.d8071220b5a0.md","headings":[{"id":"problem-definition","text":"Problem Definition","depth":2},{"id":"reviewing-clip","text":"Reviewing CLIP","depth":2},{"id":"problem-solving","text":"Problem Solving","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"performance-across-multiple-datasets","text":"Performance Across Multiple Datasets","depth":3},{"id":"comparison-between-uc-and-csc","text":"Comparison Between UC and CSC","depth":3},{"id":"generalization-and-transferability","text":"Generalization and Transferability","depth":3},{"id":"how-long-should-the-prompt-be","text":"How Long Should the Prompt Be?","depth":3},{"id":"initialization-method","text":"Initialization Method","depth":3},{"id":"interpretability-of-prompts","text":"Interpretability of Prompts","depth":3},{"id":"conclusion","text":"Conclusion","depth":3}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"multimodality/clip","relation":"background","topic":"Adapting image-text models with prompts"},{"id":"model-tuning/cocoop","relation":"next","topic":"Adapting image-text models with prompts"}]},{"id":"model-tuning/cocoop","category":"model-tuning","legacyPath":"model-tuning/2203-cocoop","legacySlug":"2203-cocoop","legacyPaths":[],"title":"CoCoOp","subtitle":"Read the image first","author":"Z. Yuan","paperDate":"2022-03-10","publishedOn":"2024-11-30","paperTitle":"Conditional Prompt Learning for Vision-Language Models","paperUrl":"https://arxiv.org/abs/2203.05557","bibliography":{"title":"Conditional Prompt Learning for Vision-Language Models","authors":["Kaiyang Zhou","Jingkang Yang","Chen Change Loy","Ziwei Liu"],"url":"https://arxiv.org/abs/2203.05557","pdfUrl":"https://arxiv.org/pdf/2203.05557","codeUrl":null,"preprint":{"id":"2203.05557","submittedOn":"2022-03-10","url":"https://arxiv.org/abs/2203.05557"},"publication":{"venue":"CVPR","year":2022,"kind":"conference","url":"https://arxiv.org/abs/2203.05557"},"citation":"@misc{modeltuningcocoop2022,\n  title = {{Conditional Prompt Learning for Vision-Language Models}},\n  author = {Kaiyang Zhou and Jingkang Yang and Chen Change Loy and Ziwei Liu},\n  year = {2022},\n  eprint = {2203.05557},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/2203.05557}\n}\n","citationPath":"/content/papers/citations/model-tuning/cocoop.be720ff7f0f6.bib"},"thumbnail":{"src":"/content/papers/assets/919586e6d93113289ff42da4bc65226ef2ba90f9b74c61fd9047d1aa7d8fb65e.jpg","width":1224,"height":580},"locale":"en","path":"/content/papers/en/model-tuning/cocoop.91c469f61e2d.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"solving-the-problem","text":"Solving the Problem","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"generalization-ability-on-unseen-categories","text":"Generalization Ability on Unseen Categories","depth":3},{"id":"who-cant-increase-parameters","text":"Who Can’t Increase Parameters?","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"model-tuning/coop","relation":"background","topic":"Adapting image-text models with prompts"}]}],"text":"Contrastive learning has left a deep impression in many fields.\n\nNaturally, researchers in text detection also want to join the wave.\n\n## Defining the Problem\n\nMultimodal applications are very popular, especially after the release of the CLIP model. Its simple concept has attracted researchers like a magnet.\n\nEveryone is trying to apply pre-trained models to their own fields in order to ride the latest trend.\n\nWait! You said you still don’t know what CLIP is?\n\n\n> [!TIP]\n> \n> We’ve already covered CLIP, and for readers who haven't encountered it yet, you can refer to our previous article:\n> \n> - [**[21.03] CLIP: Breaking the Dimensional Barrier**](/blog/papers/multimodality/clip)\n\n\n### CLIP\n\nThis chapter has been repeated several times, so let's briefly introduce CLIP again.\n\nThe diagram below shows the CLIP architecture:\n\n![clip arch](/content/papers/assets/03a0527e167fb49905db2879fecd0e0b7b140cb837e239778ffa7f83f02e25ef.jpg)\n\nSuppose we have a set of image-text pairs, one of which might be an image of a dog and the text \"a cute little dog.\"\n\nIn a training batch, CLIP will receive multiple such pairs. The image encoder might use ResNet or ViT to process the image and extract features, while the text encoder might use Transformer to process the text and extract features.\n\nThe contrastive objective raises the relative similarity of matched image–text pairs and lowers that of unmatched pairs in the batch. It encourages this separation without guaranteeing perfect separation of every example.\n\nFinally, the model is trained using 400 million image-text pairs.\n\n### Multimodal Neurons\n\nShortly after CLIP was released, OpenAI conducted some research on the CLIP model and discovered some interesting phenomena.\n\n\n> [!NOTE]\n> \n> The original paper can be found here:\n> \n> - [**[21.03] Multimodal Neurons in Artificial Neural Networks**](https://distill.pub/2021/multimodal-neurons/)\n> \n> This article provides deeper insights into the inner workings of multimodal models and inspires researchers to think further. We highly recommend readers check it out!\n\n\nIn this paper, it was pointed out that CLIP's neurons have specialized functions, such as neurons responsible for processing emotions or those responsible for geographic locations.\n\nOne of the figures related to text is shown below. Let’s take a look:\n\n\n\n![text attack](/content/papers/assets/f5167564eda377e7e16e54dbd2dcd5cd814048f7c3c7314352cf58c51551816d.jpg)\n\n\n\nThe far-left image is the original image input, and the model doesn’t show any errors; it correctly recognizes the content of the image.\n\nBut from the second image onward, things get interesting.\n\nIn the subsequent inputs, text interference is overlaid, such as a block of text saying \"ipad\" or \"pizza.\" We were surprised to discover that:\n\n- **The model gets misled!**\n\nIn these examples, overlaid text misleads CLIP’s image classification.\n\n\n> [!TIP]\n> \n> Intuitively, we might think the text block is very small, occupying only a \"tiny\" portion of the image's pixel values. Surely the model shouldn’t be influenced by such a small area, right?\n\n\n### So What Should We Do?\n\nOpenAI researchers considered this a serious issue because it means the CLIP model is too sensitive to text. In real-world applications, it could be vulnerable to attacks.\n\nMalicious behavior can manipulate the model's recognition results through text interference, leading to incorrect (but advantageous to the attacker) outcomes. Therefore, for OpenAI, the challenge is to overcome text attacks and prevent text from easily influencing the final image recognition results.\n\nBut for text detection researchers:\n\n- **This is not a bug, this is a feature!**\n\nIt turns out that CLIP is a model inherently friendly to text, which is great news for both text detection and recognition fields!\n\nSo, not only should we use it, but we should use it to the fullest!\n\n## Solving the Problem\n\nTo effectively leverage the pre-trained knowledge from CLIP, there have been many studies in the past literature, with CoOp being one of the more famous examples.\n\n\n> [!TIP]\n> \n> Here are two consecutive papers for readers unfamiliar with CoOp:\n> \n> - [**[21.09] CoOp: Whispering in the Wind**](/blog/papers/model-tuning/coop)\n> - [**[22.03] CoCoOp: Read the image first**](/blog/papers/model-tuning/cocoop)\n> \n\n\nIn simple terms, the image is fed into the image branch of CLIP to extract image features; then, the prompt text is fed into the text branch to extract text features. This method transfers CLIP's knowledge and applies it to text detection tasks.\n\nText prompts are one route for transferring knowledge. TCM also fine-tunes the image encoder at a lower learning rate and uses image-conditioned prompts to connect the visual and text features.\n\nIn the CoCoOp study referenced earlier, researchers used image features to generate prompts for the text branch, enhancing its performance through adaptive prompt learning. This technique has been widely applied in subsequent studies.\n\nIn this article, the authors also propose a model architecture based on this technique to extract knowledge from CLIP.\n\n### Model Architecture\n\n\n\n![model arch](/content/papers/assets/02cf80f702356c5f93f515ead3f00635f6ad0eb098975452c21e8e9d23fd1a2e.jpg)\n\n\n\nThe model architecture is named TCM by the authors, which might seem a bit complex, but let's break it down step by step:\n\nFirst, the authors use CLIP's pre-trained ResNet50 as the image encoder to map the input image $I_0 \\in \\mathbb{R}^{H \\times W \\times 3}$ to the embedding vector $I \\in \\mathbb{R}^{\\tilde{H} \\times \\tilde{W} \\times C}$, where:\n\n$$\n\\tilde{H} = \\frac{H}{s}, \\quad \\tilde{W} = \\frac{W}{s}, \\quad C = 1024, \\quad s = 32\n$$\n\nThe formula is represented as follows:\n\n$$\nI = \\text{ImageEncoder}(I_0)\n$$\n\n\n> [!TIP]\n> \n> This is the familiar CNN downsampling process. If the shape notation feels difficult, a quick refresher on CNNs may help: the feature map has about 1/32 of the input height and width, with 1,024 channels at each location. Exact dimensions can depend on the input size and padding.\n\n\n### Language Prompt Generator\n\nThis is the `Language Prompt Generator` in the diagram above.\n\nIn the previous step, we obtained the image features.\n\nNext, we need to activate the knowledge in the text branch. Based on CoOp’s inspiration, we add learnable prompts $\\{c_1, \\dots, c_n\\}$ to the input of the text encoder to enhance the transfer ability of the text embeddings. The formula is as follows:\n\n$$\nt_\\text{in} = [c_1, \\dots, c_n, t_\\text{in}^0] \\in \\mathbb{R}^{(n+1) \\times D}\n$$\n\nThe language prompt generator uses the image features $I$ obtained earlier to generate the prompt $cc$, as shown in the following formula:\n\n$$\ncc = \\text{LN}(\\sigma(\\text{LN}(\\bar{I})W_1 + b_1))W_2 + b_2 \\in \\mathbb{R}^D\n$$\n\nWhere $W_1 \\in \\mathbb{R}^{C \\times C}, W_2 \\in \\mathbb{R}^{C \\times D}, b_1 \\in \\mathbb{R}^C, b_2 \\in \\mathbb{R}^D$.\n\n\n> [!TIP]\n> \n> This mathematical expression is read as:\n> \n> 1. Global attention pooling produces $\\bar I$, followed by LN, the linear transformation $W_1$, and bias $b_1$.\n> 2. Here $\\sigma$ is **ReLU**, not Sigmoid. A second LN, linear transformation $W_2$, and bias $b_2$ produce $cc$.\n> 3. Broadcast $cc$ across the prompt sequence to obtain $\\hat t_\\text{in}=t_\\text{in}+cc$, the actual input to the text encoder.\n\n\n### Text Encoder\n\nThe frozen CLIP pre-trained text encoder is used in the paper, and the predefined prompt is set as \"Text.\"\n\nThe text encoder embeds the predefined single-class prompt into the continuous vector space, as shown in the formula below:\n\n$$\nt_\\text{in}^0 = \\text{WordEmbedding}(\\text{Text}) \\in \\mathbb{R}^D\n$$\n\nWhere $D = 512$.\n\nFinally, the prompt and text embeddings are combined to get the final text embedding $t_\\text{out}$:\n\n$$\nt_\\text{out} = \\text{TextEncoder}(\\hat t_\\text{in}) \\in \\mathbb{R}^C\n$$\n\n### Visual Prompt Generator\n\nThis refers to the `Visual Prompt` part in the diagram above.\n\nHere, a Transformer cross-attention mechanism is used to learn the visual prompt $\\tilde{I}$, which conveys information from the image level to the text instance level, as shown in the formula:\n\n$$\n\\tilde{I} = \\text{TDec}(Q = I, K = t_\\text{out}, V = t_\\text{out}) \\in \\mathbb{R}^{\\tilde{H} \\times \\tilde{W} \\times C}\n$$\n\nThe image embedding is then adjusted by the prompt as follows:\n\n$$\n\\hat{I} = I + \\tilde{I}\n$$\n\nAfter this step, the `Locality Embeddings` in the diagram are obtained.\n\n\n> [!TIP]\n> \n> The query is the image features $I$, while the keys and values are the text features $t_\\text{out}$. This design is meant to enable the image features to \"perceive\" and \"merge\" with the text prompt.\n\n\n### Instance–Language Matching\n\nThe text embedding $t_\\text{out}$ is matched with the adjusted image embedding $\\hat{I}$ through dot-product and Sigmoid activation, generating a score map $P$ for binary segmentation, with continuous values between 0 and 1:\n\n$$\nP = \\text{sigmoid}\\left(\\frac{\\hat{I} t_\\text{out}^\\top}{\\tau}\\right) \\in \\mathbb{R}^{\\tilde{H} \\times \\tilde{W} \\times 1}\n$$\n\nThe binary cross-entropy loss (BCE Loss) between the segmentation map and the ground truth $y_{ij}$ is:\n\n$$\nL_\\text{aux} = -\\sum_{i=1}^{\\tilde{H}} \\sum_{j=1}^{\\tilde{W}} \\left[y_{ij} \\log(P_{ij}) + (1-y_{ij}) \\log(1-P_{ij})\\right]\n$$\n\nThe total loss function is:\n\n$$\nL_\\text{total} = L_\\text{det} + \\lambda L_\\text{aux}\n$$\n\nWhere $\\lambda = 1$, and $L_\\text{det}$ is the loss of the chosen detector. The expression above uses the negative sign required when minimizing BCE; the displayed equation in the paper omits it. The matching score map is concatenated with the adapted image embeddings before the detection head.\n\nDuring the inference phase, the output of the detection head is the final result.\n\n### Training Strategy\n\nExperiments were conducted using popular text detection methods, including **DBNet (DB)**, **PAN**, and **FCENet (FCE)**. To maintain consistency in setup, the detectors were trained on both **SynthText** and real datasets. Unless stated otherwise, the backbone uses the pre-trained image encoder ResNet50 from CLIP.\n\nThe visual prompt generator consists of 3 layers of Transformer decoders, utilizing 4 attention heads, with a Transformer width of 256 and a feedforward hidden layer dimension set to 1024. The detection head uses the corresponding detection heads from DBNet, PAN, and FCENet to predict the final results.\n\nEvaluation metrics use Intersection over Union (IoU) to determine whether the model correctly detects text regions, and precision, recall, and F1 score are calculated for comparison. To ensure a fair comparison, during training and testing, regions labeled as \"do not care\" or \"###\" in all datasets are ignored.\n\n## Discussion\n\n### Integration with Existing Methods\n\n\n\n![combine with other](/content/papers/assets/06e523799ce53beece7e94de9ce46af32c95d8a2dbb4a2344d3a04965c59b1a9.jpg)\n\n\n\nThe authors initially define TCM as a modular model that can be integrated with existing text detection methods. The table above reports the results of combining TCM with three text detection methods on the IC15, TD, and CTW datasets:\n\n- **F1 Score Improvement**: TCM outperforms the original FCENet, PAN, and DBNet on the IC15 dataset by 0.9, 1.7, and 1.9 percentage points, respectively. Similar stable performance improvements were observed on the TD and CTW datasets.\n- **Inference Speed**: TCM-PAN, TCM-FCENet, and TCM-DBNet run at 18, 8.4, and 10 FPS, respectively, versus 36, 11.5, and 14.5 FPS for their original detectors. The table reports speed by model, measured with a ResNet50 backbone on one V100; these FPS figures are not separate IC15, TD, and CTW measurements.\n\n\n> [!TIP]\n> \n> We believe the impact of inference speed is still significant, and the paper's claim of \"maintaining\" high efficiency may be somewhat optimistic.\n\n\n### Pretrained CLIP Backbone\n\n\n\n![pretrain clip](/content/papers/assets/4b8bb7980721f60dba0ba9881db728634c633c00c8227e2beb9e7b06b490b905.jpg)\n\n\n\nThe first test involved replacing the original backbone network of DBNet with CLIP's pre-trained image encoder, ResNet50, to quantify the impact of the backbone network on performance. In the table above, `CR50` refers to using the CLIP image branch, while `R50` refers to using the original DBNet backbone network.\n\nReplacing DBNet's backbone with CLIP-R50 raises the F-measure by 0.4 percentage points on IC15 and 1.9 points on TD, while TT and CTW are unchanged. The backbone swap alone does not bring a consistent gain or fully use CLIP's vision-language knowledge.\n\n\n> [!TIP]\n> \n> Don't blindly use CLIP.\n\n\n### Effectiveness of Model Components\n\n\n\n![predefined prompt](/content/papers/assets/d561c72c629ceffa559ebc02e783444bb680422562a23d1895479f0c75b021c1.jpg)\n\n\n\nLet's first understand the abbreviations in the table above:\n\n- **BSL**: DBNet baseline with the CLIP ResNet50 backbone in this table.\n- **PP**: Predefined Prompt.\n- **LP**: Learnable Prompt.\n- **LG**: Language Prompt Generator.\n- **VG**: Visual Prompt Generator.\n- **TCM**: Full Model Configuration.\n\n---\n\nWhen using predefined prompts (second row in the table), performance slightly improved across the four datasets (IC15, TD, TT, CTW), with improvements of 0.05, 0.2, 0.04, and 0.1 percentage points, respectively, compared to the baseline method.\n\nWhen combining learnable prompts with predefined prompts (third row), learnable prompts consistently lead to performance improvements.\n\n\n> [!TIP]\n> \n> The number of learnable prompts is configurable. In the tested 4-, 18-, and 32-prompt rows, the F-measure did not decrease on any of the four datasets as the count rose.\n\n\nCompared to using 4 prompts, when the number was increased to 32, performance significantly improved across datasets. This could be because more learnable prompts better guide the pre-trained text encoder's knowledge, aiding text detection. To simplify later experiments, the default number of learnable prompts was set to 4.\n\n---\n\nThe authors also evaluated the performance of the language prompt generator (seventh row in the table).\n\nWith the help of the language prompt generator, performance improved further across the four datasets, particularly on ICDAR2015. These same-dataset ablations show that its conditional cues help detection here; the cross-dataset transfer experiments below address generalization.\n\n---\n\nWhen combining the visual prompt generator with the other components, F-measure was higher across all four datasets than the baseline. For the full TCM configuration with 32 learnable prompts, the gains on IC15 and TD were 1.7 and 2.0 percentage points, respectively.\n\nThis clear complementary effect arises because the visual prompt generator can propagate fine-grained visual semantic information from the text features.\n\nAdditionally, the local image embeddings generated by the visual prompt generator help guide the model to obtain more accurate text instance-level visual representations, enhancing the instance-language matching capability and producing precise segmentation maps that aid the downstream detection head.\n\n### Ablation Experiment on VG and LG's Generalization Performance\n\n![vg lg](/content/papers/assets/c1e91ae7862cd5adb7c8216296438d8eddce5267fbb3a1063eb78dcc3c2e1160.jpg)\n\nRemoving the visual prompt generator (VG) and language prompt generator (LG) from TCM results in a significant drop in generalization performance, further proving the effectiveness of VG and LG.\n\n### Frozen Encoder Experiment\n\n\n\n![freeze encoder](/content/papers/assets/25bd9165230ccd4dd6e57917e0df4936e0d748f307aef379a92f90a6286bad16.jpg)\n\n\n\nTCM freezes the text encoder and fine-tunes the image branch to retain language priors. This is a design choice for TCM, not a requirement for every use of CLIP. The authors vary the learning-rate factors of both encoders to study this choice.\n\nAmong the four settings in the table, an image-encoder learning-rate factor of 0.1 with the text encoder frozen (factor 0.0) gives the highest TD500 F-measure, 88.7%.\n\n### Increasing Training Data\n\nTo further investigate whether TCM can learn additional knowledge that is difficult to acquire just by adding more data, the authors conducted the following experiment:\n\n- **Training Data**: The model was trained using large-scale public datasets, including IC13, IC15, TD, CTW, TT, and MLT17, with a total of 13,784 images.\n- **Test Data**: The model was tested on night-time data carefully collected from ArT (326 images). A sample of the night-time data is shown in the image below.\n  ![night data](/content/papers/assets/8693726290057fd3735e9e69f4c6cee48dff60f39181bbcf6c9e3cf1be5aacf1.jpg)\n\nThe experimental results are shown in the table below:\n\n\n\n![night data result](/content/papers/assets/fad8b319dccb04e0eea8cfd81566634f4229bdd40d12fe4514f784f9b4a31e24.jpg)\n\n\n\nEven with the addition of a large amount of training data, existing methods still show limitations on night-time images that differ from the training distribution. In this NightTime-ArT test, TCM-DBNet reaches 70.2% F-measure, above DBNet's 52.8% and FCENet's 55.2%.\n\n### Increasing Parameter Count\n\n\n\n![increase params](/content/papers/assets/0651041a396360130e9dea97372bb8f30bcfe1645688d94171503df2be2f4d01.jpg)\n\n\n\nFor a fair comparison, the authors increased the parameter count of DBNet by replacing the backbone with a larger ResNet and conducted experiments on the TD500 dataset:\n\nTCM-DBNet uses 50M parameters and 156G FLOPs, between DBNet-R101 and DBNet-R152. Its 88.7% F-measure exceeds DBNet-R152's 87.3% despite the latter's 62M parameters and 180G FLOPs.\n\n### Impact of Auxiliary Loss\n\n\n\n![aux loss](/content/papers/assets/573cb7ea44e19dffeba23490026bf9744920bf809a6781010d348e808ac3eb1f.jpg)\n\n\n\nFinally, the authors compared the results with and without using auxiliary loss on the TD500 dataset:\n\nWith auxiliary loss, TCM-DBNet reaches 88.7% F-measure on TD500, versus 85.1% without it. The auxiliary loss constrains the instance-language matching score map and helps train the model.\n\n### Cross-Dataset Generalization\n\n\n\n![cross dataset](/content/papers/assets/ee8507a90c273a3c35fe366e551063aea929e7070b73fb6c0d476d3d3dd09f62.jpg)\n\n\n\nThe authors trained on IC13 and tested transfer to IC15 and TD. TCM-DBNet reaches 71.9% and 65.1% F-measure, respectively, above the DBNet baseline's 63.9% and 53.8% in the same table.\n\n## Conclusion\n\nEveryone wants to use CLIP to enhance their models, and this paper serves as an excellent example.\n\nTCM adapts knowledge from an already pretrained CLIP model to scene text detection without an additional text-specific pretraining task.\n\nAlthough the performance improvement of TCM in the current experiments is not very significant, the cross-dataset generalization experiments show that pre-trained multimodal models can provide broader knowledge, which helps improve the model's generalization ability.\n\nOverall, TCM offers a valuable direction and idea for future research.\n","imageSizes":{"/content/papers/assets/03a0527e167fb49905db2879fecd0e0b7b140cb837e239778ffa7f83f02e25ef.jpg":{"width":1726,"height":622},"/content/papers/assets/f5167564eda377e7e16e54dbd2dcd5cd814048f7c3c7314352cf58c51551816d.jpg":{"width":1712,"height":914},"/content/papers/assets/02cf80f702356c5f93f515ead3f00635f6ad0eb098975452c21e8e9d23fd1a2e.jpg":{"width":1224,"height":712},"/content/papers/assets/06e523799ce53beece7e94de9ce46af32c95d8a2dbb4a2344d3a04965c59b1a9.jpg":{"width":980,"height":504},"/content/papers/assets/4b8bb7980721f60dba0ba9881db728634c633c00c8227e2beb9e7b06b490b905.jpg":{"width":956,"height":216},"/content/papers/assets/d561c72c629ceffa559ebc02e783444bb680422562a23d1895479f0c75b021c1.jpg":{"width":968,"height":728},"/content/papers/assets/c1e91ae7862cd5adb7c8216296438d8eddce5267fbb3a1063eb78dcc3c2e1160.jpg":{"width":1224,"height":222},"/content/papers/assets/25bd9165230ccd4dd6e57917e0df4936e0d748f307aef379a92f90a6286bad16.jpg":{"width":904,"height":324},"/content/papers/assets/8693726290057fd3735e9e69f4c6cee48dff60f39181bbcf6c9e3cf1be5aacf1.jpg":{"width":952,"height":208},"/content/papers/assets/fad8b319dccb04e0eea8cfd81566634f4229bdd40d12fe4514f784f9b4a31e24.jpg":{"width":996,"height":300},"/content/papers/assets/0651041a396360130e9dea97372bb8f30bcfe1645688d94171503df2be2f4d01.jpg":{"width":944,"height":332},"/content/papers/assets/573cb7ea44e19dffeba23490026bf9744920bf809a6781010d348e808ac3eb1f.jpg":{"width":732,"height":224},"/content/papers/assets/ee8507a90c273a3c35fe366e551063aea929e7070b73fb6c0d476d3d3dd09f62.jpg":{"width":932,"height":584}}}
