Multi-granularity aigc text detection method and related device
By constructing a multi-granularity AIGC text detection method and utilizing a cross-attention network with bidirectional attention and gated recurrent unit layers, the problem of insufficient accuracy in existing AIGC detection is solved, achieving efficient and accurate detection of LLM-generated content and improving the quality of the Internet information ecosystem.
Patent Information
- Application Number
- CN202411789371.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-12-06
AI Technical Summary
Existing AIGC detection methods are inaccurate and have limited functionality in black-box testing. In particular, they are difficult to effectively control the quality of content generated by LLMs, leading to the circulation of low-quality content on the Internet and affecting the information ecosystem.
A multi-granularity AIGC text detection method is adopted. By constructing downstream networks for text AIGC detection at the document and sentence granularities, a bidirectional attention structure encoder model and a bidirectional gated recurrent unit layer are used, combined with a cross-attention layer to separate and fuse text semantic features, thereby achieving efficient detection of LLM-generated content.
It improves the accuracy of AIGC detection, ensures the purity and coherence of text semantics, can accurately identify AIGC content at the document and sentence granularity, and enhances the quality control capability of LLM-generated content.
Smart Images

Figure CN119721048B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of AIGC detection, deep learning, and big data technology, and in particular to a multi-granularity AIGC text detection method and related apparatus. Background Technology
[0002] Since OpenAI released ChatGPT, the LLM (Artificial Intelligence Generated Content) field has experienced explosive growth in recent years, fueling the rapid rise of AI-generated content (AIGC) technologies such as text-to-text, text-to-image, image-to-text, and image-to-image. Automatic commenting bots, text-to-image bots, and text-to-video AI have become incredibly popular and frequently trend on social media. Against this backdrop, LLMs have borne the weight of people's imagination and expectations for artificial intelligence. In practical applications, LLM-based AI tools have provided convenience in terms of work efficiency, but this has also led to the problem of LLM misuse.
[0003] The main manifestation of LLMs abuse lies in the use of LLMs tools, still in their optimization and development stage, to quickly generate shoddy content based on the principles of convenience and speed, aiming to pass off inferior content as high-quality content. No modification or control is made to the quality of the generated content, allowing this low-quality content to circulate in various fields and systems, mixing with real information, crowding out the ecosystem of high-quality content, and in the long run, even affecting the entire knowledge content ecosystem of the internet and damaging the credibility of any information. Therefore, a text AIGC detection method based on big data technology is needed to achieve efficient detection and identification of LLMs-generated content.
[0004] Currently, the main AIGC detection methods are divided into two categories: black-box detection and white-box detection. For white-box detection, in this scenario, the detector has complete access to LLMs and can control the model's generation behavior to achieve traceability. This is usually achieved by adding text watermarks. Therefore, white-box testing methods are not suitable for third parties that are not LLM research institutions or LLM open-source providers, and identifying AIGC through embedded watermarks is still in the exploratory stage. For black-box testing, it mainly learns the language patterns of LLMs through a large amount of data and a reasonable model structure. Therefore, it has stricter requirements for data and models. Existing black-box testing methods still have room for improvement in AIGC detection accuracy and have limited functionality. Summary of the Invention
[0005] To address the aforementioned issues, this invention proposes a multi-granularity AIGC text detection method and related apparatus. It collects high-quality open-source text data using a black-box testing approach, and enhances the detection capability of the single encoder model by constructing downstream AIGC detection networks at both the document and sentence granularities, thereby improving the AIGC detection accuracy.
[0006] In a first aspect, the present invention proposes a multi-granularity text AIGC detection method based on semantic features, the method comprising the following steps:
[0007] Obtain source text data, which consists of multiple texts, and obtain the text to be detected after preprocessing.
[0008] The text to be detected is processed by a word segmenter to map characters, resulting in a text token ID sequence with classification marker and separator character IDs, and the position of the period token ID is recorded;
[0009] The text token ID sequence is passed through an encoder model based on a bidirectional attention structure to obtain a text semantic representation vector. The token vectors corresponding to the classification marker and separator characters are separated from the text semantic representation vector to obtain a text pure semantic representation vector.
[0010] By combining the classification tag vector and the text pure semantic representation vector with the text subject detection model, the document-level text AIGC detection results are obtained.
[0011] By combining the classification tag vector, the text pure semantic representation vector, and the position of the period token ID with the text sentence discrimination model, the text AIGC detection results at the sentence level are obtained.
[0012] The document-level AIGC detection results and the statement-level AIGC detection results are integrated to obtain the multi-granularity AIGC text detection results of the text to be detected.
[0013] The text subject detection model DetectAIGC-Doc consists of a global semantic information coordination module, a document semantic representation interaction module, and a semantic information fusion decision module. The global semantic information coordination module consists of a linear layer and an activation function. The document semantic representation interaction module consists of a bidirectional gated recurrent unit layer, a normalization layer, and an activation function. The semantic information fusion decision module consists of a cross-attention layer, a Dorpout layer, and a linear layer.
[0014] The text statement discrimination model DetectAIGC-Sen consists of a global semantic information coordination module, a document statement representation extraction module, and a statement information fusion decision module. The global semantic information coordination module consists of a linear layer and an activation function. The document statement representation extraction module consists of a bidirectional gated recurrent unit layer. The statement information fusion decision module consists of a bidirectional gated recurrent unit layer and a linear layer.
[0015] In a second aspect, the present invention also provides a multi-granularity AIGC text detection device, the device comprising:
[0016] The acquisition unit is configured to acquire source text data, which consists of multiple texts and is preprocessed to obtain the text to be detected.
[0017] The location extraction unit is configured to perform character mapping on the text to be detected through a word segmenter to obtain a text token ID sequence with classification marker and separator character ID, and record the position of the period token ID;
[0018] The feature extraction unit is configured to pass the text token id sequence through an encoder model based on a bidirectional attention structure to obtain a text semantic representation vector, and to separate the token vectors corresponding to the classification marker and separator characters in the text semantic representation vector to obtain a text pure semantic representation vector;
[0019] The first detection unit is configured to pass the classification label vector and the text pure semantic representation vector through the text subject detection model to obtain the document-level text AIGC detection result;
[0020] The second detection unit is configured to use a text sentence discrimination model to obtain text AIGC detection results at the sentence level by passing the classification label vector, the text pure semantic representation vector and the position of the period token id.
[0021] The third detection unit is configured to integrate the document-level text AIGC detection results and the statement-level text AIGC detection results to obtain the multi-granularity AIGC text detection results of the text to be detected.
[0022] In a third aspect, the present invention also provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the multi-granularity AIGC text detection method as described in the first aspect of the present invention.
[0023] In a fourth aspect, the present invention also provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and the computer program, when executed by a processor, implements the multi-granularity AIGC text detection method as described in the first aspect of the present invention.
[0024] The beneficial effects of this invention are:
[0025] 1. This invention ensures the semantic purity of the data itself through specific preprocessing operations before the data stream is input into the model, preventing erroneous words and distributions from interfering with the model's judgment in the latent semantic space. At the same time, the truncation method based on punctuation marks can ensure that the semantics of the text part still have coherence to a certain extent.
[0026] 2. The present invention employs the text subject detection model DetectAIGC-Doc, which enables the text semantic representation vector to be divided into a global semantic vector and a pure text semantic vector. The global semantic vector provides a coarse-grained AIGC overall feature weight vector for the entire sentence, while the pure text semantic vector achieves joint interaction of each token on a long sequence through a bidirectional gating network to obtain a fine-grained semantic feature distribution vector. Finally, the interaction network achieves the fusion of coarse-grained semantic weights and fine-grained semantic features, ensuring that the model accurately judges the text AIGC detection at the document granularity.
[0027] 3. The present invention employs the text sentence discrimination model DetectAIGC-Sen, which enables the text semantic representation vector to be divided into a global semantic vector and a pure text semantic vector. By using the period as the basis for semantic segmentation, and extracting the vector representing the sentence semantic feature information from the position corresponding to the period after passing through a bidirectional gating network in the pure text semantic vector, the AIGC overall feature weight vector provided by the global semantic vector is used as the initial hidden state. The second bidirectional gating network controls the semantic matching relationship between sentences, accurately grasps the semantic interest points, and achieves accurate detection of text AIGC at the sentence level. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 A schematic diagram illustrating an exemplary system architecture for applying the technical solutions of the embodiments of this application;
[0030] Figure 2This is a flowchart of the multi-granularity AIGC text detection method according to an embodiment of the present invention;
[0031] Figure 3 This is a schematic diagram of the text subject detection model structure according to an embodiment of the present invention;
[0032] Figure 4 This is a schematic diagram of the text statement discrimination model structure according to an embodiment of the present invention;
[0033] Figure 5 This is a network flowchart for multi-granularity AIGC text detection according to an embodiment of the present invention;
[0034] Figure 6 This is a schematic diagram of the structure of the multi-granularity AIGC text detection device according to an embodiment of the present invention. Detailed Implementation
[0035] 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.
[0036] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0037] In natural language processing, a token is typically considered the smallest unit of text. In English, a token can be a word or punctuation mark; in Chinese, tokens are usually represented by characters or words. Tokens are fundamental for models to process and understand text.
[0038] Token ID: Each token is associated with a unique numeric ID, which is used to distinguish different tokens in the model. The model learns to map text to these numeric IDs in order to encode and decode new text.
[0039] Vocabulary: The vocabulary is a mapping table pre-built by the model that maps each possible token to a unique numeric ID. When the input text is split into tokens, the model looks up the corresponding ID of each token in the vocabulary and uses these IDs to represent the input text.
[0040] In some embodiments, the multi-granularity text AIGC detection method of the present invention can be applied to scenarios where computer devices and servers coexist, wherein the computer devices communicate with the server via a network. The computer devices can be, but are not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server.
[0041] Figure 1 A schematic diagram illustrating an exemplary system architecture to which the technical solutions of the embodiments of this application can be applied is shown, such as... Figure 1 As shown, the system architecture may include terminal device 101 and server 102.
[0042] Terminal device 101 is connected to server 102 via a network, which serves as the medium for providing a communication link between terminal device 101 and server 102. The network can include various connection types, such as wired or wireless communication links or fiber optic cables. Terminal device 101 and server 102 can be connected directly or indirectly via wired or wireless communication, without limitation.
[0043] Terminal device 101 can be a smartphone, tablet computer, smart TV, desktop computer, in-vehicle computer, or portable computer, but is not limited to these. Terminal device 101 can refer to one of multiple terminal devices; this embodiment only uses terminal device 101 as an example. Those skilled in the art will understand that the number of terminal devices can be more or less. For example, there may be only one terminal device, or there may be dozens or hundreds, or even more, in which case other terminal devices are also included in the implementation environment. This embodiment does not limit the number or type of terminal devices.
[0044] Server 102 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0045] In some embodiments, terminal device 101 acquires source text data, which may be text determined based on user input from terminal device 101. The source text data consists of multiple texts, which are preprocessed to obtain the text to be detected. The text to be detected is then sent to server 102 via a network. The server detects the text to be detected and determines the multi-granularity AIGC text detection result of the text to be detected. In other embodiments, terminal device 101 may also acquire source text data and directly detect the text to be detected within it to determine the multi-granularity AIGC text detection result of the source text data.
[0046] Figure 2 A flowchart of a multi-granularity AIGC text detection method according to an embodiment of this application is shown. This multi-granularity AIGC text detection method can be executed by a server, which may be... Figure 1 Server 102 is shown in the image. (Refer to...) Figure 2 As shown, text detection methods include:
[0047] 101. Obtain source text data, which consists of multiple texts and is preprocessed to obtain the text to be detected;
[0048] In some embodiments, the source text data can be a written form of language, and the text can be an article, sentence, paragraph, or phrase, etc. The text can be in English, Chinese, or French, etc., and this application embodiment does not limit it.
[0049] In some embodiments, in order to better ensure the semantic purity of the data itself and prevent incorrect words and distributions from interfering with the model's judgment in the latent semantic space, this embodiment performs word spelling correction on each text in the source text data to obtain the first text to be detected corresponding to each text. This method can prevent special data from interfering with the semantic representation of the text and ensure that the subsequent model can perform AIGC detection on the text from a purely semantic perspective.
[0050] In some embodiments, to ensure that the semantics of the text portion still retain a certain degree of coherence, this embodiment records the position of the period in the first text to be detected. The first text to be detected is then judged according to the maximum length. If the position of the end of the period sequence in the first text to be detected is less than the maximum length limit, no truncation is performed. If the position of the end of the period sequence is greater than the maximum length limit, the nearest period position less than the maximum length limit is found and truncated to obtain the second text to be detected. This punctuation-based truncation method ensures that the semantics of the text portion still retains coherence.
[0051] It should be noted that recording the position of the period in the first text to be detected can be achieved in Python through regular expression matching. That is, using regular expressions to process the original sentence (string) and record the position of all periods. This method can segment the text according to preset rules, ensuring the semantic coherence of the text.
[0052] It is understood that the text to be detected, the first text to be detected, and the second text to be detected can all be used as inputs for subsequent steps.
[0053] 102. The text to be detected is mapped to characters by a word segmenter to obtain a text token ID sequence with classification marker and separator character IDs, and the position of the period token ID is recorded;
[0054] In some embodiments, a tokenizer of a pre-trained model such as BERT or RoBERTa can be used to encode the text to be detected, add a classification tag [CLS] and a separator tag [SEP] to the text to be detected, and convert the text into a corresponding token ID sequence.
[0055] For example, suppose we have a text to be detected, "I am an AIGC text", and we use a BERT model whose vocabulary already contains the IDs of these tokens. For example, suppose the text to be detected is "I am an AIGC text"; add a classification tag [CLS] and a delimiter tag [SEP] to the text to be detected: [CLS] I am an AIGC text [SEP]; segment the text to be detected into tokens: [CLS], I, is, a, AIGC, text [SEP]. These tokens can be words, subwords, characters, etc., depending on the segmentation strategy or model used. In English, a token can be a word or punctuation mark; in Chinese, tokens are usually in units of characters or words. Tokens are the foundation for the model to process and understand text; find the id of each token; suppose [CLS](101), I(1000), is(1234), a(2345), AIGC(2000), text(3500)[SEP](102); therefore, the final token id sequence is: [101,1000,1234,2345,2000,3500,102].
[0056] It is important to understand that the token IDs mentioned above (such as 101, 1000, 1234, 2345, 2000, 3500, 102, etc.) are just examples. The actual token IDs will vary depending on the specific tokenizer model and its vocabulary used.
[0057] 103. Obtain the text semantic representation vector by passing the text token id sequence through an encoder model based on a bidirectional attention structure, and separate the token vectors corresponding to the classification marker and separator characters in the text semantic representation vector to obtain the text pure semantic representation vector;
[0058] 104. By passing the classification label vector and the text pure semantic representation vector through the text subject detection model, the document-level text AIGC detection results are obtained;
[0059] In some embodiments, such as Figure 3 As shown, the text subject detection model DetectAIGC-Doc includes a global semantic information coordination module, a document semantic representation interaction module, and a semantic information fusion decision module. The global semantic information coordination module includes a linear layer and a Tanh activation function. The document semantic representation interaction module includes a bidirectional gated recurrent unit layer, a normalization layer, and a SwiGLU activation function. The semantic information fusion decision module includes a cross-attention layer, a Dropout layer, a linear layer, and a Softmax function.
[0060] In some embodiments, the process of obtaining document-level text AIGC detection results includes:
[0061] The classification label vector is input into the global semantic information coordination module, and after passing through the linear layer, the latent semantic space is transformed. The semantic space is then constrained to a suitable range of semantic weights by the Tanh activation function to obtain the first global semantic information vector.
[0062] The plain text semantic vector is input into the document semantic representation interaction module. The bidirectional gated recurrent unit layer realizes strong interaction of contextual semantic sequence information, captures long-distance semantic distribution relationship, and then the latent semantic space is normalized through the normalization layer to retain abstract pure semantic features. Finally, it is input into the SwiGLU activation function, and the AIGC nonlinear semantic features are separated through a unique gating mechanism to obtain the local semantic interaction vector of the document.
[0063] The first global semantic information vector and the local semantic interaction vector of the document are input into the semantic information fusion decision module. The interaction is performed by the cross attention layer to obtain the AIGC feature interaction result vector. The AIGC feature space is integrated and compressed into the classifiable threshold space by the Dropout layer, the linear layer and the Softmax layer to obtain the document-granular text AIGC detection result.
[0064] In some embodiments, the interaction by the cross-attention layer to obtain the AIGC feature interaction result vector includes:
[0065] Multiply the first global semantic information vector by the Q weight matrix to obtain the Q matrix;
[0066] Multiply the local semantic interaction vector of the document by the K-weight matrix to obtain the K matrix;
[0067] Multiply the local semantic interaction vector of the document by the V weight matrix to obtain the V matrix;
[0068] The Q, K, and V matrices are interacted according to the cross-attention formula to obtain the AIGC feature interaction result vector.
[0069] For example, the calculation formula for document-level text AIGC detection is as follows:
[0070]
[0071] V Pure =SwiGLU(LayerNorm(BiGRU(V T V T )))
[0072] O Doc =SoftMax(Linear(Dropout(Cross-Attn(W q ·V Doc W k ·V Pure W v ·V Pure ))))
[0073] Among them, V Doc This represents the first global semantic information vector. V represents the classification label vector, Linear represents the linear layer, Tanh represents the tanh activation function, and V Pure V represents the local semantic interaction vector of a document, SwiGLU represents the SwiGLU activation function, LayerNorm represents the normalization layer, BiGRU represents the bidirectional gated recurrent unit layer, and V T Represents a plain text semantic vector, O Doc This represents the document-level text AIGC detection result, where SoftMax represents the softmax function, Cross-Attn represents the cross-attention layer, and W... q Let W represent the q-weight matrix. k Let W represent the k-weight matrix. v V represents the weight matrix v. Pure This represents a local semantic interaction vector within a document.
[0074] 105. By combining the classification tag vector, the text pure semantic representation vector, and the position of the period token id through a text sentence discrimination model, the text AIGC detection results at the sentence level are obtained.
[0075] In some embodiments, such as Figure 4 As shown, the text statement discrimination model DetectAIGC-Sen includes a global semantic information coordination module, a document statement representation extraction module, and a statement information fusion decision module. The global semantic information coordination module includes a linear layer and a Tanh activation function. The document statement representation extraction module includes a bidirectional gated recurrent unit layer. The statement information fusion decision module includes a bidirectional gated recurrent unit layer and a linear layer.
[0076] In some embodiments, the process of obtaining sentence-level text AIGC detection results includes:
[0077] The classification label vector is input into the global semantic information coordination module, and after passing through the linear layer, the latent semantic space is transformed. The semantic space is then constrained to a suitable range of semantic weights by the Tanh activation function to obtain the second global semantic information vector.
[0078] The plain text semantic vector is input into the document sentence representation extraction module. The bidirectional gated loop unit layer realizes strong interaction of context semantic sequence information. Then, the corresponding sentence vector is extracted according to the position of the period token id to obtain the document sentence semantic representation vector.
[0079] The second global semantic information vector and the document sentence semantic representation vector are input into the sentence information fusion decision module. The second global semantic information vector serves as the initial hidden layer state of the BiGRU network, providing an interactive semantic information pool. Then, each sub-sentence vector in the document sentence semantic representation vector interacts with the information pool in the order of the sentences to determine the AIGC semantic feature degree in the sentence. Finally, a linear layer constrains the AIGC feature space to the classifiable threshold space to obtain the sentence-level text AIGC detection result.
[0080] In this embodiment of the invention, the BiGRU layer enables strong interaction of contextual semantic sequence information, captures long-distance semantic distribution relationships, and the layer normalization realizes the normalization of the latent semantic space, eliminates feature offset and unique distribution interference of single text, and retains abstract pure semantic features.
[0081] For example, the calculation formula for the sentence-level text AIGC detection process is as follows:
[0082]
[0083] O Sen =BiGRU(V SenV Period )
[0084] Among them, V Sen Represents a global semantic information vector. P represents the classification label vector. Period V indicates the position of the period. Period This represents the semantic representation vector of a document's statements.
[0085] In this embodiment of the invention, the classification label vectors in steps 104 and 105 can be the same vector or different vectors. For example, when the encoder model based on the bidirectional attention structure is jointly trained with the text subject detection model and the text sentence discrimination model, the classification label vectors can be the same. When the encoder model based on the bidirectional attention structure is jointly trained with the text subject detection model and the text sentence discrimination model respectively, the encoder model based on the bidirectional attention structure can be divided into two sets of model parameters. One set of model parameters can be adapted to the text subject detection task, and the other set of model parameters can be adapted to the text sentence discrimination task. Therefore, different classification label vectors can be output, which can better adapt to the text subject detection model and the text sentence discrimination model.
[0086] 106. Integrate the document-level text AIGC detection results and the statement-level text AIGC detection results to obtain the multi-granularity AIGC text detection results of the text to be detected.
[0087] In this embodiment of the invention, integrating the text AIGC detection results at the document granularity and sentence granularity can fully utilize the complementarity of text detection information at different granularities. By fusing this information, more complete and accurate detection results can be obtained.
[0088] To better illustrate the text detection process of this invention, Figure 5For example, the text to be tested is truncated according to preset rules and encoded by a word segmenter. The position of the token ID corresponding to the period is recorded. The text token ID sequence is passed through an encoder model based on a bidirectional attention structure to obtain a text semantic representation vector. The token vectors corresponding to the classification marker and the separator character are separated from the text semantic representation vector to obtain a text pure semantic representation vector. First, the classification marker vector and the text pure semantic representation vector are passed through a text subject detection model based on a BiGRU network and a Cross-Attention network to obtain a document-level text AIGC detection result. Then, the classification marker vector, the text pure semantic representation vector, and the position of the period token ID are passed through a text sentence discrimination model based on a BiGRU network to obtain a sentence-level text AIGC detection result. Finally, the document-level text AIGC detection result and the sentence-level text AIGC detection result are integrated to obtain a multi-granularity AIGC text detection result of the text to be detected.
[0089] This invention, starting from the perspective of semantic feature interaction, fully utilizes global and local information through a downstream network composed of strong sequence networks, activation functions, and cross-attention interaction networks to accurately capture the linguistic features of non-verbal AI and achieve accurate recognition of text AIGC.
[0090] Figure 6 A block diagram of a multi-granularity AIGC text detection apparatus according to an embodiment of this application is shown, with reference to Figure 6 As shown, it includes:
[0091] The acquisition unit is configured to acquire source text data, which consists of multiple texts and is preprocessed to obtain the text to be detected.
[0092] The location extraction unit is configured to perform character mapping on the text to be detected through a word segmenter to obtain a text token ID sequence with classification marker and separator character ID, and record the position of the period token ID;
[0093] The feature extraction unit is configured to pass the text token id sequence through an encoder model based on a bidirectional attention structure to obtain a text semantic representation vector, and to separate the token vectors corresponding to the classification marker and separator characters in the text semantic representation vector to obtain a text pure semantic representation vector;
[0094] The first detection unit is configured to pass the classification label vector and the text pure semantic representation vector through the text subject detection model to obtain the document-level text AIGC detection result;
[0095] The second detection unit is configured to use a text sentence discrimination model to obtain text AIGC detection results at the sentence level by passing the classification label vector, the text pure semantic representation vector and the position of the period token id.
[0096] The third detection unit is configured to integrate the document-level text AIGC detection results and the statement-level text AIGC detection results to obtain the multi-granularity AIGC text detection results of the text to be detected.
[0097] In this embodiment of the invention, a computer device is proposed, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the multi-granularity AIGC text detection method.
[0098] In this embodiment of the invention, a computer-readable storage medium is provided, characterized in that a computer program is stored on the computer-readable storage medium, and the computer program implements the multi-granularity AIGC text detection method when executed by a processor.
[0099] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. The transmitted data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0100] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include ROM, RAM, disk, or optical disk, etc.
[0101] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A multi-granularity AIGC text detection method, characterized in that, Includes the following steps: Obtain source text data, which consists of multiple texts, and obtain the text to be detected after preprocessing. The text to be detected is processed by a word segmenter to map characters, resulting in a text token ID sequence with classification marker and separator character IDs, and the position of the period token ID is recorded; The text token ID sequence is passed through an encoder model based on a bidirectional attention structure to obtain a text semantic representation vector. The token vectors corresponding to the classification marker and separator characters are separated from the text semantic representation vector to obtain a text pure semantic representation vector. The classification label vector and the pure semantic representation vector of the text are passed through the text subject detection model to obtain the document-level text AIGC detection result. The text subject detection model includes a global semantic information coordination module, a document semantic representation interaction module, and a semantic information fusion decision module. The global semantic information coordination module includes a linear layer and a Tanh activation function. The document semantic representation interaction module includes a bidirectional gated recurrent unit layer, a normalization layer, and a SwiGLU activation function. The semantic information fusion decision module includes a cross-attention layer, a Dropout layer, a linear layer, and a Softmax function. The classification label vector, the text pure semantic representation vector, and the position of the period token ID are used to obtain the text AIGC detection result at the sentence level through a text sentence discrimination model. The text sentence discrimination model includes a global semantic information coordination module, a document sentence representation extraction module, and a sentence information fusion decision module. The global semantic information coordination module includes a linear layer and a Tanh activation function. The document sentence representation extraction module includes a bidirectional gated recurrent unit layer. The sentence information fusion decision module includes a bidirectional gated recurrent unit layer and a linear layer. The document-level AIGC detection results and the statement-level AIGC detection results are integrated to obtain the multi-granularity AIGC text detection results of the text to be detected.
2. The multi-granularity AIGC text detection method according to claim 1, characterized in that, The preprocessing of the source text data includes: Each text in the source text data is subjected to spelling correction to obtain the first text to be detected corresponding to each text; Record the position of the period in the first text to be detected. Judge the first text to be detected according to the maximum length. If the position of the end of the period sequence in the first text to be detected is less than the maximum length limit, no truncation is performed. If the position of the end of the period sequence is greater than the maximum length limit, find the nearest period position that is less than the maximum length limit and truncate it to obtain the second text to be detected.
3. The multi-granularity AIGC text detection method according to claim 1, characterized in that, The process of obtaining document-level text AIGC detection results includes: The classification label vector is input into the global semantic information coordination module, and after passing through the linear layer, the latent semantic space is transformed. The semantic space is then constrained to a suitable range of semantic weights by the Tanh activation function to obtain the first global semantic information vector. The plain text semantic vector is input into the document semantic representation interaction module. The bidirectional gated recurrent unit layer realizes strong interaction of contextual semantic sequence information, captures long-distance semantic distribution relationship, and then the latent semantic space is normalized through the normalization layer to retain abstract pure semantic features. Finally, it is input into the SwiGLU activation function, and the AIGC nonlinear semantic features are separated through a unique gating mechanism to obtain the local semantic interaction vector of the document. The first global semantic information vector and the local semantic interaction vector of the document are input into the semantic information fusion decision module. The interaction is performed by the cross attention layer to obtain the AIGC feature interaction result vector. The AIGC feature space is integrated and compressed into the classifiable threshold space by the Dropout layer, the linear layer and the Softmax layer to obtain the document-granular text AIGC detection result.
4. The multi-granularity AIGC text detection method according to claim 3, characterized in that, The AIGC feature interaction result vector obtained through the interaction via the cross-attention layer includes: Multiply the first global semantic information vector by the Q weight matrix to obtain the Q matrix; Multiply the local semantic interaction vector of the document by the K-weight matrix to obtain the K matrix; Multiply the local semantic interaction vector of the document by the V weight matrix to obtain the V matrix; The Q, K, and V matrices are interacted according to the cross-attention formula to obtain the AIGC feature interaction result vector.
5. The multi-granularity AIGC text detection method according to claim 1, characterized in that, The process of obtaining sentence-level text AIGC detection results includes: The classification label vector is input into the global semantic information coordination module, and after passing through the linear layer, the latent semantic space is transformed. The semantic space is then constrained to a suitable range of semantic weights by the Tanh activation function to obtain the second global semantic information vector. The plain text semantic vector is input into the document sentence representation extraction module. The bidirectional gated loop unit layer realizes strong interaction of context semantic sequence information. Then, the corresponding sentence vector is extracted according to the position of the period token id to obtain the document sentence semantic representation vector. The second global semantic information vector and the document sentence semantic representation vector are input into the sentence information fusion decision module. The second global semantic information vector serves as the initial hidden layer state of the BiGRU network, providing an interactive semantic information pool. Then, each sub-sentence vector in the document sentence semantic representation vector interacts with the information pool in the order of the sentences to determine the AIGC semantic feature degree in the sentence. Finally, a linear layer constrains the AIGC feature space to the classifiable threshold space to obtain the sentence-level text AIGC detection result.
6. A multi-granularity AIGC text detection device, characterized in that, The device includes: The acquisition unit is configured to acquire source text data, which consists of multiple texts and is preprocessed to obtain the text to be detected. The location extraction unit is configured to perform character mapping on the text to be detected through a word segmenter to obtain a text token ID sequence with classification marker and separator character ID, and record the position of the period token ID; The feature extraction unit is configured to pass the text token id sequence through an encoder model based on a bidirectional attention structure to obtain a text semantic representation vector, and to separate the token vectors corresponding to the classification marker and separator characters in the text semantic representation vector to obtain a text pure semantic representation vector; The first detection unit is configured to pass the classification label vector and the text pure semantic representation vector through the text subject detection model to obtain the document-level text AIGC detection result. The text subject detection model includes a global semantic information coordination module, a document semantic representation interaction module, and a semantic information fusion decision module. The global semantic information coordination module includes a linear layer and a Tanh activation function. The document semantic representation interaction module includes a bidirectional gated recurrent unit layer, a normalization layer, and a SwiGLU activation function. The semantic information fusion decision module includes a cross-attention layer, a Dropout layer, a linear layer, and a Softmax function. The second detection unit is configured to use a text sentence discrimination model to obtain text AIGC detection results at the sentence level by passing the classification label vector, the text pure semantic representation vector, and the position of the period token id. The text sentence discrimination model includes a global semantic information coordination module, a document sentence representation extraction module, and a sentence information fusion decision module. The global semantic information coordination module includes a linear layer and a Tanh activation function. The document sentence representation extraction module includes a bidirectional gated recurrent unit layer. The sentence information fusion decision module includes a bidirectional gated recurrent unit layer and a linear layer. The third detection unit is configured to integrate the document-level text AIGC detection results and the statement-level text AIGC detection results to obtain the multi-granularity AIGC text detection results of the text to be detected.
7. A computer device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the multi-granularity AIGC text detection method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the multi-granularity AIGC text detection method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Semantic matching method and device based on multi-granularity and multi-channel neural network and computer equipment
CN112434514A
Architectural design auxiliary system and method based on artificial intelligence
CN118296698A