Text detection method and system based on visual feature analysis

Through the method based on visual feature analysis, text features are extracted using BERT and MLP models, combined with radar graph visualization, and generated text patterns are identified, which solves the problems of poor text detection performance and high training cost in the existing technology, and realizes efficient text detection and generalization ability.

CN119293229APending Publication Date: 2025-01-10NANCHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410711790.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Existing text detection methods fail to effectively capture the semantic information and contextual relationships of text, resulting in poor classification performance in high-dimensional space, and the high cost of training of transformer models and difficult to generalize, especially for large-scale language models.

Method used

Using a method based on visual feature analysis, the BERT model and MLP classifier are used to extract text features, and by initializing the classification center and radius, combining radar graph visualization, the pattern of generated text is identified and binary classification is performed.

Benefits of technology

It improves the accuracy and generalization ability of text detection, reduces training costs, and achieves efficient detection of text generated by artificial intelligence, showing excellent performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293229A_ABST
    Figure CN119293229A_ABST
Patent Text Reader

Abstract

The invention provides a text detection method and system based on visual feature analysis, and the method comprises the steps: a feature extraction stage: an adopted feature extractor consists of a BERT model and an MLP classifier, so as to extract the last but one hidden layer of the MLP, which corresponds to the last hidden layer, and obtain text features in a data set; the model training stage comprises the steps of initializing a classification center c and a classification radius r, training a data set and enhancing a unified mode; in the text detection stage, text features of a to-be-detected text are extracted, the distance between the feature and the classification center c and the classification radius r are obtained according to the text features of the to-be-detected text, and whether the to-be-detected text belongs to the generated text or not is judged according to the distance between the feature and the classification center c and the classification radius r. According to the method, the text generated by artificial intelligence can be effectively detected, and the detection accuracy and generalization ability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of text detection, and in particular to a text detection method and system based on visual feature analysis. Background Art

[0002] Currently, as false information generated by artificial intelligence spreads in cyberspace, it may cause serious consequences such as phishing and spreading false information. Therefore, the detection methods of generated texts are receiving more and more attention.

[0003] In the prior art, some methods involving text detection only use statistical techniques to extract text features, such as word frequency, part of speech, etc., without considering the semantic information and contextual relationships of the text; some use common binary classifiers (such as support vector machines or logistic regression) for classification, which may not be able to capture complex text classification boundaries, especially in high-dimensional spaces; some have poor classification performance for non-training data samples because the model cannot generalize well, which may lead to misjudgment or missed judgments; although some use transformer models to extract text features, they also regard the problem as a binary classification task, without fully considering the complexity and diversity of text classification; some transformer models usually require a large amount of training data and computing resources, which may lead to high training costs, especially for large-scale language models. Summary of the invention

[0004] Based on this, the purpose of the present invention is to propose a text detection method and system based on visual feature analysis, which aims to effectively detect text generated by artificial intelligence by identifying and characterizing patterns related to language models and utilizing deep learning technology, thereby improving detection accuracy and generalization capabilities, thereby coping with the increasing problem of false information dissemination.

[0005] On the one hand, the present invention proposes a text detection method based on visual feature analysis, the method comprising:

[0006] In the feature extraction stage, the feature extractor used consists of a BERT model and an MLP classifier to extract the penultimate layer of the MLP, corresponding to the last hidden layer, to obtain the text features in the dataset;

[0007] The model training phase includes initialization of the classification center c and classification radius r, data set training, and enhancement of the unified model;

[0008] In the text detection stage, the text features of the text to be detected are extracted, and the distance between the feature and the classification center c and the classification radius r are obtained based on the text features of the text to be detected, and it is determined whether the text to be detected belongs to the generated text based on the distance between the feature and the classification center c and the classification radius r.

