A method and system for detecting WeChat public account advertisements

By using multimodal feature fusion and lightweight processing, the problem of diverse and concealed advertising detection in WeChat official accounts is solved, achieving efficient and accurate advertising recognition and dynamic updates, and improving detection accuracy and robustness.

CN122335375APending Publication Date: 2026-07-03HEFEI DAZHIHUI CAIHUI DATA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HEFEI DAZHIHUI CAIHUI DATA TECH CO LTD
Filing Date
2026-05-13
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively identify the diverse explicit and implicit advertisements in WeChat official accounts, lack multimodal fusion and dynamic update mechanisms, and have insufficient processing speed, resulting in poor user experience and legal risks.

Method used

By employing a multimodal feature fusion method, textual, visual, and structural features are extracted, and a lightweight pre-trained model and dynamic update mechanism are combined to achieve efficient detection of WeChat official account advertisements.

Benefits of technology

It achieves efficient and accurate detection of both explicit and implicit advertisements, with fast processing speed, supports dynamic updates, and significantly improves detection accuracy and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122335375A_ABST
    Figure CN122335375A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for detecting advertisements on WeChat official accounts, relating to the fields of natural language processing, computer vision, and information retrieval. The method includes: acquiring articles from official accounts and extracting text feature vectors, visual content feature vectors, and structural feature vectors; wherein, text features are extracted using paragraph semantics and a dynamically weighted keyword mechanism; visual features are fused with OCR text and image semantics and spatial attention masks are introduced to enhance high-risk areas; structural features are calculated by parsing HTML to obtain multi-dimensional structured indicators such as induced enhancement indicators; adaptive weighted fusion of multimodal features is performed using learnable weights to obtain a unified advertisement representation vector; finally, the results are input into a lightweight advertisement detection model to obtain the detection results. This invention can efficiently and accurately detect explicit and implicit advertisements, and has the advantages of high recognition accuracy, fast processing speed, and support for dynamic updates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of natural language processing, computer vision, and information retrieval technology, and in particular to a method and system for detecting advertisements on WeChat official accounts. Background Technology

[0002] With the development of the internet, WeChat official accounts have become an important platform for information dissemination and commercial promotion. However, a large amount of explicit or implicit advertising content (such as advertorials and product recommendation articles) in official account articles is difficult to identify by traditional keyword filtering methods, affecting the user reading experience and even posing legal risks. For example, CN113971237B describes a method, device, and electronic device for generating advertising filtering rules, which automatically generates advertising filtering rules based on the frequency of ad occurrences and element node information; US9600570B2 describes a method and system for text filtering, which performs semantic matching on predefined keywords to perform text filtering; and CN117033626A describes a text review method, device, equipment, and storage medium, which performs semantic information analysis to extract classification features.

[0003] Most current methods are based on keyword matching and basic natural language processing (NLP) models for ad detection, but the following problems still exist: Advertising formats are becoming more diverse: from the explicit hard ads of the past to more covert forms such as advertorials, interactive ads, and video ads, which are difficult to identify and filter using fixed rules. Lack of multimodal fusion: Advertising content often combines multiple forms such as text, images and links. Existing methods mostly use single-modal detection methods, which cannot fully identify subtle advertisements.

[0004] Lack of dynamic update mechanism: There is no mechanism for dynamically updating the advertising feature word library and pattern library, and it relies on manual updates.

[0005] Insufficient processing speed: When dealing with a massive number of articles from WeChat official accounts, the throughput of large-scale deep learning models is insufficient. Summary of the Invention

[0006] To overcome the shortcomings of the prior art, this invention proposes a method and system for detecting WeChat public account advertisements.

[0007] To achieve the above objectives, the present invention adopts the following technical solution: a method for detecting WeChat public account advertisements, comprising: S1: Obtain WeChat official account articles, perform preprocessing and segmentation to obtain several paragraphs, extract semantic features from each paragraph and perform weighted aggregation to obtain the text feature vector of the entire article; S2: Extract and aggregate the semantic features of each image in the WeChat official account article to obtain the visual content feature vector of the entire article; S3: Extract structural features from WeChat official account articles to obtain structural feature vectors; S4: Perform multimodal feature fusion on the text feature vector, visual content feature vector, and structural feature vector to obtain a unified advertising representation vector; S5: Input the unified advertising representation vector into the advertising detection model to obtain the advertising detection results.

[0008] Preferably, step S1 includes: S11: Encode each paragraph using a lightweight pre-trained language model to generate paragraph semantic vectors; S12: Load the pre-built marketing inducement dictionary and calculate the keyword weighted score of the keywords that hit in each paragraph; S13: Using keyword weighted scores, generate soft weights through a sigmoid function with a scaling factor, and use the soft weights to adjust the paragraph semantic vector to obtain the paragraph representation; S14: Perform average pooling on all paragraph representations and aggregate them to obtain the text feature vector of the entire article.

[0009] Preferably, step S2 includes: S21: Use an OCR tool to recognize the text in each image and obtain auxiliary text feature vectors; S22: Use a lightweight visual model to extract the image semantic feature vector for each image; S23: Concatenate the auxiliary text feature vector with the image semantic feature vector to obtain the visual content feature vector.

[0010] Preferably, step S22 further includes enhancement and optimization of the advertising sensitive area: The intermediate layer of the lightweight visual model outputs a feature map; High-risk regions in images are detected using a pre-trained segmentation model, and spatial attention masks are generated. The feature map is spatially weighted using the spatial attention mask so that the lightweight visual model focuses on the high-risk region.

[0011] Preferably, step S3 includes: The HTML source code of the WeChat official account article is parsed to extract multi-dimensional structured indicators, including continuous features, binary label features, and discrete category embedding features. The multi-dimensional structured indicators are concatenated to obtain a structural feature vector.

[0012] Preferably, the continuity features include external link density, image-to-text ratio, ad placement density, and incentive-enhancement index, wherein the incentive-enhancement index is calculated as follows: The WeChat public account article is subjected to regular expression matching of inducement phrases to obtain several inducement text fragments; The basic weight is assigned according to the template category to which the induced text fragment belongs, and an enhancement factor is applied according to whether it contains a preset strong stimulus element to obtain the original induced score; The original induced fraction is mapped to the [0,1] interval using the Sigmoid function to obtain the induced enhancement index. :

[0013] Where k is the number of the inducing text fragment; K is the total number of inducing text fragments; For the Sigmoid function; To control sensitivity parameters; As an enhancing factor; A binary function to determine whether a number or sign is contained; This is the k-th induced text fragment; Let k be the matching template category for the k-th induced text fragment. The base weights for matching the template category of the k-th induced text fragment; To control the trigger threshold parameter.

[0014] Preferably, step S4 specifically comprises: The text feature vector, visual content feature vector, and structural feature vector are projected to the same dimension using the first projection matrix, the second projection matrix, and the third projection matrix, respectively. Learnable first, second, and third weights are introduced to weight the three projected feature vectors. The three weighted feature vectors are concatenated and compressed using a multilayer perceptron to generate a unified advertising representation vector.

[0015] Preferably, the advertisement detection model is a binary classification neural network model based on a lightweight attention mechanism, and the model includes: A linear projection layer is used to map the uniform advertising representation vector to a preset feature dimension; A lightweight self-attention module, connected to a linear projection layer, is used to extract global dependencies and output a global feature vector. The feedforward network, connected to a lightweight self-attention module, is used to perform nonlinear transformation and feature enhancement on the global feature vector to obtain the enhanced global feature vector. The classification head, connected to the feedforward network, is used to perform binary classification based on the enhanced global feature vector, outputting the probability of advertising and the probability of non-advertising.

[0016] Preferably, it also includes a post-processing mechanism, the post-processing mechanism including: The risk control module is used to determine whether to trigger automatic blocking or manual review based on the ad detection results and the preset dynamic risk level threshold; and the dynamic update mechanism is used to update the ad detection model in an asynchronous incremental training manner when the cumulative number of manual annotation feedbacks reaches the preset threshold or a new ad pattern is detected. It also includes at least one of the following enhancement modules: The consistency module is used to calculate the semantic similarity between local segments and the whole text, and to generate semantic break features; The intent feature module is used to construct a promotion intent discrimination sub-model and output a promotion intent score; The static semantic prompt embedding module is used to generate prompt word vectors based on a pre-built prompt word library and fuse them with the unified advertising representation vector.

[0017] A WeChat Official Account Ad Detection System, used to implement the aforementioned WeChat Official Account Ad Detection Method, includes: The text feature extraction module is used to acquire WeChat official account articles, perform preprocessing and segmentation to obtain several paragraphs, extract semantic features from each paragraph and perform weighted aggregation to obtain the text feature vector of the entire article; The visual feature extraction module is used to acquire images from WeChat official account articles, extract semantic features from each image and aggregate them to obtain the visual content feature vector of the entire article. The structural feature extraction module is used to extract structural features from WeChat official account articles and obtain structural feature vectors. The multimodal fusion module is used to perform multimodal feature fusion on the text feature vector, the visual content feature vector, and the structural feature vector to obtain a unified advertising representation vector; The ad detection module is used to input the unified ad representation vector into the ad detection model to obtain ad detection results.

[0018] The advantages of this invention are: (1) This invention first obtains articles from public accounts and extracts text feature vectors, visual content feature vectors, and structural feature vectors respectively. Among them, text features are extracted using paragraph semantics and dynamic weighted keyword mechanisms; visual features are fused with OCR text and image semantics and spatial attention masks are introduced to enhance high-risk areas; structural features are calculated by parsing HTML to obtain multi-dimensional structured indicators such as induced enhancement indicators; and multi-modal features are adaptively weighted and fused using learnable weights to obtain a unified advertising representation vector; finally, the results are obtained by inputting the data into a lightweight advertising detection model. This invention can efficiently and accurately detect explicit and implicit advertisements, and has the advantages of high recognition accuracy, fast processing speed, and support for dynamic updates.

[0019] (2) This invention proposes a learnable weighted fusion architecture for multimodal features. Text, graphic, and structural features are linearly projected to a unified latent space, and three learnable weight parameters are introduced to achieve adaptive adjustment of importance between modalities. After fusion, a unified advertising representation vector is generated through MLP compression. Without increasing complexity, collaborative decision-making based on multi-source information is achieved, avoiding overall misjudgment caused by the failure of a single modality, and significantly improving detection accuracy and robustness in complex scenarios.

[0020] (3) The image advertising perception mechanism of the present invention integrates spatial attention mask: the model is introduced to locate high-risk areas in the image (such as areas containing QR codes and inducement text), generate spatial mask, weight the features, force the model to focus on high-risk local areas, and significantly improve the detection rate of hidden image advertisements such as "hidden advertisements in pictures" and "QR code traffic".

[0021] (4) This invention transforms unstructured HTML source code into computable structured indicators. By calculating multi-dimensional features such as external link density, image-to-text ratio, ad density, and incentive enhancement indicators, and introducing discrete category embedding and missing feature filling strategies, it can effectively capture typical advertising behavior patterns such as "button inducement", "link disguise", and "hidden elements", thereby improving the ability to distinguish at the structural level.

[0022] (5) This invention proposes a closed-loop driven dynamic incremental update mechanism: when the cumulative manual annotation feedback reaches a threshold (e.g., 100) or a new pattern is detected, the incremental training process is automatically triggered, and online optimization with a small learning rate is adopted to realize the continuous evolution of the model without stopping the system for retraining, thus ensuring the long-term effectiveness of the system and business continuity.

[0023] (6) This invention proposes a text semantic enhancement method based on dynamic weighting mechanism, constructs a marketing inducement dictionary with dynamically adjustable weights, generates soft weights by combining paragraph-level keyword hits, adaptively enhances paragraph vectors, significantly strengthens high-risk advertising segments, and smoothly suppresses ordinary operation guidance (such as “click to read the original text”), greatly improving the discrimination accuracy and robustness at the text level.

[0024] (7) This invention proposes three enhancement strategies for implicit soft advertising. To address challenging scenarios such as "first half popular science, second half advertising" and "no keywords but strong promotional intent," the following low-cost enhancement mechanisms are designed: semantic consistency detection, promotional intent feature module, and static semantic prompt embedding. All of the above enhancement modules do not rely on large model inference, have controllable computational overhead, and improve the coverage of advanced soft advertising. Attached Figure Description

[0025] Figure 1 This is a flowchart of the method steps of the present invention; Figure 2 This is a schematic diagram of the method structure of the present invention; Figure 3 This is a schematic diagram of the advertising detection model structure. Detailed Implementation

[0026] 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.

[0027] Example 1

[0028] like Figures 1-3 As shown, this invention proposes a method for detecting WeChat official account advertisements, including: S1: Obtain the WeChat Official Account article, preprocess and segment it to obtain several paragraphs, extract the semantic features from each paragraph and perform weighted aggregation to obtain the text feature vector of the entire article; including: The WeChat official account article you receive will be in HTML source code format or plain text format, for example: "[Limited-time offer] Click to claim your iPhone 15! Simply follow this account and share this article to your Moments to participate in the lucky draw!" Preprocessing includes removing HTML tags, emojis, and special characters.

[0029] S11: Paragraph Semantic Encoding

[0030] For each paragraph j (where j = 1, 2, ..., J, and J represents the total number of paragraphs in the article), a lightweight pre-trained language model (such as TinyBERT, DistilBERT, or ALBERT) is used for encoding to generate a paragraph semantic vector. ,in, The hidden dimension corresponds to the pre-trained language model (e.g., TinyBERT corresponds to 312).

[0031] S12: Keyword Weighted Score Calculation

[0032] Load a pre-built marketing inducement dictionary (hereinafter referred to as the dictionary), which contains various marketing inducement keywords, i=1,2,...,I, where I represents the number of keywords, including words such as "limited time", "lottery", and "scan code". Assign keyword weights to each word. Initially, all values ​​are 1, and keyword weights are dynamically adjusted based on historical false positive rates.

[0033] For each paragraph j, check which keywords in the dictionary the text content in the paragraph matches.

[0034] Calculate the keyword weighted score s in the paragraph, which represents the sum of the weights of all the keywords that appear in the paragraph.

[0035]

[0036] in, Weight the score for the keywords in the j-th paragraph; Let k be the set of keywords from the dictionary that match the j-th paragraph; k is the keyword number in the paragraph. This represents the dictionary weight corresponding to the k-th keyword.

[0037] S13: Generate paragraph representation

[0038] Using keyword weighted scoring A soft weight is generated using a sigmoid function with a scaling factor. This soft weight is used to adjust the paragraph semantic vector. To obtain paragraph representation :

[0039] in, This is the scaling factor (example value: 1.5).

[0040] If a paragraph contains many high-weight keywords (i.e.) If the value is relatively large, the soft weight will approach 1; therefore, the paragraph representation... Almost equal to The semantic information of the paragraph is fully preserved (high risk). If a paragraph does not hit any keywords (i.e., If the value is 0, and the soft weight is 0.5, then the paragraph risk is low.

[0041] S14: Aggregated into the text feature vector of the entire article

[0042] Show all paragraphs The aggregation is performed using average pooling, ultimately yielding the text feature vector for the entire article. :

[0043] Where j is the paragraph number, j=1,2,...,J, and J represents the total number of paragraphs in the article.

[0044] S2: Obtain images from WeChat official account articles, extract semantic features from each image, and aggregate them to obtain the visual content feature vector of the entire article; including: The images here were obtained by parsing HTML source code. The image URL corresponding to the tag must be the actual image displayed in the article, not a decorative element on the page. Images embedded in WeChat official account articles are in JPG / PNG format, such as a promotional image containing a QR code and the text "Scan to receive a red envelope".

[0045] S21: OCR Text Extraction

[0046] Use an OCR tool (PaddleOCR or EasyOCR) to recognize the text in each image and obtain a text sequence. Then the text sequence Input text feature extraction subunit, and generate auxiliary text feature vectors in a similar manner. .

[0047] S22: Image Semantic Coding

[0048] Lightweight vision models (such as Vision Transformer or MobileNetV3-small) are used to generate image semantic feature vectors.

[0049] Each image is resized, with the input image size uniformly set to 224×224. Simultaneously, pixel values ​​are standardized. Original image pixels are integers in the range [0, 255]. These are converted to floating-point numbers [0, 1.0] by dividing by 255. Then, the mean and standard deviation from ImageNet are used for standardization. Specifically, each pixel value x undergoes the following transformation to obtain the standard pixel value. :

[0050] mean is the average value; std is the standard deviation.

[0051] The processed image is input into a lightweight vision model, and the image semantic feature vector is output from the lightweight vision model. .

[0052] Furthermore, step S22 involves enhancing and optimizing the advertising-sensitive areas.

[0053] The images used for advertising on WeChat official accounts may not be entirely advertisements (for example, a small QR code embedded in the corner of a landscape picture), so a mechanism is needed to locate and reinforce the characteristics of these high-risk areas.

[0054] During the lightweight visual model processing in step S22, a feature map will be output in the intermediate layer. Where C is the number of channels, and H' and W' are the spatial resolutions (which may differ from H and W and need to be aligned). The following enhancement method enhances the feature map F.

[0055] A small U-Net segmentation model is pre-trained to detect high-risk regions (such as QR codes, logos, promotional badges, etc.) in an image, and spatial attention masks are applied to these high-risk regions. H and W represent the height and width of the image. For any input image, the U-Net segmentation model outputs a mask M with the same spatial dimensions as the original image, where pixels with a value of 1 correspond to QR codes, promotional logos, or persuasive text regions, and pixels with a value of 0 correspond to the plain background. The mask M is used to spatially weight the feature map F output from the intermediate output of the lightweight vision model, and the corresponding mask is then applied to the feature map F. The position is set to zero, and then flows to the downstream processing layer of the lightweight visual model, thereby forcing the lightweight visual model to focus on high-risk local areas, significantly improving the ability to identify hidden image advertisements.

[0056] S23: Based on auxiliary text feature vectors and image semantic feature vector Obtain visual content feature vectors :

[0057] in, The final output dimension is 384; MLP refers to the fully connected / linear layer of the multilayer perceptron, which is used for vector dimensionality reduction / upgrading projection. The MLP transforms a 312-dimensional vector into a 192-dimensional vector, and then the two 192-dimensional vectors are combined to form a 384-dimensional vector.

[0058] S3: Extract structural features from WeChat official account articles to obtain structural feature vectors. ;include: In actual processing, the system extracts local structural nodes related to advertising behavior from the HTML source code for feature calculation, for example: Claim Now S31: DOM Parsing and Element Markup Parse HTML source code (using tools such as BeautifulSoup or lxml) to find high-risk nodes (including backlinks). The function `display:none` is used to obtain a binary flag indicating whether a high-risk node (external link, form submission button, or hidden element) is present.

[0059] S32: Calculation of Continuous Characteristics

[0060] Continuous characteristics include external link density, image-to-text ratio, ad placement density, and incentive reinforcement metrics; Ad placement density (including the percentage of elements with class / id such as "button", "banner", and "ad").

[0061] Behavioral induction signals were extracted to obtain induction reinforcement indicators.

[0062] The process involves using regular expressions to match patterns of inducing verb phrases in WeChat public account articles, such as "Click...to enter a lottery" or "Receive...discounts," to obtain several inducing text fragments. Next, basic weights are assigned based on the template category to which these fragments belong, and enhancement factors are applied based on whether they contain strong stimulating elements such as numbers, currency symbols, or percentages (e.g., "100% chance of winning"), resulting in the original inducing score for each fragment. Finally, the Sigmoid function is used to map the original inducing scores of all fragments to the [0,1] interval to obtain the inducing enhancement index. :

[0063] Where k is the number of the inducing text fragment; K is the total number of inducing text fragments; For the Sigmoid function; To control sensitivity parameters; The basic weights for matching template categories (can be set manually or learned iteratively, initially set to (0,1)); Enhancement factor (can be set to 0.2); A binary function {0,1} to determine whether a number / symbol is contained; This is the k-th induced text fragment; The matching template category for the k-th inducement text fragment includes pre-defined words, phrases, or sentences, such as: "Click...to enter the lottery", "Receive...discount", etc. To control the trigger threshold parameter.

[0064] γ is used to amplify or reduce the discriminative power of the original value. It matches the template category in the text fragment. If there are numbers, it adds extra weight, and then the value is scaled up and down. After subtracting the threshold, it is mapped to [0,1] by the sigmoid function.

[0065] S33: Discrete Category Embedding

[0066] External links, such as government domains and shopping domains, contain different information. Therefore, an embedding matrix is ​​used to map the domain names of external links into discrete category embedding vectors. ], where n is the dimension of the embedding vector.

