Semantic risk stratification identification method based on text-image multimodal collaboration
By generating semantic scene reconstruction images and combining them with cross-modal matching networks, the problem of low accuracy and difficulty in tracing the source of implicit ideological risks in plain text review systems has been solved. This has enabled risk identification and positioning from a global to a fine-grained level, improving the accuracy of identification and review efficiency.
Patent Information
- Application Number
- CN202611422999.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-11-24
AI Technical Summary
Existing plain text moderation systems lack contextual semantic understanding capabilities when identifying implicit ideological risks, making it impossible to perform fine-grained positioning and cross-validate using visual scene semantics, resulting in low identification accuracy and difficulty in tracing the source.
A semantic risk hierarchical identification method based on text-image multimodal collaboration is adopted. By generating semantic scene reconstruction images and combining them with cross-modal matching networks for risk identification, adaptive weighted fusion of text modality and image modality is achieved to accurately locate risk segments.
It improves the accuracy of identifying complex semantic risks, achieves a leap from global risk assessment to fine-grained positioning, constructs a multi-tiered risk layering system, and improves the efficiency of engineering implementation and the accuracy of control in the review process.
Smart Images

Figure CN123159352A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of natural language processing and multimodal content security technology, specifically relating to a semantic risk hierarchical identification method based on text-image multimodal collaboration. Background Technology
[0002] With the continuous growth in the scale of online content, public texts, and user-generated content, the automated identification and stratified assessment of ideological and semantic risks in texts has become an urgent need for content security governance. Existing text moderation systems generally employ rule-based thesaurus, keyword matching, or single-text classification models to output an overall risk label or risk probability for the text to be inspected. While these solutions are effective against explicit violations and fixed expression patterns, they reveal systemic technical deficiencies when dealing with implicit expressions, semantic metaphors, contextual dependencies, and situational semantics.
[0003] First, single-text models lack contextual semantic understanding capabilities, resulting in insufficient ability to identify implicit ideological risks. Pure text classification models essentially rely on surface semantic features and statistical correlations in the training corpus, making it difficult to penetrate the narrative structure and implicit semantic layers of the text. When risky content is not presented as explicit sensitive words, but rather conveyed indirectly through narrative context, character relationships, scene descriptions, or rhetorical metaphors—for example, by using fictional dialogues or hypothetical scenarios to subtly express negative tendencies—single-text models, lacking the ability to construct contextual semantics and make visual associations, are highly prone to missed detections and misjudgments. The semantic indirectness and contextual dependence of such risks make pure text solutions particularly inadequate in ideological risk identification scenarios.
[0004] Secondly, existing solutions only output overall risk labels and confidence levels for the text, lacking the ability to pinpoint risky statements and words at a fine-grained level. The current global assessment results cannot support subsequent risk tracing, precise content rectification, and tiered control. Reviewers are forced to rely on manual, segment-by-segment checks, making it difficult to form an efficient, engineered control loop. From a practical business process perspective, there is a significant operational gap between "overall assessment of risk" and "precisely locating risky segments."
[0005] Third, pure text analysis lacks a cross-validation mechanism for visual scene semantics, making it difficult to reliably judge risk expressions based on scene context or visual metaphors. Humans often need to rely on visual experience and scene imagination as auxiliary references to understand implicit risks in text, but pure text models naturally lack this capability. A few multimodal content review solutions have attempted to introduce visual information, but their technical premise is that the input data already contains images, mainly used for joint review of original text and image materials. However, in many actual business scenarios, the object to be reviewed is only pure text, and the system cannot directly obtain the corresponding visual scene. If existing multimodal solutions are simply applied, they will completely fail due to the lack of image input. Current technology has not yet built a complete technical chain of "pure text input, visual scene reconstruction, dual-modal collaborative verification, risk stratification judgment, and fine-grained positioning output".
[0006] In summary, there is an urgent need in the current technological field for a hierarchical identification scheme for ideological semantic risks based on plain text input. This scheme should use plain text as the sole input source, introduce cross-modal auxiliary information for risk identification through semantically driven visual scene reconstruction, achieve adaptive weighted fusion verification of risk assessment results from text and image modalities, and accurately locate sentence-level and word-level risk segments based on multi-gradient risk hierarchies. This will systematically improve the accuracy, interpretability, and engineering feasibility of complex semantic risk identification. Summary of the Invention
[0007] To address the shortcomings of existing text semantic risk identification technologies, such as limited identification dimensions, low accuracy in identifying implicit risks, lack of visual scene semantic corroboration, inability to perform fine-grained localization of risk segments, and insufficient risk stratification capabilities, this invention employs a semantic risk stratification identification method based on text-image multimodal collaboration. The invention proposes the following specific solutions:
[0008] In a first aspect, the present invention proposes a semantic risk hierarchical identification method based on text-image multimodal collaboration, the method comprising:
[0009] The text to be detected is cleaned and preprocessed to obtain preprocessed text. The data to be detected is text input data containing only the text to be detected, and the text input data does not contain the original image corresponding to the text to be detected. The method uses the text to be detected as business input and generates a semantic scene reconstruction image through a text-based graph model. The semantic scene reconstruction image serves as an auxiliary visual semantic representation for cross-modal risk identification.
[0010] The text to be detected is cleaned and preprocessed. Based on semantic boundaries, the preprocessed text is split into fine-grained segments to form a multi-level text unit set containing global text, multiple sub-texts and core words. A text index mapping table is used to record the start and end positions of each sub-text and core word in the original text.
[0011] An ideological semantic risk labeling system is constructed in advance. The multi-level text unit set is input into a pre-trained text classification network, and the independent classification probability of each text unit in the ideological semantic risk labeling system is output. Based on the independent classification probability of each text unit, sentences and word fragments with classification probabilities exceeding a preset threshold are selected as candidate risk regions.
[0012] The preprocessed text is input into the text-generated image model to generate a semantic scene reconstruction image that restores the core scene and context of the text; the standardized semantic descriptions of various ideological risks and violation risks in the ideological semantic risk labeling system are used as the text prompt library of CLIP; the semantic scene reconstruction image and the prompt library are input into a cross-modal matching network to obtain the image modal risk matching probability corresponding to various risks;
[0013] By combining the semantic features of the candidate risk regions of text, the local semantic regions of the semantic scene reconstructed image are associated and matched to obtain the text modal risk probability of each text in the candidate risk regions; the image modal risk matching probability and the text modal risk probability of each text in the candidate risk regions are adaptively weighted and fused to obtain the final fused risk probability.
[0014] The risk level is determined based on the final fused risk probability and the preset threshold range; if there is no risk, the risk-free result is directly output; if there is risk, the predicted risk category is used as a priori constraint to drive the DINO model to detect risk-related entities associated with the risk category in the semantic scene reconstruction image; at the same time, entity recognition is performed on the candidate risk region to extract text entities, and the detected risk-related entities are semantically aligned with the text entities through cross-modal fuzzy matching. The successfully matched text entities are mapped back to the start and end positions in the original text based on the text index mapping table and marked as risk segments. The structured result containing risk level, risk category, risk segment and its position is output.
[0015] Secondly, this application proposes an electronic device, comprising: one or more processors; and a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the above-described semantic risk hierarchical identification method based on text-image multimodal collaboration.
[0016] Thirdly, this application proposes a computer-readable storage medium storing executable instructions that, when executed by a processor, enable the processor to implement the aforementioned semantic risk hierarchical identification method based on text-image multimodal collaboration.
[0017] The beneficial effects of this invention are as follows:
[0018] (1) This invention breaks through the bottleneck of pure text modality in identifying implicit, metaphorical and contextual semantic risks. By generating semantic scene reconstruction images that match the preprocessed text, and combining the image modality risk matching probability output by the cross-modality matching network with the text modality risk classification probability, the accuracy of risk identification in complex semantic scenes is improved.
[0019] (2) This invention achieves a leap from global risk assessment to fine-grained risk location. It uses the predicted risk category as a priori constraint to drive the DINO model to detect risk-related entities in a targeted manner. Combined with entity recognition of candidate risk regions, cross-modal fuzzy matching and text index mapping table, it accurately locks the start and end positions of risk fragments in the original text, solving the technical shortcomings of traditional plain text review schemes that cannot trace the source.
[0020] (3) This invention constructs a multi-gradient risk stratification system, which divides risks into four levels based on the final fusion risk probability and the preset threshold range, providing technical support for differentiated content control, early warning and rectification strategies, and improving the engineering implementation efficiency and control accuracy of the review process. Attached Figure Description
[0021] Figure 1 This is a flowchart of a semantic risk hierarchical identification method based on text-image multimodal collaboration according to the present invention;
[0022] Figure 2 This is a schematic diagram of the large model processing flow for text-based images according to an embodiment of the present invention;
[0023] Figure 3 This is a schematic diagram of the risk level determination process according to an embodiment of the present invention. Detailed Implementation
[0024] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0025] In some embodiments, such as Figure 1 This invention proposes a semantic risk hierarchical identification method based on text-image multimodal collaboration, which includes:
[0026] The text to be detected is cleaned and preprocessed to obtain preprocessed text; the preprocessed text is then finely split based on semantic boundaries to form a multi-level text unit set containing global text, multiple sub-texts and core words, and a text index mapping table is used to record the start and end positions of each sub-text and core word in the original text.
[0027] An ideological semantic risk labeling system is constructed in advance. The multi-level text unit set is input into a pre-trained text classification network, and the independent classification probability of each text unit in the ideological semantic risk labeling system is output. Based on the independent classification probability of each text unit, sentences and word fragments with classification probabilities exceeding a preset threshold are selected as candidate risk regions.
[0028] The preprocessed text is input into the text-generated image model to generate a semantic scene reconstruction image that restores the core scene and context of the text; the standardized semantic descriptions of various ideological risks and violation risks in the ideological semantic risk labeling system are used as the text prompt library of CLIP; the semantic scene reconstruction image and the prompt library are input into a cross-modal matching network to obtain the image modal risk matching probability corresponding to various risks;
[0029] By combining the semantic features of the candidate risk regions of text, the local semantic regions of the semantic scene reconstructed image are associated and matched to obtain the text modal risk probability of each text in the candidate risk regions; the image modal risk matching probability and the text modal risk probability of each text in the candidate risk regions are adaptively weighted and fused to obtain the final fused risk probability.
[0030] The risk level is determined based on the final fused risk probability and the preset threshold range; if there is no risk, the risk-free result is directly output; if there is risk, the predicted risk category is used as a priori constraint to drive the DINO model to detect risk-related entities associated with the risk category in the semantic scene reconstruction image; at the same time, entity recognition is performed on the candidate risk region to extract text entities, and the detected risk-related entities are semantically aligned with the text entities through cross-modal fuzzy matching. The successfully matched text entities are mapped back to the start and end positions in the original text based on the text index mapping table and marked as risk segments. The structured result containing risk level, risk category, risk segment and its position is output.
[0031] In some embodiments, a semantic risk hierarchical identification method based on text-image multimodal collaboration is specifically described, including:
[0032] S1: Based on semantic boundaries, the preprocessed text is split into fine-grained segments to form a multi-level set of text units containing global text, multiple sub-texts, and core words. A text index mapping table is used to record the start and end positions of each sub-text and core word in the original text.
[0033] For example, the system receives the text T to be detected as input, which is then preprocessed to form preprocessed text; U={u0,u1,...,u n}, where U is the preprocessed text, and u0 represents the global text, u1 to u nIt represents fine-grained text units such as statements, keywords, or phrases; at the same time, it establishes a position mapping table M to record the position of each text unit in the original text T.
[0034] S2: Input the multi-level text unit set into the pre-trained text classification network, and output the independent classification probability of each text unit in the ideological semantic risk label system; based on the independent classification probability of each text unit, select sentences and word fragments with classification probabilities exceeding a preset threshold as candidate risk regions.
[0035] For example, the text classification network can be, but is not limited to, high-precision text classification models such as BERT, RoBERTa, ERNIE, or their lightweight variants. The text classification network is pre-trained on a large-scale general corpus and fine-tuned on domain corpora labeled with risk categories, enabling it to classify and identify ideological semantic risks. The system pre-establishes a semantic risk labeling system, which can be expanded according to application scenarios, including at least several subdivided risk category labels such as no risk, discriminatory content risk, risk of violating socialist core values, risk of infringing on the legitimate rights and interests of others, risk of negative public opinion guidance, and risk of ideological deviation. Global text, sentence-level text, and keyword or phrase-level text are input into the text classification network to obtain the text modal risk probability for each text unit for each risk category. For any text unit u and risk category r, the text classification network outputs the text risk probability P. t (r,u). When P t When (r,u) exceeds a preset initial threshold, the system marks the text unit as a candidate risk text region and records the risk category, text modality risk probability, and original text location information corresponding to the candidate risk text region. The preset initial threshold can be set differently according to the sensitivity of the risk category and business control requirements. That is, a lower threshold can be set for high-risk categories to improve the recall rate, and a higher threshold can be set for low-risk categories to reduce the false positive rate.
[0036] S3: Input the preprocessed text into the text-to-image large model to generate a semantic scene reconstruction image that restores the core scene and context of the text; input the semantic scene reconstruction image into the cross-modal matching network to obtain the image modal risk matching probability corresponding to each type of risk; perform adaptive weighted fusion of the image modal risk matching probability and the text modal risk probability of each text in the candidate risk region to obtain the final fused risk probability.
[0037] Understandably, to compensate for the lack of visual scene semantic evidence in pure text models, preprocessed text is input into the text-to-image (TPE) model to generate a semantic scene reconstruction image that matches the overall semantics of the text. The TPE model can be an open-source or commercial image generation model, as long as it can generate visual scene images based on text descriptions. Using the complete text to be detected, rather than split subtexts, as input to the TPE model is because the overall semantics, narrative structure, and contextual relationships of the text are the foundation for constructing scene context; relying solely on partial sentences makes it difficult to reconstruct complete scene information. A semantic constraint strategy is employed during the generation process. Specifically, constraint information such as subject, behavior, scene, viewpoint, emotional expression, and contextual relationships is extracted from the text to be detected and organized into input prompts or control conditions for the TPE model. Through prompt word engineering, core semantic elements in the text to be detected are constructed as constraint prompt words, guiding the TPE model to prioritize the reconstruction of scene and contextual features corresponding to these core semantic elements during image generation. This ensures that the generated image faithfully reflects the core scene, characters, viewpoints, and context of the text, reducing irrelevant images and generation deviations, and ensuring a high degree of alignment between image semantics and text semantics. For cryptic or metaphorical texts, such as those conveying negative tendencies through fictional narratives, contrastive descriptions, or symbolic techniques, semantic scene reconstruction images can transform implicit semantics in the text into visual cues. This allows contextual risk signals that are difficult for pure text models to capture to be explicitly presented in image form, compensating for the inherent shortcomings of pure text models in contextual semantic understanding and providing high-quality visual input for subsequent image modality risk matching.
[0038] For example, a pre-defined semantic risk text library corresponding to the ideological semantic risk labeling system is constructed. Each risk category in the pre-defined semantic risk text library corresponds to at least one standardized risk description text. The standardized risk description text uses natural language to describe the typical semantic features, manifestations, and judgment points of that risk category. The semantic scene reconstruction image is input into the image encoding branch of a cross-modal matching network, and the standardized risk description texts corresponding to each risk category in the pre-defined semantic risk text library are input into the text encoding branch of the cross-modal matching network, resulting in image encoding vectors and risk semantic text encoding vectors, respectively. The similarity between the image encoding vector and each risk semantic text encoding vector is calculated, and the similarity is normalized to the image modal risk matching probability, outputting the matching probability score of each risk category corresponding to the semantic scene reconstruction image. The image modal risk matching probability characterizes the degree of consistency between the visual semantics of the semantic scene reconstruction image and the semantics of each pre-defined risk category. Based on the semantic features of candidate risk regions, local semantic regions of the semantic scene reconstruction image are correlated and matched to establish a correspondence between visual semantics and local text risks, providing a basis for bimodal probability fusion and fine-grained localization.
[0039] In some embodiments, the process of inputting the text to be detected into the text-to-image model and generating a semantic scene reconstruction image that restores the core scene and context of the text is based on a semantic constraint strategy, specifically including: constructing the core semantic elements in the text to be detected as constraint prompts, guiding the text-to-image model to prioritize restoring the scene and context features corresponding to the core semantic elements during the image generation process.
[0040] Figure 2 This is a schematic diagram illustrating the processing flow of the large-scale text-to-image model according to an embodiment of the present invention. For example... Figure 2 As shown, preprocessed text is input into the text-to-image model to generate semantic scene reconstruction images. A semantic constraint strategy is employed during image generation, constructing constraint prompts from the core semantic elements of the preprocessed text. This guides the text-to-image model to prioritize the reconstruction of the scene and contextual features corresponding to these core semantic elements. This semantic constraint strategy ensures that the generated semantic scene reconstruction images faithfully reproduce the core scene of the text, reducing irrelevant visual elements. Especially for cryptic and metaphorical texts, it transforms implicit semantics into visual cues, providing reliable visual input for subsequent cross-modal risk matching.
[0041] In some embodiments, inputting the semantic scene reconstructed image and the prompt library into a cross-modal matching network to obtain the image modal risk matching probability corresponding to various risks includes: constructing a preset semantic risk text library corresponding to the ideological semantic risk label system; inputting the semantic scene reconstructed image and the prompt library into the cross-modal matching network; completing the similarity matching between the image visual semantics and various preset risk semantics through image encoding and risk semantic text encoding; and outputting the matching probability score of the image corresponding to various risks; the cross-modal matching network is a CLIP network.
[0042] In some embodiments, the image modality risk matching probability and the text modality risk classification probability of the candidate risk region are adaptively weighted and fused to obtain the final fused risk probability, including:
[0043] ;
[0044] in, To ultimately integrate risk probabilities, Let be the risk probability of candidate risk region u under text modal risk r. To reconstruct the risk matching probability of an image for text modality risk r in a semantic scene, Let u be the adaptive fusion weight corresponding to the candidate risk text region u, and 0 ≤ ≤1.
[0045] For example, the adaptive fusion weights are set according to the following rules: the text modality is responsible for determining explicit semantic risks, and the image modality is responsible for correcting and calibrating implicit and contextual risks. The system can dynamically determine the weights based on training data, text length, text modality confidence, image modality confidence, risk category, and application scenario. The value of . When there is a high explicit semantic risk, such as the presence of clearly prohibited words or explicit inappropriate expressions in the text, the system can increase the text modality weight (i.e., increase ). This allows the final judgment to rely more on direct semantic evidence from the text modality; when there is a high risk of implicit, metaphorical, or contextual risks, such as when the text uses indirect narration, symbolic expression, or context-dependent methods to convey undesirable semantics, the system can reduce the text modality weight (i.e., decrease the weight of the text modality). This approach enhances image modality weights and leverages the ability of visual scene reconstruction to reveal implicit risks through probabilistic reinforcement calibration. Through this adaptive fusion mechanism, dual-modal probabilistic fusion can balance explicit text semantic judgment with implicit image scene verification, avoiding recognition biases caused by a single modality.
[0046] S4: Determine the risk level based on the final fused risk probability and the preset threshold range; if there is no risk, output the risk-free result directly; if there is risk, use the predicted risk category as a priori constraint to drive the DINO model to detect risk-related entities associated with the risk category in the semantic scene reconstruction image; at the same time, perform entity recognition on the candidate risk region to extract text entities, and perform semantic alignment between the detected risk-related entities and text entities through cross-modal fuzzy matching. The successfully matched text entities are mapped back to the start and end positions in the original text based on the text index mapping table and marked as risk segments. Output a structured result containing risk level, risk category, risk segment and its position.
[0047] For example, this step sets up a pre-jump logic to branch based on the determined risk level. If the risk level is determined to be Level 1 (no risk), the fine-grained localization process is skipped, a risk-free result is output, and the process terminates. If the risk level is determined to be Level 2 or higher, the multimodal fine-grained localization process is initiated. This pre-jump mechanism avoids performing invalid calculations on risk-free text, improving system processing efficiency. In the multimodal fine-grained localization process, the predicted risk category is used as a priori constraint to drive the DINO model to perform directional target detection on the semantic scene reconstruction image, outputting the category labels and detection box coordinates of risk-related entities. This mechanism gives the detection behavior a clear risk semantic orientation, overcomes the blindness of indiscriminate detection of all entities in the image, and improves the accuracy of risk-related entity detection. Named entity recognition is performed on the candidate risk region text to extract product entities, location entities, and proper noun entities, and the character offset of each entity is recorded. The local image region corresponding to the detection box and the text entity are input into the cross-modal matching network to calculate semantic similarity. When the similarity exceeds a preset matching threshold, it is considered a successful match. Cross-modal fuzzy matching establishes a correspondence between visual semantics and text semantics, solving the problem of insufficient risk assessment basis under a single modality. Successfully matched text entities are marked as risk fragments and mapped back to their start and end positions in the original text using a text index mapping table, achieving precise cross-modal source tracing from image detection to text location. Finally, a structured localization result containing risk level, risk category, risk statement, risk vocabulary, and location is output. Through this process, the system extends from global risk layering to precise risk fragment localization at the statement and vocabulary levels, overcoming the technical limitations of traditional plain text review solutions that can only output overall risk labels without source tracing, providing operable technical support for subsequent content control, risk handling, and rectification.
[0048] Figure 3 This is a schematic diagram illustrating the risk level determination process according to an embodiment of the present invention. Figure 3 As shown, a preliminary judgment is made based on the risk level obtained from the initial assessment. If there is no risk, the result is directly output and the process is terminated, avoiding invalid calculations on risk-free text and improving system processing efficiency. If there is risk, the predicted risk category is used as a priori constraint to drive the DINO model to detect risk-related entities in the semantic scene reconstruction image, giving the detection behavior a clear risk semantic orientation and outputting entity category labels and detection box coordinates. At the same time, entity recognition is performed on candidate risk regions to extract text entities. Cross-modal fuzzy matching is used to semantically align the detected risk-related entities with text entities. The successfully matched text entities are mapped back to the start and end positions in the original text based on the text index mapping table and marked as risk segments, realizing cross-modal accurate source tracing from image detection to text location. The output is a structured result containing risk level, risk category, risk segment and its location, overcoming the technical shortcomings of traditional pure text review schemes that cannot trace the source.
[0049] In some embodiments, driving the DINO model to target and detect risk-related entities associated with risk categories in the semantic scene reconstruction image includes: using the predicted risk category as a prior constraint, causing the DINO object detection model to focus its attention on the visual entity regions in the semantic scene reconstruction image associated with the current risk category, and outputting the category labels and detection box coordinates of the risk-related entities.
[0050] In some embodiments, the cross-modal fuzzy matching calculates the semantic similarity between the local image region corresponding to the detection box and the text entity input cross-modal matching network, and determines that the match is successful when the similarity exceeds a preset matching threshold.
[0051] In some embodiments, the image modality risk matching probability is the global risk matching result of the semantic scene reconstructed image generated for the preprocessed text, and the same image modality risk matching probability value is shared for all candidate risk regions under the same preprocessed text.
[0052] In some embodiments, the preset threshold range includes a first risk threshold T1, a second risk threshold T2, and a third risk threshold T3, and T1 < T2 < T3; the risk level determination based on the final fusion risk probability and the preset threshold range includes: a final fusion risk probability lower than T1 is Level 1 no risk, a probability between T1 and T2 is Level 2 mild risk, a probability between T2 and T3 is Level 3 moderate risk, and a probability higher than T3 is Level 4 severe risk.
[0053] For example, the maximum fusion risk probability among all risk categories and candidate risk regions is taken as the global risk probability; the fusion risk probabilities of multiple candidate risk regions are weighted and summed according to business rules to obtain the global risk probability. The global risk probability comprehensively reflects the overall risk level of the text to be detected, and T1 < T2 < T3. The risk level is determined based on the global risk probability and a preset threshold range. A global risk probability below T1 is classified as Level 1 (no risk), indicating semantic compliance and no ideological bias or illegal content; a global risk probability between T1 and T2 is classified as Level 2 (minor risk), indicating a small amount of implicit negative semantics but no serious ideological bias; a global risk probability between T2 and T3 is classified as Level 3 (moderate risk), indicating explicit illegal semantics or minor ideological bias; and a global risk probability above T3 is classified as Level 4 (severe risk), indicating content that seriously violates socialist core values, contains malicious discrimination, infringes on rights, or provides negative ideological guidance.
[0054] For example, structured results include at least risk level, risk category, risk statement, risk vocabulary, location range, visual corroboration features, and attention weight.
[0055] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A semantic risk hierarchical identification method based on text-image multimodal collaboration, characterized in that, The method includes: The text to be detected is cleaned and preprocessed to obtain preprocessed text. Based on semantic boundaries, the preprocessed text is split into fine-grained segments to form a multi-level text unit set containing global text, multiple sub-texts and core words. A text index mapping table is used to record the start and end positions of each sub-text and core word in the original text. An ideological semantic risk labeling system is constructed; the multi-level text unit set is input into a pre-trained text classification network, and the independent classification probability of each text unit in the ideological semantic risk labeling system is output; based on the independent classification probability of each text unit, sentences and word fragments with classification probabilities exceeding a preset threshold are selected as candidate risk regions; The preprocessed text is input into the text-generated image model to generate a semantic scene reconstruction image that restores the core scene and context of the text; the standardized semantic descriptions of various ideological risks and violation risks in the ideological semantic risk labeling system are used as the text prompt library of CLIP; the semantic scene reconstruction image and the prompt library are input into a cross-modal matching network to obtain the image modal risk matching probability corresponding to various risks; By combining the semantic features of the candidate risk regions of text, the local semantic regions of the semantic scene reconstructed image are associated and matched to obtain the text modal risk probability of each text in the candidate risk regions; the image modal risk matching probability and the text modal risk probability of each text in the candidate risk regions are adaptively weighted and fused to obtain the final fused risk probability. The risk level is determined based on the final fused risk probability and the preset threshold range; if there is no risk, the risk-free result is directly output; if there is risk, the predicted risk category is used as a priori constraint to drive the DINO model to detect risk-related entities associated with the risk category in the semantic scene reconstruction image; at the same time, entity recognition is performed on the candidate risk region to extract text entities, and the detected risk-related entities are semantically aligned with the text entities through cross-modal fuzzy matching. The successfully matched text entities are mapped back to the start and end positions in the original text based on the text index mapping table and marked as risk segments. The structured result containing risk level, risk category, risk segment and its position is output.
2. The semantic risk hierarchical identification method based on text-image multimodal collaboration according to claim 1, characterized in that, The process of inputting the text to be detected into the text-generated image large model and generating a semantic scene reconstruction image that restores the core scene and context of the text is based on a semantic constraint strategy, specifically including: The core semantic elements in the text to be detected are constructed as constraint prompts, which guide the text-to-image model to prioritize the restoration of the scene and context features corresponding to the core semantic elements during the image generation process.
3. The semantic risk hierarchical identification method based on text-image multimodal collaboration according to claim 2, characterized in that, The reconstructed image of the semantic scene and the prompt library are input into a cross-modal matching network to obtain the image modal risk matching probabilities corresponding to various risk types, including: A preset semantic risk text library corresponding to the ideological semantic risk label system is constructed. The semantic scene reconstruction image and the prompt library are input into the cross-modal matching network. The similarity matching between the visual semantics of the image and various preset risk semantics is completed through image encoding and risk semantic text encoding. The matching probability score of the image corresponding to various risks is output. The cross-modal matching network is the CLIP network.
4. The semantic risk hierarchical identification method based on text-image multimodal collaboration according to claim 3, characterized in that, The image modality risk matching probability and the text modality risk classification probability of the candidate risk region are adaptively weighted and fused to obtain the final fused risk probability, which includes: ; in, To ultimately integrate risk probabilities, Let be the risk probability of candidate risk region u under text modal risk r. To reconstruct the risk matching probability of an image for text modality risk r in a semantic scene, Let u be the adaptive fusion weight corresponding to the candidate risk text region u, and 0 ≤ ≤1.
5. The semantic risk hierarchical identification method based on text-image multimodal collaboration according to claim 4, characterized in that, The DINO model drives the targeted detection of risk-related entities associated with risk categories in the semantic scene reconstruction image, including: Using the predicted risk category as a prior constraint, the DINO object detection model focuses its attention on the visual entity regions in the semantic scene reconstruction image that are associated with the current risk category, and outputs the category labels and detection box coordinates of the risk-related entities.
6. The semantic risk hierarchical identification method based on text-image multimodal collaboration according to claim 5, characterized in that, The cross-modal fuzzy matching network calculates the semantic similarity between the local image region corresponding to the detection box and the text entity input. When the similarity exceeds a preset matching threshold, it is determined to be a successful match.
7. The semantic risk hierarchical identification method based on text-image multimodal collaboration according to claim 6, characterized in that, The image modality risk matching probability is the global risk matching result of the semantic scene reconstructed image generated from the preprocessed text. All candidate risk regions under the same preprocessed text share the same image modality risk matching probability value.
8. The semantic risk hierarchical identification method based on text-image multimodal collaboration according to claim 7, characterized in that, The preset threshold range includes a first risk threshold T1, a second risk threshold T2, and a third risk threshold T3, and T1 < T2 < T3; The risk level determination based on the final fusion risk probability and the preset threshold range includes: a final fusion risk probability below T1 is Level 1 no risk, a probability between T1 and T2 is Level 2 mild risk, a probability between T2 and T3 is Level 3 moderate risk, and a probability above T3 is Level 4 severe risk.
9. An electronic device, characterized in that, include: One or more processors; A memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the semantic risk hierarchical identification method based on text-image multimodal collaboration as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, It stores executable instructions that, when executed by a processor, enable the processor to implement the semantic risk hierarchical identification method based on text-image multimodal collaboration as described in any one of claims 1-8.
