Multi-granularity AIGC text detection method and related device

By building a multi-grained text AIGC detection network, using a bidirectional attention structure and a bidirectional gating cyclic unit layer, the shortcomings in the existing AIGC detection methods in terms of accuracy and functional diversity are solved, and efficient identification of the generation of low-quality content is achieved.

CN119721048AActive Publication Date: 2025-03-28CHONGQING UNIV OF POSTS & TELECOMM
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411789371.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-28
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

The existing AIGC detection methods still have room for improvement in accuracy and functional diversity, especially the black box testing methods are insufficient in identifying the generated low-quality content.

Method used

A multi-grained AIGC text detection method is proposed. By constructing a text AIGC detection downstream network with document granularity and statement granularity, the encoder model based on bidirectional attention structure and the bidirectional gating recurrent unit layer are used, combined with the global semantic information coordination module and the semantic information fusion decision module, the multi-grained analysis of text AIGC detection is realized.

Benefits of technology

It improves the accuracy of AIGC detection, can accurately identify generated low-quality content on the granularity of documents and statements, and enhances the diversity and effectiveness of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119721048A_ABST
    Figure CN119721048A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of deep learning, and relates to a multi-granularity AIGC text detection method and related device.The method comprises the steps that character mapping is conducted on a to-be-detected text through a word segmentation device, a text token id sequence is obtained, and the position of a full stop token id is recorded; enabling the text token id sequence to pass through an encoder model based on a bidirectional attention structure to obtain a text semantic representation vector, and obtaining a text pure semantic representation vector; enabling the classification mark vector and the text pure semantic representation vector to pass through a text main body detection model to obtain a text AIGC detection result of the document granularity; enabling the positions of the separation mark vector, the text pure semantic representation vector and the full stop id to pass through a text statement discrimination model to obtain a text AIGC detection result of statement granularity; and integrating to obtain a multi-granularity AIGC text detection result of the to-be-detected text. From the perspective of semantic feature interaction, global information and local information are fully utilized through a downstream network composed of a strong sequence network, an activation function, a cross attention interaction network and the like, non-spoken AI language features are accurately captured, and text AIGC accurate recognition is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present 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 devices. Background Art

[0002] Since OpenAI released ChatGPT, the field of LLMs has developed explosively in recent years, contributing to the rapid rise of artificial intelligence generated content technologies such as "text to text", "text to image", "image to text" and "image to text" (Artificial Intelligence Generated Content, AIGC). Automatic comment robots, text to image robots, and text to video AI on the Internet continue to be popular and frequently searched. In this context, LLMs carry all people's imagination and expectations of artificial intelligence. In actual application scenarios, AI tools based on LLMs provide convenience in work efficiency, but this also brings about the problem of LLMs abuse.

[0003] The main manifestation of LLMs abuse is that based on the idea of ​​convenience and speed, LLMs tools, which are still in the optimization and development stage, are used to quickly generate shoddy content in order to achieve the purpose of filling the gap, without any modification or control of the quality and content of the generated content, causing such low-quality content to circulate in various fields and systems, mixed with real information, and squeeze out the ecological space of high-quality content. In the long run, it may even affect the knowledge content ecology of the entire Internet and damage 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] At present, 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 full access to LLMs and can control the generation behavior of the model to achieve traceability. It is usually controlled by adding text watermarks. Therefore, for third parties that are not LLMs research institutions or LLMs open source parties, white-box testing methods are not applicable, and the identification of AIGC by embedding watermarks is still in the exploratory stage; for black-box testing, the language pattern of LLMs is mainly learned through a large amount of data and a reasonable model structure, so the requirements for data and models are relatively strict. The existing black-box testing methods still have room for improvement in AIGC detection accuracy and have a single function. Summary of the invention

[0005] In order to solve the above problems, the present invention proposes a multi-granularity AIGC text detection method and related devices, which collect high-quality open source text data in a black box testing manner, and enhance the detection capability of the single encoder model by constructing a text AIGC detection downstream network with document granularity and sentence granularity, thereby improving the AIGC detection accuracy.

[0006] In a first aspect of the present invention, the present invention proposes a multi-granularity text AIGC detection method based on semantic features, the method comprising the following steps:

[0007] Acquire source text data, wherein the source text data is composed of multiple texts, and obtain the text to be detected after preprocessing;

[0008] The text to be detected is character mapped through the word segmenter to obtain a text token id sequence with classification mark and separation mark character id, and the position of the period token id is recorded;

[0009] Pass the text token id sequence through an encoder model based on a bidirectional attention structure to obtain a text semantic representation vector, and separate the token vectors corresponding to the positions of the classification mark and the separation mark characters in the text semantic representation vector to obtain a text pure semantic representation vector;

[0010] The classification tag vector and the pure semantic representation vector of the text are passed through the text body detection model to obtain the text AIGC detection result at the document granularity;

[0011] The classification tag vector, the pure semantic representation vector of the text, and the position of the period token id are passed through the text sentence discrimination model to obtain the text AIGC detection result at the sentence granularity.

[0012] The text AIGC detection result at the document granularity and the text AIGC detection result at the sentence granularity are integrated to obtain a multi-granularity AIGC text detection result of the text to be detected.

[0013] The text body detection model DetectAIGC-Doc is composed 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 is composed of a linear layer and an activation function. The document semantic representation interaction module is composed of a bidirectional gated recurrent unit layer, a normalization layer, and an activation function. The semantic information fusion decision module is composed of a cross-attention layer, a Dorpout layer, and a linear layer.

[0014] Among them, the text sentence discrimination model DetectAIGC-Sen is composed of 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 is composed of a linear layer and an activation function, the document sentence representation extraction module is composed of a bidirectional gated recurrent unit layer, and the sentence information fusion decision module is composed of a bidirectional gated recurrent unit layer and a linear layer.

[0015] In a second aspect of the present invention, the present invention further proposes a multi-granularity AIGC text detection device, the device comprising:

[0016] An acquisition unit is configured to acquire source text data, wherein the source text data is composed of multiple texts, and the text to be detected is obtained after preprocessing;

[0017] A position extraction unit is configured to perform character mapping on the text to be detected through a word segmenter, obtain a text token id sequence having a classification mark and a separation mark character id, and record the position of the period token id;

[0018] A 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 separate the token vectors at positions corresponding to the classification mark and the separation mark characters in the text semantic representation vector to obtain a text pure semantic representation vector;

[0019] A first detection unit is configured to pass the classification tag vector and the text pure semantic representation vector through a text body detection model to obtain a text AIGC detection result at a document granularity;

[0020] The second detection unit is configured to pass the classification tag vector, the text pure semantic representation vector and the position of the period token id through the text sentence discrimination model to obtain the text AIGC detection result of the sentence granularity;

[0021] The third detection unit is configured to integrate the text AIGC detection result of the document granularity and the text AIGC detection result of the sentence granularity to obtain a multi-granularity AIGC text detection result of the text to be detected.

[0022] In the third aspect of the present invention, the present invention further proposes a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the multi-granularity AIGC text detection method as described in the first aspect of the present invention is implemented.

[0023] In the fourth aspect of the present invention, the present invention further proposes a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the multi-granularity AIGC text detection method as described in the first aspect of the present invention is implemented.

[0024] Beneficial effects of the present invention:

[0025] 1. The present invention ensures the semantic purity of the data itself through specific preprocessing operations before the data stream is input into the model, preventing erroneous vocabulary and distribution 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 are still coherent to a certain extent.

[0026] 2. The present invention adopts the text body 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 the AIGC coordinated feature weight vector at the coarse-grained level of the entire sentence, and the pure text semantic vector realizes the joint interaction of each token in a long sequence through a bidirectional gating network to obtain a semantic feature distribution vector at a fine-grained level. Finally, the interactive network realizes the fusion of coarse-grained semantic weights and fine-grained semantic features, ensuring that the model accurately judges the AIGC detection of text at the document granularity.

[0027] 3. The present invention adopts the text sentence discrimination model DetectAIGC-Sen, which can make the text semantic representation vector be divided into a global semantic vector and a pure text semantic vector, and then use the period as the basis for semantic segmentation, and extract the vector representation sentence semantic feature information at the position corresponding to the period from the pure text semantic vector after it passes through the bidirectional gating network, and then combine the AIGC coordinated feature weight vector on the overall coarse-grained sentence provided by the global semantic vector as the starting hidden state, and use the second bidirectional gating network to control the semantic matching relationship between sentences, accurately grasp the semantic interest points, and realize sentence-grained text AIGC precise detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0029] Figure 1 A schematic diagram of an exemplary system architecture for applying the technical solution of an embodiment of the present application;

[0030] Figure 2It is a flow chart of the multi-granularity AIGC text detection method according to an embodiment of the present invention;

[0031] Figure 3 A schematic diagram of the text body detection model structure of an embodiment of the present invention;

[0032] Figure 4 A schematic diagram of the text sentence discrimination model structure of an embodiment of the present invention;

[0033] Figure 5 A network flow chart of multi-granularity AIGC text detection according to an embodiment of the present invention;

[0034] Figure 6 Schematic diagram of the structure of a multi-granularity AIGC text detection device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0035] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0036] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0037] Token: In natural language processing, tokens are usually regarded as the smallest unit of text. 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 basis 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 created by the model in advance, which 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 a scenario where a computer device and a server coexist, wherein the computer device communicates with the server via a network. The computer device may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server may be implemented as an independent server.

[0041] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied is shown in FIG. Figure 1 As shown, the system architecture may include a terminal device 101 and a server 102 .

[0042] The terminal device 101 is connected to the server 102 via a network, and the network is used to provide a medium for a communication link between the terminal device 101 and the server 102. The network may include various connection types, such as wired or wireless communication links or optical fiber cables, etc. The terminal device 101 and the server 102 may be directly or indirectly connected via wired or wireless communication, which is not limited here.

[0043] The terminal device 101 may be a smart phone, a tablet computer, a smart TV, a desktop computer, a vehicle-mounted computer, a portable computer and other devices, but is not limited thereto. The terminal device 101 may generally refer to one of a plurality of terminal devices, and the embodiment of the present application only uses the terminal device 101 as an example. Those skilled in the art may know that the number of the above-mentioned terminal devices may be more or less. For example, the above-mentioned terminal device may be only one, or the above-mentioned terminal device may be dozens or hundreds, or a greater number, in which case the above-mentioned implementation environment also includes other terminal devices. The embodiment of the present application does not limit the number and device type of the terminal devices.

[0044] Server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.

[0045] In some embodiments, the terminal device 101 obtains source text data, which may be text determined based on user input of the terminal device 101, and the source text data is composed of multiple texts, and the text to be detected is obtained after preprocessing; the text to be detected is then sent to the server 102 through the network, and 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, after the terminal device 101 obtains the source text data, it can directly detect the text to be detected therein and 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 the present application is shown. The multi-granularity AIGC text detection method can be executed by a server, which can be Figure 1 The server 102 shown in FIG. Figure 2 As shown, the text detection method includes:

[0047] 101. Acquire source text data, where the source text data is composed of multiple texts, and obtain the text to be detected after preprocessing;

[0048] In some embodiments, the source text data may be in the form of written language, and the text may be an article, sentence, paragraph, or phrase, etc. The text may be in English, Chinese, or French, etc., which is not limited in the present embodiment.

[0049] In some embodiments, in order to better ensure the semantic purity of the data itself and prevent erroneous vocabulary and distribution from interfering with the model's judgment in the latent semantic space, this embodiment corrects the spelling of each text of 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, in order to ensure that the semantics of the text part is still coherent to a certain extent, this embodiment records the position of the period in the first text to be detected, and judges the first text to be detected according to the maximum length. If the position of the tail of the period sequence of the first text to be detected is less than the maximum length limit, no truncation is performed. If the position of the tail of the period sequence is greater than the maximum length limit, the nearest period position less than the maximum length limit is found for truncation to obtain the second text to be detected. This truncation method based on punctuation marks can ensure that the semantics of the text part is still coherent.

