# The New Paradigm of Deepfake Detection at the Text Level
## 3 Materials and Methods
### ADFTM Description  
ADFTM exclusively analyzes the dataset associated with a certain person as input. The analyzed text is compared based on the known characteristics. The same characteristicsare extracted for this text. ADFTM identifies whether these input characteristics represent an anomaly in relation to the dataset. The model returns a percentage corresponding to the anomaly level, determining whether the text is associated with a certain person. The model is based on the patterns associated with the style in which a certain author writes. Each time, the model is trained for general evaluation using the dataset corresponding to a specific author. The procedure employed for the ADFTM contains the standard steps associated with an AI model:  
* Data Collection. The first step involves gathering a dataset of texts associated with a specific individual (\"Author X\"). This dataset contains texts authentically written by Author X. * Feature selection: Relevant features that capture the author's unique writing characteristics are selected. The datasets used for anomaly detection as to an author's writing style differ from those used for distinguishing between human-written and AI-generated texts. The anomaly detection for the author verification task requires datasets focused exclusively on texts from a single author in order to establish a stylistic baseline and detect deviations. The proposed author-anomaly-detection focuses on stylistic and syntactic features unique to an individual's writing style. The dataset for classification contains the following extracted features:  
* _AW_: The mean length of the sentences in the text. * _AC_: The mean number of characters per word. * _UR_: A measure of lexical richness, calculated as the ratio of unique words to total words. * Punctuation count (_PC_): The total number of punctuation marks in the text. * Noun ratio (_NR_): The proportion of nouns relative to the total number of words. Verb ratio (_VR_): The proportion of verbs relative to the total number of words. Adjective ratio (_AR_): The proportion of adjectives relative to the total number of words. * Entropy (_ENT_): A statistical measure of randomness in word usage within the text. * Bigram frequency (_BF_): The frequency of two-word sequences (bigrams) occurring in the text. * ADFTM is trained using the preprocessed dataset associated with the individual (\"[PERSON]\"). The training process focuses on identifying unique patterns in the writing style that can distinguish texts written by [PERSON] from those that are not. The model uses these features to build a probabilistic profile of [PERSON]'s writing style, representing the baseline characteristics of the individual's textual identity. * Anomaly Detection. For any new input text, ADFTM analyzes the text and extracts the same set of features used during training. The model then compares these extracted features to the probabilistic profile of [PERSON] created during the training phase. Using anomaly-detection algorithms, the ADFTM evaluates whether the text deviates from the expected patterns associated with [PERSON]'s writing. If the input text shows anomalies compared to the reference profile, it is flagged as potentially not belonging to [PERSON] As a result, it is categorized as a deepfake. * Anomaly Scoring. The ADFTM has an associated anomaly score. This score quantifies the degree of deviation of the text from [PERSON]'s typical writing patterns. A higher anomaly score indicates a greater likelihood that the text is not associated with [PERSON] Based on this score, a decision threshold (the threshold value is identified by testing the ADFTM in the Section 4) is applied to categorize the text as one of the following:  
* Authentic, which means the text is associated with [PERSON];\(\odot\)  Deepfake, which means the text is not associated with [PERSON]. Several algorithms were evaluated to determine the best architecture for anomaly detection. Algorithms tested included Randomized Principal Component Analysis (RandomizedPCA) and K-Means Clustering.