A dual semi-supervised integrated abnormal psychological sandbox detection method and system

Through the dual semi-supervised integrated abnormal psychological sand table detection method, combined with semi-supervised feature extraction and integrated detection algorithm, the problem of difficulty in labeling virtual psychological sand table data is solved, the accuracy of abnormal detection is improved, and the cost of experts is reduced. Technical support for large-scale applications.

CN118645248BActive Publication Date: 2024-12-24SHANDONG JIANZHU UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411116609.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-12-24
Estimated Expiration
2044-08-15

AI Technical Summary

Technical Problem

In the prior art, virtual psychological sand table data is difficult to label and expert labeling is high, resulting in poor auxiliary diagnosis and lack of effective abnormal detection methods.

Method used

Using dual semi-supervised integrated anomaly psychological sand table detection method, through semi-supervised feature extraction method and semi-supervised integrated detection algorithm, combined with convolutional neural network and multi-layer perceptron, a small number of labeled samples and a massive number of labelless samples are used to integrate multiple Each exception classifier makes comprehensive judgments to improve the accuracy of abnormal detection.

Benefits of technology

It effectively improves the accuracy of identification of abnormal sand table samples, reduces the time cost of human experts, provides technical support for the application of virtual psychological sand tables in large-scale groups, and provides new ideas for the research of the national mental health census.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118645248B_ABST
    Figure CN118645248B_ABST
Patent Text Reader

Abstract

The present invention proposes a dual semi-supervised integrated abnormal psychological sand table detection method and system, which relates to the field of abnormal psychological sand table detection. The specific scheme comprises: obtaining a psychological sand table sample to be detected; extracting features from the pre-processed psychological sand table sample by using a semi-supervised feature extraction method; judging whether the psychological sand table sample is abnormal based on the extracted features by using a semi-supervised integrated detection algorithm; wherein the semi-supervised integrated detection algorithm integrates a plurality of semi-supervised abnormal classifiers, performs abnormal detection on the features respectively, performs comprehensive judgment on each abnormal detection result obtained, and finally judges it as an abnormal sample when a preset condition is met; the present invention performs abnormal detection on the psychological sand table sample by combining the semi-supervised feature extraction method and the semi-supervised integrated detection algorithm, thereby improving the accuracy of recognition and the effect of abnormal psychological sand table detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of abnormal psychological sandbox detection, and in particular relates to a dual semi-supervised integrated abnormal psychological sandbox detection method and system. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] As mental health problems become increasingly serious, they have attracted great attention. Machine learning technology has gradually shown great application value in the field of medical diagnosis and provided powerful assistance. Big data mental health diagnosis has emerged as the times require. It is an interdisciplinary research field that integrates computer science, statistics, psychology and other disciplines. It aims to realize the mining, modeling and analysis of mental health data based on artificial intelligence, machine learning and big data technology, thereby providing technical support for the relevant work planning of national mental health auxiliary diagnosis, the development of health examinations and mental health archives, and the formulation of mental health and mental hygiene prevention and treatment plans.

[0004] Many scholars have conducted extensive and in-depth research on auxiliary diagnosis of mental health, covering questionnaires and mental health scales, expert diagnosis and remote psychological services, psychological sand tray, etc. Existing research is mostly based on questionnaires and mental health scales, expert diagnosis and traditional psychological sand tray; questionnaires and mental health scales are highly subjective and deceptive, and the conclusions drawn are easily affected by personal subjective consciousness. For example, some people are unwilling to disclose their mental conditions and are unwilling to fill in the real information, resulting in inaccurate data; expert diagnosis is time-consuming, labor-intensive and costly, and the number of experts is limited, making it difficult to carry out on a large scale; psychological sand tray games are a more easily accepted way of psychological counseling and consultation, which can present the corresponding inner world through the operation of sand and the free placement of corresponding small ornaments.

[0005] Virtual psychological sand tray software came into being, making up for the shortcoming that traditional psychological sand trays cannot be widely used due to time and place restrictions. At the same time, it can record the dynamic changes of sand tools and the entire sand tray game process, and make necessary data archiving for quantitative analysis. Virtual psychological sand tray (electronic psychological sand tray) refers to the electronicization of traditional psychological sand trays. Specifically, it uses information technology to display traditional psychological sand trays on computer screens in the form of software, and transforms the traditional psychological sand tray game treatment process into an intelligent human-computer interaction process, thereby achieving the effect of psychological diagnosis and treatment.

[0006] Anomaly detection driven by virtual psychological sandbox is one of the important research branches in mental health diagnosis, but few people have conducted research on it. In addition, although there is a huge amount of virtual psychological sandbox data in the system background, due to the difficulty of data labeling and the high cost of expert labeling, the number of labeled virtual psychological sandbox samples is very scarce, resulting in poor auxiliary diagnosis effect. Summary of the invention

