A content security auditing method, system, device, and medium based on a multimodal large model.
By combining the image and text encoding modules of the multimodal large model with user-defined review standards, the problems of multimodal information fusion and scenario adaptability are solved, achieving high accuracy and flexibility in content review.
Patent Information
- Application Number
- CN202411888207.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2044-12-20
AI Technical Summary
Existing technologies struggle to effectively integrate multimodal information for end-to-end learning, resulting in low accuracy in content moderation. Furthermore, inconsistent moderation standards across different scenarios prevent them from adapting to diverse content moderation needs, and they lack flexibility and generalization capabilities.
A content security review method based on a multimodal large model is adopted. Features are extracted through image encoding and text encoding modules, combined with user-defined review standards, and the large model module is used for review reasoning to achieve the fusion of multimodal information and user-defined review.
It improves the accuracy and flexibility of content review, adapts to review standards in different scenarios, achieves higher accuracy and speed, and meets the review needs of dynamic content.
Smart Images

Figure CN119831528B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a content security auditing method, system, device and medium based on a multimodal large model. Background Technology
[0002] Content moderation for security is typically applied in various fields that require maintaining a healthy online environment and protecting users from inappropriate information. Application scenarios include social media platforms, finance, e-commerce, and public utilities. Currently, content moderation for security mainly employs methods such as regularization rules, computer vision, and natural language processing. While these conventional methods have solved some content moderation problems, they struggle to integrate and learn from various modalities in a multimodal context, resulting in low accuracy. Furthermore, user standards differ across content moderation scenarios; what is compliant in one scenario may be considered illegal in another. Conventional technologies cannot adapt to content moderation in different scenarios, posing a significant challenge to the generalization capabilities of existing technologies. Summary of the Invention
[0003] This invention provides a content security auditing method, system, device, and medium based on a multimodal large model to solve the problems existing in related technologies. The technical solution is as follows:
[0004] In a first aspect, embodiments of the present invention provide a content security auditing method based on a multimodal large model, including:
[0005] Obtain the data to be reviewed, which is an image and / or text; perform image encoding and / or text encoding on the data to be reviewed based on the image encoding module and / or text encoding module to obtain the first target feature;
[0006] Obtain user-defined review criteria, and encode the review criteria using a text encoding module to obtain the second target feature;
[0007] Based on the pre-built large model module, the first target feature and the second target feature are used for review and reasoning, and then the output layer module outputs the prediction results for content security review.
[0008] In one implementation, it further includes:
[0009] Obtain the dataset, which includes a pre-training dataset, a fine-tuning training dataset, and a test dataset. The pre-training dataset consists of pairs of images and text. The fine-tuning training dataset is a combination of various data types, including images, text, and user-defined review criteria labels. The test dataset is a combination of various data types, including images, text, and user-defined review criteria labels.
[0010] The multimodal large model is trained based on the dataset to obtain the optimal multimodal large model. The optimal multimodal large model is used to perform review inference on the data to be reviewed and the review standards, and output the prediction results. The multimodal large model includes an image encoding module, a text encoding module, a large model module, and an output layer module.
[0011] In one implementation, the first target feature is obtained by performing image encoding and / or text encoding on the data to be reviewed based on an image encoding module and / or a text encoding module, including:
[0012] When the data to be reviewed is an image, the image is processed based on a convolutional downsampling model to output a first feature layer of 64*64*256.
[0013] The first feature layer outputs a second feature layer of 64*64*256 through the convolutional position-aware transformer module. The convolutional position-aware transformer module is composed of 12 convolutional position-aware transformer blocks connected in series.
[0014] The second feature layer is processed by the information compression convolution module, and a third feature layer of 16*16*1024 is output.
[0015] After converting the third feature layer into a 256*1024 feature layer, it is input into the image channel alignment model and outputs a 256*768 feature layer to obtain the first target feature corresponding to the image.
[0016] In one implementation, the first target feature is obtained by performing image encoding and / or text encoding on the data to be reviewed based on an image encoding module and / or a text encoding module, including:
[0017] When the data to be reviewed is text, the text is segmented into multiple sub-words, and these sub-words are mapped into multiple unique codes based on a pre-built vocabulary.
[0018] Based on the text embedding model and the location embedding module, multiple unique codes are mapped into multiple high-dimensional space vectors with a dimension of 1024, resulting in an n*1024 high-dimensional vector.
[0019] Input the high-dimensional vector of n*1024 into the transformer block module, and output an n*1024 feature layer;
[0020] The n*1024 feature layer is output as an n*768 feature layer through the text channel alignment module to obtain the first target feature corresponding to the text.
[0021] In one implementation, the review reasoning is performed on the first target feature and the second target feature based on the pre-built large model module, and then the prediction result for content security review is output by the output layer module, including:
[0022] The first target feature and the second target feature are imported into the security expert module for feature layer merging, and the output is a (256+n)*768 feature layer;
[0023] The (256+n)*768 feature layer is input into the self-attention network to obtain the attention output matrix;
[0024] The attention output matrix is nonlinearly transformed based on the feedforward network module, and (256+n)*768 feature layers are output to obtain the feedforward network output matrix.
[0025] The output layer module performs linear layer mapping on the output matrix of the feedforward network to output the logits matrix. Based on the logits matrix, the prediction results used for content security review are output.
[0026] In one implementation, the security expert module includes 24 security expert transformer blocks, each of which includes a self-attention network, a content security image expert, and a content security text expert; wherein the self-attention network and the content security image expert are serially connected, the self-attention network and the content security text expert are serially connected, and the content security image expert and the content security text expert are parallelly connected.
[0027] In one implementation, the content security image expert is composed of a first fully connected layer and a second fully connected layer connected in series. The first fully connected layer has 768 input features and 1536 output features, and the second fully connected layer has 1536 input features and 768 output features. The content security text expert and the content security image expert have the same structure.
[0028] Secondly, embodiments of the present invention provide a content security auditing system based on a multimodal large model, which executes the content security auditing method based on a multimodal large model as described above.
[0029] Thirdly, embodiments of the present invention provide an electronic device comprising a memory and a processor. The memory and the processor communicate with each other via an internal connection path. The memory stores instructions, and the processor executes the instructions stored in the memory. When the processor executes the instructions stored in the memory, it causes the processor to perform the method described in any of the above embodiments.
[0030] Fourthly, embodiments of the present invention provide a computer-readable storage medium that stores a computer program, wherein when the computer program is run on a computer, the methods in any of the embodiments described above are executed.
[0031] The advantages or beneficial effects of the above technical solutions include at least the following:
[0032] This invention introduces a multimodal large model into content security review, achieving automation and intelligence in the review process. The data to be reviewed undergoes image and / or text encoding to achieve fine-grained understanding of images and / or text, laying the groundwork for user-defined review standards in the subsequent inference stage, significantly improving the accuracy and flexibility of the algorithm. Simultaneously, user-defined review standard tags are added, and the data to be reviewed and the review standard tags are imported into a content security-specific multimodal large model network for review inference. This allows users to customize review standards during the inference stage, addressing the challenges of diverse review standards and dynamic content, resulting in higher accuracy, speed, and flexibility in the review inference results.
[0033] The above overview is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of the invention will become readily apparent from the accompanying drawings and the following detailed description. Attached Figure Description
[0034] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the various drawings denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments disclosed in the invention and should not be construed as limiting the scope of the invention.
[0035] Figure 1 This is a flowchart illustrating the content moderation method based on a multimodal model according to the present invention.
[0036] Figure 2 This is a schematic diagram of the multimodal large model structure of the present invention;
[0037] Figure 3 This is a schematic diagram of the training method for the multimodal large model of the present invention;
[0038] Figure 4 This is a schematic diagram illustrating the inference of image modal data in this invention;
[0039] Figure 5 This is a structural block diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0040] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of the invention. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0041] Content moderation for security is typically applied in various fields that require maintaining a healthy online environment and protecting users from inappropriate information. Application scenarios include social media platforms, finance, e-commerce, and public utilities.
[0042] While existing solutions employ regularization rules, computer vision, and natural language processing to address some content moderation issues, they still face several technical bottlenecks and challenges:
[0043] (1) Accuracy issues: When facing multimodal content review, existing technologies have difficulty integrating information from various modalities and learning end-to-end, resulting in low accuracy.
[0044] (2) Diversity of review standards: Users have different standards for content review in different scenarios. What is compliant in a specific scenario may be considered a violation in other situations, which poses a great challenge to the generalization ability of existing technologies.
[0045] (3) Challenges of dynamic content: The nature of online content is dynamic and ever-changing, with cultural phenomena and trends emerging one after another, which places higher demands on the flexibility and adaptability of technology.
[0046] To address the aforementioned bottlenecks and challenges, this embodiment provides a content moderation method based on a multimodal large model, which enables multimodal moderation and user-defined moderation standards, significantly improving accuracy and generalization ability.
[0047] like Figure 1 As shown, a content moderation method based on a multimodal large model specifically includes the following steps:
[0048] Step S1: Obtain the data to be reviewed, which is an image and / or text; perform image encoding and / or text encoding on the data to be reviewed to obtain the first target feature.
[0049] Combination Figure 2 As shown, when the data to be reviewed is an image, the image is processed by the image encoding module. The image encoding module consists of five sub-modules: a convolutional downsampling module, a convolutional position-aware transformer module, an information compression convolution module, and an image channel alignment module.
[0050] The convolutional downsampling module consists of three convolutional kernel networks connected in series. The first convolutional kernel network consists of a 3*3 kernel with 64 kernels, a stride of 2, and padding of 1, connected in series with a batch normalization (bn), an activation function, and a pooling layer with a stride of 2. The second convolutional kernel network consists of a 3*3 kernel with 128 kernels, a stride of 2, and padding of 1, connected in series with a batch normalization (bn), an activation function, and a pooling layer with a stride of 2. The third convolutional kernel network consists of a 1*1 kernel with 256 kernels, a stride of 1, and padding of 0.
[0051] When the data to be reviewed is an image of size 1024*1024*3, the image is input into the convolutional downsampling module, and the output is the first feature layer of 64*64*256.
[0052] The specific structure of the convolutional position-aware transformer module consists of 12 concatenated convolutional position-aware transformer blocks. Each convolutional position-aware transformer block consists of a multi-head attention network, a feedforward network, and a position-aware convolutional network. The multi-head attention network has 8 attention heads. The feedforward network consists of a fully connected layer with 256 input features and 1024 output features, and a fully connected layer with 1024 input features and 256 output features, all connected in series. The position-aware convolutional network consists of a 3*3 kernel with 128 kernels, a stride of 1, and padding of 1.
[0053] The first feature layer, which outputs a 64*64*256 value from the convolutional downsampling model, is then processed by the convolutional position-aware transformer module to output a second feature layer, which also has a 64*64*256 value.
[0054] The information compression convolution module consists of a 3*3 convolution kernel with 512 kernels, a stride of 2, and padding of 1, and a 3*3 convolution kernel with 1024 kernels, a stride of 2, and padding of 1, connected in series.
[0055] The 64*64*256 second feature layer output from the convolutional position-aware transformer module is input into the information compression convolution module, which outputs a 16*16*1024 third feature layer.
[0056] The 16*16*1024 third feature layer output by the information compression convolution module is expanded through the first and second dimensions to obtain a 256*1024 feature layer. This 256*1024 feature layer is then input to the image channel alignment module, which outputs a 256*768 feature layer, thus obtaining the first target feature corresponding to the image to be reviewed. The information compression convolution module is structured as a fully connected layer with 1024 input features and 768 output features.
[0057] It should be explained that the first dimension refers to the height (or number of rows) of the feature layer, which is 16 in this embodiment. The second dimension refers to the width (or number of columns) of the feature layer, which is also 16 in this embodiment. Expanding the 16*16*1024 third feature layer through the first and second dimensions means converting this three-dimensional feature layer (16 height * 16 width * 1024 channels) into a two-dimensional feature layer (256 * 1024), where 256 is 16 (height) multiplied by 16 (width), and 1024 is the number of channels. In this embodiment, spatial information (height and width) is converted into a single dimension to facilitate subsequent processing, such as input to a fully connected layer.
[0058] When the data to be reviewed is text, the text is processed using a text encoding module. This module comprises six sub-modules: WordPiece word segmentation, text embedding, positional embedding, embedding, transformer block, and text channel alignment. Specifically:
[0059] The WordPiece word segmentation module uses the WordPiece algorithm to build a vocabulary and segments the input text to be reviewed into n sub-words. Based on the vocabulary, the n sub-words are mapped to n unique coded IDs.
[0060] The text embedding module maps the n IDs output by the WordPiece word segmentation module to n high-dimensional vectors with a dimension of 1024 through embedding.
[0061] It should be noted that in machine learning and deep learning, embedding is a technique for representing data items (such as words, images, or other types of data) as fixed-length vectors. Embedding is usually learned through the training process, and the model adjusts the embedding vectors according to the patterns and relationships in the data in order to better perform a specific task.
[0062] The position embedding module is a learnable matrix of size n*1024, where the positional encoding is randomly initialized and updated via backpropagation during training. The embedding module is obtained by adding the high-dimensional vector from the text embedding module to the high-dimensional vector from the position embedding module.
[0063] The transformer block module takes an n*1024 high-dimensional vector as input from the embedding module and outputs an n*1024 feature layer. The transformer block module consists of 12 transformer blocks connected in series. Each transformer block comprises a multi-head attention network with eight attention heads, and the feedforward network consists of a fully connected layer with 1024 input features and 2048 output features, connected in series with another fully connected layer with 2048 input features and 1024 output features.
[0064] The text channel alignment module takes an n*1024 feature layer as input from the transformer block and outputs an n*768 feature layer, thus obtaining the first target feature corresponding to the text to be reviewed. The text channel alignment module is structured as a fully connected layer with 1024 input features and 768 output features.
[0065] Step S2: Obtain user-defined review criteria, encode the review criteria into text, and obtain the second target feature.
[0066] Because user standards for content moderation vary across different scenarios, what is compliant in one scenario may be considered a violation in others. Therefore, in this embodiment, users can input custom moderation standards based on the actual scenario, which can then be used to perform moderation reasoning on the data to be reviewed.
[0067] In this embodiment, user-defined review criteria are generally input in text form. Therefore, when user-defined review criteria are received, the review criteria are text-encoded to facilitate importation into a multimodal large model for review reasoning.
[0068] The text encoding of the review standards is also processed using the text encoding module, which is the same as the text encoding method for the text to be reviewed mentioned above, and will not be described again here.
[0069] Step S3: Based on the pre-built large model module, the first target feature and the second target feature are reviewed and inferred, and then the prediction results for content security review are output through the output layer module.
[0070] In this embodiment, the large model module specifically includes three smaller modules: a security expert module, a multi-head attention module, and a feedforward network module.
[0071] The security expert module consists of 24 security expert transformer blocks. Each security expert transformer block comprises a self-attention network with eight attention heads, a content security image expert, and a content security text expert. The self-attention network and the content security image expert are connected sequentially, as are the self-attention network and the content security text expert, while the content security image expert and the content security text expert operate in parallel.
[0072] The content security image expert consists of a fully connected layer with 768 input features and 1536 output features, and another fully connected layer with 1536 input features and 768 output features, connected in series; the content security text expert has the same structure as the content security image expert.
[0073] The first target feature and the second target feature are input into the security expert module, that is, the 256*768 feature layer output by the image channel alignment module and the n*768 feature layer output by the text channel alignment module are input into the security expert module, and the output is (256+n)*768 feature layer.
[0074] The structure of the multi-head attention module is a self-attention network with 8 attention heads. The (256+n)*768 feature layer output by the security expert module is input into the multi-head attention module, and the output attention output matrix is the (256+n)*768 feature layer.
[0075] The feedforward network module consists of a fully connected layer with 768 input features and 1536 output features, and another fully connected layer with 1536 input features and 768 output features, connected in series. A nonlinear transformation is performed on the attention output matrix based on the feedforward network module to obtain the feedforward network output matrix; that is, the input of the feedforward network model is the (256+n)*768 feature layer output by the multi-head attention module, and the output is a (256+n)*768 feature layer.
[0076] Subsequently, the (256+n)*768 feature layer output by the feedforward network module passes through the output layer module to output the logits matrix. The logits matrix output by the output layer module represents the model's original scores or probabilities for different categories. The logits matrix is then processed by the Softmax function to obtain dictionary probability values, and the dictionary category with the highest probability is selected as the final prediction result.
[0077] It should be noted that the multimodal large model mentioned in this embodiment consists of an image encoding module, a text encoding module, a large model module, and an output layer module. After training the multimodal large model with a training set, in actual use, the data to be reviewed and the user-defined review standards can be input into the trained multimodal large language model to output the corresponding prediction results. The prediction results can be used for content security review, that is, to determine whether the prediction results are sensitive words, or to review whether the prediction results contain harmful information. This content security review can be carried out manually or by comparing sensitive words in a database.
[0078] like Figure 3 As shown, in this embodiment, the method for constructing a multimodal large model is as follows:
[0079] a. Acquire massive image and text datasets through web scraping and open-source datasets to create pre-training, fine-tuning, and testing datasets. The pre-training dataset includes image and text pairs, with text describing the images. The fine-tuning training dataset consists of a combination of multiple data types: images, text, and user-defined review criteria labels. Specifically, the first data type is images, text, and user-defined review criteria labels; the second is images and user-defined review criteria labels; and the third is text and user-defined review criteria labels. The testing dataset is identical to the fine-tuning training dataset, consisting of a combination of multiple data types: images, text, and user-defined review criteria labels.
[0080] The pre-training dataset, fine-tuning training dataset, and test dataset are all processed by the image encoding module and the text encoding module before being used to train the multimodal large model, so that each dataset can be used for training the multimodal large model.
[0081] b. Pre-train a large multimodal model using a pre-training dataset, specifically including the following steps:
[0082] The objective function for loss is set using cross-entropy loss to calculate the difference in cross-entropy between the actual next word and the predicted next word, as detailed below:
[0083]
[0084] The vocabulary contains V words. For a given input, the model predicts the probability distribution of the next word as P = [p1, p2, ..., pV], where pi is the probability that the model predicts the i-th word as the next word. The true distribution Q = [q1, q2, ..., qV] is a one-hot encoded vector, where qi is 1, indicating that the next word is the i-th word, and the rest are 0.
[0085] The optimizer is set up using the AdamW optimizer for training. The AdamW optimizer provides a more stable and efficient training method by improving the handling of weight decay.
[0086] c. Fine-tune the multimodal large model using the fine-tuning training dataset, and obtain the optimal multimodal large model through test data. This includes the following steps:
[0087] The loss objective function is set, including the image and text model feature space alignment loss and the model prediction cross-entropy loss; among which, the image and text model feature space alignment loss adopts a generative adversarial network, as detailed below:
[0088]
[0089] Where D is the discriminator, which is composed of an MLP network, x is the feature output by the S21 text encoding module, z is the input image, G is the image encoding module, and p data (x) represents the text feature distribution, p z (z) represents the image distribution; min G max D V(D,G) represents the adversarial process between the image coding module and the discriminator (D), where min and max represent minimizing and maximizing the objective function V, respectively. x~pdata(x) Indicates the distribution p of real text feature data data The expected value of the text feature sample x obtained by sampling is used to calculate the discriminator's ability to judge the real text feature sample; D(x) is the probability of the discriminator judging the real text feature sample x; E z ~p z (Z) represents the expected value of image z obtained by sampling from the prior image distribution pz, which is used by the generator to generate image feature samples. D(G(z)) is the discriminator's judgment probability of the image feature G(z) generated by the generator.
[0090] The optimizer was set up and trained using the AdamW optimizer.
[0091] For example, such as Figure 4 As shown, when the image to be reviewed is an aircraft, the user can input "car accident, fire, weapon" or other custom review criteria, and then import them into the multimodal large model to output the "military weapon" result.
[0092] This embodiment designs a content security-specific multimodal large model network, which achieves higher accuracy, speed, and flexibility. In constructing the multimodal large model, a fine-grained image coding network is built to improve the recognition capability of image content information. Furthermore, security content image expert and security content text expert module networks are designed within the large model module to improve the accuracy of the review process. During the pre-training phase, generative adversarial loss is used to align the embedding vector spaces of image and text modalities, effectively handling the fusion and mutual optimization of different modalities and improving the accuracy of the review. In the fine-tuning training phase, user review criteria are incorporated and fine-tuned together with the fine-tuning data to address the challenges of diverse review criteria and dynamic content.
[0093] Another embodiment of the present invention provides a content security auditing system based on a multimodal large model, which executes the content security auditing method based on a multimodal large model as described above. The functions of each module in the system of this embodiment can be found in the corresponding descriptions in the above methods, and will not be repeated here.
[0094] Another embodiment of the present invention provides an electronic device, Figure 5 A structural block diagram of an electronic device according to an embodiment of the present invention is shown. Figure 5 As shown, the electronic device includes a memory 100 and a processor 200. The memory 100 stores a computer program that can run on the processor 200. When the processor 200 executes the computer program, it implements the content security auditing method based on a multimodal large model as described in the above embodiments. The number of memories 100 and processors 200 can be one or more.
[0095] The electronic device also includes:
[0096] The communication interface 300 is used to communicate with external devices and perform data exchange and transmission.
[0097] If the memory 100, processor 200, and communication interface 300 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc.
[0098] Optionally, in a specific implementation, if the memory 100, processor 200, and communication interface 300 are integrated on a single chip, then the memory 100, processor 200, and communication interface 300 can communicate with each other through an internal interface.
[0099] This invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method provided in this invention.
[0100] This invention also provides a chip, which includes a processor for calling and executing instructions stored in a memory, causing a communication device on which the chip is installed to perform the method provided in this invention.
[0101] This invention also provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute the method provided in this invention.
[0102] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting the Advanced Reduced Instruction Set Computing (RISC) machine (ARM) architecture.
[0103] Further, optionally, the aforementioned memory may include read-only memory and random access memory, and may also include non-volatile random access memory. The memory may be volatile or non-volatile, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0104] In the above embodiments, implementation can be achieved, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the present invention is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.
[0105] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0106] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0107] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope disclosed in the present invention, and these should all be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for content security review based on a multi-modal large model, characterized in that, The method comprises the following steps: acquiring to-be-audited data, the to-be-audited data being images and / or texts; image encoding and / or text encoding are performed on the to-be-audited data based on an image encoding module and / or a text encoding module, to obtain first target features; acquiring user-defined auditing standards, text encoding is performed on the auditing standards based on the text encoding module, to obtain second target features; auditing reasoning is performed on the first target features and the second target features based on a pre-constructed large model module, and a prediction result for content security auditing is output through an output layer module, comprising: the first target features and the second target features are imported into a security expert module for feature layer merging, and output is a (256+n)*768 feature layer; wherein the security expert module comprises 24 security expert transformer blocks, each security expert transformer block comprising a self-attention network, a content security image expert and a content security text expert; wherein the self-attention network and the content security image expert are in series, the self-attention network and the content security text expert are in series, and the content security image expert and the content security text expert are in parallel; the (256+n)*768 feature layer is input into the self-attention network, to obtain an attention output matrix; a non-linear transformation is performed on the attention output matrix based on a feedforward network module, to output a (256+n)*768 feature layer, and obtain a feedforward network output matrix; a linear layer mapping is performed on the feedforward network output matrix through the output layer module, to output a logits matrix, and the prediction result is output according to the logits matrix, the prediction result being used for content security auditing. 2.The method of claim 1, wherein, Further comprising: acquiring a data set, the data set comprising a pre-training data set, a fine-tuning training data set and a test data set; wherein the pre-training data set comprises data pairs of images and texts; the fine-tuning training data set is a combination of multiple types of data in images, texts and user-defined auditing standard labels; the test data set is a combination of multiple types of data in images, texts and user-defined auditing standard labels; training a multi-modal large model based on the data set, to obtain an optimal multi-modal large model, the optimal multi-modal large model being used for auditing reasoning on the to-be-audited data and the auditing standards, and outputting the prediction result; the multi-modal large model comprising the image encoding module, the text encoding module, the large model module and the output layer module. 3.The method of claim 1, wherein, the image encoding and / or text encoding performed on the to-be-audited data based on the image encoding module and / or the text encoding module, to obtain the first target features, comprising: in the case where the to-be-audited data is images, processing the images based on a convolution downsampling model, to output a 64*64*256 first feature layer; The first feature layer outputs a second feature layer of 64*64*256 through a convolutional position-aware transformer module composed of 12 convolutional position-aware transformer blocks in series; The second feature layer is processed through an information compression convolutional module to output a third feature layer of 16*16*1024; The third feature layer is converted into a 256*1024 feature layer and then input into an image channel alignment model to output a feature layer of 256*768, thereby obtaining the first target feature corresponding to the image. 4.The method of claim 1, wherein, The image encoding module and / or the text encoding module encode the to-be-audited data to obtain the first target feature, including: In the case that the to-be-audited data is text, the text is segmented into multiple subwords, and the multiple subwords are mapped into multiple unique codes based on a pre-constructed vocabulary; The multiple unique codes are mapped into multiple high-dimensional space vectors with a dimension of 1024 based on a text embedding model and a position embedding module, thereby obtaining high-dimensional vectors of n*1024; The high-dimensional vectors of n*1024 are input into a transformer block module to output a feature layer of n*1024; The feature layer of n*1024 is output through a text channel alignment module to obtain the first target feature corresponding to the text. 5.The method of claim 1, wherein, The content security image expert is composed of a first fully connected layer and a second fully connected layer in series, the input feature number of the first fully connected layer is 768, the output feature number is 1536, the input feature number of the second fully connected layer is 1536, and the output feature number is 768. The content security text expert and the content security image expert have the same structure.
6. A multi-modal large model-based content security review system, characterized in that, The method for content security auditing based on a multi-modal large model according to any one of claims 1-5 is executed.
7. An electronic device, comprising: It includes: A processor and a memory, the memory stores instructions, the instructions are loaded and executed by the processor to implement the method for content security auditing based on a multi-modal large model according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method for content security auditing based on a multi-modal large model according to any one of claims 1-5.
Citation Information
Patent Citations
Content auditing method, training method of content auditing model and related device
CN115565038A
Combined vision and language learning models for automated medical reports generation
US20230386646A1