A generative artificial intelligence detection and evaluation method and system based on blockchain

Through blockchain technology and homomorphic encryption, combined with multi-party secure computing, the problem of data privacy leakage during generative artificial intelligence training is solved, and the privacy protection and model security of generative artificial intelligence are realized.

CN118520505BActive Publication Date: 2024-11-15DATA INTELLIGENCE HUINENG (DALIAN) TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410985053.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-11-15
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

Generative artificial intelligence may leak sensitive information during training, and the model's computing resources and data volume are huge, making it difficult for a single institution to complete the model training and deployment independently, which poses the risk of privacy security and data privacy leakage.

Method used

Adopt a generative artificial intelligence detection and evaluation method based on blockchain to improve data privacy protection through homomorphic encryption and multi-party secure computing. The specific steps include obtaining text classification data sets, performing feature extraction and model training, encrypting model parameters using Paillier homomorphic encryption, distributing and aggregating encrypted model parameters using secure multi-party calculations, writing them to the blockchain network, and inference process encrypted calculations are performed, and access permissions to the results are controlled through smart contract verification and control.

Benefits of technology

It effectively protects data privacy in generative artificial intelligence training and inference processes, ensures the security and reliability of the model, prevents data leakage and malicious tampering, and realizes multi-party collaborative privacy protection computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118520505B_ABST
    Figure CN118520505B_ABST
Patent Text Reader

Abstract

The present application discloses a blockchain-based generative artificial intelligence detection and evaluation method and system, which involves blockchain technology, including: obtaining a text classification data set; extracting features from the text classification data set; using the extracted text feature vector as training data, inputting the text detection model based on the generative adversarial network for training; using the Paillier homomorphic encryption algorithm to encrypt the trained text detection model; using the secure multi-party computing protocol to distribute the encrypted model parameters to multiple participants; obtaining the text to be classified, and using the Paillier homomorphic encryption algorithm to encrypt the text to be classified; through the secret sharing protocol and the obfuscated circuit protocol in the secure multi-party computing, each participant performs joint reasoning calculations in the encrypted space; uploading the encrypted classification results and metadata including the timestamp and the caller ID to the blockchain network. In view of the privacy leakage of generative artificial intelligence data in the prior art, the present application improves privacy protection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain-based generative artificial intelligence detection and evaluation method and system. Background Art

[0002] In recent years, artificial intelligence technology has developed rapidly, especially generative artificial intelligence has been widely used in natural language processing, computer vision and other fields. By learning the potential distribution of a large amount of real data, generative artificial intelligence can generate artificial samples that are highly similar to real data, showing great potential in tasks such as data enhancement, style transfer, and content creation. However, the training process of generative artificial intelligence usually requires a large amount of real data as training samples, which may contain sensitive content such as personal privacy information and commercial secrets. During the training process, if the data is not adequately protected from privacy, it may lead to the leakage of sensitive information, posing serious privacy and security risks. In addition, artificial samples generated by generative artificial intelligence may be abused by malicious parties to generate false information, forge evidence, etc., posing a threat to social security and stability.

[0003] In view of the privacy and security issues of generative artificial intelligence, academia and industry have conducted extensive research and exploration. Although traditional privacy protection methods, such as data desensitization and noise addition, can protect data privacy to a certain extent, they inevitably affect the availability of data and the performance of the model. In practical applications, due to the huge amount of computing resources and data required for generative artificial intelligence, it is difficult for a single institution to complete model training and deployment tasks independently. Multi-party participation, model sharing, and result verification have become inevitable requirements for generative artificial intelligence applications. Blockchain technology, with its decentralized, tamper-proof, and traceable characteristics, provides an ideal infrastructure for building multi-party collaborative generative artificial intelligence applications.

[0004] In the related art, for example, Chinese patent document CN117371049A provides a machine-generated text detection method and system based on blockchain and generative adversarial network. The method obtains a text classification data set including a text classification data set and corresponding category labels; trains a machine-generated text detection model based on generative adversarial network; deploys the trained machine-generated text detection model based on generative adversarial network into the blockchain system; takes the received text to be classified as input, and the trained machine-generated text detection model based on generative adversarial network performs classification prediction to obtain the classification result; the blockchain system records the classification result on the blockchain; and the blockchain system returns the classification result to the user. However, when training a machine-generated text detection model based on generative adversarial network, a large amount of text classification data sets are required as training data. These data sets may contain sensitive personal privacy information. If they are maliciously stolen or leaked during the training process, they will pose a serious threat to user privacy. Therefore, the privacy protection of this solution needs to be further improved. Summary of the invention

[0005] In response to the problem of privacy leakage of generative artificial intelligence data in the prior art, the present application provides a blockchain-based generative artificial intelligence detection and evaluation method and system, which improves data privacy protection through homomorphic encryption and multi-party secure computing.

[0006] The purpose of this application is achieved through the following technical solutions.

[0007] One aspect of the present specification provides a blockchain-based generative artificial intelligence detection and evaluation method, including: in step S1, a text classification dataset is obtained, which contains a large amount of text data and corresponding category labels. The text data can come from various sources, such as news articles, social media posts, customer reviews, etc. The category label indicates the predefined category to which the text belongs, such as news topics, sentiment polarity, etc. The obtained text classification dataset will serve as the basis for subsequent model training. In step S2, feature extraction is performed on the text classification dataset to obtain a text feature vector. Specifically, a pre-trained word vector model such as Word2Vec or Glove can be used to map the words in the text into a dense vector representation. Then, a deep learning model such as a recurrent neural network (RNN) or a convolutional neural network (CNN) is used to encode the word vector sequence and extract the semantic features of the text. In addition, the attention mechanism can also be used to capture key information in the text and improve the quality of feature representation. Finally, the extracted text feature vector is used as training data and input into a text detection model based on a generative adversarial network (GAN) for training. GAN consists of two parts: a generator and a discriminator. The generator is responsible for generating fake text, and the discriminator is responsible for distinguishing between real text and fake text. Through adversarial learning between the generator and the discriminator, the performance of the text detection model is continuously improved. In step S3, the trained text detection model is encrypted using the Paillier homomorphic encryption algorithm. Paillier encryption is a homomorphic encryption algorithm based on a public key cryptosystem that supports direct addition and multiplication operations on encrypted data. By performing Paillier encryption on the model parameters, model calculations can be performed without leaking the original data. Then, the encrypted model parameters are distributed to multiple participants using the secure multi-party computing (MPC) protocol. Each participant only holds part of the encrypted model parameters and cannot restore the complete model alone. Then, through the secret sharing protocol in MPC, such as Shamir secret sharing, the encrypted model parameters held by multiple participants are securely aggregated to obtain the aggregated encrypted model parameters. Finally, the aggregated encrypted model parameters are written into the blockchain network, and the integrity and verifiability of the model are ensured by using the tamper-proof and traceable characteristics of the blockchain. In step S4, the text to be classified is obtained and encrypted using the Paillier homomorphic encryption algorithm. Similarly, the encrypted text to be classified is distributed to multiple participants holding encrypted model parameters using the MPC protocol. Each participant holds a portion of the encrypted text to be classified and model parameters. Then, through the secret sharing protocol and the obfuscated circuit protocol in the MPC, each participant performs joint reasoning calculations in the encrypted space. The obfuscated circuit protocol allows the participants to collaboratively complete reasoning calculation tasks without leaking personal privacy data.Through secure multi-party computing, each participant can execute the text detection model on the encrypted data to obtain the encrypted classification results without decrypting the original data. In step S5, the encrypted classification results, as well as metadata including timestamp and caller ID, are uploaded to the blockchain network. The uploaded classification results are verified through smart contracts to ensure the integrity of the results and the credibility of the source. At the same time, the access rights to the classification results are controlled by smart contracts, and only authorized parties can access and decrypt the results. In this way, the confidentiality of the classification results is guaranteed and the trusted sharing of the results is achieved.

[0008] Among them, the generative adversarial network can generate samples that are highly similar to real texts through adversarial learning between the generator and the discriminator, which is used to enhance the robustness and generalization ability of the text detection model. The discriminator can be used as a text detection model to continuously improve the recognition and detection ability of false texts through adversarial training. Homomorphic encryption allows calculations to be performed directly on ciphertext, and the calculation results are consistent with the plaintext calculation results after decryption. By homomorphically encrypting the model parameters and input data, model training and reasoning calculations can be performed without leaking the original data, effectively protecting data privacy. Secure multi-party computing allows multiple participants to complete computing tasks together without leaking their own private data. By splitting and secretly sharing the model parameters and input data, multiple participants can collaborate on model reasoning, which improves the security and reliability of the model while ensuring data privacy. The aggregated encrypted model parameters and encrypted classification results are written into the blockchain network, and the classification results are access control and verification through smart contracts, which reflects the application of blockchain technology in ensuring that data cannot be tampered with and is traceable. The blockchain network records data in the form of a distributed ledger, and uses a consensus mechanism and hash chain structure to ensure the integrity and non-tamperability of data. By putting model parameters and classification results on the chain and using smart contracts to control access to and verify data, the transparency and credibility of the entire detection and evaluation process can be guaranteed, and data can be prevented from being maliciously tampered with or forged. In the text classification task, by extracting features from the text classification data set, the text feature vector is obtained, and it is used as training data to input the generative adversarial network model for training, which reflects the technical characteristics of text classification and feature engineering. Text classification is an important task in the field of natural language processing. By representing and extracting features from text data, unstructured text can be converted into structured feature vectors, laying the foundation for subsequent model training and prediction.

[0009] Specifically, in step S3, the trained text detection model is encrypted using the Paillier homomorphic encryption algorithm. Specifically, the public key required for Paillier encryption is first generated. and private key , where n is the product of two large prime numbers p and q, and g is A generator of , λ is , μ is The modular inverse of n, where In the Paillier encryption algorithm, lcm stands for the least common multiple. Then, each parameter w_i of the text detection model is encrypted to obtain the encrypted parameter , where r is a randomly selected optimization factor to ensure semantic security. Then, the encrypted model parameters are distributed to multiple participants using the secure multi-party computing (MPC) protocol. Here, the secret sharing technology is used to divide the encrypted model parameters into multiple shares, and each participant only holds one of the shares. Specifically, for each encrypted parameter , randomly generate k-1 shares , the kth share pass Calculate, where j=1, 2, ..., k-1. Then, k shares The secret is sent to k participants respectively. Each participant holds only one share and cannot restore the original encryption parameters alone. In order to further improve security and reliability, the Verifiable Secret Sharing (VSS) protocol can be introduced to ensure that the shares held by each participant are valid and consistent.

[0010] Specifically, when distributing the secret shares, the secret sharing party generates and publishes a set of commitments, allowing the participants to verify whether the shares they received are correct without revealing the shares of other participants. Commitments can be generated through the Pedersen commitment scheme, that is, for the shares , generate random numbers , calculate commitment , where g and h are two generators and p is a large prime number. The secret sharing party publishes all the commitments , participants can check To verify the validity of the sharing, where j = 1, 2, ..., k. After all participants verify that the sharing is valid, the partially encrypted model parameters held by multiple participants are securely aggregated through the secret reconstruction protocol in MPC.

[0011] Specifically, each participant calculates ,in is the value of the Lagrange interpolation polynomial at 0. Then, all participants send Ti to a designated aggregator, who calculates , get the aggregated encrypted model parameters . In order to verify the correctness of the aggregation results, a zero-knowledge proof protocol, such as the Schnorr protocol, can be introduced to allow the aggregator to prove that it has indeed calculated the correct aggregation results according to the protocol without leaking the individual's Ti value. Finally, the aggregated encrypted model parameters are written to the blockchain network. To further improve security, a secure decentralized storage protocol, such as the Inter Planetary File System (IPFS), can be deployed on the blockchain to store the encrypted parameters in the IPFS network, and only the IPFS hash value is stored on the blockchain as an index. In this way, even if the blockchain network is attacked, the content of the encrypted parameters cannot be directly obtained. At the same time, in order to achieve access control and auditing, smart contracts can be deployed on the blockchain to stipulate that only authorized parties can access and use the encrypted model parameters, and all access logs are recorded to achieve traceability and auditability.

[0012] Preferably, the Verifiable Secret Sharing (VSS) protocol is introduced to ensure that the shares held by the participants are valid and consistent by generating and verifying commitments, thereby improving security. In the secret reconstruction phase, a zero-knowledge proof protocol, such as the Schnorr protocol, is introduced to allow the aggregator to prove the correctness of the aggregation results without disclosing personal shares, further protecting privacy. The decentralized storage protocol IPFS is used to store encryption model parameters, and only IPFS hash indexes are stored on the blockchain to improve storage security and scalability. Smart contracts are deployed on the blockchain to implement access control and auditing of encryption model parameters, record all access logs, and achieve traceability and auditability.

[0013] Further, in step S2, feature extraction is performed on the text classification data set to obtain a text feature vector, including: encoding the text classification data set using a pre-trained BERT (Bidirectional Encoder Representations from Transformers) model to extract a semantic feature vector. BERT is a pre-trained language model based on the Transformer architecture. By performing bidirectional encoding training on large-scale unlabeled text data, rich semantic representations can be learned. Specifically, each text classification data set is input into the BERT model, and after calculation by multiple layers of Transformer encoders, the corresponding word vector or sentence vector is extracted from the output of the last layer as a semantic feature vector. The BERT model can capture the contextual information and semantic relationship of the text and generate high-quality semantic representations. The text classification data set is segmented to obtain a word sequence of each text classification data set. Here, a segmentation tool suitable for a specific language can be used, such as NLTK and spaCy in English, jieba and THULAC in Chinese, etc. The segmentation process divides each text classification data set into a series of words or phrases to form a word sequence. Segmentation is the basis of text feature extraction, and can convert unstructured text into a structured word sequence representation. Based on the word sequence, the TF-IDF (Term Frequency-Inverse Document Frequency) algorithm is used to calculate the weight of each word in the corresponding text classification dataset to obtain a weight vector. TF-IDF is a classic text feature representation method that takes into account the frequency of occurrence of a word in a text and its sparsity in the entire corpus. For each text classification dataset, the TF value of each word in its word sequence is calculated, that is, the frequency of occurrence of the word in the text. At the same time, the IDF value of each word is calculated, that is, the logarithm of the reciprocal number of texts in which the word appears in the entire text classification dataset. The TF value and IDF value of each word are multiplied to obtain the TF-IDF weight of the word in the corresponding text. Finally, each text classification dataset can be represented as a TF-IDF weight vector, where each dimension of the vector corresponds to a word and the dimension value is the TF-IDF weight of the word. The extracted semantic feature vector and the weight vector are concatenated to obtain the initial text feature vector corresponding to each text classification dataset. Specifically, for each text classification dataset, the semantic feature vector obtained by BERT encoding and the TF-IDF weight vector are concatenated to form a longer vector representation. The concatenated vector contains both deep semantic information and word-level statistical information, which can more comprehensively characterize the characteristics of the text.

[0014] Preferably, after obtaining the initial text feature vector, further optimization and processing can be performed to improve the quality and effectiveness of the features: normalize the initial text feature vector, such as L2 normalization, scale the vector to unit length, eliminate the dimensional differences between different feature dimensions, and make the feature vectors between different texts more comparable. Use feature selection or dimensionality reduction techniques, such as chi-square test, information gain, principal component analysis (PCA), etc., to select the most discriminative and informative feature subsets from the initial text feature vector, or map the high-dimensional feature vector to a low-dimensional space to reduce the dimension of the feature and improve the training efficiency and generalization performance of the model. Introduce attention mechanisms, such as Self-Attention or HierarchicalAttention, to assign different importance weights to different features in the initial text feature vector, so that the model can adaptively focus on the key information in the text and capture the semantic focus and contextual dependencies of the text. Use technologies such as local sensitive hashing (LSH) to quickly index and retrieve text feature vectors, improve the efficiency of feature matching and similarity calculation, and support real-time processing of large-scale text data.

[0015] Further, in step S2, the text feature vector of the text classification data set is extracted. In addition to using the pre-trained BERT model to extract semantic features and the TF-IDF algorithm to calculate word weights, a feature selection network based on the attention mechanism is introduced to further optimize and refine the initial text feature vector, including: constructing a feature selection network based on the attention mechanism, and taking the obtained initial text feature vector as input. The feature selection network adopts a combined structure of an attention mechanism layer and a fully connected layer, the purpose of which is to adaptively select and combine the most discriminative and informative features by learning the importance weights of the features, so as to obtain a more compact and effective text representation. The importance weight of each feature is learned by the attention mechanism layer in the feature selection network to obtain an attention weight vector. Specifically, the initial text feature vector is input into the attention mechanism layer, and the correlation and importance between the features are calculated by Self-Attention or a similar attention calculation method. The attention mechanism layer assigns a weight score to each feature by learning the interaction and dependency between the features, indicating the contribution of the feature to the text semantics. The higher the weight score, the more important the feature is and the more information it contains. The weight scores are normalized by the Softmax function to obtain the attention weight vector. Each element of the vector takes a value between 0 and 1, indicating the importance weight of the corresponding feature. The attention weight vector is multiplied element by element with the initial text feature vector to obtain the weighted text feature vector. Specifically, each element in the attention weight vector is multiplied with the element at the corresponding position in the initial text feature vector to obtain the weighted feature value. Through this weighted operation, the influence of important features can be amplified and the interference of minor features can be weakened, so that the text feature vector pays more attention to key information and ignores noise and redundancy. The weighted text feature vector is input into the fully connected layer of the feature selection network, and the final text feature vector is obtained through nonlinear transformation. The fully connected layer maps the weighted text feature vector to a new feature space through a series of nonlinear transformations, such as Sigmoid, ReLU and other activation functions, and extracts high-level semantic representations. The fully connected layer can be trained end-to-end through the back-propagation algorithm to optimize the parameters of the feature selection network so that it can learn the most discriminative and generalizable text feature representation.

[0016] Preferably, the following optimization techniques can also be used to further improve the performance and efficiency of the feature selection network: introduce a multi-head attention mechanism in the attention mechanism layer, divide the feature vector into multiple subspaces, calculate the attention weight independently in each subspace, and then concatenate or average the results of multiple subspaces to obtain the final attention weight vector. The multi-head attention mechanism can capture the diverse relationships between features and improve the expressiveness and robustness of the attention mechanism. Add a residual connection to the feature selection network, and add the initial text feature vector to the output of the fully connected layer at the element level to form a residual block. The residual connection can alleviate the degradation problem of the network, allowing the network to learn a deeper feature representation while accelerating the training convergence speed. Perform L1 or L2 regularization on the output of the feature selection network to encourage the network to learn sparse feature representations and reduce the influence of redundant and noisy features. The regularization term can be used as part of the loss function and jointly optimized with the classification loss to balance feature selection and classification performance. Dropout technology is used to randomly discard some neurons between the fully connected layers of the feature selection network to prevent overfitting and improve the generalization ability of the network. Dropout can be seen as a variant of ensemble learning. By averaging the prediction results of multiple sub-networks, it reduces the dependence on a single feature or neuron and enhances the robustness of the model.

[0017] Further, in step S2, the extracted text feature vector is used as training data and input into a text detection model based on a generative adversarial network (GAN) for training, including: constructing a generator and a discriminator of the text detection model. The generator adopts a conditional generative adversarial network (CGAN) structure, and the discriminator adopts a convolutional neural network (CNN) structure. CGAN is a variant of GAN, and by introducing conditional information, specific properties of generated samples can be controlled. CNN performs well in text classification tasks and can effectively extract local features and semantic information of text. The extracted text feature vector is used as a conditional input, and a random noise vector is sampled from a preset random distribution (such as a Gaussian distribution or a uniform distribution). Then, the text feature vector and the random noise vector are concatenated to form a conditional vector. The conditional vector contains the semantic features and random noise of the text, and can control the content and diversity of the generated text. The conditional vector is input into the generator. The generator uses an LSTM (Long Short-Term Memory) network to perform sequence modeling on the conditional vector. LSTM is a recurrent neural network that can capture long-distance dependencies and contextual information of text. Through the LSTM network, the generator generates adversarial text samples based on the conditional vector, making it semantically close to the real text, but with certain differences and diversity. The adversarial text samples generated by the generator and the real text samples in the text classification dataset constitute training data pairs. The training data pairs are input into the discriminator. The discriminator extracts local features of the text through the convolution layer, performs feature selection and dimension reduction through the pooling layer, and fuses the extracted features through the fully connected layer. Finally, the discriminator outputs the authenticity probability of the text (indicating whether the text is real or generated) through the sigmoid function, and outputs the category probability of the text (indicating the possibility that the text belongs to each category) through the softmax function. According to the authenticity probability and category probability of the text output by the discriminator, the objective functions of the generator adversarial loss, the discriminator adversarial loss and the discriminator classification loss are constructed. The generator adversarial loss is used to measure the distribution difference between the generated text and the real text in the discriminator feature space. The goal is to make the generated text as close to the real text as possible and deceive the discriminator into judging it as real text. Commonly used loss functions are cross entropy loss or Wasserstein distance. Discriminator adversarial loss is used to measure the discriminator's ability to distinguish between real text and generated text. The goal is to enable the discriminator to accurately distinguish between real text and generated text, judging real text as true and generated text as false. Commonly used loss functions include binary cross entropy loss. Discriminator classification loss is used to measure the discriminator's accuracy in distinguishing text categories. The goal is to enable the discriminator to correctly predict the category to which the text belongs, minimizing classification errors. Commonly used loss functions include multivariate cross entropy loss or focal loss.Through the gradient descent algorithm (such as Adam optimizer) and the back-propagation algorithm, the parameters of the generator and the discriminator are alternately trained to minimize the objective function of the discriminator classification loss. During the training process, the generator and the discriminator compete with each other and continuously improve each other's performance until a Nash equilibrium is reached. The generator learns to generate realistic adversarial text samples, and the discriminator learns to accurately distinguish the authenticity and category of the text. After multiple rounds of iterative training, the final text detection model is obtained.

[0018] Preferably, the following techniques can also be used to optimize the training effect of the model: Introduce an attention mechanism (such as Self-Attention or Hierarchical Attention) in the generator, so that it can adaptively focus on different parts of the text, capture key information and long-distance dependencies, and generate more coherent and semantically consistent text. Introduce residual connection or gradient penalty in the discriminator to alleviate the gradient vanishing and gradient exploding problems in GAN training, and improve training stability and convergence speed. Use techniques such as Spectral Normalization or Wasserstein GAN to constrain the Lipschitz constant of the discriminator to prevent the discriminator from being too powerful, making it difficult for the generator to learn. Use techniques such as Teacher Forcing or Scheduled Sampling to gradually reduce the reliance on real text during the training of the generator, and encourage the generator to generate more diverse and innovative texts. Introduce the idea of ​​Reinforcement Learning, regard GAN training as a sequential decision-making process, and optimize the generator's strategy through algorithms such as PolicyGradient, so that it can dynamically adjust the generation behavior according to feedback signals.

[0019] Further, in step S2, the extracted text feature vector is used as training data and input into a text detection model based on a generative adversarial network for training. In addition to the basic CGAN and CNN structures, it also includes: by adjusting the dimension and sampling distribution parameters of the random noise vector, the diversity of the adversarial text samples output by the generator is controlled. The random noise vector is one of the inputs of the generator, and its dimension and sampling distribution will affect the degree of variation and richness of the generated text. By increasing the dimension of the random noise vector, the potential space of the generator can be expanded, enabling it to generate more diverse text samples. At the same time, by adjusting the sampling distribution parameters of the random noise vector (such as mean, variance, mixing coefficient, etc.), the specific attributes and style of the generated text can be controlled. For example, sampling noise vectors from different Gaussian distributions can generate texts with different themes or emotional tendencies. The Gumbel-Softmax function is set at the output layer of the generator to convert the discrete text generation process into a continuous gradient process. When traditional GAN ​​generates discrete data (such as text), it faces the problem that the gradient cannot be directly transferred, resulting in training difficulties. The Gumbel-Softmax function relaxes the discrete sampling process into continuous approximate sampling by introducing Gumbel random variables and Softmax functions, so that the gradient can flow between the generator and the discriminator. Specifically, in the output layer of the generator, the logit value of each word is Gumbel-Softmax transformed to obtain a continuous probability distribution. Then, discrete word sequences are sampled from this distribution. In this way, the generator can directly use the gradient information of the discriminator for optimization, improving the stability and efficiency of training. The gradient penalty term is set as a regularization term in the loss function of the discriminator to constrain the gradient norm of the discriminator and prevent the discriminator from overfitting. In GAN training, if the discriminator is too powerful, it may make it difficult for the generator to learn and fall into the problem of gradient vanishing or gradient exploding. The gradient penalty (GradientPenalty) penalizes the degree to which the gradient norm of the discriminator at the interpolation point between the real sample and the generated sample deviates from 1 by adding a regularization term to the loss function of the discriminator. Specifically, each time the discriminator is updated, an interpolation point is randomly selected, the gradient norm of the discriminator output to the input at this point is calculated, and the square of the difference between it and 1 is used as a penalty term and added to the discriminator's loss function. In this way, the discriminator can be encouraged to maintain smoothness and Lipschitz continuity between real samples and generated samples, preventing the discriminator from overfitting real data and improving the learning ability of the generator. The weight matrices of the convolutional layer and the fully connected layer of the discriminator are spectrally normalized, and the spectral norm of the weight matrix is ​​set to a constant to improve the Lipschitz continuity of the discriminator.Spectral Normalization is a parameter constraint technique that limits the spectral norm (i.e., maximum singular value) of the discriminator weight matrix so that the discriminator function satisfies the Lipschitz continuity condition. Specifically, the weight matrix of each convolutional layer and fully connected layer of the discriminator is spectrally decomposed to obtain its maximum singular value. Then, the weight matrix is ​​divided by the maximum singular value to make its spectral norm equal to 1. In this way, the Lipschitz constant of the discriminator function can be controlled, the gradient explosion of the discriminator can be prevented, and the stability and convergence of GAN training can be improved. At the same time, spectral normalization does not significantly increase the computational complexity and is easy to implement and integrate into the existing GAN framework.

[0020] Preferably, the training process of the text detection model based on the generative adversarial network can be further optimized: by adjusting the dimension of the random noise vector and the sampling distribution parameters, the diversity of the adversarial text samples output by the generator is controlled, so that the generated text is richer and more realistic, covering a wider semantic space. By setting the Gumbel-Softmax function in the output layer of the generator, the discrete text generation process is converted into a continuous gradient process, so that the generator can directly use the gradient information of the discriminator for optimization, alleviate the gradient transfer problem in discrete data generation, and improve the stability and efficiency of training. By setting the gradient penalty term in the loss function of the discriminator, the gradient norm of the discriminator is constrained to prevent the discriminator from overfitting, and the discriminator is encouraged to maintain smoothness and Lipschitz continuity between real samples and generated samples, thereby improving the learning ability of the generator. By spectrally normalizing the weight matrices of the convolutional layer and the fully connected layer of the discriminator, the spectral norm of the weight matrix is ​​set to a constant, the Lipschitz continuity of the discriminator is improved, the Lipschitz constant of the discriminator function is controlled, the gradient explosion of the discriminator is prevented, and the stability and convergence of GAN training are improved.