[0007] In order to overcome the shortcomings of the above-mentioned prior art, the present invention provides a dual semi-supervised integrated abnormal psychological sand table detection method and system. By combining a semi-supervised feature extraction method and a semi-supervised integrated detection algorithm, anomaly detection is performed on psychological sand table samples, thereby improving the accuracy of recognition and the effect of abnormal psychological sand table detection.

[0008] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions:

[0009] The first aspect of the present invention provides a dual semi-supervised integrated abnormal psychological sandbox detection method.

[0010] A dual semi-supervised integrated abnormal psychological sandbox detection method, comprising:

[0011] Obtain the psychological sand tray sample to be tested;

[0012] Using semi-supervised feature extraction method, features are extracted from the pre-processed psychological sand table samples;

[0013] Based on the extracted features, a semi-supervised integrated detection algorithm is used to determine whether the psychological sand table sample is abnormal;

[0014] Among them, the semi-supervised integrated detection algorithm integrates multiple semi-supervised anomaly classifiers, performs anomaly detection on features respectively, makes a comprehensive judgment on each anomaly detection result obtained, and finally determines it as an abnormal sample when the preset conditions are met.

[0015] Furthermore, the psychological sandbox sample is a user operation log generated when a user uses a virtual psychological sandbox software to create a virtual sandbox, which records the user operation steps and processes.

[0016] Furthermore, the semi-supervised feature extraction method performs feature extraction through a feature extraction model after semi-supervised training;

[0017] The feature extraction model includes a convolutional neural network for feature extraction and a multi-layer perceptron for classification prediction, and the multi-layer perceptron is used to assist in training the convolutional neural network.

[0018] Furthermore, the semi-supervised training of the feature extraction model is specifically as follows:

[0019] Use labeled samples to conduct supervised training on the initial feature extraction model, optimize model parameters, and obtain a preliminary feature extraction model;

[0020] Input the unlabeled samples into the preliminary feature extraction model for feature extraction and classification prediction to obtain pseudo labels and form pseudo labeled samples;

[0021] The pseudo-labeled samples are merged with the labeled samples to form a new training set, and the feature extraction model is retrained to obtain a feature extraction model after semi-supervised training.

[0022] Furthermore, the integrated multiple semi-supervised anomaly classifiers include four classifiers constructed based on an improved clustering k-Means algorithm, an improved local anomaly factor LOF algorithm, an improved k-nearest neighbor kNN algorithm, and an improved isolation forest iForest algorithm;

[0023] Among them, these four classifiers all use a small amount of labeled samples combined with a large amount of unlabeled samples to model and predict abnormal samples.

[0024] Furthermore, the improved clustering k-Means algorithm initializes two cluster centers according to the labels of the labeled samples, and determines the abnormal classification of the unlabeled samples according to the distances from the unlabeled samples to the two cluster centers;

[0025] The improved local outlier factor LOF algorithm uses labeled samples to train an initial LOF model, uses the trained LOF model to calculate the LOF value of unlabeled samples, and performs outlier classification based on the LOF value;

[0026] The improved k-nearest neighbor (kNN) algorithm uses labeled samples to train the initial kNN model to obtain the optimal number of neighbors k. For each unlabeled sample, its k nearest neighbors are found, and voting is performed based on the labels of these neighbors to determine the abnormal classification of the sample.

[0027] The improved isolation forest iForest algorithm uses unlabeled samples to initialize an isolation forest model, the weights of all decision tree paths in the model are 1, and the isolation forest model is iteratively updated using labeled samples in the labeled sample set, and the weights on the corresponding paths are adjusted according to the labels of the labeled samples until the labeled sample set is empty, thereby obtaining the final constructed isolation forest model.

[0028] Furthermore, the above-mentioned comprehensive judgment of each abnormal detection result is specifically as follows:

[0029] The number of abnormal results in each abnormal detection result is counted. When the number of results is not less than the preset threshold, it is finally determined to be an abnormal sample.

[0030] The second aspect of the present invention provides a dual semi-supervised integrated abnormal psychological sandbox detection system.

[0031] A dual semi-supervised integrated abnormal psychological sandbox detection system, including a sample acquisition module, a feature extraction module and an abnormality judgment module:

[0032] The sample acquisition module is configured to: acquire a psychological sandbox sample to be tested;

[0033] The feature extraction module is configured to: extract features from the preprocessed psychological sand table samples using a semi-supervised feature extraction method;

[0034] The abnormality judgment module is configured to: judge whether the psychological sand table sample is abnormal based on the extracted features through a semi-supervised integrated detection algorithm;

[0035] Among them, the semi-supervised integrated detection algorithm integrates multiple semi-supervised anomaly classifiers, performs anomaly detection on features respectively, makes a comprehensive judgment on each anomaly detection result obtained, and finally determines it as an abnormal sample when the preset conditions are met.

[0036] The third aspect of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of a dual semi-supervised integrated abnormal psychological sandbox detection method as described in the first aspect of the present invention.

[0037] The fourth aspect of the present invention provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the dual semi-supervised integrated abnormal psychological sandbox detection method as described in the first aspect of the present invention are implemented.

[0038] One or more of the above technical solutions have the following beneficial effects:

[0039] (1) The present invention combines semi-supervised learning in both feature extraction and anomaly judgment by designing a dual semi-supervised training process, making full use of labeled samples and unlabeled samples. Furthermore, the learning results of multiple anomaly classifiers are integrated to improve the accuracy of abnormal sandbox sample recognition.

[0040] (2) Different from the scale method, expert diagnosis method, and physical sand table method commonly used in traditional mental health auxiliary diagnosis, the present invention is based on massive virtual psychological sand table log data and introduces machine learning methods to mine abnormal sand table samples, effectively reducing the time cost of human experts; this provides technical support for the application of virtual psychological sand tables in large-scale groups and provides new ideas for national mental health census research.

[0041] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0043] Figure 1 is a method flow chart of the first embodiment;

[0044] Figure 2 This is a method framework diagram of the first embodiment, in which black, dark gray, and light gray represent different dimensions of the psychological sandbox sample, black represents the time dimension t, light gray represents the operation type dimension o, and dark gray represents the operation object dimension s. DETAILED DESCRIPTION

[0045] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0046] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0047] How to conduct accurate abnormal psychological sand tray detection based on a small number of labeled psychological sand tray samples to assist in mental health diagnosis is a very challenging problem.

[0048] The present invention designs a dual semi-supervised integrated abnormal psychological sand table detection method and system, introduces semi-supervised learning and integrated learning into the abnormal psychological sand table detection task, and obtains an abnormal sand table sample set in combination with an abnormal sample detection algorithm; abnormal samples refer to outlier samples that are easily isolated, accounting for a very small proportion of the total sample volume, and their characteristic values ​​are very different from those of normal samples; abnormal detection is performed on the samples, and the detected abnormal samples often have mental health risks; therefore, abnormal sample detection can detect sample information with abnormal behavior from massive psychological sand table data, thereby assisting human experts in making accurate diagnoses.

[0049] Embodiment 1

[0050] In one embodiment of the present disclosure, a dual semi-supervised integrated abnormal psychological sandbox detection method is provided. Figure 1 As shown, the following steps are included:

[0051] Step S1: Obtain the psychological sandbox sample to be tested and perform preprocessing.

[0052] Furthermore, the psychological sandbox sample is a user operation log generated when a user uses a virtual psychological sandbox software to create a virtual sandbox, which records the user operation steps and processes.

[0053] Step S2: Use the semi-supervised feature extraction method to extract features from the preprocessed psychological sand table samples.

[0054] Furthermore, the semi-supervised feature extraction method performs feature extraction through a feature extraction model after semi-supervised training;

[0055] The feature extraction model includes a convolutional neural network for feature extraction and a multi-layer perceptron for classification prediction, and the multi-layer perceptron is used to assist in training the convolutional neural network.

[0056] Furthermore, the semi-supervised training of the feature extraction model is specifically as follows:

[0057] Use labeled samples to conduct supervised training on the initial feature extraction model, optimize model parameters, and obtain a preliminary feature extraction model;

[0058] Input the unlabeled samples into the preliminary feature extraction model for feature extraction and classification prediction to obtain pseudo labels and form pseudo labeled samples;

[0059] The pseudo-labeled samples are merged with the labeled samples to form a new training set, and the feature extraction model is retrained to obtain a feature extraction model after semi-supervised training.

[0060] Step S3: Based on the extracted features, a semi-supervised integrated detection algorithm is used to determine whether the psychological sand table sample is abnormal;

[0061] Among them, the semi-supervised integrated detection algorithm integrates multiple semi-supervised anomaly classifiers, performs anomaly detection on features respectively, makes a comprehensive judgment on each anomaly detection result obtained, and finally determines it as an abnormal sample when the preset conditions are met.

[0062] Furthermore, the integrated multiple semi-supervised anomaly classifiers include four classifiers constructed based on the improved clustering k-Means algorithm, the local anomaly factor LOF algorithm, the k nearest neighbor kNN algorithm and the isolation forest iForest algorithm respectively;

[0063] Among them, these four classifiers all use a small amount of labeled samples combined with a large amount of unlabeled samples to model and predict abnormal samples.

[0064] Furthermore, the improved clustering k-Means algorithm initializes two cluster centers according to the labels of the labeled samples, and determines the abnormal classification of the unlabeled samples according to the distances from the unlabeled samples to the two cluster centers;

[0065] The improved local outlier factor LOF algorithm uses labeled samples to train an initial LOF model, uses the trained LOF model to calculate the LOF value of unlabeled samples, and performs outlier classification based on the LOF value;