[0067] S34: Concatenate the various structured indicators to obtain the structural feature vector.

[0068] Multi-dimensional structured indicators are extracted from structural features, including continuous features (12-dimensional), binary marker features (8-dimensional), and discrete category embeddings (44-dimensional). Continuous features include the link density, image-to-text ratio, ad density, and inducement intensity indicators mentioned above, and are normalized. Binary marker features, such as whether or not a "Read the original text" backlink is included, are represented by {0,1}. Discrete category embeddings are calculated using the embedding vectors mentioned above. Finally, all features are concatenated to form a 64-dimensional structured feature vector. .

[0069] Each dimension corresponds to a predefined structured metric. For metric items that logically do not exist, their values ​​are set to zero. For metric items missing due to parsing anomalies, a learnable missing label vector is used to fill in the missing items, with an existence indicator bit appended to avoid false features caused by directly padding with zeros. Here, the multi-dimensional structured metrics can be expanded with different features based on the advertising type, increasing the dimensionality to adapt to the required level of granularity.

[0070] S4: Text feature vector of the entire article Visual content feature vector and structural feature vectors Multimodal feature fusion is performed to obtain a unified advertising representation vector; specifically: Linear projection is performed on the text feature vector, visual content feature vector, and structural feature vector respectively. These are then weighted using learnable weights and concatenated before being passed through a fully connected layer to generate a unified advertising representation vector. .

[0071] That is, projecting the features of each modality onto the same dimension. :

[0072] in, , and These are the first, second, and third projection matrices (projection matrices for each modality).

[0073] Three weights are introduced, concatenated, and compressed into a unified advertising representation vector using an MLP. .

[0074] , , They are designated as first, second, and third weights, respectively.

[0075] S5: Unify the advertising representation vector Input the ad detection model and obtain the ad detection results.

[0076] Input compatibility: Uniform advertising representation vector It can accept vectors of 512 dimensions (or expanded to 513 dimensions); Lightweight requirements: Parameter size ≤ 1M, inference latency ≤ 200ms (on a regular server CPU). Output format: Binary classification probability output, including advertisement probability. Non-advertising probability ,at the same time + =1.