[0021] Further, in step S4, a homomorphic encryption algorithm is used to encrypt the text to be classified to protect data privacy and security, including: dividing the text to be classified into m parts according to a preset method, and each part is encrypted and processed by a participant. The preset method can be divided according to the length, content, semantics and other characteristics of the text to ensure that the size and importance of each part are relatively balanced. For example, it can be divided according to natural division units such as sentences, paragraphs, pages, etc. of the text, or it can be divided according to semantic units such as the subject, keywords, named entities, etc. of the text. The purpose of the division is to assign the encryption and processing tasks of the text to multiple participants to achieve distributed and parallel secure computing. Each participant generates their own public-private key pair based on the Paillier homomorphic encryption algorithm, the public key is used to encrypt data and homomorphic computing, and the private key is used to decrypt data. Paillier homomorphic encryption is a probabilistic public key encryption system based on a composite residue class, which has additive homomorphism, that is, the addition operation on the ciphertext is equivalent to the addition operation on the plaintext. Specifically, the i-th participant generates a pair of public and private keys (pki, ski), where the public key pki includes a large integer Ni and a generator gi, satisfying specific number theory conditions; the private key ski is a factor related to Ni. The public key pki can be made public to other participants for encrypting data and performing homomorphic computations; the private key The i-th participant keeps it for decrypting data. The i-th participant uses the generated i-th public key Encrypt the i-th text part to obtain the i-th encrypted text segment. Specifically, for each numerical feature in the i-th text part (such as word frequency, TF-IDF value, etc.), the i-th participant uses the public key In and , calculate the encrypted ciphertext: ,in, is a randomly selected integer used to ensure the semantic security of encryption. Through this encryption operation, the i-th text part is converted into the i-th encrypted text fragment, and each numerical feature is encrypted into a ciphertext.

[0022] Preferably, for non-numerical text features (such as part of speech, named entities, etc.), it is necessary to first perform appropriate encoding or quantization, convert them into numerical features, and then perform homomorphic encryption. Common encoding methods include One-Hot encoding, WordEmbedding, etc. In order to improve the efficiency of encryption and calculation, a block encryption strategy can be adopted to further divide each text part into multiple small blocks, encrypt each small block independently, and then splice the encrypted small blocks together to form an encrypted text fragment. This can reduce the time and space complexity of a single encryption. During the encryption process, it is necessary to ensure that the public keys Ni between different participants are mutually prime to ensure the correctness of subsequent homomorphic calculations. Secure multi-party computing protocols, such as secret sharing, oblivious transmission, etc., can be used to securely exchange and verify public keys between participants. In order to verify the correctness of encryption and calculation, mechanisms such as zero-knowledge proof or homomorphic signature can be introduced to enable participants to prove to other participants that they have performed correct encryption and calculation operations without disclosing private keys and plaintext.

[0023] Furthermore, in step S4, a homomorphic encryption algorithm is used to encrypt the text to be classified, and a multi-party secure computing framework based on federated learning is constructed to realize distributed model training and gradient aggregation, including: constructing a multi-party secure computing framework based on federated learning, and using the obtained model parameters encrypted by the i-th public key and the obtained i-th encrypted text fragment as the input of the i-th participant. Federated learning is a distributed machine learning paradigm that allows multiple participants to collaboratively train a global model without sharing original data. In this framework, each participant maintains a local model and uses the encrypted text fragment and model parameters for local training. The input of the i-th participant includes two parts: one is the global model parameters encrypted by the i-th public key, and the other is the i-th encrypted text fragment. In the federated learning framework, the i-th participant independently performs local model training. Local model training includes the following steps: inputting the i-th encrypted text fragment into the i-th local model, and calculating the output and loss function of the i-th local model in the encrypted space. Specifically, the i-th participant uses the encrypted text fragment as input, performs forward propagation of the local model in the encrypted space through homomorphic computation, and obtains the encrypted model output and loss function value. The gradient of the i-th local model is calculated based on the Paillier homomorphic property. Using the additive homomorphism of Paillier encryption, the i-th participant can calculate the gradient of the local model in the encrypted space without decrypting the intermediate results. The partial derivatives of the loss function with respect to the model parameters can be approximated by homomorphic addition and scalar multiplication. The above steps are performed independently for all participants, that is, the value range of i is 1 to m. Each participant uses its own encrypted text fragment and local model for training to obtain the encrypted local gradient. Each participant uploads the calculated encrypted local gradient to the federated learning server for encrypted aggregation. The federated learning server is a central node responsible for coordinating communication and computation between participants. The participant sends the encrypted local gradient to the server, and the server aggregates these gradients in the encrypted space to obtain the encrypted global gradient. The federated learning server adds random noise to the encrypted gradients through the differential privacy mechanism, and uses the secret sharing protocol to decrypt the aggregated results into plaintext gradients. To further protect privacy, the server adds random noise to the aggregated encrypted gradients and uses differential privacy technology so that the contributions of individual participants are hidden in the noise. Then, the server collaborates with the participants to decrypt the aggregated gradients through the secret sharing protocol to obtain the global gradient in plaintext. Secret sharing ensures the security of the decryption process and prevents a single participant or server from obtaining plaintext information alone. The federated learning server updates the global model parameters based on the plaintext gradients and sends the updated global parameters to each participant. The server uses the plaintext global gradients to update the parameters of the global model through optimization algorithms such as gradient descent.The updated global parameters are encrypted and distributed to all participants for the next round of local training. The local training and gradient aggregation process is repeated until the global model parameters meet the preset convergence conditions. Federated learning continuously updates the global model through multiple rounds of iterations until the model performance reaches the expected convergence standard, such as the change in the loss function value is less than the threshold, or the maximum number of iterations is reached.

[0024] Preferably, in order to improve communication efficiency, gradient compression, sparsification and other technologies can be used to reduce the size of uploaded gradients. At the same time, an asynchronous communication mode can be used to allow participants to upload gradients asynchronously to reduce waiting time. In order to ensure the security of the model, secure multi-party computing mechanisms such as secret sharing and oblivious transmission can be introduced to achieve secure communication and calculation between participants. Verifiable computing technology can also be used to enable participants to verify the correctness of the calculation results performed by each other. In order to balance model performance and privacy protection, the privacy budget and noise intensity of differential privacy can be adjusted to weigh the risk of privacy leakage and model effect. At the same time, a hybrid privacy protection mechanism can be used to combine homomorphic encryption, differential privacy, secure multi-party computing and other technologies to provide stronger privacy guarantees.

[0025] Further, in step S4, the text to be classified is encrypted by a homomorphic encryption algorithm, and combined with secret sharing and obfuscation circuits and other technologies, text classification under multi-party secure computing is realized, including: the i-th participant inputs the i-th local model obtained by training the text fragment to be classified encrypted by the i-th public key, calculates the output of the i-th local model in the encryption space, and obtains the i-th encrypted intermediate result. Specifically, the i-th participant uses its own trained local model to predict the encrypted text fragment to be classified, and obtains the encrypted intermediate result through homomorphic computing. This intermediate result can be the output probability, feature vector, etc. of the model, depending on the specific model architecture and task. The i-th participant uses a secret sharing protocol to divide the i-th encrypted intermediate result into k secret shares, and sends k-1 secret shares to other participants respectively. Secret sharing is a basic protocol for secure multi-party computing, which allows a secret value to be divided into multiple shares, which are held by different participants, and the original secret value can only be reconstructed when enough shares are aggregated. Common secret sharing protocols include Shamir secret sharing and Blakley secret sharing. The i-th participant divides the encrypted intermediate result into k secret shares, retains one share for itself, and distributes the remaining k-1 shares to other participants. Each participant collects m secret shares, reconstructs the m secret shares into the i-th encrypted intermediate result using the reconstruction algorithm of the secret sharing protocol, and uploads the reconstructed i-th encrypted intermediate result to the federated learning server. Each participant receives k-1 secret shares from other participants, plus one share held by itself, for a total of k shares. Using the reconstruction algorithm of the secret sharing protocol, such as Lagrange interpolation, the i-th encrypted intermediate result can be recovered from these k shares. Each participant uploads the reconstructed encrypted intermediate result to the federated learning server. The federated learning server collects the m uploaded encrypted intermediate results, and uses the additive homomorphic property of the Paillier homomorphic encryption algorithm to perform homomorphic addition operations on the m encrypted intermediate results in the encrypted space to obtain the encrypted aggregated result. The server performs element-wise addition on the encrypted intermediate results uploaded by all participants in the encrypted space to obtain the encrypted aggregated result. This aggregated result represents the comprehensive information output by the local models of all participants, but it is still encrypted. The federated learning server uses the threshold decryption mechanism of the Paillier homomorphic encryption algorithm to decrypt the encrypted aggregated result together with each participant to obtain the plaintext aggregated result. Paillier homomorphic encryption supports threshold decryption, which means that the private key is divided into multiple shares, and the decryption is completed by multiple parties in collaboration. The server sends the encrypted aggregated result and its own private key share to each participant. Each participant uses its own private key share to partially decrypt the aggregated result, and then returns the partially decrypted result to the server.The server collects all partial decryption results and combines them to obtain the aggregated result of the plaintext. The federated learning server inputs the aggregated result of the plaintext into the obfuscated circuit protocol. The obfuscated circuit protocol uses Boolean circuits to perform secure comparison and classification judgment on the aggregated results of the plaintext and output the final text classification result. Obfuscated circuits are a secure multi-party computing protocol that allows multiple parties to jointly calculate a Boolean circuit without disclosing their respective inputs. The server uses the plaintext aggregation result as input and collaborates with the participants to execute the obfuscated circuit protocol. Boolean operations are used inside the obfuscated circuit to perform secure comparisons, threshold judgments and other operations on the aggregated results, and finally obtain the classification label of the text. Obfuscated circuits ensure the privacy of the calculation process, and the participants cannot know each other's inputs and intermediate results.

[0026] Preferably, in order to improve computing efficiency, parallel computing and batch processing can be used to encrypt, share secrets and perform obfuscated circuit calculations on large-scale text data in batches and in parallel. At the same time, hardware accelerators such as GPUs and FPGAs can be used to accelerate cryptography and machine learning operations. In order to verify the correctness of the calculation results, verifiable computing technologies such as zk-SNARK and zk-STARK can be introduced to enable participants to prove the correctness of the calculation process and results they perform without disclosing privacy. This can prevent malicious participants from submitting erroneous intermediate or final results.