[0066] The improved k-nearest neighbor (kNN) algorithm uses labeled samples to train the initial kNN model to obtain the optimal number of neighbors k. For each unlabeled sample, its k nearest neighbors are found, and voting is performed based on the labels of these neighbors to determine the abnormal classification of the sample.

[0067] The improved isolation forest iForest algorithm initializes an isolation forest model, in which the weights of all decision tree paths in the model are 1, and iteratively updates the isolation forest model using labeled samples in the labeled sample set, and adjusts the weights on the corresponding paths according to the labels of the labeled samples until the labeled sample set is empty, and uses the finally constructed isolation forest model to determine the abnormal classification of unlabeled samples.

[0068] Furthermore, the above-mentioned comprehensive judgment of each abnormal detection result is specifically as follows:

[0069] The number of abnormal results in each abnormal detection result is counted. When the number of results is not less than the preset threshold, it is finally determined to be an abnormal sample.

[0070] The following is a detailed description of the implementation process of a dual semi-supervised integrated abnormal psychological sandbox detection method in this embodiment.

[0071] In order to select a suitable anomaly classification algorithm for anomaly detection and improve the accuracy of abnormal sandbox sample identification, this embodiment proposes a dual semi-supervised integrated abnormal psychological sandbox detection algorithm for abnormal sample detection; when the user uses the virtual psychological sandbox software to create a virtual sandbox, the software background records the steps and processes of the user's operation and generates a large number of user operation logs; therefore, this embodiment is based on a large amount of virtual psychological sandbox data and uses machine learning and data mining related technologies to detect abnormal sandbox samples, which mainly includes three parts:

[0072] 1. Sample acquisition and preprocessing

[0073] Obtain user operation logs from the virtual psychological sandbox software and construct a psychological sandbox sample for feature extraction:

[0074] Extract the operations of the user in the sandbox from the user operation log to form a 3D binary tensor X∈(0,1) T×O×S , as a psychological sand table sample, where T represents the time dimension (in this embodiment, the total sand table time is divided into 10 equal parts to obtain the time dimension T, that is, T=10), O represents the number of operation types, and S represents the number of operation objects; if o operations are performed in time period t, and the operation object is sand tool number s, then the corresponding value X t×o×s The value is 1 if yes, otherwise 0.

[0075] Assuming that in a virtual psychological sandbox software, there are 9 types of operations and 1200 operation objects, then the corresponding psychological sandbox sample is X∈(0,1) 10×9×1200 .

[0076] The data used for training in this embodiment all come from a psychological sand table website. User operation logs are obtained in batches from the background of the website, and a psychological sand table sample set is constructed in the above manner.

[0077] 2. Semi-supervised feature extraction

[0078] Through the convolutional neural network (CNN), the labeled samples are initially extracted, the model parameters are optimized, and then the unlabeled samples are extracted to obtain high-dimensional feature representation, realizing end-to-end feature extraction in semi-supervised learning. This process uses labeled data to guide the model's feature extraction capabilities and applies it to a large amount of unlabeled data, improving the effect of feature extraction and the robustness of the model; in this way, by combining labeled data with unlabeled data, semi-supervised learning is used to achieve end-to-end feature extraction.

[0079] In order to realize semi-supervised training of convolutional neural networks, a multi-layer perceptron is added to assist in training the convolutional neural network. The convolutional neural network and the multi-layer perceptron are collectively referred to as a feature extraction model. The convolutional neural network is used for feature extraction, and the multi-layer perceptron is used for classification prediction.

[0080] Specifically, Figure 2 As shown in the figure, the convolutional neural network consists of convolutional layers, pooling layers, and fully connected layers. Each convolutional layer contains several filters, which slide on the input samples, perform dot product operations, and generate features. The convolution operation performs nonlinear transformations through activation functions (such as ReLU) to enhance the expressiveness of the model. The convolutional layer is followed by the pooling layer. Commonly used pooling operations include maximum pooling and average pooling. The pooling layer is used to downsample features, reduce the amount of calculation and the number of parameters, while retaining important features.

[0081] After multiple layers of convolution and pooling, the features of the last layer are flattened into a one-dimensional vector as the input of the fully connected layer. The fully connected layer combines different features through linear and nonlinear transformations to generate a high-dimensional feature representation, that is, the extracted features.

[0082] Finally, a multi-layer perceptron is used to classify the extracted features through Softmax or other activation functions. The classification here is binary classification, that is, it is divided into two categories: abnormal samples and normal samples.

[0083] Based on the above structure, the specific semi-supervised training process is:

[0084] A small amount of labeled sample data U1={X1, …,X i ,…,X n} Input to the convolutional neural network (CNN) for feature extraction, X i represents the i-th psychological sandbox sample, and n is the number of labeled samples.

[0085] Use labeled samples to train the initial feature extraction model, optimize the model parameters, and obtain a preliminary feature extraction model.