[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 positions of all periods; this method can stage the text according to preset rules to ensure the semantic coherence of the text part.

[0052] It is understandable 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. Perform character mapping on the text to be detected through a word segmenter to obtain a text token id sequence having a classification mark and a separation mark character id, and record the position of the period token id;

[0054] In some embodiments, a Tokenizer of a pre-trained model such as BERT, RoBERTa, etc. can be used to encode the text to be detected, add a classification tag [CLS] and a separation tag [SEP] to the text to be detected, and convert the text into a corresponding token id sequence.

[0055] For example, suppose there is 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 classification tags [CLS] and separation tags [SEP] to the text to be detected: [CLS] I am an AIGC text [SEP]; split the text to be detected into tokens: [CLS], I, am, an, AIGC, text [SEP], these tokens can be words, subwords, characters, etc., depending on the word 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. Token is the basis 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 should be understood that the above token IDs (such as 101, 1000, 1234, 2345, 2000, 3500, 102, etc.) are just examples, and the actual token ID will vary depending on the specific tokenizer model used and its vocabulary.

[0057] 103. Obtain a text semantic representation vector by using an encoder model based on a bidirectional attention structure for the text token id sequence, and separate the token vectors at positions corresponding to the classification mark and the separation mark characters from the text semantic representation vector to obtain a text pure semantic representation vector;

[0058] 104. The classification tag vector and the text pure semantic representation vector are passed through the text body detection model to obtain the text AIGC detection result at the document granularity;

[0059] In some embodiments, Figure 3 As shown, the text body 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, and 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 the document granularity text AIGC detection result includes:

[0061] The classification tag vector is input into the global semantic information coordination module, and the latent semantic space is transformed through the linear layer, and the semantic space is constrained to the appropriate 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, and the bidirectional gated recurrent unit layer realizes the strong interaction of contextual semantic sequence information and captures the long-distance semantic distribution relationship. Then the latent semantic space is normalized through the normalization layer to retain the abstract pure semantic features. Finally, the SwiGLU activation function is input to separate the AIGC nonlinear semantic features through the unique gating mechanism to obtain the document local semantic interaction vector.

[0063] The first global semantic information vector and the document local semantic interaction vector are input into the semantic information fusion decision module, and interacted by the cross attention layer to obtain the AIGC feature interaction result vector. The Dropout layer, linear layer, and Softmax layer integrate and compress the AIGC feature space to the classifiable threshold space to obtain the document granularity 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 a Q matrix;

[0066] Multiply the document local semantic interaction vector by the K weight matrix to obtain the K matrix;

[0067] Multiply the document local semantic interaction vector by the V weight matrix to obtain the V matrix;

[0068] The Q matrix, K matrix, and V matrix are interacted according to the cross-attention formula to obtain the AIGC feature interaction result vector.

[0069] Exemplarily, the calculation formula of the document granularity text AIGC detection process 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 represents the first global semantic information vector, represents the classification label vector, Linear represents the linear layer, Tanh represents the tanh activation function, V Pure represents the document local semantic interaction vector, SwiGLU represents the SwiGLU activation function, LayerNorm represents the normalization layer, BiGRU represents the bidirectional gated recurrent unit layer, V T represents the plain text semantic vector, O Doc represents the document-level text AIGC detection result, SoftMax represents the softmax function, Cross-Attn represents the cross-attention layer, and W q represents the q weight matrix, W k represents the k weight matrix, W v represents the v weight matrix, V Pure Represents the document local semantic interaction vector.

[0074] 105. The classification tag vector, the text pure semantic representation vector and the position of the period token id are passed through a text sentence discrimination model to obtain a text AIGC detection result at the sentence granularity;

[0075] In some embodiments, Figure 4 As shown, the text sentence discrimination model DetectAIGC-Sen 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, and the sentence information fusion decision module includes a bidirectional gated recurrent unit layer and a linear layer.

[0076] In some embodiments, the process of obtaining the sentence granularity text AIGC detection result includes:

[0077] The classification tag vector is input into the global semantic information coordination module, and the latent semantic space is transformed through the linear layer, and the semantic space is constrained to the appropriate 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, and the bidirectional gated recurrent unit layer realizes the strong interaction of contextual 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 is used as the starting hidden layer state of the BiGRU network to provide an interactive semantic information pool. Each sub-sentence vector in the document sentence semantic representation vector interacts with the information pool according to the sentence order 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-granularity text AIGC detection result.

[0080] In the embodiment of the present invention, the BiGRU layer realizes strong interaction of contextual semantic sequence information, captures long-distance semantic distribution relations, and layer normalization realizes normalization of latent semantic space, eliminates feature offset and unique distribution interference of single text, and retains abstract pure semantic features.

[0081] Exemplarily, the calculation formula of the sentence granularity text AIGC detection process is as follows:

[0082]

[0083] O Sen =BiGRU(V Sen,V Period )

[0084] Among them, V Sen represents the global semantic information vector, represents the classification label vector, P Period Indicates the period position V Period Represents the semantic representation vector of the document sentence.

[0085] In an embodiment of the present invention, the classification label vectors of step 104 and step 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 body detection model and the text sentence discrimination model, they can be the same classification label vector. When the encoder model based on the bidirectional attention structure is jointly trained with the text body detection model and the text sentence discrimination model respectively, the encoder model based on the bidirectional attention structure can be divided into two corresponding groups of model parameters, one group of model parameters can adapt to the text body detection task, and the other group of model parameters can adapt to the text sentence discrimination task. Therefore, different classification label vectors can be output, which can better adapt to the text body detection model and the text sentence discrimination model.

[0086] 106. Integrate the text AIGC detection result at the document granularity and the text AIGC detection result at the sentence granularity to obtain a multi-granularity AIGC text detection result of the text to be detected.

[0087] In an embodiment of the present invention, the text AIGC detection results at the document granularity and the sentence granularity are integrated, which can make full use of the complementarity of text detection information at different granularities. By fusing this information, a more complete and accurate detection result can be obtained.

[0088] In order to better illustrate the text detection process of the present invention, Figure 5As an example, the text to be tested is truncated according to preset rules and then encoded by a word segmenter, and the token id position corresponding to the separator period is recorded, and the text token id sequence is passed through an encoder model based on a bidirectional attention structure to obtain a text semantic representation vector, and the token vectors corresponding to the positions of the classification mark and the separation mark characters are separated from the text semantic representation vector to obtain a text pure semantic representation vector. First, the classification mark vector and the text pure semantic representation vector are passed through a text body detection model based on a BiGRU network and a Cross-Attention network to obtain a document-granularity text AIGC detection result, and then the classification mark 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-granularity text AIGC detection result, and finally the document-granularity text AIGC detection result and the sentence-granularity text AIGC detection result are integrated to obtain a multi-granularity AIGC text detection result of the text to be tested.

[0089] Starting from the perspective of semantic feature interaction, the present invention fully utilizes global and local information through a downstream network composed of structures such as a strong sequence network, an activation function, and a cross-attention interaction network, accurately captures the language features of non-spoken AI, and realizes accurate recognition of text AIGC.

[0090] Figure 6 A block diagram of a multi-granularity AIGC text detection device according to an embodiment of the present application is shown, referring to Figure 6 As shown, including:

[0091] An acquisition unit is configured to acquire source text data, wherein the source text data is composed of multiple texts, and the text to be detected is obtained after preprocessing;

[0092] A position extraction unit is configured to perform character mapping on the text to be detected through a word segmenter, obtain a text token id sequence having a classification mark and a separation mark character id, and record the position of the period token id;

[0093] A 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 separate the token vectors at positions corresponding to the classification mark and the separation mark characters in the text semantic representation vector to obtain a text pure semantic representation vector;

[0094] A first detection unit is configured to pass the classification tag vector and the text pure semantic representation vector through a text body detection model to obtain a text AIGC detection result at a document granularity;

[0095] The second detection unit is configured to pass the classification tag vector, the text pure semantic representation vector and the position of the period token id through the text sentence discrimination model to obtain the text AIGC detection result of the sentence granularity;

[0096] The third detection unit is configured to integrate the text AIGC detection result of the document granularity and the text AIGC detection result of the sentence granularity to obtain a multi-granularity AIGC text detection result of the text to be detected.

[0097] In an embodiment of the present invention, a computer device is proposed, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the multi-granularity AIGC text detection method when executing the computer program.

[0098] In an embodiment of the present invention, a computer-readable storage medium is proposed, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the multi-granularity AIGC text detection method is implemented.

[0099] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0100] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, which can include: ROM, RAM, disk or CD, etc.