[0027] Further, in step S5, the classification results are controlled by smart contracts to ensure that only authorized callers can access the classification results, and the credibility and integrity of the classification results are verified, including: the smart contract includes an access control contract and a result verification contract, and the two contracts work together to achieve access control and verification of the classification results. Smart contracts are self-executing, tamper-proof codes deployed on the blockchain, which automatically execute the contract logic through predefined rules and conditions. The access control contract is responsible for verifying the identity and access rights of the caller, and the result verification contract is responsible for verifying the metadata of the classification results to ensure the credibility of the results. The access control contract verifies whether the caller has the right to access the output text classification results based on the caller's identity information and access request, and grants or denies access based on the verification result. Specifically, the access control contract maintains an access control list (ACL) that records the identity information and corresponding access rights of each caller. When the caller initiates an access request, it needs to provide its own identity information, such as a digital certificate, public key, etc. The access control contract verifies the authenticity of the caller's identity by verifying the caller's digital signature. Then, the contract queries the ACL based on the caller's identity information to determine whether it has the right to access the corresponding classification results. If there is permission, access is granted; otherwise, the access request is denied. The result verification contract verifies the source credibility and integrity of the classification result by verifying the timestamp and caller ID in the metadata of the uploaded classification result. The metadata of the classification result contains information such as timestamp and caller ID, which is used to track and verify the generation process of the result. When the result verification contract receives the classification result, it first checks the digital signature of the result to ensure that the result has not been tampered with. Then, the contract extracts the timestamp and caller ID in the result metadata and compares them with the status maintained inside the contract. By verifying the timestamp, it can be determined whether the result is the latest generated; by verifying the caller ID, it can be confirmed that the result is generated by an authorized caller. Only verified classification results will be accepted and stored.

[0028] Another aspect of the present specification also provides a blockchain-based generative artificial intelligence detection and evaluation system for executing a blockchain-based generative artificial intelligence detection and evaluation method of the present application, including: a text generation module: the module is based on generative artificial intelligence technology, such as GPT, BERT, etc., to realize the understanding and generation of input text. The module receives the text fragments or keywords input by the user, and generates relevant text content through a pre-trained language model. The generation process adopts privacy protection mechanisms, such as differential privacy, homomorphic encryption, etc., to ensure the privacy security of user input. The technical features of this module include large-scale language models, privacy protection generation algorithms, etc. Text segmentation module: the module is responsible for segmenting the generated text content according to certain rules and strategies to form multiple text fragments. The segmentation rules can be based on semantics, syntax, length and other factors to ensure that the segmented fragments have independent meaning and integrity. The technical features of this module include text segmentation algorithms, adaptive segmentation strategies, etc. Privacy protection module: the module is responsible for privacy protection processing of the segmented text fragments to ensure the privacy security of the text content during the detection and evaluation process. The module adopts a homomorphic encryption algorithm to encrypt the text fragments and generate encrypted text fragments. At the same time, the module generates the corresponding public and private key pairs for subsequent ciphertext calculations and result decryption. The technical features of this module include homomorphic encryption algorithms, key management mechanisms, etc. Federated learning module: Based on the federated learning framework, this module coordinates multiple participants to conduct collaborative text classification model training and reasoning. The module takes the encrypted text fragments and public keys generated by the privacy protection module as input and distributes them to each participant. The participants use the encrypted data to train the model locally, and optimize the global model through encrypted gradient aggregation and model update. The technical features of this module include federated learning protocols, encrypted gradient aggregation algorithms, model encryption and decryption mechanisms, etc. Secure computing module: Based on federated learning, this module introduces secure multi-party computing technology to achieve privacy-preserving computing of classification results. The module uses protocols such as secret sharing and obfuscated circuits to securely calculate text classification results between multiple participants while protecting the input privacy of all parties. The calculation process ensures the correctness and credibility of the results through mechanisms such as threshold decryption and verifiable computing. The technical features of this module include secret sharing protocols, obfuscated circuit design, threshold decryption mechanisms, verifiable computing protocols, etc. Blockchain module: This module uses blockchain technology to provide decentralized data storage, consensus mechanism and smart contracts for the system. The module stores encrypted text fragments, model parameters, classification results and other data on the blockchain to ensure that the data cannot be tampered with and is traceable. The consensus mechanism ensures the consistency and credibility of the data through multi-party verification and confirmation. Smart contracts implement access control and verification of classification results, control access to the results based on the identity and permissions of the caller, and verify the credibility and integrity of the source of the results.The technical features of this module include blockchain architecture, consensus algorithm, smart contract design, access control mechanism, etc. User interface module: This module provides a user-friendly interactive interface, allowing users to input text content to be detected and display the results of the detection evaluation. The module presents information such as confidence, keyword annotation, risk warning, etc. of text classification in a visual way to help users intuitively understand and interpret the results. At the same time, the module provides identity authentication and authorization mechanisms to ensure that only authorized users can access and use system functions. The technical features of this module include user interface design, data visualization technology, identity authentication protocol, etc. The text generation module is responsible for generating text content to be detected, the text segmentation module segments the text, and the privacy protection module encrypts the text fragments. The federated learning module and the secure computing module implement distributed text classification model training and privacy protection computing, and the blockchain module provides data storage, consensus and access control. The user interface module is responsible for interaction with users and result display. Generative artificial intelligence technology is used to generate and understand text content, privacy protection technology ensures the confidentiality of user data, federated learning and secure computing technology realize multi-party collaborative model training and reasoning, and blockchain technology provides the characteristics of data immutability and traceability, as well as flexible access control and verification mechanisms.

[0029] Compared with the prior art, the advantages of this application are:

[0030] By introducing a text detection model based on conditional generative adversarial networks, the generator is used to generate adversarial samples, the generalization ability of the discriminator is enhanced, and the text classification model can effectively identify adversarial attacks and improve the robustness of the model.

[0031] The pre-trained BERT model is used to extract the semantic features of the text, and the TF-IDF algorithm is used to extract the word weight features. The attention mechanism is used to perform feature selection and weighting to obtain a more discriminative text feature vector and improve the accuracy of text classification.

[0032] The Gumbel-Softmax function is introduced in the output layer of the generator to convert the discrete text generation process into a continuous gradient optimization process. The gradient penalty term is introduced in the loss function of the discriminator to constrain the gradient norm of the discriminator to prevent the gradient vanishing or gradient exploding problems and improve the stability and convergence speed of training.

[0033] The Paillier homomorphic encryption algorithm is used to encrypt the model parameters and the text to be classified to ensure that the original data will not be leaked to other participants. Through the secure multi-party computing protocol, the multi-party collaborative model training and reasoning process is realized in the encrypted space to complete the text classification task without leaking privacy.

[0034] The encrypted model parameters are uploaded to the blockchain network, and the decentralized characteristics and consensus mechanism of the blockchain are used to ensure the transparency and verifiability of the model training process, and prevent single point failures and malicious tampering.

[0035] Adopt secure computing protocols such as secret sharing and obfuscated circuits to achieve privacy-preserving reasoning among multiple parties and ensure that data during the reasoning process will not be leaked to other participants. Upload the reasoning results to the blockchain through smart contracts, use access control contracts and result verification contracts to control access rights to the results, and verify the integrity and source credibility of the results.

[0036] Based on the federated learning framework, the text classification task is divided into multiple participants. Each participant only needs to process part of the data it owns, which reduces the computing and storage pressure of a single participant and improves the scalability of the system. It is suitable for large-scale text classification scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 is an exemplary flow chart of a blockchain-based generative artificial intelligence detection and evaluation method according to some embodiments of this specification;

[0038] Figure 2 is an exemplary flow chart of obtaining an initial text feature vector according to some embodiments of this specification;

[0039] Figure 3 is an exemplary flow chart of obtaining a final text feature vector according to some embodiments of this specification;

[0040] Figure 4 is an exemplary flow chart of obtaining a trained text detection model according to some embodiments of this specification;

[0041] Figure 5 This is an exemplary flowchart for obtaining the final text classification result according to some embodiments of this specification. DETAILED DESCRIPTION

[0042] The method and system provided in the embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0043] Embodiment 1, Figure 1 is an exemplary flow chart of a blockchain-based generative artificial intelligence detection and evaluation method according to some embodiments of this specification, Figure 1 This is a flowchart of a blockchain-based generative artificial intelligence detection and evaluation method in this application. Figure 1As shown, the method mainly includes the following: obtaining a text classification data set, which includes text data and corresponding category labels; performing feature extraction on the text classification data set to obtain a text feature vector; using the extracted text feature vector as training data, and inputting it into a text detection model based on a generative adversarial network for training; using the Paillier homomorphic encryption algorithm to encrypt the trained text detection model; using a secure multi-party computing protocol to distribute the encrypted model parameters to multiple participants, each party holding part of the encrypted model parameters; aggregating the part of the encrypted model parameters held by multiple participants through a secret sharing protocol in secure multi-party computing to obtain the aggregated encrypted model parameters. model parameters; write the aggregated encrypted model parameters into the blockchain network; obtain the text to be classified, and use the Paillier homomorphic encryption algorithm to encrypt the text to be classified; use the secure multi-party computing protocol to distribute the encrypted text to be classified to multiple participants holding the encrypted model parameters, each party holding part of the encrypted text to be classified and the model parameters; through the secret sharing protocol and the obfuscated circuit protocol in the secure multi-party computing, each participant performs joint reasoning calculations in the encrypted space to obtain the encrypted classification results; upload the encrypted classification results and metadata containing the timestamp and caller ID to the blockchain network, and perform access control and verification on the classification results through smart contracts.