[0009] In summary, according to the above-mentioned text detection method based on visual feature analysis, a new way is used to detect AI-generated text, using language models to reveal potential generation patterns and distinguishing them through binary classification tasks, thereby providing valuable insights. ViewChat not only uses the BERT model combined with MLP to train the classification model and extract the penultimate layer of MLP as text features, but also uses a radar chart visualization method to observe the distribution of text and identify hidden patterns of generated text. With this method, ViewChat is able to detect AI-generated text more accurately, has stronger generalization capabilities, and has shown excellent performance in experiments, reaching an advanced level.

[0010] In some embodiments, the feature extractor used is composed of a BERT model and an MLP classifier to extract the penultimate layer of the MLP, corresponding to the last hidden layer, and the step of obtaining the text features in the data set also includes:

[0011] The loss calculation formula in the feature extraction stage is:

[0012]

[0013] Among them, Loss1 represents the loss value in the feature extraction stage, K represents the number of losses in this round of calculation, and the final average is taken. represents the true label value, the generated text is 1, the correct text is 0, p k Represents the probability of text prediction being generated text, output by the model.

[0014] In some embodiments, the steps of initializing the classification center r and the classification radius r include: For the text generated in the training dataset, use the current feature extractor to extract text features, and take the median of all text feature values ​​as the value of each dimension of the classification center c: c = [median( ), median( ), . . .,median( ), . . . , median( )] Among them, median( ) indicates a specific dimension Nonlinear median filtering value of ; Calculate the text features generated in the training dataset, calculate the Euclidean distance between the text features of the dataset and the classification center c, sort all the Euclidean distances in ascending order, and store the sorted results in an array of length l: r = distance[ 0.95 × l ] Wherein, distance[·] indicates calculating the Euclidean distance between two vectors, and [·] indicates rounding to the nearest integer.

[0021] In some embodiments, the step of training the data set includes:

[0022] During the training of the dataset, the loss function is:

[0023]

[0024] Among them, Loss2 represents the loss value during the training process of the dataset, D(Si,c) represents the Euclidean distance between the features extracted by the text feature extractor and the classification center c, label represents the text label, the generated text is assigned 1, and the human text is assigned 0, mean() represents the calculation of the average value, and max(x,y) represents the return of the maximum value between x and y.

[0025] In some embodiments, the step of enhancing the unified mode includes:

[0026] Update the classification radius r according to the following formula:

[0027] r=r+lr×direction

[0028] Among them, lr represents the hyperparameter that determines the speed of gradient descent, and direction represents the direction of gradient descent;

[0029] The direction of gradient descent is calculated according to the following formula:

[0030]

[0031] Among them, bf represents boundary fairness.

[0032] In some embodiments, boundary fairness is calculated according to the following formula:

[0033]

[0034] Among them, cgr represents the proportion of correctly generated text, and chr represents the proportion of correctly written text.

[0035] In some embodiments, the correctly generated text ratio and the correctly written text ratio are calculated according to the following formula:

[0036]

[0037] Among them, TP represents the number of generated texts correctly predicted by the model as positive, FN represents the number of generated texts incorrectly predicted by the model as negative, TN represents the number of written texts correctly predicted by the model as negative, and FP represents the number of written texts incorrectly predicted by the model as positive.

[0038] On the other hand, an embodiment of the present invention provides a text detection system based on visual feature analysis, the system comprising:

[0039] The feature extraction module is used in the feature extraction stage. The feature extractor used consists of a BERT model and an MLP classifier to extract the penultimate layer of the MLP, corresponding to the last hidden layer, to obtain the text features in the dataset;

[0040] Model training module, used in the model training phase, including initialization of classification center c and classification radius r, data set training, and enhanced unified mode;

[0041] The text detection module is used in the text detection stage to extract the text features of the text to be detected, and obtain the distance between the feature and the classification center c and the classification radius r based on the text features of the text to be detected, and judge whether the text to be detected belongs to the generated text based on the distance between the feature and the classification center c and the classification radius r.

[0042] On the other hand, the present invention further provides a storage medium, including one or more programs stored in the storage medium, which, when executed, implement the above-mentioned text detection method based on visual feature analysis.

[0043] In another aspect, the present invention further provides a computer device, the computer device comprising a memory and a processor, wherein:

[0044] The memory is used to store computer programs;

[0045] When the processor is used to execute the computer program stored in the memory, the above-mentioned text detection method based on visual feature analysis is implemented.

[0046] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description or will be learned through embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A flowchart of a text detection method based on visual feature analysis proposed in the first embodiment of the present invention;

[0048] Figure 2 A schematic diagram of a detector is an example;

[0049] Figure 3It is a structural diagram of the feature extraction part and the feature decision part;

[0050] Figure 4 It is a structural diagram of a text detection system based on visual feature analysis in the second embodiment of the present invention.

[0051] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0052] See also Figure 1 , which is a flowchart of a text detection method based on visual feature analysis in a first embodiment of the present invention, the method comprises steps S01 to S03, wherein:

[0053] Step S01: In the feature extraction stage, the feature extractor used consists of a BERT model and an MLP classifier to extract the penultimate layer of the MLP, corresponding to the last hidden layer, to obtain the text features in the dataset;

[0054] In this step, the feature extractor consists of a BERT model and an MLP. The BERT model is a widely adopted pre-trained model for text classification, and is usually used in conjunction with an MLP classifier to perform classification using its [CLS] token. The penultimate layer of the MLP, corresponding to the last hidden layer, is selected to extract features. Therefore, the loss calculation formula for the feature extraction stage is:

[0055]

[0056] After the training of the feature extraction phase is completed, we will obtain an initial classification center c and classification radius r.

[0057] Step S02: model training phase, including initialization of classification center c and classification radius r, data set training and enhancement of unified mode;

[0058] It should be noted that in the feature decision stage, the BERT+MLP network will continue to be trained until the optimal classification center c and classification radius r are found. Then, whether the text is generated text is determined by whether the distance between the feature of the text and the classification center c is less than the classification radius r.

[0059] The training process consists of three stages: initialization, dataset training, and enhanced text generation mode. In these stages, it is necessary to maintain the mode of using classification center c and classification radius r to characterize the generated text.

[0060] Initialization: The values ​​of the classification center c and the classification radius r need to be initialized to determine the uniform pattern used in the training phase. In this embodiment, the classification radius is initialized only at the beginning of the first training phase, while the classification center is initialized at the beginning of all phases. The classification center c is initialized as follows: For the text generated in the training data set, use the current feature extractor to extract text features. Take the median of all feature values ​​as the value of each dimension of c.

[0061] c=[median(d1),median(d2),...,median(d 20 )]

[0062] Here, median(d i ) represents a specific dimension d i The nonlinear median filter value of the classification radius r is initialized as follows: First, the text features of the text generated in the training dataset are calculated. Next, the Euclidean distance between these features and the classification center c is calculated. These distances are sorted in ascending order and stored in an array of length l, called distance. The initialization formula of r is as follows:

[0063] r = distance[0.95×l].

[0064] It is worth noting that the initialization of r ensures that 95% of the generated text in the training data is included in the generated text patterns.

[0065] Dataset training: Different from the use of cross entropy loss in the previous binary classification task, in this example, a custom loss function is designed:

[0066]

[0067] Where D(Si,c) represents the Euclidean distance between the text feature extracted by the feature extractor and the classification center c. label represents the text label, which is assigned 1 for generated text and 0 for human text. mean() calculates the mean, and max(x,y) returns the maximum value between x and y. After the training phase is completed, our feature extractor is further optimized to achieve an enhanced unified model.

[0068] Enhanced unified mode: After completing the dataset training phase, the feature extractor needs to be enhanced to obtain an improved classification center c, which can accurately characterize the text generation mode. In order to further enhance this mode, the classification radius r needs to be updated. Specifically, the gradient descent algorithm is chosen to update r, taking into account the learning rate lr and the descent direction. The calculation formula is as follows:

[0069] r=r+lr×direction

[0070] Where lr is a hyperparameter that determines the speed of gradient descent, and direction indicates the direction of gradient descent. The value of direction depends on the classification result of the current training. To determine the direction, we introduce a new metric called BF (boundary fairness), which quantifies the fairness of the classification boundary. In order to fully introduce the proposed method, we define two new metrics: CGR (Correctly Generated Text Ratio) and CHR (Correctly Written Text Ratio), which represent the proportion of correctly classified samples in AI-generated text and manually written text, respectively. The calculation formula is as follows:

[0071]

[0072] Among them, TP (True Positives) refers to the number of positive samples (generated text) correctly predicted as positive by the model. FN (False Negatives) indicates the number of positive samples that are incorrectly predicted as negative by the model. TN (True Negatives) indicates the number of negative samples (written text) that are correctly predicted as negative by the model. FP (False Positives) indicates the number of negative samples that are incorrectly predicted as positive by the model. Using cgr and chr, bf can be calculated as follows:

[0073]

[0074] Based on the visual analysis of the features extracted by the feature extractor, the following inferences can be drawn: When the value of bf is 0.5, the classifier can effectively distinguish between generated text and human text. If bf exceeds 0.5, it means that the classification radius r is too large. On the contrary, if bf is less than 0.5, it means that the classification radius r is too small. Therefore, the goal of the model is to achieve a bf value of 0.5 to enhance the text generation mode. Therefore, the scheme for calculating the direction is:

[0075]

[0076] Step S03: In the text detection stage, the text features of the text to be detected are extracted, and the distance between the feature and the classification center c and the classification radius r are obtained based on the text features of the text to be detected, and whether the text to be detected belongs to the generated text is determined based on the distance between the feature and the classification center c and the classification radius r.

[0077] In this step, when the distance between the text feature of the text to be detected and the classification center c is less than the classification radius r, the text to be detected is judged to be generated text; when the distance between the text feature of the text to be detected and the classification center c is greater than or equal to the classification radius r, the text to be detected is judged to be written text.

[0078] Uses a unique approach to detect and distinguish AI-generated text. By combining pre-trained language models (such as BERT) with multi-layer perceptrons (MLPs) and using radar chart visualization technology, ViewChat is able to reveal the distribution patterns of generated text in a low-dimensional feature space. This approach not only improves the accuracy of detecting AI-generated text, but also demonstrates excellent generalization capabilities, that is, maintaining high accuracy on unseen data distributions. In addition, by leveraging the unique distribution patterns of generated text, detection performance is improved while reducing algorithm complexity.

[0079] Dataset introduction:

[0080] Four datasets are mainly used. The ChatGPT model generates two text datasets, HC3 and Lamini. The GPT-4 model generates one text dataset, Alpaca. The falcon model generates one text dataset, Argilla. The following is an introduction to the four datasets.

[0081] HC3 dataset: includes questions and their corresponding human / ChatGPT answers, mainly derived from public question-answering datasets and Wikipedia, used to compare the differences between human and ChatGPT answers.

[0082] Lamini dataset: It consists of answers generated by ChatGPT based on resources such as selfinstruct, P3, FLAN, and Alpaca, demonstrating the ability to generate text based on different instructions.

[0083] Falcon dataset: generated by the Falcon model developed by the UAE Institute of Technology and Innovation. It supports multiple languages ​​and is mainly used for natural language processing tasks. It shows the model performance under different parameter configurations.

[0084] Alpaca dataset: Content generated by GPT-4 based on the Alpaca prompt set, demonstrating the ability to generate text based on a specific instruction set. The Alpaca prompt set is designed to optimize the instruction nature of generated text.

[0085] Experimental setup:

[0086] In terms of metric standards, we selected two indicators commonly used to evaluate classification models, Precision and AUC, as evaluation indicators. The following is an explanation of these two evaluation indicators:

[0087] Precision: Precision describes the proportion of samples that are actually positive among all samples predicted by the model to be positive. This metric is very important, especially in applications where the cost of misclassifying as positive is high, such as spam detection. High precision means that fewer negative samples are misclassified as positive. The range of this metric is 0 to 1, and the closer to 1, the better.

[0088] AUC: AUC (Area Under the ROC Curve) measures the model's ability to distinguish between positive and negative samples. The ROC curve is a graph of the True Positive Rate (TPR) versus the False Positive Rate (FPR) by changing the classification threshold. The AUC value ranges from 0 to 1. The closer the AUC value is to 1, the better the classification performance of the model is, and the better it can distinguish between positive and negative samples. AUC is a probability value, which indicates the probability that the model correctly judges that the positive sample is ranked before the negative sample when a positive sample and a negative sample are randomly selected.

[0089] Experimental results:

[0090] First, each data set is divided into a training set and a test set in a ratio of 3:1 to verify the detection ability of this method in the same data set. The experimental results are shown in Table 1:

[0091] Table 1

[0092]

[0093]

[0094] Next, a cross-experiment is used to verify the generalization performance of this method, that is, different datasets are used as training sets and other datasets are used as test sets.

[0095] When the HC3 dataset is used as the training set, the results are as follows in Table 2:

[0096] Table 2

[0097] Lamini Falcon Alpaca Precision 0.8346 0.8360 0.8363 AUC 0.9300 0.8867 0.8855

[0098] When the Lamini dataset is used as the training set, the results are as follows in Table 3:

[0099] Table 3

[0100] HC3 Falcon Alpaca Precision 0.8725 0.8781 0.8771 AUC 0.9437 0.9444 0.9428

[0101] When the Falcon dataset is used as the training set, the results are as follows in Table 4:

[0102] Table 4

[0103] HC3 Lamini Alpaca Precision 0.7783 0.7642 0.7661 AUC 0.9044 0.9048 0.9028

[0104] When using the Alpaca dataset as the training set, the results are as follows in Table 5:

[0105] Table 5

[0106]

[0107]

[0108] In summary, according to the above-mentioned text detection method based on visual feature analysis, a new way is used to detect AI-generated text, using language models to reveal potential generation patterns and distinguishing them through binary classification tasks, thereby providing valuable insights. ViewChat not only uses the BERT model combined with MLP to train the classification model and extract the penultimate layer of MLP as text features, but also uses a radar chart visualization method to observe the distribution of text and identify hidden patterns of generated text. With this method, ViewChat is able to detect AI-generated text more accurately, has stronger generalization capabilities, and has shown excellent performance in experiments, reaching an advanced level.

[0109] See also Figure 4 , which is a schematic diagram of the structure of a text detection system based on visual feature analysis in a second embodiment of the present invention, the system comprises:

[0110] A feature extraction module 10 is used in the feature extraction stage. The feature extractor used is composed of a BERT model and an MLP classifier to extract the penultimate layer of the MLP, corresponding to the last hidden layer, to obtain the text features in the data set;

[0111] The model training module 20 is used in the model training phase, including initialization of the classification center c and the classification radius r, data set training, and enhancement of the unified mode;

[0112] The text detection module 30 is used in the text detection stage to extract the text features of the text to be detected, and obtain the distance between the feature and the classification center c and the classification radius r based on the text features of the text to be detected, and determine whether the text to be detected belongs to the generated text based on the distance between the feature and the classification center c and the classification radius r.

[0113] Another aspect of the present invention further provides a computer storage medium on which one or more programs are stored, and when the programs are executed by a processor, the above-mentioned text detection method based on visual feature analysis is implemented.

[0114] On the other hand, the present invention further proposes a computer device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the above-mentioned text detection method based on visual feature analysis.

[0115] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0116] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0117] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0118] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0119] The above-described embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.

Claims

1. A text detection method based on visual feature analysis, characterized in that: The method comprises: In the feature extraction stage, the feature extractor used consists of a BERT model and an MLP classifier to extract the penultimate layer of the MLP, corresponding to the last hidden layer, to obtain the text features in the dataset; The model training phase includes initialization of the classification center c and classification radius r, data set training, and enhancement of the unified model; In the text detection stage, the text features of the text to be detected are extracted, and the distance between the feature and the classification center c and the classification radius r are obtained based on the text features of the text to be detected, and it is determined whether the text to be detected belongs to the generated text based on the distance between the feature and the classification center c and the classification radius r.