[0077] The ad detection model is a binary classification neural network model based on a lightweight attention mechanism. The model includes a linear projection layer with one connection, used to receive input data and map it to a preset feature dimension to project features; a lightweight self-attention module, connected to the linear projection layer, used to extract the global dependencies of the input features while reducing computational complexity, and output a global feature vector; a feedforward network, connected to the lightweight self-attention module, used to perform nonlinear transformation and feature enhancement on the global feature vector to obtain an enhanced global feature vector; and a classification head, connected to the feedforward network, configured to perform a binary classification task based on the enhanced global feature vector.

[0078] The advertising detection model includes a linear projection layer, a lightweight self-attention module, a feedforward network, and a classification head, and is suitable for binary classification tasks based on global feature vectors.

[0079] Explanation: Input uniform advertising representation vector The linear projection layer compresses the vector dimension, reducing subsequent computational complexity while retaining key discriminative information. Then, a single-layer lightweight Transformer encoder module is input, and LayerNorm normalizes the input, improving training stability. The lightweight self-attention mechanism uses two attention heads and merges the projected features of the query (Q), key (K), and value (V) into a single fully connected layer, significantly reducing the number of parameters. Since the attention network input is a single token (representing the full text), the attention weights degenerate into an identity mapping, but this structure is retained to support future expansion (such as multi-segment input). Residual connections add the attention output to the input, alleviating gradient vanishing and enhancing feature reuse. The feedforward neural network introduces non-linear expressive power. Global feature extraction directly removes the sequence dimension without pooling, resulting in a 128-dimensional fixed-length vector. The classification head (MLP) consists of two fully connected layers (128→64→2), using the GELU activation function and Dropout (0.2) in between to prevent overfitting, ultimately outputting the logits of the two classes. The logits are converted into a probability distribution to provide confidence scores. The flowchart is as follows. Figure 2 As shown.

[0080] Post-processing mechanism: 1. Risk Control Module This module receives output from the backbone network, including the probability distribution of each sample belonging to different categories (confidence scores for advertisements and non-advertisements). Based on this, business rules and security thresholds are introduced to perform a final risk assessment on each sample, preventing high-risk content from being missed.

[0081] The implementation method is as follows: Set dynamic risk level thresholds (Initial value is 0.7), if If the content contains blacklisted keywords (such as "scan to join a group") or QR code images, it will be directly identified as a "high-risk advertisement," triggering automatic blocking or manual review; even if the content contains blacklisted keywords (such as "scan to join a group") or QR code images, it will still be blocked. It also needs to be marked as suspicious.

[0082] 2. Dynamic update mechanism

[0083] If more than N (e.g., 100) manually annotated feedback results are received, or a new advertising pattern is discovered, an update strategy is implemented: fine-tuning the parameters of the last two fully connected layers, freezing the previous layers, and using a small learning rate (e.g., ...). Incremental training is performed; the update process is executed asynchronously in the background, and the new model is hot-swapped and launched after verification, avoiding full retraining.

[0084] 3 optional enhancement modules, including: (1) Consistency Module This approach primarily targets advertorials that begin with scientific information and then abruptly transition to advertisements in the latter half, aiming to improve the ability to identify these hidden forms of content. The input is the original main text (the same as the input for text feature extraction). Semantic vectors for local segments (such as each paragraph) are calculated, and then the cosine similarity between each segment and the semantic vector of the entire text is calculated. If significantly low-consistency segments exist, they are marked as semantic breakpoint features (with values ​​{0,1}), which can directly improve the risk score.

[0085] (2) Intent Feature Module

[0086] Primarily targeting advertorials without explicit advertising copy, a promotional intent discrimination sub-model (e.g., a small TextCNN) is constructed. The input is the original main text (the same as the input for text feature extraction). Judgment criteria are set, including whether it contains brand-beautifying words (e.g., "celebrity endorsement"), whether it contains conversion verbs (e.g., "claim now," "limited time offer"), and whether it creates a sense of urgency (e.g., "only XX left," "deadline tonight"). The output is a promotional intent score. This can directly improve the risk score.

[0087] (3) Static semantic prompt embedding

[0088] By leveraging a pre-built lexicon of commercial promotional intent prompts, high-frequency promotional expressions are extracted from historical data. Customized persuasive phrases are then compiled using industry knowledge (e.g., e-commerce, education), and after review, a structured prompt lexicon is formed (e.g., brand enhancement - "industry leader," scarcity creation - "deadline tonight," social proof - "personally tested and effective"). A lightweight text model (e.g., Sentence-BERT) is used to generate semantic vectors for these prompts. The similarity between the original features and each prompt vector is calculated to obtain attention weights. These weighted aggregates are then concatenated into the output vector of the feature extraction module, enhancing the advertising representation vector. This mechanism explicitly injects domain prior knowledge without calling external large models or significantly increasing computational overhead, effectively improving the model's ability to discern implicit commercial intent.

[0089] This invention constructs a high-precision, high-efficiency, and iterative WeChat public account advertising detection method and system through multimodal deep collaboration, dynamic knowledge injection, and structured behavior modeling. It has significant advantages in identifying hidden forms such as advertorials, image-hidden ads, and induced external links, and solves the core pain point of existing technologies that "can see hard ads but cannot see soft ads".

[0090] This patent achieves high-accuracy identification of various advertising formats in WeChat official accounts through multimodal feature fusion and a lightweight processing architecture, particularly for soft advertising formats such as "Recommended Reading" and "You May Like," achieving an accuracy rate of 96.7%. The system processes each article in 0.5 seconds, meeting the requirements for second-level processing. Through a dynamic update mechanism, the system maintains the timeliness of its detection capabilities. The false positive rate is controlled below 3.2%, significantly better than existing technologies. This patent has the following advantages over existing technologies: High accuracy recognition: Through multimodal feature fusion, it can identify subtle advertisements that are difficult to detect by traditional methods, with an accuracy rate of 96.7%.

[0091] Processing speed in seconds: Using a lightweight model, a single text can be processed in 0.5 seconds.

[0092] Dynamic adaptability: Design a dynamic update mechanism for the advertising feature word library and model to maintain the timeliness of the detection system.

[0093] Domain knowledge injection: By integrating prior knowledge of inducement techniques from industries such as e-commerce and education into the model through prompt vocabulary and intent module, the ability to discern business intent is improved.

[0094] Example 2

[0095] This invention proposes a WeChat official account advertising detection system to implement the aforementioned WeChat official account advertising detection method, comprising: The text feature extraction module is used to acquire WeChat official account articles, perform preprocessing and segmentation to obtain several paragraphs, extract semantic features from each paragraph and perform weighted aggregation to obtain the text feature vector of the entire article; The visual feature extraction module is used to acquire images from WeChat official account articles, extract semantic features from each image and aggregate them to obtain the visual content feature vector of the entire article. The structural feature extraction module is used to extract structural features from WeChat official account articles and obtain structural feature vectors. The multimodal fusion module is used to perform multimodal feature fusion on the text feature vector, the visual content feature vector, and the structural feature vector to obtain a unified advertising representation vector; The ad detection module is used to input the unified ad representation vector into the ad detection model to obtain ad detection results.

[0096] Of course, those skilled in the art will recognize that the present invention is not limited to the details of the exemplary embodiments described above, but also includes the same or similar structures that can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

[0097] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

[0098] The technologies, shapes, and structures not described in detail in this invention are all known technologies.

Claims

1. A method for detecting advertisements on WeChat official accounts, characterized in that, include: S1: Obtain WeChat official account articles, perform preprocessing and segmentation to obtain several paragraphs, extract semantic features from each paragraph and perform weighted aggregation to obtain the text feature vector of the entire article; S2: Extract and aggregate the semantic features of each image in the WeChat official account article to obtain the visual content feature vector of the entire article; S3: Extract structural features from WeChat official account articles to obtain structural feature vectors; S4: Perform multimodal feature fusion on the text feature vector, visual content feature vector, and structural feature vector to obtain a unified advertising representation vector; S5: Input the unified advertising representation vector into the advertising detection model to obtain the advertising detection results.

2. The WeChat Official Account Ad Detection Method as described in claim 1, characterized in that, Step S1 includes: S11: Encode each paragraph using a lightweight pre-trained language model to generate paragraph semantic vectors; S12: Load the pre-built marketing inducement dictionary and calculate the keyword weighted score of the keywords that hit in each paragraph; S13: Using keyword weighted scores, generate soft weights through a sigmoid function with a scaling factor, and use the soft weights to adjust the paragraph semantic vector to obtain the paragraph representation; S14: Perform average pooling on all paragraph representations and aggregate them to obtain the text feature vector of the entire article.

3. The WeChat Official Account Ad Detection Method as described in claim 1, characterized in that, Step S2 includes: S21: Use an OCR tool to recognize the text in each image and obtain auxiliary text feature vectors; S22: Use a lightweight visual model to extract the image semantic feature vector for each image; S23: Concatenate the auxiliary text feature vector with the image semantic feature vector to obtain the visual content feature vector.

4. The WeChat Official Account Ad Detection Method as described in claim 3, characterized in that, Step S22 also includes enhancement and optimization of advertising sensitive areas: The intermediate layer of the lightweight visual model outputs a feature map; High-risk regions in images are detected using a pre-trained segmentation model, and spatial attention masks are generated. The feature map is spatially weighted using the spatial attention mask so that the lightweight visual model focuses on the high-risk region.

5. The method for detecting WeChat official account advertisements as described in claim 1, characterized in that, Step S3 includes: The HTML source code of the WeChat official account article is parsed to extract multi-dimensional structured indicators, including continuous features, binary label features, and discrete category embedding features. The multi-dimensional structured indicators are concatenated to obtain a structural feature vector.

6. The WeChat Official Account Ad Detection Method as described in claim 5, characterized in that, The continuity features include external link density, image-to-text ratio, ad placement density, and incentive-enhancement index, which is calculated as follows: The WeChat public account article is subjected to regular expression matching of inducement phrases to obtain several inducement text fragments; The basic weight is assigned according to the template category to which the induced text fragment belongs, and an enhancement factor is applied according to whether it contains a preset strong stimulus element to obtain the original induced score; The original induced fraction is mapped to the [0,1] interval using the Sigmoid function to obtain the induced enhancement index. : Where k is the number of the inducing text fragment; K is the total number of inducing text fragments; For the Sigmoid function; To control sensitivity parameters; As an enhancing factor; A binary function to determine whether a number or sign is contained; This is the k-th induced text fragment; Let k be the matching template category for the k-th induced text fragment. The base weights for matching the template category of the k-th induced text fragment; To control the trigger threshold parameter.

7. The WeChat Official Account Ad Detection Method as described in claim 1, characterized in that, Step S4 specifically involves: The text feature vector, visual content feature vector, and structural feature vector are projected to the same dimension using the first projection matrix, the second projection matrix, and the third projection matrix, respectively. Learnable first, second, and third weights are introduced to weight the three projected feature vectors. The three weighted feature vectors are concatenated and compressed using a multilayer perceptron to generate a unified advertising representation vector.

8. The method for detecting WeChat official account advertisements as described in claim 1, characterized in that, The advertisement detection model is a binary classification neural network model based on a lightweight attention mechanism, and the model includes: A linear projection layer is used to map the uniform advertising representation vector to a preset feature dimension; A lightweight self-attention module, connected to a linear projection layer, is used to extract global dependencies and output a global feature vector. The feedforward network, connected to a lightweight self-attention module, is used to perform nonlinear transformation and feature enhancement on the global feature vector to obtain the enhanced global feature vector. The classification head, connected to the feedforward network, is used to perform binary classification based on the enhanced global feature vector, outputting the probability of advertising and the probability of non-advertising.

9. The method for detecting WeChat official account advertisements as described in claim 1, characterized in that, It also includes a post-processing mechanism, which includes: The risk control module is used to determine whether to trigger automatic blocking or manual review based on the ad detection results and the preset dynamic risk level threshold; and the dynamic update mechanism is used to update the ad detection model in an asynchronous incremental training manner when the cumulative number of manual annotation feedbacks reaches the preset threshold or a new ad pattern is detected. It also includes at least one of the following enhancement modules: The consistency module is used to calculate the semantic similarity between local segments and the whole text, and to generate semantic break features; The intent feature module is used to construct a promotion intent discrimination sub-model and output a promotion intent score; The static semantic prompt embedding module is used to generate prompt word vectors based on a pre-built prompt word library and fuse them with the unified advertising representation vector.

10. A WeChat Official Account Ad Detection System, characterized in that, A method for detecting WeChat public account advertisements as described in any one of claims 1-9, comprising: The text feature extraction module is used to acquire WeChat official account articles, perform preprocessing and segmentation to obtain several paragraphs, extract semantic features from each paragraph and perform weighted aggregation to obtain the text feature vector of the entire article; The visual feature extraction module is used to acquire images from WeChat official account articles, extract semantic features from each image and aggregate them to obtain the visual content feature vector of the entire article. The structural feature extraction module is used to extract structural features from WeChat official account articles and obtain structural feature vectors. The multimodal fusion module is used to perform multimodal feature fusion on the text feature vector, the visual content feature vector, and the structural feature vector to obtain a unified advertising representation vector; The ad detection module is used to input the unified ad representation vector into the ad detection model to obtain ad detection results.

Citation Information

Patent Citations

  • Method, device and electronic device for generating advertisement filtering rules

    CN113971237B

  • Text auditing method, device and equipment and storage medium

    CN117033626A

  • Method and system for text filtering

    US9600570B2