[0044] Figure 2 This is an exemplary flow chart for obtaining an initial text feature vector according to some embodiments of this specification, and a text classification data set is obtained, which includes text data and corresponding category labels. Data preparation stage: prepare a text classification data set as training data. Feature extraction stage: use the pre-trained BERT model to encode each text data in the text classification data set and extract a semantic feature vector. The BERT model converts the text data into a semantic feature vector of a fixed dimension, and each element in the vector represents the representation of the text in the corresponding semantic dimension. Each text data in the text classification data set is segmented to obtain a word sequence. Based on the word sequence, the TF-IDF algorithm is used to calculate the weight of each word in the corresponding text data to obtain a weight vector. The weight vector represents the importance of each word to the text representation. The extracted semantic feature vector and the weight vector are concatenated to obtain the initial text feature vector corresponding to each text data.

[0045] Figure 3This is an exemplary flow chart for obtaining the final text feature vector according to some embodiments of this specification. The feature selection stage: construct a feature selection network based on the attention mechanism, and take the initial text feature vector as input. Through the attention mechanism layer in the feature selection network, learn the importance weight of each feature to obtain the attention weight vector. The attention weight vector represents the contribution of each feature to the final text representation. The attention weight vector is multiplied element by element with the initial text feature vector to obtain a weighted text feature vector. The weighted text feature vector enhances the representation of important features and weakens the influence of secondary features. The weighted text feature vector is input into the fully connected layer of the feature selection network, and the final text feature vector is obtained through nonlinear transformation. The final text feature vector is a high-level representation of the original text data, which integrates semantic information and word weight information, and is optimized by the attention mechanism.

[0046] Figure 4 This is an exemplary flow chart for obtaining a trained text detection model according to some embodiments of this specification. In the model training stage, the generator and discriminator of the text detection model are constructed. The generator adopts a conditional generative adversarial network (CGAN) structure, and the discriminator adopts a convolutional neural network (CNN) structure. The extracted text feature vector is used as a conditional input, and a random noise vector is sampled from a preset random distribution (such as a Gaussian distribution). The text feature vector and the random noise vector are spliced ​​to form a conditional vector. The conditional vector is input into the generator, and the conditional vector is sequence modeled through the LSTM network in the generator to obtain an adversarial text sample. The adversarial text sample is a simulated text data generated by the generator according to the conditional vector. The adversarial text sample and the real text sample in the text classification data set constitute a training data pair. The training data pair is input into the discriminator. The discriminator extracts local features of the text through a convolutional layer, performs feature selection and dimensionality reduction through a pooling layer, and fuses the extracted features through a fully connected layer. The discriminator outputs the authenticity probability of the text through a sigmoid function, indicating the probability that the text is a real sample. The category probability of the text is output through a softmax function, indicating the probability that the text belongs to each category. According to the authenticity probability and category probability of the text output by the discriminator, the objective functions of the generator adversarial loss, discriminator adversarial loss and discriminator classification loss are constructed. The objective function measures the performance of the generator and the discriminator and guides the direction of model training. Through the gradient descent algorithm and the back propagation algorithm, the parameters of the generator and the discriminator are trained to minimize the objective function of the discriminator classification loss. The model parameters are continuously updated during the training process to improve the generator's ability to generate simulated text and the discriminator's ability to discriminate the authenticity and category of the text. During the training process, the diversity of the adversarial text samples output by the generator is controlled by adjusting the dimension and sampling distribution parameters of the random noise vector. The noise vector introduces randomness to increase the diversity of the generated text.

[0047] The Gumbel-Softmax function is set in the output layer of the generator to convert the discrete text generation process into a continuous gradient process. This allows the generator to directly use the gradient information of the discriminator for optimization and improve the stability of training. The gradient penalty term is set as a regularization term in the loss function of the discriminator to constrain the gradient norm of the discriminator and prevent the discriminator from overfitting. The gradient penalty term limits the gradient change speed of the discriminator and improves the generalization ability of the discriminator. The weight matrices of the convolutional layer and the fully connected layer of the discriminator are spectrally normalized, and the spectral norm of the weight matrix is ​​set to a constant. Spectral normalization improves the Lipschitz continuity of the discriminator and enhances the stability and robustness of the discriminator. After multiple rounds of iterative training, the final text detection model is obtained, including the trained generator and discriminator parameters.

[0048] Figure 5 This is an exemplary flow chart for obtaining the final text classification result according to some embodiments of this specification. Model application stage: Use the trained text detection model to extract features of new text data to be detected to obtain a text feature vector. Input the text feature vector into the trained generator to generate an adversarial text sample. Input the adversarial text sample into the trained discriminator to obtain the authenticity probability and category probability of the text. According to the authenticity probability and category probability, the authenticity and category of the text data to be detected are judged to achieve the purpose of text detection and classification.

[0049] Model encryption phase: obtain the trained text detection model, including the model parameters of the generator and the discriminator. The Paillier homomorphic encryption algorithm is used to encrypt the trained text detection model. Specifically, the model parameters of the generator and the discriminator are encrypted respectively. The Paillier homomorphic encryption algorithm generates a public key and a private key pair. The public key is used to encrypt the model parameters, and the private key is used to decrypt the encrypted model parameters. The model parameters of the generator and the discriminator are encrypted element by element using the public key of the Paillier homomorphic encryption algorithm. The encrypted model parameters are in ciphertext form, which protects the privacy of the model parameters. Model distribution phase: the encrypted model parameters are distributed to multiple participants using the secure multi-party computing protocol. Participants can be different institutions, organizations or individuals who jointly participate in the secure calculation of the model. The encrypted generator model parameters and the discriminator model parameters are divided into multiple parts, each of which contains partially encrypted model parameters. The divided partially encrypted model parameters are distributed to the corresponding participants through a secure channel. Each participant only holds partially encrypted model parameters and cannot restore the complete model alone.

[0050] Model aggregation phase: Aggregate some of the encrypted model parameters held by multiple participants through a secret sharing protocol. The secret sharing protocol ensures data privacy between participants, and the complete encrypted model parameters can only be restored when enough participants participate. Each participant secretly shares some of the encrypted model parameters it holds to generate multiple shared values. The number of shared values ​​is the same as the number of participants. The participants exchange shared values ​​through a secure channel to ensure that each participant obtains the shared values ​​of other participants. Each participant combines all the shared values ​​received through the recovery algorithm of the secret sharing protocol to obtain the aggregated encrypted model parameters. The aggregated encrypted model parameters are a linear combination of the original encrypted model parameters, which conforms to the properties of Paillier homomorphic encryption.

[0051] Blockchain storage phase: write the aggregated encryption model parameters to the blockchain network. The blockchain network consists of multiple nodes, each of which maintains a complete copy of the blockchain data. The participants package the aggregated encryption model parameters into transactions and submit them to the blockchain network. The transaction contains the hash value of the encryption model parameters to verify the integrity of the data. The consensus mechanism of the blockchain network ensures the validity and consistency of the transaction. Through consensus algorithms (such as proof of work, proof of stake, etc.), blockchain nodes reach a consensus on the transaction and package the transaction into blocks. The newly generated blocks are appended to the end of the blockchain to form an unalterable chain structure. The encryption model parameters are permanently recorded on the blockchain as transaction data. All nodes in the blockchain network synchronously update their own copies of the blockchain data to ensure that each node holds the same encryption model parameters.

[0052] Data encryption stage: obtain the text data to be classified, preprocess and segment it. Divide the text to be classified into m parts according to the preset method, and each part is encrypted and processed by a participant. Each participant generates its own public-private key pair based on the Paillier homomorphic encryption algorithm. The public key is used to encrypt data and homomorphic calculations, and the private key is used to decrypt data. The i-th participant uses the generated i-th public key to encrypt the i-th text part and obtain the i-th encrypted text fragment. The encrypted text fragment is in ciphertext form, which protects the privacy of the original text data.

[0053] Federated learning phase: Build a multi-party secure computing framework based on federated learning, and use the encrypted model parameters and encrypted text fragments as inputs for each participant. In the federated learning framework, the i-th participant independently performs local model training. Local model training includes: inputting the i-th encrypted text fragment into the i-th local model, and calculating the output and loss function of the i-th local model in the encrypted space. Calculate the gradient of the i-th local model based on the Paillier homomorphic property to obtain the encrypted local gradient. Each participant uploads the calculated encrypted local gradient to the federated learning server for encrypted aggregation. The federated learning server adds random noise to the encrypted gradient through the differential privacy mechanism to protect the privacy of the gradient data. The federated learning server uses a secret sharing protocol to decrypt the aggregation result into a plaintext gradient. The federated learning server updates the global model parameters based on the plaintext gradient and sends the updated global parameters to each participant. Repeat the local training and gradient aggregation process until the global model parameters meet the preset convergence conditions.

[0054] Inference calculation stage: The i-th participant uses the i-th public key to encrypt the text fragment to be classified and obtain the trained i-th local model, calculates the output of the i-th local model in the encrypted space, and obtains the i-th encrypted intermediate result. The i-th participant uses the secret sharing protocol to divide the i-th encrypted intermediate result into k secret shares, and sends k-1 secret shares to other participants respectively. Each participant collects m secret shares and uses the reconstruction algorithm of the secret sharing protocol to reconstruct the m secret shares into the i-th encrypted intermediate result. Each participant uploads the reconstructed i-th encrypted intermediate result to the federated learning server.