[0086] After the initial training is completed, the unlabeled sample data Input into the trained model for feature extraction and classification prediction, represents the jth psychological sandbox sample, m is the number of unlabeled samples, and the unlabeled samples are predicted by the model to obtain pseudo labels; then, these pseudo-labeled samples are merged with the labeled samples to form a new training set.

[0087] The model is retrained using a new training set and optimized iteratively. In each iteration, labeled and pseudo-labeled samples are used for convolution and pooling to extract features and optimize model parameters.

[0088] 3. Semi-supervised integrated detection

[0089] Existing commonly used abnormal sample detection algorithms often only use unlabeled samples for modeling, resulting in low detection accuracy. Considering that in the abnormal psychological sandbox detection task in real scenarios, a small number of labeled samples can be obtained through expert annotation. Therefore, this embodiment introduces semi-supervised learning to improve the commonly used anomaly detection algorithm. This embodiment selects four anomaly detection algorithms for improvement: clustering k-Means algorithm, local anomaly factor LOF algorithm, k nearest neighbor kNN algorithm and isolation forest iForest algorithm, and they are named 2CD-Means algorithm, Semi-LOF algorithm, Semi-kNN algorithm and Pre-iForest algorithm respectively. The improved algorithm can use a small number of labeled samples and combine with a large number of unlabeled samples to perform modeling and prediction of abnormal sandbox.

[0090] By using multiple improved algorithms and adopting the Ensemble Learning method, multiple classifiers are trained and combined to solve a problem. This method has achieved great success in practice and is widely used in tasks such as educational data mining, computer vision, natural language understanding, and medical diagnosis. In order to improve the accuracy of model prediction, this embodiment makes a comprehensive judgment on the abnormal detection results obtained by multiple classifiers, and finally determines them as abnormal samples when the preset conditions are met.

[0091] The following is a detailed description of the improvement and integration of the algorithm. Since the four improved algorithms all use a small number of labeled samples combined with a large number of unlabeled samples to model and predict the abnormal sandbox, the following preparations must be done at the beginning:

[0092] First, prepare labeled samples and unlabeled samples. Assume that some samples are labeled normal samples and abnormal samples, and the rest are unlabeled.

[0093] Then, both the labeled samples and the unlabeled samples are input into the trained convolutional neural network, and feature extraction is performed to obtain the labeled sample representation vector {x1, x2, …, x n} and unlabeled sample representation vector , used in the following algorithm.

[0094] 1. 2CD-Means algorithm

[0095] First, two cluster centers are initialized using labeled samples. One center is initialized to the average value of all normal samples, and the other center is initialized to the average value of all abnormal samples. The average value here is calculated using features.

[0096] Then, each unlabeled sample is assigned to the cluster center closest to it. Using the features, the distance between each unlabeled sample and the two initialized centers is calculated, and it is assigned to the center closest to it, thereby obtaining the classification of the unlabeled samples.

[0097] By utilizing the initial information of labeled samples, the K-means algorithm can more effectively detect anomalies in unlabeled samples.

[0098] 2. Semi-LOF algorithm:

[0099] First, perform initial training, use labeled samples to train the initial LOF model, calculate the LOF value of each labeled sample, and adjust the k value (number of neighbors) so that the LOF values ​​of the labeled positive and negative samples are consistent with expectations.

[0100] Next, the unlabeled samples are evaluated. The LOF values ​​of the unlabeled samples are calculated using the trained LOF model, and classified according to the LOF values. Samples with high LOF values ​​are marked as outliers (i.e., abnormal samples), and samples with low LOF values ​​are marked as normal points (i.e., normal samples).

[0101] In this process, an iterative approach can be used to continuously use new labeled samples to retrain the LOF model and improve classification accuracy. In this way, by combining labeled samples and unlabeled samples, the classification effect of the model can be gradually optimized, and the ability to identify outliers and normal points can be improved.

[0102] 3. Semi-kNN algorithm:

[0103] First, the initial kNN model is trained using labeled samples, and an appropriate k value (number of neighbors) is selected to ensure that the labeled samples can be accurately classified.

[0104] Then, for each unlabeled sample, find its k nearest neighbors, and vote based on the labels of these neighbors to determine the category of the sample; if the labeled samples account for the majority in the voting results, the unlabeled sample is labeled with the majority class.

[0105] Next, use the above steps to label a portion of unlabeled samples (pseudo-labeled), add the pseudo-labeled samples to the training set, and retrain the kNN model; through this iterative method, pseudo-labeling and self-training are continuously performed until the classification results converge.

[0106] 4. Pre-iForest algorithm:

[0107] First, an isolation forest model is initialized, and the weights of all decision tree paths in the model are initialized to 1.

[0108] Then, the model is iteratively updated using the labeled data, specifically:

[0109] A sample is randomly selected from the labeled data and tested using the model; if the test is correct, that is, the test result is consistent with the label, then continue to select the next sample; if the test is wrong, that is, the test result is inconsistent with the label, then adjust the weight on the corresponding path according to the category of the sample, reduce the weight of the positive class, and increase the weight of the negative class; this process continues until the labeled data set is empty.

[0110] Among them, detection errors are divided into two cases:

[0111] Case 1: If the true label is a normal sample and the prediction is an abnormal sample, the weight is increased.

[0112] Case 2: If the true label is an abnormal sample and it is predicted to be a normal sample, the weight is reduced.

[0113] This embodiment uses the above four anomaly detection algorithms as examples to explain how to use a small number of labeled samples and combine them with a large number of unlabeled samples to model and predict anomaly sandboxes. It also includes other algorithms that can achieve anomaly detection. Assume that t Anomaly detection algorithms, building t Anomaly Classifier ,use t Anomaly classifiers are used to detect anomalies on unlabeled samples. t Anomaly detection results.

[0114] 5. Integration

[0115] Since the number of abnormal samples generated by using traditional anomaly detection algorithms alone is relatively large, in order to further narrow the scope of abnormal samples and improve the accuracy of anomaly detection, this embodiment proposes an integrated comprehensive judgment method. Assume that a given sample If it is determined The number of classifiers for abnormal samples is not less than the set threshold , it is finally determined to be an abnormal sample and added to the abnormal sandbox sample set O, which can be expressed by the formula:

[0116]

[0117]

[0118]

[0119] in, is a collection of psychological sandbox samples to be tested. is the number of anomaly classifiers, For the The set of abnormal samples detected by an anomaly classifier, is the indicator function, If the condition is met, the value is 1, otherwise it is 0; is subject to., indicating constraints; threshold Is not greater than t It is a positive integer, which is used to adjust the confidence of samples in the abnormal point set. The larger the value, the higher the confidence of the abnormal samples.

[0120] In the integration stage, the threshold It is set to 4 (equivalent to the number of anomaly classifiers), that is, the "all 1 is 1" strategy: only when all anomaly classifiers judge it as an abnormal sample, it is finally judged as an abnormal sample; this setting can effectively improve the accuracy of virtual psychological sandbox detection, but it is often difficult to take into account the recall rate. In practical applications, it can be set by human experts based on experience.

[0121] In order to evaluate the performance of the proposed method, this embodiment uses accuracy, precision, recall, F1 score and area under the curve (AUC) as evaluation indicators; the student's virtual psychological sandbox data is used as input, and the predicted output is a binary value. That is, if the student's psychological condition is abnormal, the label is positive, and if the student's psychological condition is normal, the label is negative. Therefore, accuracy, precision, recall, F1 score and AUC can be expressed by the following formulas:

[0122]

[0123]

[0124]

[0125]

[0126]

[0127] in, , , , and are accuracy, precision, recall, F1 score and area under the curve, TP (FP) and TN (FN) are the number of correctly (incorrectly) predicted mental health abnormal samples and the number of mental health normal samples, respectively. P is the number of positive samples, and N is the number of negative samples. is the prediction score of the positive sample, that is, the probability of predicting the positive sample as a positive example, is the prediction score of the negative sample, that is, the probability of predicting the negative sample as a positive example.

[0128] This embodiment compares the proposed dual semi-supervised integrated abnormal psychological sandbox detection method with four traditional outlier detection algorithms. The comparison results are shown in Table 1, where iForest, LOF, kNN and k-means are the four traditional outlier detection algorithms used for comparison, Our approach is the method of this embodiment, and the optimal result on a certain indicator is indicated in bold.

[0129] Table 1 Comparison results of different methods

[0130]

[0131] It can be seen from Table 1 that compared with the traditional outlier detection method, the method proposed in this embodiment has achieved better performance in various indicators, which means that the accuracy of the abnormal samples detected by the method proposed in this embodiment is higher.

[0132] Embodiment 2

[0133] In one embodiment of the present disclosure, a dual semi-supervised integrated abnormal psychological sandbox detection system is provided, including a sample acquisition module, a feature extraction module and an abnormality judgment module:

[0134] The sample acquisition module is configured to: acquire a psychological sandbox sample to be tested;

[0135] The feature extraction module is configured to: extract features from the preprocessed psychological sand table samples using a semi-supervised feature extraction method;

[0136] The abnormality judgment module is configured to: judge whether the psychological sand table sample is abnormal based on the extracted features through a semi-supervised integrated detection algorithm;

[0137] Among them, the semi-supervised integrated detection algorithm integrates multiple semi-supervised anomaly classifiers, performs anomaly detection on features respectively, makes a comprehensive judgment on each anomaly detection result obtained, and finally determines it as an abnormal sample when the preset conditions are met.

[0138] Embodiment 3

[0139] The purpose of this embodiment is to provide a computer-readable storage medium.

