CN117371049A - Machine-generated text detection method and system based on blockchain and generated countermeasure network - Google Patents
Machine-generated text detection method and system based on blockchain and generated countermeasure network Download PDFInfo
- Publication number
- CN117371049A CN117371049A CN202311166903.2A CN202311166903A CN117371049A CN 117371049 A CN117371049 A CN 117371049A CN 202311166903 A CN202311166903 A CN 202311166903A CN 117371049 A CN117371049 A CN 117371049A
- Authority
- CN
- China
- Prior art keywords
- text
- generated
- machine
- blockchain
- layer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 108
- 238000012549 training Methods 0.000 claims abstract description 72
- 238000000034 method Methods 0.000 claims abstract description 22
- 230000003042 antagnostic effect Effects 0.000 claims abstract description 10
- 230000004913 activation Effects 0.000 claims description 22
- 230000006870 function Effects 0.000 claims description 18
- 238000010606 normalization Methods 0.000 claims description 18
- 230000003993 interaction Effects 0.000 claims description 16
- 230000008569 process Effects 0.000 claims description 16
- 239000013598 vector Substances 0.000 claims description 11
- 230000008485 antagonism Effects 0.000 claims description 10
- 238000009826 distribution Methods 0.000 claims description 10
- 230000007246 mechanism Effects 0.000 claims description 10
- 238000012545 processing Methods 0.000 claims description 10
- 238000003860 storage Methods 0.000 claims description 8
- 230000002779 inactivation Effects 0.000 claims description 6
- 238000007781 pre-processing Methods 0.000 claims description 6
- 230000009466 transformation Effects 0.000 claims description 6
- 238000013145 classification model Methods 0.000 claims description 5
- 230000006872 improvement Effects 0.000 claims description 5
- 238000005457 optimization Methods 0.000 claims description 5
- 238000012795 verification Methods 0.000 claims description 5
- 230000015654 memory Effects 0.000 claims description 4
- 230000002457 bidirectional effect Effects 0.000 claims description 3
- 238000004140 cleaning Methods 0.000 claims description 3
- 238000011156 evaluation Methods 0.000 claims description 3
- 238000000605 extraction Methods 0.000 claims description 3
- 238000013459 approach Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000007787 long-term memory Effects 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000006403 short-term memory Effects 0.000 description 2
- 230000002411 adverse Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000001010 compromised effect Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000008713 feedback mechanism Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000012800 visualization Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Abstract
The invention provides a machine-generated text detection method and a system based on a blockchain and a generated type countermeasure network, wherein the method comprises the steps of acquiring a text classification data set comprising text training data and corresponding category labels; training a machine-generated text detection model based on a generated type countermeasure network; deploying the trained machine-generated text detection model based on the generated type countermeasure network into a blockchain system; taking the received text to be classified as input, and performing classification prediction on a trained machine-generated text detection model based on a generated type countermeasure network to obtain a classification result; the block chain system records the classification result on the block chain; the block chain system returns a classification result to the user; the invention can realize high-accuracy classification of the real text and the antagonistic text, and ensures the safety and the credibility of the data through the blockchain technology.
Description
Technical Field
The invention relates to a machine-generated text detection method and system based on a blockchain and a generated type countermeasure network, and belongs to the technical field of text detection.
Background
With the rapid development of large language models, the performance of many language-dependent systems has been significantly improved, enabling the generation of convincing topic text. There is therefore a growing concern that large language models like ChatGPT may have potential negative effects on society, such as false news, hacking and social security issues. First, the generation capabilities of large language models give them the potential to create false information and false news. Without proper control and supervision, these models may be misused, resulting in a wide spread of false information. This presents challenges for information credibility in the news industry and society. Second, the use of large language models also presents a plagiarism problem. These models can generate high quality text including academic papers, news stories, etc. These models may be used to hack the work of others, infringing intellectual property, if there is not enough supervision and auditing mechanism. In addition, the application of large language models may also raise social security issues. These models can generate personalized responses by interacting with users, but if the models are abused or exploited, they can cause problems of false information, harassment, personal attack, etc., which can have adverse effects on users and society. Therefore, how to effectively detect these texts becomes important.
Current methods of machine-generated text detection are roughly separable into black box detection and white box detection. The black box detection method focuses on detecting text generated by a large language model using only API-level access rights. Such methods typically do not directly access and control the internal structure and generation process of the model. Thus, the black box approach relies on collecting human and machine generated text samples to build a training dataset and train a classification model. These classification models make decisions and checks by analyzing aspects such as features, context, and semantics of the generated text. While the white-box detection method requires a higher level of access rights to the large language model. This approach allows for a more thorough understanding and control of the internal operation of the model. For example, intermediate states of the model may be monitored, parameters of the generation algorithm controlled, and special marks or watermarks embedded in the generated text. By these means, the generated text can be tracked and detected to determine if it is machine-generated. However, none of the above methods can effectively identify the resistant text.
For example, the paper GLTR Statistical Detection and Visualization of Generated Text proposes a machine-generated text detection system named GLTR, which applies a statistical-based approach to detect common machine-generated text. Although this paper can distinguish machine-generated text from manually written text, the accuracy of recognition is low and the detection system proposed by this paper does not take into account the problem of system data security, which may lead to data leakage, tampering or unauthorized access.
As another example, the paper "DetectGPT: zero-Shot Machine-Generated Text Detection using Probability Curvature" defines a curvature-based criterion to determine whether a channel is generated by a given language model. Although this paper achieves a high degree of accuracy in recognition of machine-generated text, it is relatively low in recognition of antagonistic text.
The above-described problem is that which should be considered and addressed in a machine-generated text detection process based on blockchain and generative antagonism networks.
Disclosure of Invention
The invention aims to provide a machine-generated text detection method and a system based on a blockchain and a generated type countermeasure network, which solve the problem that the recognition accuracy of the countermeasure text is to be improved in the prior art.
The technical scheme of the invention is as follows:
a machine-generated text detection method based on a blockchain and a generated type countermeasure network comprises the following steps,
s1, data acquisition: acquiring a text classification data set comprising text training data and corresponding category labels;
s2, model training: training a machine-generated text detection model based on a generated countermeasure network by using the text classification data set in the step S1, wherein the machine-generated text detection model based on the generated countermeasure network comprises a generator and a discriminator, learning and optimizing model parameters according to input text characteristics and corresponding class labels during training, and training the generator and the discriminator to enable the generator to generate the countermeasure text, wherein the discriminator is used for discriminating the countermeasure text from real text types, and after training is completed, the trained machine-generated text detection model based on the generated countermeasure network is obtained;
s3, model deployment: deploying the trained machine-generated text detection model based on the generated countermeasure network into a blockchain system, and encrypting model parameters;
s4, a classification process: taking the received text to be classified as input, performing classification prediction on a trained machine-generated text detection model based on a generated type countermeasure network to obtain a classification result, and encrypting the input and output of the model;
s5, recording the block chain: the block chain system records the classification result on the block chain;
s6, outputting a result: and the blockchain system returns the classification result to the user, and the user acquires the classification result, namely, the class label to which the input text belongs.
Further, in step S1, a text classification dataset comprising text training data and corresponding category labels is obtained, in particular,
s11, cleaning and preprocessing the prepared original text data to obtain text training data;
s12, creating a label: creating a corresponding category label for each text data;
s13, acquiring a text classification data set, wherein the text classification data set comprises text training data and corresponding class labels.
Further, in step S2, a machine-generated text detection model based on the generated challenge network is trained using the dataset of step S1, specifically,
s21, coding text training data to obtain a text sequence for model training;
s22, a machine-generated text detection model based on the generated countermeasure network is subjected to alternating training of the generator and the discriminator, parameters of the generator are fixed, parameters of the discriminator are updated, and then parameters of the discriminator are fixed, and parameters of the generator are updated.
Further, in step S2, in a machine-generated text detection model based on a generated countermeasure network,
the generator comprises a convolution layer, a first batch normalization layer, a first leak-ReLU activation layer, a long-short-period memory network LSTM, a full-connection layer, a second batch normalization layer, a second leak-ReLU activation layer and an output layer, wherein local semantic features of an input text sequence and noise vectors are captured through the convolution layer, normalization processing is carried out through the first batch normalization layer, nonlinear processing is carried out through the first leak-ReLU activation layer by using a leak-ReLU activation function, context information of a longer period is captured through the long-short-period memory network LSTM, linear transformation is carried out through the full-connection layer, nonlinear processing is carried out through the second leak-ReLU activation layer after normalization is carried out through the second batch normalization layer, and finally probability distribution of each word in the text sequence is mapped through output layer by using a Sigmoid function, so that the antagonistic text with difference from the original data is generated.
Further, in step S2, in a machine-generated text detection model based on a generated countermeasure network,
the discriminator comprises a bidirectional encoder BERT based on a transducer, a first random inactivation layer, namely a first Dropout layer, a first linear layer, a third leakage-ReLU activation layer, a second Dropout layer, a second linear layer and a normalized exponential function layer, namely a Softmax layer, wherein input data comprises real texts and opposite texts output by a generator, after the input data firstly passes through the BERT, the input data is randomly discarded through the first random inactivation layer, and then passes through a sequence consisting of the first linear layer, the third leakage-ReLU activation layer and the second Dropout layer, the nonlinear transformation and the feature extraction are carried out, and then the output feature is mapped to a vector with an additional output dimension through the second linear layer, wherein the additional output dimension is used for representing whether an input sample is real or false; finally, calculating probability distribution of the output vector through a Softmax function of the Softmax layer, and judging the antagonistic text and the real text category.
Further, in step S3, the trained machine-generated text detection model based on the generated countermeasure network is deployed into the blockchain system, specifically, by saving the weights and structures of the machine-generated text detection model based on the generated countermeasure network as a specific file format, and then uploading the weights and structures into the intelligent contracts or distributed storage on the blockchain.
Further, in step S5, the blockchain system will record the classification result onto the blockchain, specifically, by writing the classification result into the state of the smart contract or into the transaction data in the blockchain.
Further, a step S7 is included in which a blockchain-based rewards mechanism is employed in the user feedback process to provide a user with a token reward as an incentive to provide valuable text input or feedback, specifically,
s71, user feedback collection: the user provides feedback for each classification result, including judging whether the classification is accurate or not and whether the classification is wrong or not;
s72, feedback recording and verification: the feedback of the user is recorded on the blockchain and the feedback content is encrypted;
s73, feedback evaluation and rewarding: evaluating the classification result of the model according to the feedback information of the user, if the feedback of the user is consistent with the classification result of the model and is approved by other users, the user obtains rewards, sets rewards of different levels and evaluates according to the accuracy, frequency and participation degree of the user;
s74, model optimization and improvement: the collected user feedback is used for optimizing and improving the text classification model, the weakness and misclassification condition of the model are found by analyzing the user feedback, and the feedback information is used for retraining the misclassification of the model and adjusting the decision boundary of the discriminator.
A system for implementing the machine-generated text detection method based on blockchain and generative antagonism network of any of the above claims, characterized by: comprises a data acquisition module, a model training module, a block chain system and an interaction module,
and a data acquisition module: acquiring a text classification data set comprising text training data and corresponding category labels;
model training module: training a machine-generated text detection model based on a generated countermeasure network by using a text classification data set, wherein the machine-generated text detection model based on the generated countermeasure network comprises a generator and a discriminator, learning and optimizing model parameters according to input text characteristics and corresponding target categories during training, training the generator and the discriminator to enable the generator to generate a countermeasure text, discriminating the countermeasure text from real text categories, and obtaining a trained machine-generated text detection model based on the generated countermeasure network after training is completed;
blockchain system: deploying the trained machine-generated text detection model based on the generated countermeasure network, and encrypting model parameters; taking the received text to be classified as input, performing classification prediction on a trained machine-generated text detection model based on a generated type countermeasure network to obtain a classification result, and encrypting the input and output of the model; recording the classification result to the block chain; and returning the classification result to the interaction module;
and an interaction module: and the user acquires a classification result, namely, the class label to which the input text belongs through the interaction module.
The beneficial effects of the invention are as follows: according to the machine-generated text detection method and system based on the blockchain and the generated type countermeasure network, the blockchain combined generated type countermeasure network is applied to the field of machine-generated text detection for the first time, a machine-generated text detection model based on the generated type countermeasure network is adopted, high-accuracy classification of real texts and countermeasure texts can be achieved, and safety and credibility of data are guaranteed through a blockchain technology.
Drawings
FIG. 1 is a flow chart of a machine-generated text detection method based on a blockchain and a generated countermeasure network in accordance with an embodiment of the present invention;
FIG. 2 is an illustrative diagram of a generator of a machine-generated text detection model based on a generated countermeasure network in an embodiment;
FIG. 3 is an illustrative diagram of a discriminant of a machine-generated text detection model based on a generated countermeasure network in an embodiment;
FIG. 4 is an illustrative diagram of a machine-generated text detection system based on a blockchain and a generated countermeasure network in accordance with an embodiment.
Detailed Description
Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Examples
A machine-generated text detection method based on a blockchain and a generated countermeasure network, as shown in fig. 1, comprises the following steps,
s1, data acquisition: acquiring a text classification data set comprising text training data and corresponding category labels;
s11, cleaning and preprocessing the prepared original text data to obtain text training data;
s12, creating a label: creating a corresponding category label for each text data; these tags may be user-defined category tags or tags automatically extracted from the data;
s13, acquiring a text classification data set, wherein the text classification data set comprises text training data and corresponding class labels.
S2, model training: training a machine-generated text detection model based on a generated countermeasure network by using the text classification data set in the step S1, wherein the machine-generated text detection model based on the generated countermeasure network comprises a generator and a discriminator, learning and optimizing model parameters according to input text characteristics and corresponding target categories during training, and training the generator and the discriminator to enable the generator to generate the countermeasure text, wherein the discriminator is used for discriminating the countermeasure text from the real text categories, and obtaining the trained machine-generated text detection model based on the generated countermeasure network after training is completed;
in step S2, a machine-generated text detection model based on a generated challenge network is trained using the dataset of step S1, specifically,
s21, coding text training data to obtain a text sequence for model training;
s22, a machine-generated text detection model based on the generated countermeasure network is subjected to alternating training of the generator and the discriminator, parameters of the generator are fixed, parameters of the discriminator are updated, and then parameters of the discriminator are fixed, and parameters of the generator are updated.
In step S2, training and tuning the model using the training data to improve classification accuracy and performance. The training process carries out learning and optimization of model parameters according to the input text characteristics and the corresponding category labels. A game process is realized for a machine-generated text detection model GenDetectNet training generator and a discriminator based on a generated type countermeasure network, so that the generator generates a vivid countermeasure text, the discriminator discriminates the countermeasure text and the real text category, and the performance of the generator and the discriminator is improved through repeated iterative training to set times.
In step S2, in a machine-generated text detection model based on a generated countermeasure network, the generator is a key component for generating dummy data, which takes as input a text sequence noise vector, and generates a countermeasure text similar to but slightly different from the original data.
As shown in fig. 2, the generator includes a convolution layer, a first batch normalization layer, a first leakage rectifying linear unit activation layer, a long and short term memory network LSTM, a full connection layer, a second batch normalization layer, a second leakage rectifying linear unit activation layer and an output layer, the input text sequence and the noise vector capture local semantic features through the convolution layer, the normalization processing is performed through the first batch normalization layer, the nonlinear processing is performed by the first leakage-ReLU activation layer by applying a leakage-ReLU activation function, the longer-term context information is captured through the long and short term memory network LSTM, the linear transformation is performed through the full connection layer, the nonlinear processing is performed by the second leakage-ReLU activation layer after the normalization processing is performed by using the second batch normalization layer, and finally the output mapping is performed to probability distribution of each word in the text sequence through the output layer by using a Sigmoid function, so as to generate the antagonistic text with difference from the original data.
In step S2, in the machine-generated text detection model based on the generated countermeasure network,
as shown in fig. 3, the discriminator includes a bidirectional encoder BERT based on a Transformer, a first random inactivation layer, namely a first Dropout layer, a first linear layer, a third leak-ReLU activation layer, a second Dropout layer, a second linear layer and a normalized exponential function layer, namely a Softmax layer, input data includes real text and opposite text output by the generator, the input data is firstly subjected to BERT, is subjected to random discarding by the input first random inactivation layer, is subjected to nonlinear transformation and feature extraction by a sequence consisting of the first linear layer, the third leak-ReLU activation layer and the second Dropout layer, and then is subjected to mapping of output features to a vector with additional output dimensions by the second linear layer, wherein the additional output dimensions are used for representing whether an input sample is real or false; finally, calculating probability distribution of the output vector through a Softmax function of the Softmax layer, and judging the antagonistic text and the real text category.
Since the conventional generation countermeasure network GAN only focuses on judging the authenticity of the input sample, it outputs a probability value between 0 and 1, which indicates the probability that the input sample is a true sample. If the probability approaches 1, the input sample is considered to be a real sample by the discriminator; if the probability approaches 0, it means that the arbiter considers the input sample to be the antagonistic sample generated by the generator. However, in conventional GAN, the arbiter network does not further classify the samples. It is only responsible for judging the authenticity of the input sample and does not classify the class to which it belongs. In this regard, embodiments extend the functionality of the arbiter so that it can not only determine whether an input text sample is a true sample or an antagonistic sample, but also further classify the category to which they belong. And the BERT is used as a first layer in the discriminator, so that the model learns more accurate and rich feature representation, the classification accuracy is improved, word vector representation of each word is obtained by inputting the text into the BERT model, and meanwhile, the context-related representation of the whole text can be obtained. On the other hand, given the wide application of GPT generated text in various fields, the challenge is coverage of sample data. By using BERTs that are pre-trained over a large scale of data for a long time, semantic information and contextual relevance of text can be better captured.
In a machine-generated text detection model based on a generated countermeasure network, a loss function of a discriminator D is defined as L D =L S +L C :
L S =-E[logP(S=real|x real )]-E[logP(S=adversarial|x adversarial )]
L C =-E[logP(C=c|x real )]-E[logP(C=c|x adversarialeal )]
Wherein L is S Representing errors in identifying the source data. L (L) C The error in identifying the target class is measured. P (s=real|x) real ) Representing the probability that a given real input sample discriminant target variable S is predicted to be real, P (s=universal|x adversarial ) Representing the probability that a given resistance input sample discriminator target variable S is predicted to be real. P (c=c|x) real ) Representing the probability that given a true input sample, the arbiter target variable C outputs its correct class,P(C=c|x adversarialeal ) Representing the probability that a given challenge input sample, the arbiter outputs its correct class.
P d And P g Representing examples of actual data distribution and generation, respectively, we expect the samples generated by generator G to be compared with the actual distribution P d The sample of the middle sample is similar. The generator G should generate as close to real data statistics as possible. In other words, the average sample batch generated by generator G should be similar to the true prototype sample. Formally, let f (x) denote the activation on the middle layer of the arbiter D, then the feature matching penalty of the generator G is defined as:
wherein,representing the desired output of the function f (x) over the real data distribution, < >>Representing the desired output of the function f (x) over the generator data distribution.
The generator G penalty also takes into account errors caused by the false cases correctly identified by the arbiter D, i.e
Wherein,represents the expected value of the sample generated by generator G, P (c=
adversarial|x adversarialeal ) Representing the probability that the arbiter D correctly classifies the challenge sample as the "challenge" class.
The loss function of generator G is
A total loss function of a machine-generated text detection model based on a generated challenge network:
L total =L G +αL D
where α is a superparameter to balance the importance of generator loss and discriminator loss.
S3, model deployment: and deploying the trained machine-generated text detection model based on the generated type countermeasure network into a blockchain system, and encrypting model parameters.
In step S3, the trained machine-generated text detection model based on the generated countermeasure network is deployed into the blockchain system, specifically, the weights and structures of the machine-generated text detection model based on the generated countermeasure network are saved into a specific file format, such as ONNX, PMML, etc., and then uploaded into a smart contract or distributed storage on the blockchain.
In step S3, the trained parameters of the machine-generated text detection model based on the generated countermeasure network are stored in an intelligent contract or distributed storage on the blockchain, so as to ensure the safety and the credibility of the model. And the model parameters are encrypted by using an asymmetric encryption algorithm, the parameters of the model are encrypted by using a public key, and only a holder of a private key can decrypt and access the parameters of the model, so that the safety and the protection of the model can be enhanced by encrypting the parameters of the model. Even if the parameters of the model are compromised during transmission or storage, a person without a private key cannot decrypt and access the actual parameter values.
S4, a classification process: taking the received text to be classified as input, performing classification prediction on a trained machine-generated text detection model based on a generated type countermeasure network to obtain a classification result, and encrypting the input and output of the model;
in step S4, an asymmetric encryption algorithm is applied to the input and output of the model, and the input of the model is encrypted using the public key of the recipient of the model. The recipient then decrypts using the corresponding private key. For the output of the model, the private key of the sender is used to sign to ensure that the recipient can verify the integrity and authenticity of the output data.
S5, recording the block chain: the block chain system records the classification result on the block chain; specifically, the classification result is written into the state of the intelligent contract or the transaction data in the blockchain.
In step S5, after the text classification is completed, the classification result is recorded on the blockchain. Such a record may enable non-tamperable and traceable features to increase the transparency and reliability of the result.
S6, outputting a result: and the blockchain system returns the classification result to the user, and the user acquires the classification result, namely, the class label to which the input text belongs.
In step S6, the user can verify the credibility of the classification result on the blockchain and make subsequent decisions or operations according to the credibility.
Further comprising step S7, a blockchain-based rewards mechanism is operative in a user feedback process for awarding a token to a user as an incentive to provide valuable text input or feedback, in particular,
s71, user feedback collection: the user provides feedback for each classification result, including judging whether the classification is accurate or not and whether the classification is wrong or not; these feedback may be in the form of user-selected labels, confidence scores, or text descriptions.
S72, feedback recording and verification: the feedback of the user is recorded on the blockchain, and the feedback content is encrypted, so that the source of the feedback and the credibility of the content are ensured; due to the non-tamper and traceability of the blockchain, data records on the blockchain can be protected from tampering and loss and provide a transparent verification process.
In step S72, an asymmetric encryption algorithm is applied to the feedback content to encrypt the user feedback, only the person with the private key can decrypt and access the content of the user feedback, thereby preventing unauthorized persons from acquiring sensitive information, and after the asymmetric encryption algorithm is applied to encrypt the user feedback, the integrity and the authenticity of the feedback can be verified through the digital signature. The receiver can verify the digital signature by using the public key of the sender, so that the feedback data is ensured not to be tampered in the transmission process;
s73, feedback evaluation and rewarding: evaluating the classification result of the model according to the feedback information of the user, and if the feedback of the user is consistent with the classification result of the model and is approved by other users, the user obtains rewards, sets rewards of different levels and evaluates according to the accuracy, frequency and participation degree of the user;
in step S73, the blockchain system may evaluate the classification result of the model according to the feedback information of the user. If the user's feedback is consistent with the classification result of the model and is accepted by other users, the user may obtain a corresponding reward. The reward may be a token, a digital asset, or other form of incentive mechanism. The reward mechanism may motivate the user to actively participate in the feedback process and provide high quality feedback information. The blockchain system may set rewards at different levels, assessed according to the accuracy, frequency and engagement of the user. This may attract more user involvement, providing more beneficial feedback information to improve and optimize the performance of the model.
S74, model optimization and improvement: the collected user feedback is used for optimizing and improving the text classification model, the weakness and misclassification condition of the model are found by analyzing the user feedback, and the feedback information is used for retraining the misclassification of the model and adjusting the decision boundary of the discriminator.
According to the machine-generated text detection method based on the blockchain and the generated type countermeasure network, the blockchain combined generated type countermeasure network is applied to the field of machine-generated text detection for the first time, a machine-generated text detection model based on the generated type countermeasure network is adopted, high-accuracy classification of real texts and countermeasure texts can be achieved, and safety and credibility of data are guaranteed through a blockchain technology.
The invention provides a machine-generated text detection method based on a blockchain and a generated countermeasure network, and aims at solving the problem that a current machine-generated text detection model cannot accurately detect a countermeasure text. This challenge training process helps to improve the accuracy of the model in detecting challenge text.
Aiming at the problems that the storage and management of data of the current machine-generated text detection system can be subjected to security risks, the sources and the properties of the data can be difficult to verify, the traceability and the transparency are lacked, and the authenticity and the integrity of the data can not be ensured, the invention combines the blockchain technology, and improves the security, the transparency and the traceability of the data.
Aiming at the problem that the current machine-generated text detection model is low in detection accuracy of machine-generated texts and human-generated texts, the invention adds BERT in the first layer of the discriminator, so that the model learns more accurate and rich characteristic representation, and the classification task of the upper layer is assisted by utilizing the strong representation capability of the BERT, so that the classification accuracy is improved.
As shown in fig. 4, an embodiment further provides a system for implementing the machine-generated text detection method based on the blockchain and the generated countermeasure network according to any one of the above, which is characterized in that: comprises a data acquisition module, a model training module, a block chain system and an interaction module,
and a data acquisition module: acquiring a text classification data set comprising text training data and corresponding category labels;
model training module: training a machine-generated text detection model based on a generated countermeasure network by using a text classification data set, wherein the machine-generated text detection model based on the generated countermeasure network comprises a generator and a discriminator, learning and optimizing model parameters according to input text characteristics and corresponding target categories during training, training the generator and the discriminator to enable the generator to generate a countermeasure text, discriminating the countermeasure text from real text categories, and obtaining a trained machine-generated text detection model based on the generated countermeasure network after training is completed;
blockchain system: deploying the trained machine-generated text detection model based on the generated countermeasure network, and encrypting model parameters; taking the received text to be classified as input, performing classification prediction on a trained machine-generated text detection model based on a generated type countermeasure network to obtain a classification result, and encrypting the input and output of the model; recording the classification result to the block chain; and returning the classification result to the interaction module;
blockchain system: including a distributed storage module, a smart contract, a transaction and consensus mechanism module, and a rewards mechanism module.
And the distributed storage module is as follows: the method comprises the steps of storing parameters and related data of a trained machine-generated text detection model based on a generated countermeasure network;
intelligent contract: the machine-generated text detection model based on the generated countermeasure network is used for loading the trained text classification task. The functions defined in the smart contracts may receive text input and call models to perform predictive and categorization operations;
transaction and consensus mechanism module: the consistency and the safety of the data are ensured. Each sort operation is packaged as a transaction and validated by the consensus algorithm and added to the blockchain.
A reward mechanism module: for enabling the incentive to conduct a token reward to a user as providing valuable text input or feedback.
And an interaction module: and the user acquires a classification result, namely, the class label to which the input text belongs through the interaction module.
And an interaction module: the system comprises a user interface unit, a user identity verification unit, a text input and preprocessing unit, a result display unit, a user feedback unit and an interaction recording and tracing unit.
User interface unit: for providing a user-friendly interface for a user to enter text data and view classification results. A web application, mobile application, desktop application, or the like is employed.
User authentication unit: for authentication of a user; in a blockchain system, for some sensitive text classification tasks, user authentication is required to ensure that only authorized users can access and use the system.
Text input and preprocessing unit: text entry boxes and related options are provided and text data to be classified may be entered by a user. Preprocessing operations, including removal of stop words, punctuation, etc., are performed to reduce noise and improve classification accuracy.
A result display unit: and returning the corresponding classification result to the block chain system and displaying the classification result to the user.
Feedback mechanism unit: for the user to provide feedback information, such as confirming the accuracy of the classification result or correcting the erroneous classification result. These feedback can be recorded and used for model improvement and optimization, to improve the performance and accuracy of the classification system,
interaction record and tracing unit: the interaction process, such as user feedback, between the user and the blockchain system is recorded. Therefore, the traceability of the classification task can be realized, and the traceability and the transparency of the classification process are ensured.
In the machine-generated text detection model based on the generated type countermeasure network, the generator is used for disturbing the original text to simulate human editing behaviors, meanwhile, the discriminators are used for distinguishing the countermeasure text from the real text and outputting the category of the discriminators, model parameters, classification results and training data are uploaded to the blockchain, and the safety and the credibility of the data are ensured.
The machine-generated text detection method and system based on the blockchain and the generated countermeasure network adopt a model GenDetectNet of machine-generated text detection based on the condition generated countermeasure network, and the model combines a generator and a discriminator, so that the characteristics and modes of the countermeasure text can be learned. By using the countermeasure text and the real text generated by the generator as training data, the detector can better recognize the generated text, and the accuracy of detecting the countermeasure text can be improved.
According to the machine-generated text detection method and system based on the blockchain and the generated countermeasure network, a large amount of training data is collected, the discriminators are trained by using the countermeasure training method, and the blockchain technology is combined in the detection system.
According to the machine-generated text detection method and system based on the blockchain and the generated countermeasure network, a dynamic game process is established through the training generator and the discriminator so as to iterate and improve the performance of the model. In addition, the present invention introduces BERT into the arbiter. The BERT as part of the discriminant may provide deeper semantic understanding and text representation, thereby enhancing the discrimination capabilities of the model for text. And finally, uploading the model parameters, the classification result and the training data to a blockchain to ensure the safety and the credibility of the data. By combining BERT and resistance training and blockchain technology, genDetectNet can more accurately detect and distinguish resistance texts, improving overall detection performance and safety.
The foregoing description is only illustrative of the invention and is not to be construed as limiting the invention. Various modifications and variations of the present invention will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of the present invention, should be included in the scope of the claims of the present invention.
Claims (9)
1. A machine-generated text detection method based on a blockchain and a generated type countermeasure network is characterized by comprising the following steps of: comprises the steps of,
s1, data acquisition: acquiring a text classification data set comprising text training data and corresponding category labels;
s2, model training: training a machine-generated text detection model based on a generated countermeasure network by using the text classification data set in the step S1, wherein the machine-generated text detection model based on the generated countermeasure network comprises a generator and a discriminator, learning and optimizing model parameters according to input text characteristics and corresponding class labels during training, and training the generator and the discriminator to enable the generator to generate the countermeasure text, wherein the discriminator is used for discriminating the countermeasure text from real text types, and after training is completed, the trained machine-generated text detection model based on the generated countermeasure network is obtained;
s3, model deployment: deploying the trained machine-generated text detection model based on the generated countermeasure network into a blockchain system, and encrypting model parameters;
s4, a classification process: taking the received text to be classified as input, performing classification prediction on a trained machine-generated text detection model based on a generated type countermeasure network to obtain a classification result, and encrypting the input and output of the model;
s5, recording the block chain: the block chain system records the classification result on the block chain;
s6, outputting a result: and the blockchain system returns the classification result to the user, and the user acquires the classification result, namely, the class label to which the input text belongs.
2. The machine-generated text detection method based on blockchain and generative antagonism network of claim 1, wherein: in step S1, a text classification dataset comprising text training data and corresponding category labels is obtained, in particular,
s11, cleaning and preprocessing the prepared original text data to obtain text training data;
s12, creating a label: creating a corresponding category label for each text data;
s13, acquiring a text classification data set, wherein the text classification data set comprises text training data and corresponding class labels.
3. The machine-generated text detection method based on blockchain and generative antagonism network of claim 1, wherein: in step S2, a machine-generated text detection model based on a generated challenge network is trained using the dataset of step S1, specifically,
s21, coding text training data to obtain a text sequence for model training;
s22, a machine-generated text detection model based on the generated countermeasure network is subjected to alternating training of the generator and the discriminator, parameters of the generator are fixed, parameters of the discriminator are updated, and then parameters of the discriminator are fixed, and parameters of the generator are updated.
4. A machine-generated text detection method based on blockchain and generative antagonism network as in any of claims 1-3, wherein: in step S2, in the machine-generated text detection model based on the generated countermeasure network,
the generator comprises a convolution layer, a first batch normalization layer, a first leak-ReLU activation layer, a long-short-period memory network LSTM, a full-connection layer, a second batch normalization layer, a second leak-ReLU activation layer and an output layer, wherein a text sequence and a noise vector are input, local semantic features are captured through the convolution layer, normalization processing is carried out through the first batch normalization layer, nonlinear processing is carried out through the first leak-ReLU activation layer by applying a leak-ReLU activation function, context information of a longer period is captured through the long-short-period memory network LSTM, linear transformation is carried out through the full-connection layer, nonlinear processing is carried out through the second leak-ReLU activation layer after normalization is carried out through the second batch normalization layer, and finally output is mapped into probability distribution of each word in the text sequence through the output layer by using a Sigmoid function, so that an antagonistic text with difference from original data is generated.
5. A machine-generated text detection method based on blockchain and generative antagonism network as in any of claims 1-3, wherein: in step S2, in the machine-generated text detection model based on the generated countermeasure network,
the discriminator comprises a bidirectional encoder BERT based on a transducer, a first random inactivation layer, namely a first Dropout layer, a first linear layer, a third leakage-ReLU activation layer, a second Dropout layer, a second linear layer and a normalized exponential function layer, namely a Softmax layer, wherein input data comprises real texts and opposite texts output by a generator, after the input data firstly passes through the BERT, the input data is randomly discarded through the first random inactivation layer, and then passes through a sequence consisting of the first linear layer, the third leakage-ReLU activation layer and the second Dropout layer, the nonlinear transformation and the feature extraction are carried out, and then the output feature is mapped to a vector with an additional output dimension through the second linear layer, wherein the additional output dimension is used for representing whether an input sample is real or false; finally, calculating probability distribution of the output vector through a Softmax function of the Softmax layer, and judging the antagonistic text and the real text category.
6. A machine-generated text detection method based on blockchain and generative antagonism network as in any of claims 1-3, wherein: in step S3, the trained machine-generated text detection model based on the generated countermeasure network is deployed into the blockchain system, specifically, the weights and structures of the machine-generated text detection model based on the generated countermeasure network are uploaded into the intelligent contracts or the distributed storage on the blockchain.
7. The machine-generated text detection method based on blockchain and generative antagonism network of claim 1, wherein: in step S5, the blockchain system records the classification result onto the blockchain, specifically, by writing the classification result into the state of the intelligent contract or the transaction data in the blockchain.
8. The machine-generated text detection method based on blockchain and generative antagonism network of claim 1, wherein: further comprising step S7, a blockchain-based rewards mechanism is operative in a user feedback process for awarding a token to a user as an incentive to provide valuable text input or feedback, in particular,
s71, user feedback collection: the user provides feedback for each classification result, including judging whether the classification is accurate or not and whether the classification is wrong or not;
s72, feedback recording and verification: the feedback of the user is recorded on the blockchain and the feedback content is encrypted;
s73, feedback evaluation and rewarding: evaluating the classification result of the model according to the feedback information of the user, if the feedback of the user is consistent with the classification result of the model and is approved by other users, the user obtains rewards, sets rewards of different levels and evaluates according to the accuracy, frequency and participation degree of the user;
s74, model optimization and improvement: the collected user feedback is used for optimizing and improving the text classification model, the weakness and misclassification condition of the model are found by analyzing the user feedback, and the feedback information is used for retraining the misclassification of the model and adjusting the decision boundary of the discriminator.
9. A system for implementing the blockchain and generative antagonism network-based machine-generated text detection method of any of claims 1-8, characterized by: comprises a data acquisition module, a model training module, a block chain system and an interaction module,
and a data acquisition module: acquiring a text classification data set comprising text training data and corresponding category labels;
model training module: training a machine-generated text detection model based on a generated countermeasure network by using a text classification data set, wherein the machine-generated text detection model based on the generated countermeasure network comprises a generator and a discriminator, learning and optimizing model parameters according to input text characteristics and corresponding target categories during training, training the generator and the discriminator to enable the generator to generate a countermeasure text, discriminating the countermeasure text from real text categories, and obtaining a trained machine-generated text detection model based on the generated countermeasure network after training is completed;
blockchain system: deploying the trained machine-generated text detection model based on the generated countermeasure network, and encrypting model parameters; taking the received text to be classified as input, performing classification prediction on a trained machine-generated text detection model based on a generated type countermeasure network to obtain a classification result, and encrypting the input and output of the model; recording the classification result to the block chain; and returning the classification result to the interaction module;
and an interaction module: and the user acquires a classification result, namely, the class label to which the input text belongs through the interaction module.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311166903.2A CN117371049A (en) | 2023-09-08 | 2023-09-08 | Machine-generated text detection method and system based on blockchain and generated countermeasure network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311166903.2A CN117371049A (en) | 2023-09-08 | 2023-09-08 | Machine-generated text detection method and system based on blockchain and generated countermeasure network |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117371049A true CN117371049A (en) | 2024-01-09 |
Family
ID=89404877
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311166903.2A Pending CN117371049A (en) | 2023-09-08 | 2023-09-08 | Machine-generated text detection method and system based on blockchain and generated countermeasure network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117371049A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117648295A (en) * | 2024-01-26 | 2024-03-05 | 中国信息通信研究院 | Text issuing method and device based on blockchain, electronic equipment and storage medium |
CN117648295B (en) * | 2024-01-26 | 2024-05-10 | 中国信息通信研究院 | Text issuing method and device based on blockchain, electronic equipment and storage medium |
-
2023
- 2023-09-08 CN CN202311166903.2A patent/CN117371049A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117648295A (en) * | 2024-01-26 | 2024-03-05 | 中国信息通信研究院 | Text issuing method and device based on blockchain, electronic equipment and storage medium |
CN117648295B (en) * | 2024-01-26 | 2024-05-10 | 中国信息通信研究院 | Text issuing method and device based on blockchain, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112613501A (en) | Information auditing classification model construction method and information auditing method | |
Lu et al. | Robust few-shot learning for user-provided data | |
CN111652290B (en) | Method and device for detecting countermeasure sample | |
CN111626367A (en) | Countermeasure sample detection method, apparatus, device and computer readable storage medium | |
Cheng et al. | From rumor to genetic mutation detection with explanations: a GAN approach | |
WO2021051530A1 (en) | Method, apparatus and device for detecting abnormal mail, and storage medium | |
CN115186303B (en) | Financial signature safety management method and system based on big data cloud platform | |
CN112789634A (en) | Active defense against untrusted machine learning systems | |
Mukherjee et al. | Monitoring, recognition and attendance automation in online class: combination of image processing, cryptography in IoT security | |
Li et al. | Steganographic security analysis from side channel steganalysis and its complementary attacks | |
CN114595689A (en) | Data processing method, data processing device, storage medium and computer equipment | |
Chua et al. | Problem Understanding of Fake News Detection from a Data Mining Perspective | |
CN113450147B (en) | Product matching method, device, equipment and storage medium based on decision tree | |
CN114595382A (en) | Privacy decision recommendation system based on image data and deep learning | |
CN111784360B (en) | Anti-fraud prediction method and system based on network link backtracking | |
Al Maruf et al. | Ensemble approach to classify spam sms from bengali text | |
CN117371049A (en) | Machine-generated text detection method and system based on blockchain and generated countermeasure network | |
CN106530199B (en) | Multimedia integration steganalysis method based on window type hypothesis testing | |
CN113259369B (en) | Data set authentication method and system based on machine learning member inference attack | |
Kodovsky | Steganalysis of digital images using rich image representations and ensemble classifiers | |
Paudel et al. | Context-aware iot device functionality extraction from specifications for ensuring consumer security | |
CN111832640A (en) | Method for detecting similarity of target domain based on two classifiers in domain self-adaptation | |
Desai | An Exploration of the Effectiveness of Machine Learning Algorithms for Text Classification | |
Ramya et al. | SVM Based Fake Account Sign-In Detection | |
Aghaei et al. | Automated CVE Analysis for Threat Prioritization and Impact Prediction |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |