A Method and Device for Detecting Harmful Chinese Memes Combining Relative Intent Reasoning and Knowledge Enhancement
By combining relative intent reasoning and knowledge enhancement methods, and utilizing external knowledge bases and multimodal detection models for optimization and updates, the cultural dependence and semantic ambiguity issues in Chinese harmful meme detection are resolved, achieving higher detection accuracy and interpretation generation capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DALIAN UNIV OF TECH
- Filing Date
- 2026-03-27
- Publication Date
- 2026-06-30
AI Technical Summary
Existing Chinese harmful meme detection models suffer from strong cultural dependence, high semantic ambiguity, high subjectivity, and poor interpretability when dealing with harmful memes in the Chinese context, resulting in insufficient recognition accuracy and interpretability.
Combining relative intent reasoning and knowledge enhancement methods, this approach generates semantic keywords for training memes by acquiring image descriptions and textual descriptions of the memes. It then uses an external Chinese harmful semantic knowledge base for background knowledge retrieval and reordering, and combines a multimodal detection model for optimization and updates to generate harmful or harmless labels and provide explanations.
It improves the accuracy and robustness of Chinese harmful meme detection, reduces the false positive rate, generates more convincing explanations, and enhances the model's interpretability and ability to understand complex cultural metaphors.
Smart Images