[0055] Result aggregation stage: The federated learning server collects the m uploaded encrypted intermediate results. The federated learning server uses the additive homomorphic property of the Paillier homomorphic encryption algorithm to perform homomorphic addition operations on the m encrypted intermediate results in the encrypted space to obtain the encrypted aggregated result. The federated learning server uses the threshold decryption mechanism of the Paillier homomorphic encryption algorithm to decrypt the encrypted aggregated result together with all participants to obtain the plaintext aggregated result.

[0056] Classification judgment stage: The federated learning server inputs the aggregated results of the plaintext into the obfuscated circuit protocol. The obfuscated circuit protocol uses Boolean circuits to perform security comparison and classification judgment on the aggregated results of the plaintext. The obfuscated circuit protocol outputs the final text classification result and completes the classification task of the text to be classified.

[0057] Classification result chain stage: The final text classification result is obtained through the obfuscated circuit protocol, and the result is still encrypted. Metadata containing a timestamp and a caller ID is generated for the encrypted classification result. The timestamp indicates the time when the classification result was generated, and the caller ID indicates the identifier of the caller requesting the classification task. The encrypted classification result and the corresponding metadata are packaged into a transaction and submitted to the blockchain network. The consensus mechanism of the blockchain network verifies the validity of the transaction and packages the transaction into a block. The newly generated block is appended to the end of the blockchain to form an unalterable chain structure. The encrypted classification results and metadata are permanently recorded on the blockchain as transaction data. All nodes in the blockchain network synchronously update their own copies of the blockchain data to ensure that each node holds the same classification results and metadata.

[0058] Access control phase: Deploy an access control contract in the blockchain network to control access rights to the classification results. When the caller initiates an access request to the classification results, the access control contract verifies the identity information of the caller. The access control contract determines whether the caller has the right to access the requested classification results based on the preset access control rules. If the caller passes the identity authentication and has the corresponding access rights, the access control contract grants the caller access rights to the classification results. If the caller fails to pass the identity authentication or does not have the corresponding access rights, the access control contract denies the caller's access request.

[0059] Result verification phase: Deploy a result verification contract in the blockchain network to verify the source credibility and integrity of the classification result. When the caller obtains access rights and requests to obtain the classification result, the result verification contract verifies the metadata of the requested classification result. The result verification contract first verifies the timestamp of the classification result to ensure that the timestamp is within a reasonable range and consistent with the time requested by the caller. The result verification contract also verifies the caller ID of the classification result to ensure that the caller ID matches the caller ID of the caller requesting access. If the timestamp and caller ID are verified, the result verification contract confirms the source credibility and integrity of the classification result and returns the encrypted classification result to the caller. If the timestamp or caller ID verification fails, the result verification contract refuses to return the classification result and records the verification failure event. Data decryption and use phase: After receiving the encrypted classification result, the caller uses its own private key to decrypt the result and obtain the plaintext classification result. The caller can perform subsequent business processing and decision-making based on the plaintext classification result.

[0060] Embodiment 2, the application of the present application is a classification of customer complaints of a financial institution based on a blockchain generative artificial intelligence detection and evaluation method. The financial institution has a large amount of customer complaint text data, and these texts need to be classified for timely processing and response. The financial institution collects and organizes customer complaint text data to form a complaint text data set. The complaint text data set is preprocessed by cleaning, word segmentation, and stop word removal to improve data quality. The preprocessed complaint text is feature extracted using word vector technology (such as Word2Vec, GloVe, etc.) to obtain a text feature vector. The financial institution uses the extracted text feature vector as training data to construct a text detection model based on a conditional generative adversarial network (CGAN). CGAN consists of a generator and a discriminator. The generator is used to generate synthetic complaint texts, and the discriminator is used to determine whether the text is real or synthetic. Through the adversarial training process of the generator and the discriminator, the performance of the generator is continuously optimized so that it can generate complaint texts close to reality.

[0061] During the training process, the text feature vector is used as conditional information to input into the generator and discriminator to guide the model to learn the features of complaint texts of different categories. After the training is completed, the financial institution obtains the trained CGAN text detection model, including the model parameters of the generator and the discriminator. The model parameters are encrypted using the Paillier homomorphic encryption algorithm to convert the plaintext model parameters into ciphertext form. Through the secure multi-party computing protocol, the encrypted model parameters are distributed to the other two trusted institutions, and each institution obtains part of the encrypted model parameters. Cryptography technology is used to ensure the confidentiality and integrity of the model parameters during the distribution process. The three institutions each hold part of the encrypted model parameters, and aggregate their respective parts through a secret sharing protocol. The secret sharing protocol ensures that the aggregated encrypted model parameters are calculated without leaking the partial parameters held by each party.

[0062] The aggregated encrypted model parameters are written into the alliance blockchain network, and the immutable and traceable characteristics of the blockchain are used to ensure the secure storage and sharing of the model parameters. The alliance blockchain network is jointly maintained by three institutions, and each institution holds a complete copy of the blockchain data. When a financial institution needs to classify a new complaint text, the encrypted complaint text is sent to the other two institutions. The three institutions use a secret sharing protocol to jointly reason on the complaint text in an encrypted space to obtain an encrypted classification result. Through secure multi-party computing and threshold decryption technology, the encrypted classification results are restored to plain text without leaking the content of the complaint text. The plain text classification results are returned to the financial institution, and the financial institution handles and responds to the complaint accordingly based on the classification results.

[0063] After receiving a new customer complaint text, the financial institution first performs necessary preprocessing on the text, such as formatting and denoising. The Paillier homomorphic encryption algorithm is used to encrypt the preprocessed complaint text and convert the plaintext into ciphertext. The Paillier homomorphic encryption algorithm has additive homomorphism, allowing addition operations to be performed on the ciphertext to obtain the ciphertext of the addition result. The encrypted complaint text is subsequently transmitted and processed in the form of ciphertext, protecting the confidentiality of the text. The financial institution distributes the encrypted complaint text to two other trusted institutions through a secure multi-party computing protocol. The secure multi-party computing protocol ensures that the encrypted text is securely transmitted to other institutions without leaking the content of the complaint text. After each institution receives the encrypted complaint text, it saves it in a local secure storage.

[0064] The three institutions use security protocols such as secret sharing and obfuscated circuits to conduct joint reasoning on the complaint text in an encrypted space. The secret sharing protocol divides the encrypted complaint text into multiple secret shares and sends them to other institutions separately. Each institution uses the received secret shares to perform partial calculations locally to obtain the secret shares of the intermediate results. The secret shares of the intermediate results are sent to other institutions for further calculations through a secure communication protocol. The obfuscated circuit protocol uses the secret shares of the intermediate results as input and performs logical operations and comparison operations in an encrypted space. The obfuscated circuit protocol ensures the privacy of the calculation process and prevents any party from obtaining the intermediate results or input data of other parties. After multiple rounds of secret sharing and obfuscated circuit calculations, the three institutions finally obtain the encrypted classification results. The financial institution uploads the encrypted classification results and related metadata to the blockchain network. The metadata includes timestamps, hash values ​​of complaint texts, hash values ​​of classification results, etc., which are used to verify and trace the source and integrity of the results. Through smart contracts, the encrypted classification results and metadata are packaged into blocks and broadcast to other nodes in the blockchain network. The consensus mechanism of the blockchain network verifies the validity of the block and appends the block to the end of the blockchain. All nodes in the blockchain network synchronously update their own copies of blockchain data to ensure that each node holds the same classification results and metadata.

[0065] When a financial institution needs to obtain classification results, it can retrieve the corresponding blocks and transaction data from the blockchain network. Through the timestamp and hash value in the metadata, the financial institution can verify the source credibility and integrity of the classification results. The access control mechanism in the smart contract ensures that only authorized financial institutions can access and decrypt the classification results. The financial institution uses its own private key to decrypt the encrypted classification results and obtain the plaintext classification results. Based on the classification results, the financial institution can handle and respond to customer complaints in a timely manner to improve customer satisfaction.

[0066] Finally, a smart contract is deployed in the blockchain network to verify the uploaded classification results. The smart contract contains the logic to verify the integrity and source credibility of the classification results. When the encrypted classification results and metadata are uploaded to the blockchain network, the smart contract automatically triggers the verification process. The smart contract first verifies whether the timestamp in the metadata is legal to ensure the timeliness of the classification results. The smart contract compares the hash value of the complaint text in the metadata with the hash value stored on the chain to verify the integrity of the complaint text. The smart contract verifies the hash value of the classification result to ensure that the classification result has not been tampered with. If the verification passes, the smart contract marks the classification result as credible and records the verification result on the blockchain. If the verification fails, the smart contract will refuse to accept the classification result and record the reason for the verification failure. An access control contract is deployed in the blockchain network to manage access rights to the classification results. The access control contract maintains a list of authorized financial institutions, and only institutions in the list can access the classification results. The financial institution initiates an access request to the access control contract and provides its own identity information. The access control contract verifies the identity of the financial institution and checks whether it is in the authorized access list. If the financial institution passes identity authentication and has access rights, the access control contract grants it access rights to the encrypted classification results. The financial institution uses its own private key to decrypt the encrypted classification results and obtain the plaintext classification results. If the financial institution fails identity authentication or does not have access rights, the access control contract denies its access request. After obtaining the plaintext classification results, the financial institution can promptly understand the categories and contents of customer complaints. According to the categories of complaints, such as product quality, service attitude, and fee disputes, the financial institution can formulate targeted handling measures. The financial institution can associate the classification results with customer information and record the progress and results of complaint handling. By analyzing the complaint classification results, the financial institution can find problems and deficiencies in the service and make improvements and optimizations. The financial institution can also use the classification results to conduct customer satisfaction analysis, service quality evaluation, etc. to improve customer experience. During the entire complaint text classification process, the other two institutions only have access to the encrypted complaint text and intermediate calculation results. Due to the use of Paillier homomorphic encryption and secure multi-party computing protocols, the institutions cannot recover the plaintext content from the encrypted data. The institutions are also unable to infer the classification results alone because the classification results are obtained after multi-party joint calculations and are encrypted. Only financial institutions hold the private key to decrypt the classification results, and other institutions cannot obtain the plaintext classification results. In this way, during the collaboration between institutions, the privacy of customers is effectively protected and sensitive information will not be leaked.