[0140] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in a dual semi-supervised integrated abnormal psychological sandbox detection method as described in the first embodiment of the present disclosure.

[0141] Embodiment 4

[0142] The purpose of this embodiment is to provide an electronic device.

[0143] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps in a dual semi-supervised integrated abnormal psychological sandbox detection method as described in the first embodiment of the present disclosure are implemented.

[0144] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A dual semi-supervised integrated abnormal psychological sandbox detection method, characterized in that: include: Step S1: Obtain the psychological sand table sample to be tested; The psychological sand table sample is composed of time dimension, operation type dimension and operation object dimension; The total time spent on the sand table is divided equally to obtain the time dimension; Step S2: Using a semi-supervised feature extraction method, extract features from the pre-processed psychological sand table samples; The semi-supervised feature extraction method performs feature extraction through a feature extraction model after semi-supervised training; The feature extraction model includes a convolutional neural network for feature extraction and a multi-layer perceptron for classification prediction, wherein the multi-layer perceptron is used to assist in training the convolutional neural network; The convolutional neural network consists of a convolutional layer, a pooling layer, and a fully connected layer. After multiple layers of convolution and pooling, the features of the last layer are flattened into a one-dimensional vector as the input of the fully connected layer. The fully connected layer combines different features through linear and nonlinear transformations to generate a high-dimensional feature representation to obtain the extracted features. The semi-supervised training process of the feature extraction model is as follows: a small amount of labeled sample data U1={X1, …,X i ,…,X n } Input into the convolutional neural network for feature extraction, X i represents the i-th psychological sandbox sample, and n is the number of labeled samples; Use the labeled samples to train the initial feature extraction model, optimize the model parameters, and obtain a preliminary feature extraction model; After training, the unlabeled sample data Input into the trained feature extraction model for feature extraction and classification prediction, represents the jth psychological sandbox sample, m is the number of unlabeled samples, and the unlabeled samples are predicted by the feature extraction model to obtain pseudo-labeled samples; these pseudo-labeled samples are merged with the labeled samples to form a new training set; Retrain the feature extraction model using the new training set and continuously iterate and optimize; In each iteration, convolution and pooling are performed using labeled samples and pseudo-labeled samples to extract features and optimize model parameters; Step S3: Based on the extracted features, a semi-supervised integrated detection algorithm is used to determine whether the psychological sand table sample is abnormal; The semi-supervised integrated detection algorithm integrates multiple semi-supervised anomaly classifiers, performs anomaly detection on features respectively, makes a comprehensive judgment on each anomaly detection result, and finally determines it as an abnormal sample when the preset conditions are met; Integrated multiple semi-supervised anomaly classifiers, including four classifiers based on the improved clustering k-Means algorithm, the improved local anomaly factor LOF algorithm, the improved k-nearest neighbor kNN algorithm, and the improved isolation forest iForest algorithm; Among them, these four classifiers all use a small number of labeled samples combined with a large number of unlabeled samples to model and predict abnormal samples; The improved clustering k-Means algorithm initializes two cluster centers according to the labels of the labeled samples. One center is initialized to the average value of all normal samples, and the other center is initialized to the average value of all abnormal samples. The abnormal classification of unlabeled samples is determined based on the distance from the unlabeled samples to the two cluster centers. The improved local outlier factor LOF algorithm uses labeled samples to train the initial LOF model, determines the optimal neighbor number k value, uses the trained LOF model to calculate the LOF value of unlabeled samples, and classifies outliers based on the LOF value; The improved k-nearest neighbor (kNN) algorithm uses labeled samples to train the initial kNN model to obtain the optimal number of neighbors k. For each unlabeled sample, its k nearest neighbors are found, and the labels of these neighbors are voted to determine the abnormal classification of the sample. The improved Isolation Forest iForest algorithm uses unlabeled samples to initialize an isolation forest model. The weights of all decision tree paths in the isolation forest model are 1. The isolation forest model is iteratively updated using labeled samples in the labeled sample set. The weights on the corresponding paths are adjusted according to the labels of the labeled samples until the labeled sample set is empty, thus obtaining the final constructed isolation forest model.

2. A dual semi-supervised integrated abnormal psychological sandbox detection method as claimed in claim 1, characterized in that: The psychological sand table sample is a user operation log generated when a user uses a virtual psychological sand table software to create a virtual sand table, which records the user operation steps and processes.

3. A dual semi-supervised integrated abnormal psychological sandbox detection method as claimed in claim 1, characterized in that: The comprehensive judgment of each abnormal detection result obtained is specifically as follows: The number of abnormal results in each abnormal detection result is counted. When the number of results is not less than the preset threshold, it is finally determined to be an abnormal sample.