[0101] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A multi-granularity AIGC text detection method, characterized in that: The following steps are involved: Acquire source text data, wherein the source text data is composed of multiple texts, and obtain the text to be detected after preprocessing; The text to be detected is character mapped through the word segmenter to obtain a text token id sequence with classification mark and separation mark character id, and the position of the period token id is recorded; The text tokenid sequence is passed through an encoder model based on a bidirectional attention structure to obtain a text semantic representation vector, and the token vectors corresponding to the positions of the classification mark and the separation mark characters are separated from the text semantic representation vector to obtain a text pure semantic representation vector; The classification tag vector and the pure semantic representation vector of the text are passed through the text body detection model to obtain the text AIGC detection result at the document granularity; The classification tag vector, the pure semantic representation vector of the text, and the position of the period tokenid are passed through the text sentence discrimination model to obtain the text AIGC detection result at the sentence granularity. The text AIGC detection result at the document granularity and the text AIGC detection result at the sentence granularity are integrated to obtain a multi-granularity AIGC text detection result of the text to be detected.

2. A multi-granularity AIGC text detection method according to claim 1, characterized in that: The preprocessing process of the source text data includes: Correct the spelling of each text in the source text data to obtain a first text to be detected corresponding to each text; Record the position of the period in the first text to be detected, and judge the first text to be detected according to the maximum length. If the position of the tail of the period sequence of the first text to be detected is less than the maximum length limit, no truncation is performed. If the position of the tail of the period sequence is greater than the maximum length limit, find the nearest period position less than the maximum length limit for truncation to obtain the second text to be detected.