[0067] This embodiment makes full use of blockchain, homomorphic encryption and secure multi-party computing technology to achieve privacy-preserving text classification under multi-party participation. By dividing the model training and reasoning process into multiple stages, each stage is responsible for different participants, avoiding the centralized storage and processing of sensitive data and reducing the risk of privacy leakage. At the same time, smart contracts are used to verify and control access to the classification results, ensuring the credibility and confidentiality of the results. This embodiment provides a feasible solution to solve the privacy and security issues in generative artificial intelligence, and has strong practical value.

Claims

1. A blockchain-based generative artificial intelligence detection and evaluation method, comprising: S1, obtain a text classification dataset, which contains text data and corresponding category labels; S2, extracting features from the text classification data set to obtain a text feature vector; using the extracted text feature vector as training data and inputting it into a text detection model based on a generative adversarial network for training; S3, uses the Paillier homomorphic encryption algorithm to encrypt the trained text detection model; uses the secure multi-party computing protocol to distribute the encrypted model parameters to multiple participants, each party holds part of the encrypted model parameters; aggregates the encrypted model parameters held by multiple participants through the secret sharing protocol in the secure multi-party computing to obtain the aggregated encrypted model parameters; writes the aggregated encrypted model parameters into the blockchain network; S4, obtain the text to be classified, and use the Paillier homomorphic encryption algorithm to encrypt the text to be classified; use the secure multi-party computing protocol to distribute the encrypted text to be classified to multiple participants holding encryption model parameters, each party holding part of the encrypted text to be classified and model parameters; through the secret sharing protocol and obfuscated circuit protocol in the secure multi-party computing, each participant performs joint reasoning calculations in the encrypted space to obtain the encrypted classification results; S5, uploads the encrypted classification results and metadata including timestamp and caller ID to the blockchain network, and controls and verifies access rights to the classification results through smart contracts; In S2, the text feature vector of the text classification dataset is extracted, including: Use the pre-trained BERT model to encode the text classification dataset and extract the semantic feature vector; Perform word segmentation on the text classification dataset to obtain the word sequence of each text classification dataset; Based on the word sequence, the TF-IDF algorithm is used to calculate the weight of each word in the corresponding text classification data set to obtain a weight vector; The extracted semantic feature vector and weight vector are concatenated to obtain the initial text feature vector corresponding to each text classification data set; In S4, the homomorphic encryption algorithm is used to encrypt the classified text, including: The text to be classified is divided into m parts according to a preset method, and each part is encrypted and processed by a participant; Each participant generates their own public and private key pair based on the Paillier homomorphic encryption algorithm. The public key is used to encrypt data and perform homomorphic computations, and the private key is used to decrypt data. The i-th participant uses the generated i-th public key to encrypt the i-th text part to obtain the i-th encrypted text fragment; In S4, the homomorphic encryption algorithm is used to encrypt the classified text, which also includes: The i-th participant inputs the trained i-th local model using the text segment to be classified encrypted by the i-th public key, calculates the output of the i-th local model in the encrypted space, and obtains the i-th encrypted intermediate result; The i-th participant uses the secret sharing protocol to divide the i-th encrypted intermediate result into k secret shares, and sends k-1 secret shares to other participants respectively; Each participant collects m secret shares, uses the reconstruction algorithm of the secret sharing protocol to reconstruct the m secret shares into the i-th encrypted intermediate result, and uploads the reconstructed i-th encrypted intermediate result to the federated learning server; The federated learning server collects the m uploaded encrypted intermediate results, and uses the additive homomorphic property of the Paillier homomorphic encryption algorithm to perform homomorphic addition operations on the m encrypted intermediate results in the encrypted space to obtain the encrypted aggregated result. The federated learning server uses the threshold decryption mechanism of the Paillier homomorphic encryption algorithm to decrypt the encrypted aggregation results together with all participants to obtain the plaintext aggregation results. The federated learning server inputs the obtained plaintext aggregation results into the obfuscated circuit protocol. The obfuscated circuit protocol uses Boolean circuits to perform security comparison and classification judgment on the plaintext aggregation results and output the final text classification results.

2. The blockchain-based generative artificial intelligence detection and evaluation method according to claim 1 is characterized in that: In S2, the text feature vector of the text classification dataset is extracted, which also includes: Construct a feature selection network based on the attention mechanism and use the obtained initial text feature vector as input; The importance weight of each feature is learned through the attention mechanism layer in the feature selection network to obtain the attention weight vector; Multiply the attention weight vector by the initial text feature vector element by element to obtain the weighted text feature vector; The weighted text feature vector is input into the fully connected layer of the feature selection network, and the final text feature vector is obtained through nonlinear transformation.

3. The blockchain-based generative artificial intelligence detection and evaluation method according to claim 2 is characterized in that: In S2, the extracted feature vector is used as training data to input the text detection model based on the generative adversarial network for training, including: Construct the generator and discriminator of the text detection model, where the generator adopts the conditional generative adversarial network (CGAN) structure and the discriminator adopts the convolutional neural network (CNN) structure; The extracted text feature vector is used as a conditional input, and a random noise vector is sampled from a preset random distribution; the text feature vector and the random noise vector are concatenated to form a conditional vector; The conditional vector is input into the generator, and the conditional vector is sequence modeled through the LSTM network in the generator to obtain adversarial text samples; The adversarial text samples and the real text samples in the text classification dataset form a training data pair; the training data pair is input into the discriminator; the discriminator extracts the local features of the text through the convolution layer, performs feature selection and dimension reduction through the pooling layer, fuses the extracted features through the fully connected layer, and outputs the authenticity probability of the text through the sigmoid function and the category probability of the text through the softmax function; According to the authenticity probability and category probability of the text output by the discriminator, the objective functions of the generator adversarial loss, discriminator adversarial loss and discriminator classification loss are constructed; among them, the generator adversarial loss is used to measure the distribution difference between the generated text and the real text in the discriminator feature space; the discriminator adversarial loss is used to measure the discriminator's ability to distinguish between real text and generated text; the discriminator classification loss is used to measure the discriminator's accuracy in distinguishing text categories; Through the gradient descent algorithm and back propagation algorithm, the parameters of the generator and discriminator are trained, the objective function of the discriminator classification loss is minimized, and the trained text detection model is obtained.

4. The blockchain-based generative artificial intelligence detection and evaluation method according to claim 3 is characterized in that: In S2, the extracted feature vector is used as training data to input the text detection model based on the generative adversarial network for training, which also includes: In the process of training the parameters of the generator and discriminator, the diversity of adversarial text samples output by the generator is controlled by adjusting the dimension of the random noise vector and the sampling distribution parameters; The Gumbel-Softmax function is set at the output layer of the generator to convert the discrete text generation process into a continuous gradient process, so that the generator can directly use the gradient information of the discriminator for optimization to improve the stability of training; A gradient penalty term is set as a regularization term in the discriminator's loss function to constrain the discriminator's gradient norm and prevent the discriminator from overfitting. The weight matrices of the convolutional and fully connected layers of the discriminator are spectrally normalized, and the spectral norm of the weight matrix is ​​set to a constant to improve the Lipschitz continuity of the discriminator.

5. The blockchain-based generative artificial intelligence detection and evaluation method according to claim 1 is characterized in that: Also includes: Construct a multi-party secure computing framework based on federated learning, and use the obtained model parameters encrypted by the i-th public key and the obtained i-th encrypted text fragment as the input of the i-th participant; In the federated learning framework, the i-th participant independently conducts local model training; local model training includes inputting the i-th encrypted text fragment into the i-th local model, calculating the output and loss function of the i-th local model in the encrypted space, and calculating the gradient of the i-th local model based on the Paillier homomorphism property; where i ranges from 1 to m; Each participant uploads the calculated encrypted local gradient to the federated learning server for encrypted aggregation; the federated learning server adds random noise to the encrypted gradient through the differential privacy mechanism, and uses the secret sharing protocol to decrypt the aggregated result into a plaintext gradient; The federated learning server updates the global model parameters based on the plaintext gradient and sends the updated global parameters to each participant; The local training and gradient aggregation process is repeated until the global model parameters meet the preset convergence conditions.

6. The blockchain-based generative artificial intelligence detection and evaluation method according to claim 1 is characterized in that: In S5, smart contracts are used to control access rights to classification results, including: Smart contracts include access control contracts and result verification contracts; The access control contract verifies whether the caller has the authority to access the output text classification results based on the caller's identity information and access request, and grants or denies access based on the verification results; The result verification contract verifies the source credibility and integrity of the classification result by verifying the timestamp and caller ID in the metadata of the uploaded classification result.

7. A system based on the blockchain-based generative artificial intelligence detection and evaluation method described in any one of claims 1 to 6.