4. A dual semi-supervised integrated abnormal psychological sandbox detection system, characterized in that: Including sample acquisition module, feature extraction module and abnormality judgment module: The sample acquisition module is configured to: acquire a psychological sandbox sample to be tested; The psychological sand table sample consists of a time dimension, an operation type dimension, and an operation object dimension; wherein the total sand table time is divided equally to obtain the time dimension; The feature extraction module is configured to: extract features from the preprocessed psychological sand table samples using a semi-supervised feature extraction method; The semi-supervised feature extraction method performs feature extraction through a feature extraction model after semi-supervised training; The feature extraction model includes a convolutional neural network for feature extraction and a multi-layer perceptron for classification prediction, wherein the multi-layer perceptron is used to assist in training the convolutional neural network; The convolutional neural network consists of a convolutional layer, a pooling layer, and a fully connected layer. After multiple layers of convolution and pooling, the features of the last layer are flattened into a one-dimensional vector as the input of the fully connected layer. The fully connected layer combines different features through linear and nonlinear transformations to generate a high-dimensional feature representation to obtain the extracted features. The semi-supervised training process of the feature extraction model is as follows: a small amount of labeled sample data U1={X1, …,X i ,…,X n } Input into the convolutional neural network for feature extraction, X i represents the i-th psychological sandbox sample, and n is the number of labeled samples; Use the labeled samples to train the initial feature extraction model, optimize the model parameters, and obtain a preliminary feature extraction model; After training, the unlabeled sample data Input into the trained feature extraction model for feature extraction and classification prediction, represents the jth psychological sandbox sample, m is the number of unlabeled samples, and the unlabeled samples are predicted by the feature extraction model to obtain pseudo-labeled samples; these pseudo-labeled samples are merged with the labeled samples to form a new training set; Retrain the feature extraction model using the new training set and continuously iterate and optimize; In each iteration, convolution and pooling are performed using labeled samples and pseudo-labeled samples to extract features and optimize model parameters; The abnormality judgment module is configured to: judge whether the psychological sand table sample is abnormal based on the extracted features through a semi-supervised integrated detection algorithm; The semi-supervised integrated detection algorithm integrates multiple semi-supervised anomaly classifiers, performs anomaly detection on features respectively, makes a comprehensive judgment on each anomaly detection result, and finally determines it as an abnormal sample when the preset conditions are met; Semi-supervised feature extraction method, which extracts features through the feature extraction model after semi-supervised training; The semi-supervised integrated detection algorithm integrates multiple semi-supervised anomaly classifiers, performs anomaly detection on features respectively, makes a comprehensive judgment on each anomaly detection result, and finally determines it as an abnormal sample when the preset conditions are met; Integrated multiple semi-supervised anomaly classifiers, including four classifiers based on the improved clustering k-Means algorithm, the improved local anomaly factor LOF algorithm, the improved k-nearest neighbor kNN algorithm, and the improved isolation forest iForest algorithm; Among them, these four classifiers all use a small number of labeled samples combined with a large number of unlabeled samples to model and predict abnormal samples; The improved clustering k-Means algorithm initializes two cluster centers according to the labels of the labeled samples. One center is initialized to the average value of all normal samples, and the other center is initialized to the average value of all abnormal samples. The abnormal classification of unlabeled samples is determined based on the distance from the unlabeled samples to the two cluster centers. The improved local outlier factor LOF algorithm uses labeled samples to train the initial LOF model, determines the optimal neighbor number k value, uses the trained LOF model to calculate the LOF value of unlabeled samples, and classifies outliers based on the LOF value; The improved k-nearest neighbor (kNN) algorithm uses labeled samples to train the initial kNN model to obtain the optimal number of neighbors k. For each unlabeled sample, its k nearest neighbors are found, and the labels of these neighbors are voted to determine the abnormal classification of the sample. The improved Isolation Forest iForest algorithm uses unlabeled samples to initialize an isolation forest model. The weights of all decision tree paths in the isolation forest model are 1. The isolation forest model is iteratively updated using labeled samples in the labeled sample set. The weights on the corresponding paths are adjusted according to the labels of the labeled samples until the labeled sample set is empty, thus obtaining the final constructed isolation forest model.

5. An electronic device, comprising: a memory for non-transitory storage of computer readable instructions; a processor for executing the computer-readable instructions; Wherein, when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 3 is executed.

6. A storage medium, characterized in that: The computer-readable instructions are non-transitorily stored, wherein when the computer-readable instructions are executed by a computer, the method according to any one of claims 1 to 3 is performed.

Citation Information

Patent Citations

  • Semi-supervised learning-based portal vein detection and positioning method and system

    CN112733708A

  • Abnormal signal semi-supervised classification method and system, and data processing terminal

    CN113541834A

  • Wind generating set gearbox diagnosis method based on semi-supervised momentum prototype network

    CN113920348A

  • License plate quality judgment method based on semi-supervised learning

    CN116129413A

  • Block chain abnormal transaction detection method based on semi-supervised learning

    CN116644283A