3. A multi-granularity AIGC text detection method according to claim 1, characterized in that: The text body 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, and the semantic information fusion decision module includes a cross attention layer, a Dropout layer, a linear layer and a Softmax function.

4. A multi-granularity AIGC text detection method according to claim 3, characterized in that: The process of obtaining the document granularity text AIGC detection results includes: The classification tag vector is input into the global semantic information coordination module, and the latent semantic space is transformed through the linear layer, and the semantic space is constrained to the appropriate 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, and the bidirectional gated recurrent unit layer realizes the strong interaction of contextual semantic sequence information and captures the long-distance semantic distribution relationship. Then the latent semantic space is normalized through the normalization layer to retain the abstract pure semantic features. Finally, the SwiGLU activation function is input to separate the AIGC nonlinear semantic features through the unique gating mechanism to obtain the document local semantic interaction vector. The first global semantic information vector and the document local semantic interaction vector are input into the semantic information fusion decision module, and interacted by the cross attention layer to obtain the AIGC feature interaction result vector. The Dropout layer, linear layer, and Softmax layer integrate and compress the AIGC feature space to the classifiable threshold space to obtain the document granularity text AIGC detection result.

5. A multi-granularity AIGC text detection method according to claim 4, characterized in that: The AIGC feature interaction result vector obtained by the cross attention layer interaction includes: Multiply the first global semantic information vector by the Q weight matrix to obtain a Q matrix; Multiply the document local semantic interaction vector by the K weight matrix to obtain the K matrix; Multiply the document local semantic interaction vector by the V weight matrix to obtain the V matrix; The Q matrix, K matrix, and V matrix are interacted according to the cross-attention formula to obtain the AIGC feature interaction result vector.

6. A multi-granularity AIGC text detection method according to claim 1, characterized in that: 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, and the sentence information fusion decision module includes a bidirectional gated recurrent unit layer and a linear layer.

7. A multi-granularity AIGC text detection method according to claim 6, characterized in that: The process of obtaining the sentence-granular text AIGC detection result includes: The classification tag vector is input into the global semantic information coordination module, and the latent semantic space is transformed through the linear layer, and the semantic space is constrained to the appropriate 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, and the bidirectional gated recurrent unit layer realizes the strong interaction of contextual 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 is used as the starting hidden layer state of the BiGRU network to provide an interactive semantic information pool. Each sub-sentence vector in the document sentence semantic representation vector interacts with the information pool according to the sentence order 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-granularity text AIGC detection result.

8. A multi-granularity AIGC text detection device, characterized in that: The device comprises: An acquisition unit is configured to acquire source text data, wherein the source text data is composed of multiple texts, and the text to be detected is obtained after preprocessing; A position extraction unit is configured to perform character mapping on the text to be detected through a word segmenter, obtain a text token id sequence having a classification mark and a separation mark character id, and record the position of the period token id; A feature extraction unit is configured to pass the text tokenid sequence through an encoder model based on a bidirectional attention structure to obtain a text semantic representation vector, and separate the token vectors at positions corresponding to the classification mark and the separation mark characters in the text semantic representation vector to obtain a text pure semantic representation vector; A first detection unit is configured to pass the classification tag vector and the text pure semantic representation vector through a text body detection model to obtain a text AIGC detection result at a document granularity; The second detection unit is configured to pass the classification tag vector, the text pure semantic representation vector and the position of the period token id through the text sentence discrimination model to obtain the text AIGC detection result of the sentence granularity; The third detection unit is configured to integrate the text AIGC detection result of the document granularity and the text AIGC detection result of the sentence granularity to obtain a multi-granularity AIGC text detection result of the text to be detected.

9. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the multi-granularity AIGC text detection method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the multi-granularity AIGC text detection method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • End-to-end classification method of large-scale news text based on Bi-GRU and word vector

    CN108846017A

  • A text implication relation recognition method based on multi-granularity information fusion

    CN109299262A

  • Semantic matching method and device based on multi-granularity and multi-channel neural network and computer equipment

    CN112434514A

  • Column semantic recognition method and system based on context awareness of GCN and RoBERTa

    CN117312989A

  • Architectural design auxiliary system and method based on artificial intelligence

    CN118296698A