Figure CN122309746A_ABST
Abstract
Description
Technical Field
[0008] ,
[0007] , ,
[0001] The present invention relates to the technical field of meme detection, and in particular, to a method and device for detecting Chinese harmful memes by combining relative intention reasoning and knowledge enhancement. Background Art
[0002] With the rapid development of mobile Internet and social media, as a unique cultural dissemination carrier combining pictures and texts, memes are widely used on Chinese social platforms such as Weibo and WeChat due to their humorous, satirical and easy-to-spread characteristics. However, the wide popularity of memes also brings a "double-edged sword" effect, that is, the proliferation of harmful memes. These harmful memes often use subtle visual cues, puns, homophonic puns or specific cultural metaphors to spread hate speech, discriminatory ideologies, cyber violence and false information, posing a serious threat to the digital ecosystem and real social order.
[0003] Existing research on harmful meme detection mainly focuses on the English context and mostly adopts classification-based supervised learning methods. For example, existing datasets such as HarMeme and MAMI and their supporting detection models, although promoting the development of multimodal detection technology, have significant limitations in dealing with harmful memes in the Chinese context.
[0004] First, Chinese harmful memes have strong cultural dependence and semantic ambiguity. Different from straightforward hate speech, Chinese memes often adopt a "semantic inconsistency" mechanism, that is, using cute and benign visual images to cover underlying malicious texts, or using specific Internet slang (such as "useless person", "working like a horse" etc.) to express insulting meanings. Existing mainstream models often lack an understanding of these deep cultural background knowledge, resulting in the inability to accurately identify the harmfulness of memes containing metaphors and ironic content.
[0005] Second, the determination of harmfulness is highly subjective. The same meme may generate completely different interpretations in the eyes of different observers (for example, a picture describing the current situation after graduating from university, some people regard it as self-deprecation, while some people regard it as spreading negative emotions). Traditional single-label classification models often ignore this polysemy and subjectivity, lack an interpretable analysis of the internal logic of memes, and are difficult to give convincing judgment reasons. Summary of the Invention
[0006] Based on this, it is necessary to address the above problems and propose a method and device for detecting Chinese harmful memes by combining relative intention reasoning and knowledge enhancement.
[0007] A method for detecting Chinese harmful memes by combining relative intention reasoning and knowledge enhancement, the method comprising:
[0008] Acquire training memes, which include image descriptions, text, and meme images. Use a lightweight plain text large language model to generate an extended set of meme semantic keywords based on the image descriptions and text. Each keyword in the set of meme semantic keywords is a highly refined extract of the potentially harmful meanings of the training meme, and each keyword corresponds to a query.
[0009] For each query, search the Chinese harmful semantic knowledge base for multiple target documents that are most semantically relevant to it. These multiple target documents constitute a set of background knowledge documents that are strongly related to the training meme.
[0010] The re-ranking model constructs prompt words for each candidate document and its corresponding query in the background knowledge document set, and outputs them to the causal language model inside the re-ranking model. The causal language model outputs the strong correlation probability of each candidate document and its corresponding query. The first number of candidate documents with strong correlation probabilities greater than a first preset value are retained as the fine-check document set.
[0011] The image description, text, meme image, and refined document set constitute the meme content of the training meme. The meme content, combined with the explanations of the training meme as a harmful meme and the explanations of the training meme as a harmless meme, constitutes classification inference prompts. The classification inference prompts are input into the multimodal detection model and the predicted label of the training meme is output. The cross-entropy loss between the predicted label and the actual label of the training meme is calculated using a classification loss function. When the cross-entropy loss is greater than a preset value, the vector jointly represented by the meme image and text of the training meme is input into the attention mechanism projection layer in the multimodal detection model to optimize and update the multimodal detection model, thereby obtaining a classification multimodal detection model.
[0012] The meme to be detected is input into the classification multimodal detection model to obtain the label and reason corresponding to the meme to be detected, wherein the label is harmful or harmless.
[0013] In one embodiment, for each query, multiple target documents most semantically relevant to the query are searched in a Chinese harmful semantic knowledge base, and these multiple target documents constitute the training meme. The collection of strongly related background knowledge documents includes:
[0014] The BM25 algorithm in the BM25 retrieval tool is used to accurately match a first number of candidate documents that are strongly related to the query from the Chinese harmful semantic knowledge base. The first number of candidate documents constitute the BM25 retrieval document set.
[0015] Using the word embedding model of the dense retrieval tool, the query is mapped to a low-dimensional dense vector space with documents in the Chinese harmful semantic knowledge base, respectively, to obtain query encoding output and document encoding output. The cosine similarity between the two encoding outputs is calculated. The top five documents with the highest to lowest cosine similarity among all documents in the Chinese harmful semantic knowledge base are selected as the dense retrieval document set.
[0016] For each candidate document in the BM25 search document set and the dense search document set, the inverse ranking fusion algorithm is used to calculate its document ranking score in the BM25 search document set and the dense search document set, and then weighted to obtain the target document ranking score of each candidate document. All candidate documents in the BM25 search document set and the dense search document set are sorted from high to low according to the target document ranking score, and the top five candidate documents with the highest target document ranking scores are selected as the set of background knowledge documents most relevant to the query.
[0017] In one embodiment, the step of using the BM25 algorithm in the BM25 search engine to accurately match a first number of candidate documents that are strongly relevant to the query, wherein the first number of candidate documents constitute the BM25 search document set, includes:
[0018] For each keyword in the set of semantic keywords corresponding to the training meme, the inverse document frequency of each keyword is calculated. Based on the inverse document frequency, the relevance score between each keyword and each document in the Chinese harmful semantic knowledge base is calculated. The documents in the Chinese harmful semantic knowledge base are selected from high to low according to the relevance score, and the documents corresponding to the top five scores are selected as the BM25 retrieval document set.
[0019] In one embodiment,
[0020] The inverse document frequency is achieved by the following expression:
[0021]
[0022] in, For terms, For terms Inverse document frequency; This represents the total number of documents in the Chinese Harmful Semantics Knowledge Base. For included terms The number of candidate documents;
[0023] The correlation score is achieved through the following expression:
[0024]
[0025] in, For relevance score; For terms Inverse document frequency; For terms In the document The frequency in; Document length; For document The average length; This is a saturation parameter; This is the length normalization parameter.
[0026] In one embodiment, the cosine similarity is achieved by the following expression:
[0027]
[0028] in, Cosine similarity; Output the query code; Output the document encoding; Represents a word embedding model; Norm calculation.
[0029] In one embodiment, the target document ranking score is achieved using the following expression:
[0030]
[0031] in, The ranking score for the target document; Retrieve document collection for BM25 and densely searched document sets A candidate document in the document; The number of search engines; Weights for the BM25 search engine or dense search engine; Retrieve document collection for candidate documents in BM25 Or intensively search document collections The ranking in the equation; k is a smoothing constant.
[0032] In one embodiment, the strong correlation probability is achieved by the following expression:
[0033]
[0034] in, For query The probability of strong correlation with candidate documents; Predicting queries using causal language models The first probability value of relevance to the candidate document; Predicting queries using causal language models The second probability value of relevance to candidate documents.
[0035] A Chinese harmful meme detection device combining relative intent reasoning and knowledge enhancement, the device comprising:
[0036] The generation module is used to obtain training memes, which include image descriptions, text, and meme images. It uses a lightweight plain text large language model to generate an extended set of meme semantic keywords based on the image descriptions and text. Each keyword in the set of meme semantic keywords is a highly refined summary of the potentially harmful meanings of the training meme, and each keyword corresponds to a query.
[0037] The search module is used to find multiple target documents that are most semantically relevant to each query in the Chinese harmful semantic knowledge base. These multiple target documents constitute a set of background knowledge documents that are strongly related to the training meme.
[0038] The construction module is used to construct prompt words for each candidate document and its corresponding query in the background knowledge document set through the re-ranking model, and output them to the causal language model inside the re-ranking model. The causal language model outputs the strong correlation probability of each candidate document and its corresponding query; and retains a first number of candidate documents with strong correlation probabilities greater than a first preset value as the fine-check document set.
[0039] An optimization and update module is used to construct the meme content of the training meme, which consists of the image description, text, meme image, and refined document set. The meme content, combined with the explanations of the training meme as a harmful meme and the explanations of the training meme as a harmless meme, constitutes classification inference prompts. The classification inference prompts are input into the multimodal detection model and the predicted label of the training meme is output. The cross-entropy loss between the predicted label and the actual label of the training meme is calculated through a classification loss function. When the cross-entropy loss is greater than a preset value, the vector jointly represented by the meme image and text of the training meme is input into the attention mechanism projection layer in the multimodal detection model to optimize and update the multimodal detection model, thereby obtaining a classification multimodal detection model.
[0040] The label generation module is used to input the meme to be detected into the classification multimodal detection model to obtain the label and reason corresponding to the meme to be detected, wherein the label is harmful or harmless.
[0041] This invention provides a method for detecting and interpreting harmful Chinese memes that integrates an external cultural knowledge base and possesses multi-faceted dialectical reasoning capabilities, thereby improving the accuracy, robustness, and interpretability of the detection. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] in:
[0044] Figure 1 This is an application environment diagram of a Chinese harmful meme detection method that combines relative intent reasoning and knowledge enhancement in one embodiment.
[0045] Figure 2 This is a flowchart of a Chinese harmful meme detection method that combines relative intent reasoning and knowledge enhancement in one embodiment;
[0046] Figure 3 This is a structural block diagram of a Chinese harmful meme detection device that combines relative intent reasoning and knowledge enhancement in one embodiment.
[0047] Figure 4 This is a structural block diagram of a computer device in one embodiment. Detailed Implementation
[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0049] To address the technical problems in the background art, this application provides a method for detecting harmful Chinese memes that combines relative intent reasoning and knowledge enhancement.
[0050] Figure 1 This is a diagram illustrating the application environment of a Chinese harmful meme detection method combining relative intent reasoning and knowledge enhancement in one embodiment. (Refer to...) Figure 1This method for detecting harmful Chinese memes, combining relative intent reasoning and knowledge enhancement, is applied to a system for detecting harmful Chinese memes that combines relative intent reasoning and knowledge enhancement. The system includes a terminal 110 and a server 120. The terminal 110 and server 120 are connected via a network. The terminal 110 can be a desktop terminal or a mobile terminal, and the mobile terminal can be at least one of a mobile phone, tablet computer, or laptop computer. The server 120 can be a standalone server or a server cluster consisting of multiple servers. Terminal 110 is used to acquire training memes, which include image descriptions, text, and meme images. A lightweight plain text large language model is used to generate an extended set of meme semantic keywords based on the image descriptions and text. Each keyword in the meme semantic keyword set is a highly refined extraction of the potentially harmful meanings of the training meme, and each keyword corresponds to a query. Server 120 is used to search for multiple target documents that are semantically most relevant to each query in a Chinese harmful semantic knowledge base. These multiple target documents constitute a set of background knowledge documents strongly related to the training meme. A re-ranking model is used to construct prompt words for each candidate document in the background knowledge document set and its corresponding query, and outputs them to the causal language model inside the re-ranking model. The causal language model outputs the strong correlation probability of each candidate document and its corresponding query. A first number of candidate documents with strong correlation probabilities greater than a first preset value are retained. Selected documents are used as the set of documents for detailed inspection. The image descriptions, text, meme images, and the set of documents for detailed inspection constitute the meme content of the training meme. The meme content, combined with the explanations supporting the training meme as a harmful meme and the explanations supporting the training meme as a harmless meme, constitutes classification inference prompts. The classification inference prompts are input into the multimodal detection model, which outputs the predicted labels of the training memes. The cross-entropy loss between the predicted labels and the actual labels of the training memes is calculated using a classification loss function. When the cross-entropy loss is greater than a preset value, the vector jointly represented by the meme image and text of the training meme is input into the attention mechanism projection layer in the multimodal detection model to optimize and update the multimodal detection model, thereby obtaining a classification multimodal detection model. The meme to be detected is input into the classification multimodal detection model to obtain the label and reason corresponding to the meme to be detected, wherein the label is either harmful or harmless.
[0051] like Figure 2 As shown, in one embodiment, a method for detecting harmful Chinese memes combining relative intent reasoning and knowledge enhancement is provided. This method can be applied to both terminals and servers; this embodiment illustrates its application to a terminal. The method for detecting harmful Chinese memes combining relative intent reasoning and knowledge enhancement specifically includes the following steps:
[0052] S10: Obtain the training meme, the training meme Includes image description ,text and meme images Using the lightweight plain text large language model Qwen3-1.7B based on image descriptions and text Generate an extended set of meme semantic keywords The set of meme semantic keywords Each keyword in the text is a training meme. A highly refined summary of potentially harmful meanings, with each keyword corresponding to a specific query. ;
[0053] S20: For each query The Chinese Harmful Semantics Knowledge Base (C-HarmKB) was used to find multiple target documents that were most semantically relevant to the target document. These multiple target documents constituted and trained memes. Collection of strongly related background knowledge documents ;
[0054] S30: Background knowledge document set through the Qwen3-Reranker-0.6B re-ranking model Each candidate document and its corresponding query in the algorithm are used to construct suggestion words, which are then output to the causal language model (Qwen3) inside the re-ranking model. The causal language model (Qwen3) outputs the strong correlation probability of each candidate document and its corresponding query. The first number of candidate documents with a strong correlation probability greater than a first preset value are retained as the set of documents for detailed analysis. ;
[0055] S40: Image description ,text Meme Images and a collection of detailed inspection documents The training meme Meme content P ( , , , The meme content P( , , , Combined with support training memes Explanation of harmful memes and support training memes Explanation of harmless memes The classification inference prompts are constructed and input into the multimodal detection model Qwen2.5-VL, which outputs the predicted labels of the training memes. The cross-entropy loss between the predicted and actual labels of the training memes is calculated using a classification loss function. If the cross-entropy loss is greater than a preset value, the training meme is... meme images and text Vectors of joint representation The input is fed into the attention mechanism projection layer in the multimodal detection model to optimize and update the multimodal detection model, thereby obtaining a classification multimodal detection model;
[0056] S50: Input the meme to be detected into the classification multimodal detection model to obtain the label and reason corresponding to the meme to be detected, wherein the label is harmful or harmless.
[0057] In one embodiment, the query for each query The Chinese Harmful Semantics Knowledge Base (C-HarmKB) was used to find multiple target documents that were most semantically relevant to the target document. These multiple target documents constituted and trained memes. Collection of strongly related background knowledge documents include:
[0058] S201: Using the BM25 algorithm in the BM25 search engine, accurately match a first number of candidate documents strongly related to query q from the Chinese Harmful Semantic Knowledge Base (C-HarmKB). The first number of candidate documents constitute the BM25 search document set. ;
[0059] S202: Using the dense retrieval tool's word embedding model Qwen3-Embedding-0.6B to embed the query Documents in the Chinese Harmful Semantics Knowledge Base Mapping to a low-dimensional dense vector space yields query and document encoding outputs, respectively. The cosine similarity between the two encoding outputs is then calculated. All documents in the Chinese harmful semantic knowledge base are then classified according to their cosine similarity. Extract the top five documents from highest to lowest value. As a collection of densely searched documents ;
[0060] S203: For BM25 document retrieval set and densely searched document sets Each candidate document in the BM25 retrieval document set is evaluated using the Inverse Ranking Fusion (RRF) algorithm. and densely searched document sets The document ranking scores in the dataset are then weighted to obtain the target document ranking score for each candidate document. ; BM25 retrieves document collection and densely searched document sets All candidate documents are ranked by their scores according to the target document. Sort the documents from highest to lowest score and select the top five candidate documents with the highest ranking scores for the target document, as the match with the query. The most relevant collection of background knowledge documents .
[0061] In one embodiment, the BM25 algorithm in the BM25 search engine is used to precisely match a first number of candidate documents that are strongly correlated with query q, and these first number of candidate documents constitute the BM25 search document set. include:
[0062] For the set of semantic keywords corresponding to the training memes Each keyword in the text is treated as a term t, and the calculation of each term is performed. The inverse document frequency (IVF) is used to calculate the relevance score between each keyword and each document in the Chinese harmful semantic knowledge base. Documents in the Chinese harmful semantic knowledge base are then ranked according to their relevance scores. Extract the documents corresponding to the top five scores from highest to lowest. As a collection of documents retrieved by BM25 .
[0063] In one embodiment,
[0064] The inverse document frequency is achieved by the following expression:
[0065]
[0066] in, For terms, For terms Inverse document frequency; This represents the total number of documents in the Chinese Harmful Semantics Knowledge Base. For included terms The number of candidate documents.
[0067] The correlation score is achieved through the following expression:
[0068]
[0069] in, For relevance score, For terms Inverse document frequency, For terms In the document The frequency in For document length, For document average length, The saturation parameter is 1.5. The length normalization parameter is 0.75.
[0070] In one embodiment, the cosine similarity is achieved by the following expression:
[0071]
[0072] in, Cosine similarity; Output the query code; Output the document encoding; The word embedding model is represented by Qwen3-Embedding-0.6B; Norm calculation.
[0073] In one embodiment, the target document ranking score is achieved using the following expression:
[0074]
[0075] in, The ranking score for the target document; Retrieve document collection for BM25 and densely searched document sets A candidate document in the document; The number of search engines; The weights of the BM25 search engine or dense search engine (the weights of the BM25 search engine are...). =0.6, the weight of the dense searcher is =0.4); Retrieve document collection for candidate documents in BM25 Or intensively search document collections The ranking (if the candidate document does not appear in the BM25 search document set) and densely searched document sets In the middle, then (0); k is the smoothing constant (60).
[0076] In one embodiment, the strong correlation probability This can be achieved using the following expression:
[0077]
[0078] in, For query The probability of strong correlation with candidate documents; Predicting queries using a causal language model (Qwen3) The first probability value of relevance to the candidate document; Predicting queries using a causal language model (Qwen3) The second probability value of relevance to candidate documents; To set a threshold (0.7 in this invention), only retain... The Top-K (K is set to 3 in this invention) documents are used as the final set of refined documents for retrieval. Collection of documents for detailed review This refers to the background knowledge generated in the Attribution Knowledge Enhancement (AKE) stage, which serves as the external knowledge enhancement input for the subsequent Relative Intent Reasoning (RIR) stage, thereby ensuring that the model has accurate background knowledge support when understanding specific cultural metaphors such as "a novice dog" or "working like a cow or a horse".
[0079] The target multimodal detection model is updated again based on the updated multimodal detection model, and the target multimodal detection model predicts the final decision label. (When determining that a meme is harmful) When the value is 1, the meme is determined to be harmless. (If the value is 0), the classification loss function uses cross-entropy loss:
[0080]
[0081] in, The number of categories (2 for this task). These are the trainable parameters for LoRA. The classification inference prompt is designed as follows: "You are a meme analysis expert familiar with Chinese internet culture and social psychology. Please analyze the given Chinese meme in the context of Chinese culture and determine whether it expresses harm. The meme consists of an image description and text content, and provides two opposing interpretation perspectives. Input information: [Meme image description]: {meme_discription} [Meme text content]: {text} [Interpretation A (harmless perspective)]: {intent_noharm} [Interpretation B (harmful perspective)]: {intent_harm}. Output requirements: Please strictly follow the following JSON format to output the analysis results: {{ "final_choice": "harmful / non-harmful"}"
[0082] loss function By calculating the difference between the text generated by the multimodal detection model and the real interpreted text, low-rank adaptation (LoRA) is applied to fine-tune the loss function to reduce its loss. This value enables the model to learn to analyze memes using a relative intent reasoning mechanism, that is, to comprehensively consider the potential semantics of memes through harmful and harmless perspectives, thereby increasing the accuracy of the multimodal detection model in classifying harmful memes.
[0083] Secondly, there is the task of interpreting and generating harmful Chinese memes. This invention will use the above-mentioned meme content P( , , , And two dialectical perspectives of information: including information supporting training memes. Explanation of harmful memes and support training memes Explanation of harmless memes This, combined with the prompt input model, means that the multimodal detection model needs to generate a coherent natural language text to explain the input memes. The reason why it is harmful. The process is modeled as an autoregressive language generation task, with its loss function... Defined as the negative log-likelihood of the generated sequence:
[0084]
[0085] in The first explanatory text generated for the multimodal detection model Each Token The length of the explanatory text is specified. The generated prompt is: "You are a meme analysis expert familiar with Chinese internet culture and social psychology. Please analyze the given Chinese meme within the context of Chinese culture, determine whether it expresses harm, and provide an explanation for why the meme is harmful. The meme consists of an image description and text content, providing two opposing interpretive perspectives. Input information: [Meme image description]: {meme_discription} [Meme text content]: {text} [Interpretation A (harmless perspective)]: {intent_noharm} [Interpretation B (harmful perspective)]: {intent_harm}. Output requirements: Please strictly adhere to the following JSON format for outputting the analysis results: {{ "explanation": "Give a one-sentence reason for the decision"}}"
[0086] loss function By calculating the difference between the text generated by the multimodal detection model and the real interpreted text, low-rank adaptation (LoRA) is applied to fine-tune the loss function to reduce its loss. The value enables the model to learn to analyze memes using a relative intention reasoning mechanism, that is, to comprehensively consider the potential semantics of memes through harmful and harmless perspectives, thereby reducing the subjective judgment of the fine-tuned multimodal detection model on Chinese harmful memes and outputting explanations that are more in line with objective perspectives and human cognition.
[0087] The forward propagation process includes training memes. meme images and text Vectors of joint representation The feature tensor output in the projection layer of the attention mechanism in a multimodal detection model Based on the generation of feature tensors, the parameters of the projection layer of the attention mechanism in a multimodal detection model are updated, thereby obtaining an updated multimodal detection model. Feature tensor The calculation formula is revised as follows:
[0088]
[0089] in, For training memes meme images and text Joint representation; For characteristic tensors; This refers to the parameter update amount of the neural network layer in the multimodal detection model; This is the scaling factor; This is the original weight matrix of the multimodal detection model. The increment of the weight matrix, and These are two low-rank matrices.
[0090] To preserve the generality of large models while enabling multimodal detection models to learn relative intent reasoning mechanisms, this invention employs Low-Rank Adaptive (LoRA) fine-tuning technology. The core idea of LoRA fine-tuning is to freeze the principal weight matrix of the network layer parameters during the parameter updates of some neural network layers in the multimodal detection model. By introducing two low-rank matrices and (where rank) To approximate the parameter update amount of the neural network layer to be updated. , The calculation formula is:
[0091]
[0092] During the training initialization phase, the low-rank matrix Initialized using Gaussian distribution, low-rank matrix Initialize it as a zero matrix to ensure that the initial state is maintained. In this way, the present invention only requires updating a very small number of parameters to adapt the multimodal detection model to the Relative Intent Reasoning (RIR) mechanism.
[0093] Through this relative intention reasoning training, the multimodal detection model learns to internally consider relative intentions before making a judgment. This involves separately considering the reasonable interpretation of the meme in a non-malicious context (e.g., self-deprecation, humor) and the aggressive interpretation in a malicious context (e.g., discrimination, insult). Then, based on the background knowledge generated in the Attribution Knowledge Enhancement (AKE) stage, it determines which interpretation is more consistent with objective facts. This mechanism significantly reduces the model's misjudgment rate for ambiguous memes. For example, it correctly identifies a meme containing derogatory terms but actually being self-deprecating as "harmless," or a seemingly cute meme containing malicious metaphors as "harmful."
[0094] In a harmful meme detection task, this embodiment evaluates the performance of this application in terms of accuracy, precision, recall, and F1 score. The experimental results are shown in Table 1.
[0095] Table 1
[0096]
[0097] Analysis of the data in Table 1 shows that the untuned multimodal detection model performs poorly in handling harmful Chinese memes, with accuracy generally below 60% and a low F1 score, indicating its difficulty in understanding complex cultural metaphors. In contrast, while traditional supervised fine-tuning (SFT) significantly improves performance, the RIKE framework proposed in this invention surpasses SFT in all metrics. Particularly on the InternVL3.5-8B model, the RIKE method improves accuracy to 96.7% and achieves an F1 score of 0.969, demonstrating that combining relative intent reasoning with knowledge enhancement strategies effectively improves the model's ability to identify harmful content, especially in reducing false negatives (improving recall).
[0098] Secondly, in the interpretation and generation task, this embodiment evaluated the quality of the model's generated decision-making basis. Evaluation metrics included automation metrics (BLEU-4, ROUGE-L) and multi-dimensional scores based on large model referees (information content, logicality, cultural relevance, simplicity, and persuasiveness). Experimental results are shown in Table 2.
[0099] Table 2
[0100]
[0101] As shown in Table 2, the application of the RIKE framework of this invention significantly improved the quality of explanations generated by each model. Regarding automation metrics, the significant increase in BLEU-4 and ROUGE-L scores (e.g., Qwen2.5-VL-7B's BLEU-4 increased from 14.17 to 51.69) indicates a high degree of lexical and structural consistency between the generated text and the high-quality, manually annotated explanations. In terms of multi-dimensional scoring, the RIKE method showed particularly significant improvements in cultural relevance and logical consistency, confirming that introducing an external cultural knowledge base (C-HarmKB) can effectively help the model accurately interpret specific internet slang and metaphors, thereby generating more persuasive and context-appropriate decision explanations.
[0102] In summary, this invention constructs a logically rigorous and highly interpretable Chinese harmful meme detection system based on multimodal detection model reasoning by employing a hybrid retrieval and reordering algorithm in the Attribution Knowledge Enhancement (AKE) stage and dialectical reasoning and multi-task loss optimization based on LoRA fine-tuning in the Relative Intent Reasoning (RIR) stage.
[0103] This application also provides a Chinese harmful meme detection device that combines relative intention reasoning and knowledge enhancement, such as... Figure 3 As shown, the device includes:
[0104] The generation module 10 is used to obtain training memes, which include image descriptions, text, and meme images. It uses a lightweight plain text large language model to generate an extended set of meme semantic keywords based on the image descriptions and text. Each keyword in the set of meme semantic keywords is a highly refined summary of the potentially harmful meanings of the training meme, and each keyword corresponds to a query.
[0105] The search module 20 is used to search for multiple target documents that are semantically most relevant to each query in the Chinese harmful semantic knowledge base. These multiple target documents constitute the training memes. A collection of strongly related background knowledge documents;
[0106] The construction module 30 is used to construct prompt words for each candidate document and its corresponding query in the background knowledge document set through the re-ranking model, and output them to the causal language model inside the re-ranking model. The causal language model outputs the strong correlation probability of each candidate document and its corresponding query; and retains a first number of candidate documents with strong correlation probabilities greater than a first preset value as the fine-check document set.
[0107] The optimization and update module 40 is used to construct the meme content of the training meme, which consists of the image description, text, meme image, and refined document set. The meme content, combined with the explanations of the training meme as a harmful meme and the explanations of the training meme as a harmless meme, constitutes classification inference prompts. The classification inference prompts are input into the multimodal detection model and the predicted label of the training meme is output. The cross-entropy loss between the predicted label and the actual label of the training meme is calculated through the classification loss function. When the cross-entropy loss is greater than a preset value, the vector jointly represented by the meme image and text of the training meme is input into the attention mechanism projection layer in the multimodal detection model to optimize and update the multimodal detection model, so as to obtain a classification multimodal detection model.
[0108] The label generation module 50 is used to input the meme to be detected into the classification multimodal detection model to obtain the label and reason corresponding to the meme to be detected, wherein the label is harmful or harmless.
[0109] Figure 4 An internal structural diagram of a computer device in one embodiment is shown. This computer device can specifically be a terminal or a server. Figure 4 As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a Chinese harmful meme detection method combining relative intent reasoning and knowledge enhancement. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to implement the Chinese harmful meme detection method combining relative intent reasoning and knowledge enhancement. Those skilled in the art will understand that... Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0110] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0111] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0112] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for detecting harmful Chinese memes that combines relative intention reasoning and knowledge enhancement, characterized in that, The method includes: Acquire training memes, which include image descriptions, text, and meme images. Use a lightweight plain text large language model to generate an extended set of meme semantic keywords based on the image descriptions and text. Each keyword in the set of meme semantic keywords is a highly refined extract of the potentially harmful meanings of the training meme, and each keyword corresponds to a query. For each query, search the Chinese harmful semantic knowledge base for multiple target documents that are most semantically relevant to it. These multiple target documents constitute a set of background knowledge documents that are strongly related to the training meme. The re-ranking model constructs prompt words for each candidate document and its corresponding query in the background knowledge document set, and outputs them to the causal language model inside the re-ranking model. The causal language model outputs the strong correlation probability of each candidate document and its corresponding query. The first number of candidate documents with strong correlation probabilities greater than a first preset value are retained as the fine-check document set. The image description, text, meme image, and refined document set constitute the meme content of the training meme. The meme content, combined with the explanations of the training meme as a harmful meme and the explanations of the training meme as a harmless meme, constitutes classification inference prompts. The classification inference prompts are input into the multimodal detection model and the predicted label of the training meme is output. The cross-entropy loss between the predicted label and the actual label of the training meme is calculated using a classification loss function. When the cross-entropy loss is greater than a preset value, the vector jointly represented by the meme image and text of the training meme is input into the attention mechanism projection layer in the multimodal detection model to optimize and update the multimodal detection model, thereby obtaining a classification multimodal detection model. The meme to be detected is input into the classification multimodal detection model to obtain the label and reason corresponding to the meme to be detected, wherein the label is harmful or harmless.
2. The method for detecting harmful Chinese memes combining relative intent reasoning and knowledge enhancement according to claim 1, characterized in that, The process of searching for multiple target documents that are semantically most relevant to each query in the Chinese harmful semantic knowledge base, and the multiple target documents forming a set of background knowledge documents strongly related to the training meme, includes: The BM25 algorithm in the BM25 retrieval tool is used to accurately match a first number of candidate documents that are strongly related to the query from the Chinese harmful semantic knowledge base. The first number of candidate documents constitute the BM25 retrieval document set. Using the word embedding model of the dense retrieval tool, the query is mapped to a low-dimensional dense vector space with documents in the Chinese harmful semantic knowledge base, respectively, to obtain query encoding output and document encoding output. The cosine similarity between the two encoding outputs is calculated. The top five documents with the highest to lowest cosine similarity among all documents in the Chinese harmful semantic knowledge base are selected as the dense retrieval document set. For each candidate document in the BM25 search document set and the dense search document set, the inverse ranking fusion algorithm is used to calculate its document ranking score in the BM25 search document set and the dense search document set, and then weighted to obtain the target document ranking score of each candidate document. All candidate documents in the BM25 search document set and the dense search document set are sorted from high to low according to the target document ranking score, and the top five candidate documents with the highest target document ranking scores are selected as the set of background knowledge documents most relevant to the query.
3. The method for detecting harmful Chinese memes combining relative intent reasoning and knowledge enhancement according to claim 1, characterized in that, The first number of candidate documents that are strongly related to the query are precisely matched using the BM25 algorithm in the BM25 search engine. The first number of candidate documents constitute the BM25 search document set, which includes: For each keyword in the set of semantic keywords corresponding to the training meme, the inverse document frequency of each keyword is calculated. Based on the inverse document frequency, the relevance score between each keyword and each document in the Chinese harmful semantic knowledge base is calculated. The documents in the Chinese harmful semantic knowledge base are selected from high to low according to the relevance score, and the documents corresponding to the top five scores are selected as the BM25 retrieval document set.
4. The method for detecting harmful Chinese memes combining relative intent reasoning and knowledge enhancement according to claim 3, characterized in that, The inverse document frequency is achieved by the following expression: in, For terms, For terms Inverse document frequency; This represents the total number of documents in the Chinese Harmful Semantics Knowledge Base. For included terms The number of candidate documents; The correlation score is achieved through the following expression: in, For relevance score; For terms Inverse document frequency; For terms In the document The frequency in; Document length; For document The average length; This is a saturation parameter; This is the length normalization parameter.
5. The method for detecting harmful Chinese memes combining relative intent reasoning and knowledge enhancement according to claim 2, characterized in that, The cosine similarity is achieved through the following expression: in, Cosine similarity; Output the query code; Output the document encoding; Represents a word embedding model; Norm calculation.
6. The method for detecting harmful Chinese memes combining relative intent reasoning and knowledge enhancement according to claim 5, characterized in that, The target document ranking score is achieved using the following expression: in, The ranking score for the target document; Retrieve document collection for BM25 and densely searched document sets A candidate document in the document; The number of search engines; Weights for the BM25 search engine or dense search engine; Retrieve document collection for candidate documents in BM25 Or intensively search document collections The ranking in the equation; k is a smoothing constant.
7. The method for detecting harmful Chinese memes combining relative intent reasoning and knowledge enhancement according to claim 1, characterized in that, The strong correlation probability is expressed by the following formula: in, For query The probability of strong correlation with candidate documents; Predicting queries using causal language models The first probability value of relevance to the candidate document; Predicting queries using causal language models The second probability value of relevance to candidate documents.
8. A Chinese harmful meme detection device combining relative intention reasoning and knowledge enhancement, characterized in that, The device includes: The generation module is used to obtain training memes, which include image descriptions, text, and meme images. It uses a lightweight plain text large language model to generate an extended set of meme semantic keywords based on the image descriptions and text. Each keyword in the set of meme semantic keywords is a highly refined summary of the potentially harmful meanings of the training meme, and each keyword corresponds to a query. The search module is used to find multiple target documents that are semantically most relevant to each query in the Chinese harmful semantic knowledge base. These multiple target documents constitute the training memes. A collection of strongly related background knowledge documents; The construction module is used to construct prompt words for each candidate document and its corresponding query in the background knowledge document set through the re-ranking model, and output them to the causal language model inside the re-ranking model. The causal language model outputs the strong correlation probability of each candidate document and its corresponding query; and retains a first number of candidate documents with strong correlation probabilities greater than a first preset value as the fine-check document set. An optimization and update module is used to construct the meme content of the training meme, which consists of the image description, text, meme image, and refined document set. The meme content, combined with the explanations of the training meme as a harmful meme and the explanations of the training meme as a harmless meme, constitutes classification inference prompts. The classification inference prompts are input into the multimodal detection model and the predicted label of the training meme is output. The cross-entropy loss between the predicted label and the actual label of the training meme is calculated through a classification loss function. When the cross-entropy loss is greater than a preset value, the vector jointly represented by the meme image and text of the training meme is input into the attention mechanism projection layer in the multimodal detection model to optimize and update the multimodal detection model, thereby obtaining a classification multimodal detection model. The label generation module is used to input the meme to be detected into the classification multimodal detection model to obtain the label and reason corresponding to the meme to be detected, wherein the label is harmful or harmless.