Content body discovery method based on multimodal abnormal content understanding
Through multi-modal abnormal content understanding methods, image, video and text features are extracted and fused, and large language models are used for LoRA fine-tuning, which solves the problem of low efficiency of single-modal analysis and improves the accuracy of abnormal content identification and content subject discovery. sex and efficiency.
Patent Information
- Application Number
- CN202411002747.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-25
AI Technical Summary
Existing content understanding methods usually rely only on single modal analysis and cannot fully utilize the complementary information between multi-modal data, resulting in low accuracy and efficiency in abnormal content identification and content subject discovery in complex scenarios.
A multi-modal abnormal content understanding method is adopted to extract image, video and text features from multi-modal data, perform feature fusion, and use a large language model to perform LoRA fine-tuning to generate a multi-modal fusion abnormal content report.
It improves the accuracy of abnormal content identification and the efficiency of content subject discovery, realizes comprehensive analysis of multi-modal data, and enhances the understanding of abnormal content and the effective discovery of content subjects.
Smart Images

Figure CN118536049B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision and natural language processing, and in particular to a content subject discovery method based on multimodal abnormal content understanding. Background Art
[0002] In the era of information explosion, various media platforms are flooded with a large amount of multimodal data, including pictures, videos and texts. These data often contain some abnormal content (such as abnormal objects in images, abnormal behaviors in videos, abnormal events in texts, etc.), and the identification of these abnormal contents and the discovery of content subjects are of great significance for applications such as content filtering, security monitoring, and automated review.
[0003] Existing content understanding methods usually rely on a single modality (such as image-based or text-based) for analysis, and fail to fully utilize the complementary information between different modalities. This results in low accuracy and efficiency in abnormal content identification and content subject discovery in complex scenarios. Therefore, a content subject discovery method based on comprehensive analysis of multimodal data is urgently needed. Summary of the invention
[0004] In view of this, the present invention provides a content body discovery method based on multimodal abnormal content understanding to improve the accuracy of abnormal content identification and the efficiency of content body discovery.
[0005] The present invention discloses a content subject discovery method based on multimodal abnormal content understanding, which comprises:
[0006] Step 1: Extract OCR text from images and videos in the multimodal data, and extract multiple audio segment data from the audio in the multimodal data;
[0007] Step 2: Perform feature extraction on the images and videos in the multimodal data, the multiple audio clips extracted in step 1, and the text and OCR text in the multimodal data to obtain an image feature matrix, a video feature matrix, an audio feature matrix, and a text feature matrix, respectively;
[0008] Step 3: Project the image feature matrix, video feature matrix, and audio feature matrix into the text space to fuse them with the text feature matrix to obtain a feature matrix for anomaly detection and subject discovery;
[0009] Step 4: Perform LoRA (low rank adaptation) instruction supervised fine-tuning on the feature matrix on the large language model, add a projection layer to the output of the large language model, and extract the feature vectors of the abnormal content and the abnormal content body from the output of the large language model;
[0010] Step 5: Use the vector database to store the feature vector, perform clustering and distance calculation on the feature vector, and determine whether it belongs to the same content body based on the threshold, and generate a multimodal fusion abnormal content report; the abnormal content report contains the abnormal content description and content body identification of the image, video and text.
[0011] Furthermore, the step 2 comprises:
[0012] Image feature extraction: Use contrastive learning and coarse-grained fusion of Transformer architecture image encoder to convert images in multimodal data into image feature matrices;
[0013] Video feature extraction: Use contrastive learning and coarse-grained fusion of Transformer architecture image encoder to encode each frame of the video in the multimodal data, and then cluster to form a video feature matrix of the key frames;
[0014] Audio feature extraction: Use feature extractors to extract audio data of different durations. Perform feature extraction to obtain an audio feature matrix;
[0015] Text feature extraction: Perform lexical analysis on the input text data, split it into words or subword units, use the BPE algorithm to segment the sentences, use the pre-trained Embedding model to map the segmented text data, and map the tokens obtained from the segmentation into vectors of fixed size;
[0016] Perform word segmentation, vectorization, and feature extraction on the text data and OCR text in the multimodal data to obtain the text feature matrix .
[0017] Furthermore, the image feature extraction includes:
[0018] Step 21: Use a coarse-grained and fine-grained fusion module to improve the representation capability of the Transformer architecture image encoder with contrastive learning and coarse-grained and fine-grained fusion;
[0019] Step 22: Use contrastive learning to align the image features and text features extracted by the coarse-grained fusion module to form an image encoder image_encoder;
[0020] Step 23: After the image is input into the image encoder image_encoder for encoding, an image feature matrix is obtained.
[0021] Furthermore, the step 21 comprises:
[0022] Global feature extraction:
[0023]
[0024] in, is a pre-trained global feature extractor, where It is the input picture when training the coarse-grained and fine-grained fusion module. The image features extracted by the global feature extractor, is the input image, is the characteristic length, is the global feature dimension, is the real number space;
[0025] Local feature extraction:
[0026]
[0027] in, is a pre-trained local feature extractor, The image features extracted by the local feature extractor, is the characteristic length, is the local feature dimension;
[0028]
[0029] in, To adjust the local features of the shape, is a learnable parameter used to map local features to , The feature dimension after adjusting the shape;
[0030] Linear Projection:
[0031]
[0032] in, To adjust the global features of the shape, is a learnable parameter used to map global features to dimensional space;
[0033] Calculate the attention weights:
[0034]
[0035] in, is the attention score matrix, for The transpose of
[0036]
[0037] in, is the attention weight, is the softmax function;
[0038] Weighted local features:
[0039]
[0040] in, is the weighted local feature, Represents matrix multiplication;
[0041] Fusion of global and local features:
[0042]
[0043] in, The fused features.
[0044] Further, the step 22 comprises:
[0045] Input definition: Represents the image feature Batch that needs to be aligned, Represents the text batch that needs to be aligned, where B represents the batch size and n represents the text length. Represents the feature dimension of the text, is the real number space;
[0046] Feature extraction required for contrastive learning:
[0047]
[0048]
[0049] in, represents the features obtained by the coarse-grained and fine-grained fusion module, represents the coarse-grained and fine-grained fusion module of the previous step, represents a text encoder, is the text feature extracted by the text encoder, B represents the batch size, n is the feature length of the text, is the text feature dimension;
[0050] Feature projection and normalization:
[0051]
[0052]
[0053] in, is the normalized image feature, is the projected and normalized text feature, is a learnable parameter used to map text features to dimensional space, Express Find the second norm of Express The matrix product of finds the binorm;
[0054] Compute the scaled cosine similarity:
[0055]
[0056] in, To calculate the scaled cosine similarity between image features and text features, is a parameter used to control the scaling degree of similarity. express The transpose of
[0057] Contrastive learning loss calculation:
[0058]
[0059]
[0060]
[0061] in, express The value of the ith row and ith column of express The value of the i-th row and j-th column of express The value of the jth row and jth column of express The value of the jth row and ith column of , exp represents the exponential function, is the cross entropy loss when the image is used as a query, is the cross entropy loss when text is used as query, is the total contrastive learning loss;
[0062] The specific weight update process is as follows:
[0063] Gradient calculation of the loss function:
[0064]
[0065]
[0066] Weight update:
[0067]
[0068] in, represents the learning rate, It means to find partial derivatives.
[0069] Furthermore, the video feature extraction includes:
[0070] Input video: ,in, is the total number of video frames, For the Frame image, is the i-th frame image, For video;
[0071] Encode video frame: , where image_encoder is the image encoder, is the feature dimension, is the encoding result of the i-th frame image, is the real number space;
[0072] is the feature set of all frames; For the The feature matrix of the frame;
[0073] Clustering:
[0074] ,in, is the number of clusters; is the clustering function, For the The center point of the cluster, For the The center point of the cluster, is the set of cluster centers, is a set of cluster center points;
[0075] Keyframe selection:
[0076]
[0077] Select the frame closest to each cluster center as the key frame to form the key frame feature sequence L;
[0078] Positional encoding:
[0079]
[0080] in, , k is The parameters in is the position of the key frame in the key frame feature sequence; is the position encoding value of the i-th key frame; d represents the feature dimension, is a parameter of frequency in position encoding;
[0081] Final eigenvector:
[0082]
[0083] For each keyframe ;
[0084] Represents the final video feature matrix.
[0085] Furthermore, the text feature extraction includes:
[0086] The input is multimodal text data and image OCR text data , the two are fused by the fusion function to obtain the text for multimodal feature fusion ,in , is the text fusion function, Use the pre-trained Embedding model to extract features and obtain the text feature matrix .
[0087] Furthermore, the step 3 comprises:
[0088] Image feature projection: Image feature matrix Project and align them to the text space to obtain an image feature matrix that can be used for feature fusion ,Right now , is the matrix used to project the image feature matrix into the text space;
[0089] Video feature projection: Video feature matrix Project and align them to the text space to obtain a video feature matrix that can be used for feature fusion ,Right now , is the matrix used to project the video feature matrix into the text space;
[0090] Audio feature projection: video feature matrix Project and align them to the text space to obtain a video feature matrix that can be used for feature fusion ,Right now , is the matrix used to project the audio feature matrix into the text space;
[0091] Multimodal feature fusion: Fusion of all multimodal data to obtain a feature matrix for abnormal content detection and subject discovery , , is the multimodal feature fusion function, It is a text feature matrix.
[0092] Furthermore, step 3 further includes:
[0093] It is a feature matrix Add marks to different matrices in the feature matrix to distinguish each modality data in the multimodal data, that is:
[0094] Input the projected text feature matrix , image feature matrix , video feature matrix , audio feature matrix ;
[0095] Perform a vectorization operation on the fusion template using a pre-trained Embedding model to obtain a template matrix. The fusion template is:
[0096] Content that needs to detect anomalies:
[0097] <text>< >< / text>
[0098] <picture>< >< / picture>
[0099] <video>< >< / video>
[0100] <audio>< >< / audio>
[0101] Replace the vector in the template matrix with , vector with , vector with , vector with .
[0102] Furthermore, step 4 includes:
[0103] Freeze the original pre-trained large language model, add two low-rank decomposition matrices to the original weight matrix, and the optimization objective changes from the original formula that requires a large number of training parameters: to a formula that only needs to adjust some parameters: ;
[0104] Among them, represents the true label of the t-th one, is a pre-trained autoregressive language model, is the original weight matrix, is a low-rank decomposition matrix, is the frozen weight matrix, is the change of the low-rank decomposition matrix, is the training data set, is the input sequence, is the target sequence, Used to indicate sequence order. is the original language model, is the adjusted language model;
[0105] A projection layer is added to the output of the large language model to extract the abnormal content and abnormal content main feature vector, and the abnormal main feature vector is used as the input of the content main body discovery model to discover the abnormal content main body.
[0106] Furthermore, the step 5 comprises:
[0107] Cluster feature vector:
[0108] ,in, is a collection of multiple abnormal subject feature vectors, is the number of clusters; is the clustering function, For the The center point of the cluster, For the The center or representative point of a cluster, is the cluster center;
[0109] Define the distance function:
[0110]
[0111] in, is the distance function, is the input feature vector, is the eigenvector The jth component of is the i-th cluster center The jth component of is the dimension of the feature vector;
[0112] Determine whether they belong to the same content body:
[0113] Define a distance threshold , if the eigenvector to The distance is less than or equal to , then the feature vector is considered to belong to the same content body, otherwise it belongs to different content bodies.
[0114] Due to the adoption of the above technical solution, the present invention has the following advantages:
[0115] The present invention proposes a multimodal large model analysis method that combines image, video and text information. By extracting and fusing data from different modalities and introducing a large language model, accurate understanding, reasonable reasoning and effective discovery of abnormal content can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0116] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0117] Figure 1 A flowchart of a content subject discovery method based on multimodal abnormal content understanding according to an embodiment of the present invention;
[0118] Figure 2 Schematic diagram of multimodal feature fusion according to an embodiment of the present invention;
[0119] Figure 3 A schematic diagram of abnormal content detection according to an embodiment of the present invention;
[0120] Figure 4 A schematic diagram of similarity matching results found for the content body according to an embodiment of the present invention. DETAILED DESCRIPTION
[0121] The present invention is further described in conjunction with the accompanying drawings and embodiments, and the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field should fall within the scope of protection of the embodiments of the present invention.
[0122] Technical term analysis:
[0123] Large Language Model: A large language model is an artificial intelligence model trained with a large amount of text data that can understand and generate natural language. Typical examples include GPT (such as GPT-3 and GPT-4) and the Llama series of large models.
[0124] Multimodal: Multimodal refers to data involving multiple different types of modalities, such as text, images, audio, and video. In multimodal analysis, these different modal data are processed together to achieve a more comprehensive understanding and analysis.
[0125] Feature Fusion: Feature fusion refers to combining feature vectors from different modalities or different feature extraction methods to build a more comprehensive representation. Feature fusion helps to utilize the complementary information of multimodal data and enhance the performance of the model.
[0126] Attention Mechanism: Attention mechanism is a method to improve model performance by assigning different weights to different parts of data when processing sequence data. It was first used in neural machine translation and has been widely used in Transformer models.
[0127] CNN (Convolutional Neural Network): Convolutional Neural Network is a deep learning model that is particularly suitable for processing grid-structured data, such as images and videos. CNN extracts local features through convolution operations and builds more abstract high-level features layer by layer.
[0128] See also Figures 1 to 4 The present invention provides an embodiment of a content subject discovery method based on multimodal abnormal content understanding, which realizes accurate understanding, reasonable reasoning and effective discovery of abnormal content subject by extracting and fusing data of different modalities and introducing a large language model. The method includes the following steps: multimodal feature extraction, multimodal feature fusion, abnormal content detection, and content subject discovery.
[0129] S1: Multimodal feature extraction;
[0130] Preprocess and extract features of multimodal data (including video, pictures, audio, and text). Specifically, it is divided into the following steps:
[0131] S11: Pre-process the image, video, and audio to extract image text OCR data and multiple audio clip data.
[0132] 1) Extracting OCR (Optical Character Recognition) text from images: This patent uses a deep learning model to accurately identify images containing text data, supporting multiple languages including Chinese and English. Used for subsequent text data feature extraction.
[0133] 2) Extracting audio segment data: Specifically, for audio data of varying lengths, they are first segmented into 30-second audio segments, then uniformly resampled to 16,000 Hz, and then the spectrum data is calculated through short-time Fourier transform for feature extraction.
[0134] S12: Perform feature extraction operations on the image data, video data, multiple audio clip data in 1, image OCR text in 1, and other text data.
[0135] 1) Image feature extraction: Using a pre-trained Transformer architecture image encoder based on contrastive learning, image data can be converted into sequence data similar to that used in natural language processing tasks, and visual features can be extracted from these sequence data. The present invention uses a Transformer architecture image encoder with contrastive learning and coarse and fine granularity fusion to convert the image into a feature matrix, which is then fused and complemented with the text feature matrix; in the process of image feature extraction, a coarse and fine granularity fusion module is used to improve the representation ability of the image encoder, and the coarse and fine granularity fusion module fuses the local features and global features of the image. In addition, the use of an image encoder pre-trained based on contrastive learning can achieve zero-sample reasoning capabilities for image modalities and text modalities.
[0136] The image encoder is image_encoder obtained by contrastive learning, and the input image The image feature matrix obtained after encoding by the image encoder is .
[0137] The purpose of the coarse-grained and fine-grained fusion module is to preserve as many image detail features as possible while taking into account the global visual features. The specific design is as follows:
[0138] Global feature extraction process:
[0139]
[0140] in, is a pre-trained global feature extractor, where It is the input picture when training the coarse-grained and fine-grained fusion module. The image features extracted by the global feature extractor, is the input image, is the characteristic length, is the global feature dimension, is the real number space;
[0141] Local feature extraction:
[0142]
[0143] in, is a pre-trained local feature extractor, The image features extracted by the local feature extractor, is the characteristic length, is the local feature dimension;
[0144]
[0145] in, To adjust the local features of the shape, is a learnable parameter used to map local features to , The feature dimension after adjusting the shape;
[0146] Linear Projection:
[0147]
[0148] in, To adjust the global features of the shape, is a learnable parameter used to map global features to dimensional space;
[0149] Calculate the attention weights:
[0150]
[0151] in, is the attention score matrix, for The transpose of
[0152]
[0153] in, is the attention weight, is the softmax function;
[0154] Weighted local features:
[0155]
[0156] in, is the weighted local feature, Represents matrix multiplication;
[0157] Fusion of global and local features:
[0158]
[0159] in, is the fused feature;
[0160] Then, contrastive learning is used to align the image features and text features extracted by the coarse-grained fusion module to form an image encoder image_encoder. The specific steps are as follows:
[0161] Input definition: Represents the image feature Batch that needs to be aligned, Indicates the text batch that needs to be aligned, where B represents the batch size and n represents the text length. Represents the feature dimension of the text, is the real number space.
[0162] Feature extraction required for contrastive learning:
[0163]
[0164]
[0165] in, represents the features obtained by the coarse-grained and fine-grained fusion module, represents the coarse-grained and fine-grained fusion module of the previous step, represents a text encoder, is the text feature extracted by the text encoder, B represents the batch size, n is the feature length of the text, is the text feature dimension;
[0166] Feature projection and normalization:
[0167]
[0168]
[0169] in, is the normalized image feature, is the projected and normalized text feature, is a learnable parameter used to map text features to dimensional space, Express Find the second norm of Express The matrix product of finds the binorm;
[0170] Compute the scaled cosine similarity:
[0171]
[0172] in, To calculate the scaled cosine similarity between image features and text features, is a parameter used to control the scaling degree of similarity. express The transpose of
[0173] Contrastive learning loss calculation:
[0174]
[0175]
[0176]
[0177] in, express The value of the ith row and ith column of express The value of the i-th row and j-th column of express The value of the jth row and jth column of express The value of the jth row and ith column of , exp represents the exponential function, is the cross entropy loss when the image is used as a query, is the cross entropy loss when text is used as query, is the total contrastive learning loss.
[0178] The subscripts of are all i, that is, the subscripts are the same, which means that the image features and text features are corresponding. The subscripts of are all j, that is, the subscripts are the same, which means that the image features and text features are corresponding. The subscripts are i and j, that is, the subscripts are different, which means that the image features and text features are not corresponding. The subscripts of are j and i, that is, the subscripts are different, indicating that the image features and text features are not corresponding.
[0179] The specific weight update process is as follows:
[0180] Gradient calculation of the loss function:
[0181]
[0182]
[0183] Weight update:
[0184]
[0185] in, represents the learning rate, It means to find partial derivatives.
[0186] 2) Video feature extraction: By extracting features from each frame of the video and clustering them to form a feature matrix of key frames, it is possible to extract features from a video. When extracting key frames, each frame of the video is first encoded using the image encoder in 1), and then clustered to form a feature matrix of key frames to increase data density and reduce redundant data. The specific process is as follows:
[0187] Input video: ,in, is the total number of video frames, For the Frame image, is the i-th frame image, For video;
[0188] Encode video frame: , where image_encoder is the image encoder, is the feature dimension, is the encoding result of the i-th frame image, is the real number space;
[0189] is the feature set of all frames; For the The feature matrix of the frame;
[0190] Clustering:
[0191] ,in, is the number of clusters; is the clustering function, For the The center point of the cluster, For the The center point of the cluster, is the set of cluster centers, is a set of cluster center points;
[0192] Keyframe selection:
[0193]
[0194] Select the frame closest to each cluster center as the key frame to form the key frame feature sequence L;
[0195] Positional encoding:
[0196]
[0197] in, , k is The parameters in is the position of the key frame in the key frame feature sequence; is the position encoding value of the i-th key frame; d represents the feature dimension, is a parameter of frequency in position encoding;
[0198] Final eigenvector:
[0199]
[0200] For each keyframe ;
[0201] Represents the final video feature matrix.
[0202] 3) Audio feature extraction: Audio feature extractors capture the temporal and frequency characteristics of audio through multi-scale feature learning and attention mechanisms, and use large-scale pre-training and transfer learning strategies to enhance the generalization ability of the model. They are able to perform a wide range of tasks, including but not limited to speech recognition, music classification, sound event detection, and audio generation. Specifically, for audio data of varying lengths, First, we need to uniformly resample to 16000Hz, then use signal processing methods such as short-time Fourier transform to extract frequency domain features, and then use the Encoder-Decoder architecture to model and train the features to obtain the final feature extractor. And use the feature extractor to extract features from the audio to obtain the final audio feature matrix. .
[0203] S13: Segment and vectorize text data and extract features: When segmenting text data, first perform lexical analysis on the input text data and divide it into words or subword units. Then use the BPE algorithm to segment the sentences to improve the processing capabilities of low-frequency words and new words. Then use the pre-trained Embedding model to map the segmented text data and map the tokens obtained from the segmentation to vectors of fixed size.
[0204] The input of this step is multimodal text data and image OCR text data , the two are fused by the fusion function to obtain the text for multimodal feature fusion ,in , is the text fusion function. Use the pre-trained Embedding model to extract features and obtain the text feature matrix .
[0205] S2: multimodal feature fusion;
[0206] 1. Image feature projection: The image feature matrix obtained in the previous step Project and align them to the text space to obtain an image feature matrix that can be used for feature fusion , specifically , is the matrix used to project the image feature matrix into the text space.
[0207] 2. Video feature projection: Project the video feature matrix obtained in the previous section to uniformly align it in the text space, obtaining a video feature matrix for feature fusion. Specifically , is the matrix for projecting the video feature matrix into the text space.
[0208] 3. Audio feature projection: Project the audio feature matrix obtained in the previous section to uniformly align it in the text space, obtaining an audio feature matrix for feature fusion. Specifically , is the matrix for projecting the audio feature matrix into the text space.
[0209] 4. Multimodal feature fusion: Fuse all multimodal data (including video, pictures, audio, and text) to obtain a feature matrix for abnormal content detection. Specifically , is the multimodal feature fusion function, is the text feature matrix.至此,多模态数据融合为一个特征矩阵 for the abnormal content detection model to perform abnormal detection and subject discovery.
[0210] Specifically is the fusion function that merges text, pictures, video, and audio data into the same feature matrix, adding markers to the different feature matrices of each modality for abnormal content detection to distinguish the data of each modality. The steps are as follows:
[0211] 1) The input text feature matrix, image feature matrix, video feature matrix, and audio feature matrix respectively correspond to: .
[0212] 2) Perform a vectorization operation on the fusion template using a pre-trained Embedding model to obtain the template matrix. The fusion template is as follows:
[0213] Content to be detected for abnormalities:
[0214] <Text>< >< / Text>
[0215] <Picture>< >< / Picture>
[0216] <Video>< >< / Video>
[0217] <Audio>< >< / Audio>
[0218] 3) The template matrix Vector Replacement , Vector Replacement , Vector Replacement , Vector Replacement .
[0219] S3: Abnormal content detection;
[0220] For the detection of abnormal content, it is necessary to learn and model the abnormal content. First, the feature matrix obtained by fusion of multimodal features is fine-tuned on the large language model with LoRA instruction supervision, so that the large language model has the ability to understand abnormal content and extract main features. Freeze the original pre-trained large language model, add two low-rank decomposition matrices to the original weight matrix, and the optimization target is changed from the original formula that requires a large number of training parameters: It becomes a formula that only needs to adjust some parameters: ;
[0221] in, represents the true value label of the tth one, is a pre-trained autoregressive language model, is the original weight matrix, is a low-rank decomposition matrix, is the frozen weight matrix, is the change of the low-rank decomposition matrix, is the training data set, is the input sequence, is the target sequence, Used to indicate sequence order. is the original language model, is the adjusted language model;
[0222] A projection layer is added to the output of the large language model to extract the abnormal content and abnormal content main feature vector, and the abnormal main feature vector is used as the input of the content main body discovery model to discover the abnormal content main body.
[0223] S4: Content body discovery:
[0224] When the abnormal content detection step detects abnormal content, the feature vector of the abnormal content body will be output. The present invention uses a vector database to store these feature vectors, clusters and calculates the distance between these feature vectors, and determines whether they belong to the same content body according to the threshold. The specific steps are as follows:
[0225] 1) Clustering feature vector:
[0226] 2) ,in, is a collection of multiple abnormal subject feature vectors, is the number of clusters; is the clustering function, For the The center point of the cluster, For the The center or representative point of a cluster, is the cluster center;
[0227] 3) Define the distance function:
[0228]
[0229] in, is the distance function, is the input feature vector, is the eigenvector The jth component of is the i-th cluster center The jth component of is the dimension of the feature vector;
[0230] 4) Determine whether they belong to the same content body:
[0231] Define a distance threshold , if the eigenvector to The distance is less than or equal to , then these feature vectors are considered to belong to the same content body.
[0232]
[0233] Result output:
[0234] Generate a multi-modal fusion abnormal content report, including abnormal content description and content body identification of images, videos and texts.
[0235] The content subject discovery method based on multimodal abnormal content understanding provided in this embodiment is applied on real social media, and other published content of a user is confirmed based on the text and picture speech content of the user on the social media.
[0236] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A content subject discovery method based on multimodal abnormal content understanding, It is characterized in that include: Step 1: Extract OCR text from images and videos in the multimodal data, and extract multiple audio segment data from the audio in the multimodal data; Step 2: Perform feature extraction on the images and videos in the multimodal data, the multiple audio clips extracted in step 1, and the text and OCR text in the multimodal data to obtain an image feature matrix, a video feature matrix, an audio feature matrix, and a text feature matrix, respectively; Step 3: Project the image feature matrix, video feature matrix, and audio feature matrix into the text space to fuse them with the text feature matrix to obtain a feature matrix for anomaly detection and subject discovery; Step 4: Perform LoRA instruction supervision fine-tuning on the feature matrix on the large language model, add a projection layer to the output of the large language model, and extract the feature vectors of the abnormal content and the abnormal content body from the output of the large language model; Step 5: Use the vector database to store the feature vector, perform clustering and distance calculation on the feature vector, and determine whether it belongs to the same content body based on the threshold, and generate a multimodal fusion abnormal content report; the abnormal content report contains the abnormal content description and content body identification of the image, video and text.
2. The method according to claim 1, It is characterized in that The step 2 comprises: Image feature extraction: Use contrastive learning and coarse-grained fusion of Transformer architecture image encoder to convert images in multimodal data into image feature matrices; Video feature extraction: Use contrastive learning and coarse-grained fusion of Transformer architecture image encoder to encode each frame of the video in the multimodal data, and then cluster to form a video feature matrix of the key frames; Audio feature extraction: Use feature extractors to extract audio data of different durations. Perform feature extraction to obtain an audio feature matrix; Text feature extraction: Perform lexical analysis on the input text data, split it into words or subword units, use the BPE algorithm to segment the sentences, use the pre-trained Embedding model to map the segmented text data, and map the tokens obtained from the segmentation into vectors of fixed size; Perform word segmentation, vectorization, and feature extraction on the text data and OCR text in the multimodal data to obtain the text feature matrix .
3. The method according to claim 2, It is characterized in that The image feature extraction comprises: Step 21: Use a coarse-grained and fine-grained fusion module to improve the representation capability of the Transformer architecture image encoder with contrastive learning and coarse-grained and fine-grained fusion; Step 22: Use contrastive learning to align the image features and text features extracted by the coarse-grained fusion module to form an image encoder image_encoder; Step 23: After the image is input into the image encoder image_encoder for encoding, an image feature matrix is obtained.
4. The method according to claim 3, It is characterized in that The step 21 comprises: Global feature extraction: in, is a pre-trained global feature extractor, where It is the input picture when training the coarse-grained and fine-grained fusion module. The image features extracted by the global feature extractor, is the input image, is the characteristic length, is the global feature dimension, is the real number space; Local feature extraction: in, is a pre-trained local feature extractor, The image features extracted by the local feature extractor, is the characteristic length, is the local feature dimension; in, To adjust the local features of the shape, is a learnable parameter used to map local features to , The feature dimension after adjusting the shape; Linear Projection: in, To adjust the global features of the shape, is a learnable parameter used to map global features to dimensional space; Calculate the attention weights: in, is the attention score matrix, for The transpose of in, is the attention weight, is the softmax function; Weighted local features: in, is the weighted local feature, Represents matrix multiplication; Fusion of global and local features: in, The fused features.
5. The method according to claim 4, It is characterized in that The step 22 comprises: Input definition: Represents the image feature Batch that needs to be aligned, Represents the text batch that needs to be aligned, where B represents the batch size and n represents the text length. Represents the feature dimension of the text, is the real number space; Feature extraction required for contrastive learning: in, represents the features obtained by the coarse-grained and fine-grained fusion module, represents the coarse-grained and fine-grained fusion module of the previous step, represents a text encoder, is the text feature extracted by the text encoder, B represents the batch size, n is the feature length of the text, is the text feature dimension; Feature projection and normalization: in, is the normalized image feature, is the projected and normalized text feature, is a learnable parameter used to map text features to dimensional space, Express Find the second norm of Express The matrix product of finds the binorm; Compute the scaled cosine similarity: in, To calculate the scaled cosine similarity between image features and text features, is a parameter used to control the scaling degree of similarity. express The transpose of Contrastive learning loss calculation: in, express The value of the ith row and ith column of express The value of the i-th row and j-th column of express The value of the jth row and jth column of express The value of the jth row and ith column of , exp represents the exponential function, is the cross entropy loss when the image is used as a query, is the cross entropy loss when text is used as query, is the total contrastive learning loss; The specific weight update process is as follows: Gradient calculation of the loss function: Weight update: in, represents the learning rate, It means to find partial derivatives.
6. The method according to claim 2, It is characterized in that The video feature extraction comprises: Input video: ,in, is the total number of video frames, For the Frame image, is the i-th frame image, For video; Encode video frame: , where image_encoder is the image encoder, is the feature dimension, is the encoding result of the i-th frame image, is the real number space; is the feature set of all frames; For the The feature matrix of the frame; Clustering: ,in, is the number of clusters; is the clustering function, For the The center point of the cluster, For the The center point of the cluster, is the set of cluster centers, is a set of cluster center points; Keyframe selection: Select the frame closest to each cluster center as the key frame to form the key frame feature sequence L; Positional encoding: in, , k is The parameters in is the position of the key frame in the key frame feature sequence; is the position encoding value of the i-th key frame; d represents the feature dimension, is a parameter of frequency in position encoding; Final eigenvector: For each keyframe ; Represents the final video feature matrix.
7. The method according to claim 2, It is characterized in that The step 3 comprises: Image feature projection: Image feature matrix Project and align them to the text space to obtain an image feature matrix that can be used for feature fusion ,Right now , is the matrix used to project the image feature matrix into the text space; Video feature projection: Video feature matrix Project and align them to the text space to obtain a video feature matrix that can be used for feature fusion ,Right now , is the matrix used to project the video feature matrix into the text space; Audio feature projection: video feature matrix Project and align them to the text space to obtain a video feature matrix that can be used for feature fusion ,Right now , is the matrix used to project the audio feature matrix into the text space; Multimodal feature fusion: Fusion of all multimodal data to obtain a feature matrix for abnormal content detection and subject discovery , , is the multimodal feature fusion function, is the text feature matrix.
8. The method according to claim 7, It is characterized in that The step 3 also includes: is the feature matrix Different matrices in are marked to distinguish the modal data in the multimodal data, namely: Input the projected text feature matrix , image feature matrix , video feature matrix , audio feature matrix ; Use the pre-trained Embedding model to vectorize the fusion template and obtain the template matrix. The fusion template is: Need to detect abnormal content: <Text>< >< / Text> <Picture>< >< / Picture> <Video>< >< / Video> <Audio>< >< / Audio> The template matrix Vector Replacement , Vector Replacement , Vector Replacement , Vector Replacement .
9. The method according to claim 2, It is characterized in that The step 4 comprises: Freeze the original pre-trained large language model, add two low-rank decomposition matrices to the original weight matrix, and change the optimization objective from the original formula that requires a large number of training parameters: It becomes a formula that only needs to adjust some parameters: ; in, represents the true value label of the tth one, is a pre-trained autoregressive language model, is the original weight matrix, is a low-rank decomposition matrix, is the frozen weight matrix, is the change of the low-rank decomposition matrix, is the training data set, is the input sequence, is the target sequence, Used to indicate sequence order. is the original language model, is the adjusted language model; A projection layer is added to the output of the large language model to extract the abnormal content and abnormal content main feature vector, and the abnormal main feature vector is used as the input of the content main body discovery model to discover the abnormal content main body.
10. The method according to claim 2, It is characterized in that The step 5 comprises: Cluster feature vector: ,in, is a collection of multiple abnormal subject feature vectors, is the number of clusters; is the clustering function, For the The center point of the cluster, For the The center or representative point of a cluster, is the cluster center; Define the distance function: in, is the distance function, is the input feature vector, is the eigenvector The jth component of is the i-th cluster center The jth component of is the dimension of the feature vector; Determine whether they belong to the same content body: Define a distance threshold , if the eigenvector to The distance is less than or equal to , then the feature vector is considered to belong to the same content body, otherwise it belongs to different content bodies.
Citation Information
Patent Citations
Abnormal transaction data identification method and device, storage medium and electronic equipment
CN117670359A
Attention aware multi-modal model for content understanding
US20240086457A1