2. The text detection method based on visual feature analysis according to claim 1 is characterized in that: The feature extractor used is composed of a BERT model and an MLP classifier to extract the penultimate layer of the MLP, corresponding to the last hidden layer, and the step of obtaining the text features in the data set also includes: The loss calculation formula in the feature extraction stage is: Among them, Loss1 represents the loss value in the feature extraction stage, K represents the number of losses in this round of calculation, and the final average is taken. represents the true label value, the generated text is 1, the correct text is 0, p k Represents the probability of text prediction being generated text, output by the model.

3. The text detection method based on visual feature analysis according to claim 1 is characterized in that: The steps of initializing the classification center r and the classification radius r include: For the text generated in the training dataset, use the current feature extractor to extract text features, and take the median of all text feature values ​​as the value of each dimension of the classification center c: c = [median( ), median( ), . . .,median( ),. . . , median( )] Among them, median( ) indicates a specific dimension Nonlinear median filtering value of ; Calculate the text features generated in the training dataset, calculate the Euclidean distance between the text features of the dataset and the classification center c, sort all the Euclidean distances in ascending order, and store the sorted results in an array of length l: r = distance[ 0.95 × l ] Wherein, distance[·] indicates calculating the Euclidean distance between two vectors, and [·] indicates rounding to the nearest integer.

4. The text detection method based on visual feature analysis according to claim 1 is characterized in that: The steps of training the data set include: During the training of the dataset, the loss function is: Among them, Loss2 represents the loss value during the training process of the dataset, D(Si,c) represents the Euclidean distance between the features extracted by the text feature extractor and the classification center c, label represents the text label, the generated text is assigned 1, and the human text is assigned 0, mean() represents the calculation of the average value, and max(x,y) represents the return of the maximum value between x and y.

5. The text detection method based on visual feature analysis according to claim 1 is characterized in that: The steps of enhancing the unified mode include: Update the classification radius r according to the following formula: r=r+lr×direction Among them, lr represents the hyperparameter that determines the speed of gradient descent, and direction represents the direction of gradient descent; The direction of gradient descent is calculated according to the following formula: Among them, bf represents boundary fairness.

6. The text detection method based on visual feature analysis according to claim 5 is characterized in that: The boundary fairness is calculated according to the following formula: Among them, cgr represents the proportion of correctly generated text, and chr represents the proportion of correctly written text.

7. The text detection method based on visual feature analysis according to claim 6 is characterized in that: The correct generated text ratio and the correct written text ratio are calculated according to the following formula: Among them, TP represents the number of generated texts correctly predicted by the model as positive, FN represents the number of generated texts incorrectly predicted by the model as negative, TN represents the number of written texts correctly predicted by the model as negative, and FP represents the number of written texts incorrectly predicted by the model as positive.

8. A text detection system based on visual feature analysis, characterized in that: The system comprises: The feature extraction module is used in the feature extraction stage. The feature extractor used consists of a BERT model and an MLP classifier to extract the penultimate layer of the MLP, corresponding to the last hidden layer, to obtain the text features in the dataset; Model training module, used in the model training phase, including initialization of classification center c and classification radius r, data set training, and enhanced unified mode; The text detection module is used in the text detection stage to extract the text features of the text to be detected, and obtain the distance between the feature and the classification center c and the classification radius r based on the text features of the text to be detected, and judge whether the text to be detected belongs to the generated text based on the distance between the feature and the classification center c and the classification radius r.

9. A storage medium, characterized in that: include: The storage medium stores one or more programs, which, when executed by a processor, implement the text detection method based on visual feature analysis as described in any one of claims 1 to 7.

10. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein: The memory is used to store computer programs; When the processor is used to execute the computer program stored in the memory, it implements the text detection method based on visual feature analysis described in any one of claims 1-7.