A training method and system for a methamphetamine addict detection model
Through EEG-based EEG signal processing and deep convolutional network, a meth addict detection model is constructed, which solves the problems of low spatial resolution, expensive equipment and hair impact of methamphet addict detection in the prior art, and improves recognition Efficiency, achieving high accuracy detection of methamphetamine addicts.
Patent Information
- Application Number
- CN202110925526.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-12
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2041-08-12
AI Technical Summary
The existing detection methods for methamphetamine addicts have problems such as low spatial resolution, expensive equipment, hair impact accuracy and insufficient sample size, resulting in low recognition efficiency.
EEG-based EEG signals are used to obtain EEG signals through visually induced stimulus images, preprocessing and difference calculations are performed, and the meth addict detection network model is constructed, the model is optimized using backpropagation algorithm, and the deep convolutional network is combined with , iterative training and verification.
The problems of insufficient time, expensive equipment and hair impact were solved, spatial resolution and recognition efficiency were improved, the average accuracy of 86% was achieved, the sample size was amplified, and the individual-specific impact was reduced.
Smart Images

Figure CN113598794B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of machine learning and feature detection, and more specifically, relates to a training method and system for a methamphetamine addict detection model. Background Art
[0002] The gold standard for detecting methamphetamine addicts is urine testing, which is fast, convenient, easy to carry and highly accurate. However, this method is affected by the half-life of drugs. The time period for urine testing to be positive after methamphetamine use is 1 hour to 3 days after drug use, which means that it can only detect addicts who have been addicted to drugs shortly after taking them. Given that methamphetamine addicts have damaged nervous systems and pose a great potential social hazard, how to successfully identify methamphetamine addicts from the perspective of cognitive neuroscience and make up for the short-term disadvantage of urine testing has become a research hotspot in the industry.
[0003] Existing methods for detecting methamphetamine addicts from the perspective of cognitive neuroscience mainly include the use of electroencephalogram (EEG), functional magnetic resonance imaging (fMRI), and functional near-infrared spectroscopy (fNIRS).
[0004] However, the above-mentioned methamphetamine addict detection methods all have some technical problems that cannot be ignored. For the EEG method, although it is simple and portable with high temporal resolution, its spatial resolution is low; for the fMRI method, it can intuitively reflect the degree of brain area activation, but the equipment is expensive; for the fNIRS method, its temporal and spatial resolution and equipment price are between the EEG method and the fMRI method, but the hair of the person to be tested will affect the accuracy of the test. Summary of the invention
[0005] In view of the above defects or improvement needs of the prior art, the present invention provides a training method and system for a methamphetamine addict detection model, which aims to make up for the short-term disadvantage of urine detection, solve the technical problem of low spatial resolution of the existing methamphetamine addict detection method based on EEG, the technical problem of expensive equipment in the methamphetamine addict detection method based on fMRI, the technical problem of the hair of the person to be detected affecting the detection accuracy in the methamphetamine addict detection method based on fNIRS, the feasibility problem of identification of the existing methamphetamine addict detection method based on EEG, and the problem of low recognition efficiency caused by insufficient sample size and unclear features of the existing deep convolutional network model.
[0006] To achieve the above object, according to one aspect of the present invention, a method for training a methamphetamine addict detection model is provided, comprising the following steps:
[0007] (1) obtaining electroencephalogram (EEG) signals of multiple test subjects after they see visual evoked stimulus images;
[0008] (2) preprocessing the electroencephalogram signal corresponding to each subject to be tested obtained in step (1) to obtain a preprocessed electroencephalogram signal corresponding to each subject to be tested;
[0009] (3) For the preprocessed EEG signals corresponding to each subject to be tested obtained in step (2), the voltage values a1, a2, ..., am of each sub-EEG signal corresponding to the standard stimulus picture are subtracted from the voltage values b1, b2, ..., bn of each sub-EEG signal corresponding to the addiction deviation picture, so as to obtain a data set corresponding to the subject to be tested and composed of multiple voltage difference values, namely {a1-b1, a1-b2, ..., a1-bn, a2-b1, a2-b2, ..., a2-bn, ..., am-b1, am-b2, ...am-bn}. The data sets of all subjects to be tested are divided into a training set and a test set in a ratio of 4:1, where n represents the total number of sub-EEG signals corresponding to the addiction deviation pictures, and m represents the total number of sub-EEG signals corresponding to the standard stimulus pictures.
[0010] (4) Inputting the training set obtained in step (3) into the methamphetamine addict detection network model, and using the back propagation algorithm to update and optimize the weight parameters and bias parameters of each layer in the methamphetamine addict detection network model to obtain an updated methamphetamine addict detection network model.
[0011] (5) iteratively training the methamphetamine addict detection network model updated in step (4) until the loss function of the methamphetamine addict detection network model reaches a minimum;
[0012] (6) Using the test set obtained in step (3), the iteratively trained methamphetamine addict detection network model is iteratively verified until the classification accuracy is optimal, thereby obtaining a trained methamphetamine addict detection network model.
[0013] Preferably, step (1) specifically comprises first collecting 64-channel EEG signals after the test subject sees different visual evoked stimulus pictures in the oddball experimental mode, and then repeating the process after a predetermined time interval, so as to finally obtain the final EEG signal.
[0014] Preferably, the visually induced stimulation pictures include standard stimulation pictures and addiction deviation pictures, wherein the standard stimulation pictures are pictures that are completely unrelated to methamphetamine, and the addiction deviation pictures are pictures that are highly related to methamphetamine.
[0015] Preferably, step (2) is specifically as follows: first, for the electroencephalogram signal corresponding to each person to be tested, the average voltage of TP9 and TP10 channels is selected as the reference voltage, and then the voltage of all other 62 channels is respectively subtracted from the reference voltage to obtain the electroencephalogram signal after reference removal, and then the electroencephalogram signal is band-pass filtered from 1 to 30 Hz, and then the artifacts, signal drift and non-biological signals in the electroencephalogram signal after band-pass filtering are removed, and then the independent component analysis (ICA) method is used to remove the electrooculogram interference in the electroencephalogram signal to obtain the electroencephalogram signal after interference removal; then, from the de-referenced electroencephalogram signal, the electroencephalogram signal is band-pass filtered from 1 to 30 Hz, and then the artifacts, signal drift and non-biological signals in the electroencephalogram signal after band-pass filtering are removed, and then the electrooculogram interference in the electroencephalogram signal is removed by the independent component analysis (ICA) method to obtain the electroencephalogram signal after interference removal; then, From the EEG signals after interference removal, the EEG signals 200ms before and 1000ms after each standard stimulus picture is presented to the test subject are intercepted to generate a sub-EEG signal corresponding to each standard stimulus picture, and the EEG signals 200ms before and 1000ms after each addiction deviation picture is presented to the test subject are intercepted to generate a sub-EEG signal corresponding to each addiction deviation picture. All the sub-EEG signals corresponding to all standard stimulus pictures and all the sub-EEG signals corresponding to all addiction deviation pictures together constitute the preprocessed EEG signal corresponding to the test subject.
[0016] Preferably, the initial value of the weight parameter in step (4) is a random value output by a truncated normal distribution with a standard deviation of 0.1, and the initial value of the bias parameter is set to 0;
[0017] The back propagation algorithm uses Adam-Optimizer as the optimizer.
[0018] Preferably, the loss function L of the methamphetamine addict detection network model is:
[0019]
[0020] Where N is the total number of samples in the training set, K is the number of categories in the training set, and t i,k represents the prediction result after the i-th training sample of the k-th class is input into the methamphetamine addict detection network model, y i,k represents the true result corresponding to the i-th training sample of the k-th category, k∈[1,K], λ represents the degree of regularization, and its value is 0.01, W i,k It represents the weight parameter when the i-th training sample of the k-th category is input into the methamphetamine addict detection network model, which changes automatically with the training of the CNN methamphetamine addict detection network model.
[0021] Preferably, the methamphetamine addict detection network model adopts a convolutional neural network, and its specific structure is as follows:
[0022] The first layer is the input layer, whose input size is 300×62 EEG signals;
[0023] The second layer is a one-dimensional convolution layer with a convolution kernel size of 1×100 and 64 convolution kernels. Its input is the 300×62 EEG signal of the input layer, and its output dimension is 201×64.
[0024] The third layer is a maximum pooling layer with a stride of 2, an input dimension of 201×64, and an output dimension of 100×64.
[0025] The fourth layer is the convolution layer, whose convolution kernel size is 1×32, the number of convolution kernels is 128, its input dimension is 100×64, and its output dimension is 69×128.
[0026] The fifth layer is a maximum pooling layer with a stride of 2, an input dimension of 69×128, and an output dimension of 34×128.
[0027] The sixth layer is the convolution layer, whose convolution kernel size is 1×32, the number of convolution kernels is 256, its input dimension is 34×128, and its output dimension is 3×256.
[0028] The seventh layer is a maximum pooling layer with a stride of 2, an input dimension of 3×256, and an output dimension of 1×256.
[0029] The eighth layer is a Dropout layer with a ratio of 0.3 and an output dimension of 1×256.
[0030] The ninth layer is a fully connected layer, whose input dimension is 1×256 and whose output dimension is 1×2;
[0031] According to another aspect of the present invention, there is provided a training system for a methamphetamine addict detection model, comprising:
[0032] The first module is used to obtain electroencephalogram signals of multiple test subjects after they see visual induced stimulus pictures.
[0033] The second module is used to preprocess the electroencephalogram signal corresponding to each subject to be tested obtained by the first module to obtain a preprocessed electroencephalogram signal corresponding to each subject to be tested;
[0034] The third module is used for, for the preprocessed EEG signals corresponding to each subject to be tested obtained in the second module, respectively subtracting the voltage values a1, a2, ..., am of each sub-EEG signal corresponding to the standard stimulus picture from the voltage values b1, b2, ..., bn of each sub-EEG signal corresponding to the addiction deviation picture, so as to obtain a data set corresponding to the subject to be tested and consisting of multiple voltage difference values, that is, {a1-b1, a1-b2, ..., a1-bn, a2-b1, a2-b2, ..., a2-bn, ..., am-b1, am-b2, ...am-bn}, and dividing the data sets of all subjects to be tested into a training set and a test set in a ratio of 4:1, wherein n represents the total number of sub-EEG signals corresponding to the addiction deviation picture, and m represents the total number of sub-EEG signals corresponding to the standard stimulus picture;
[0035] The fourth module is used to input the training set obtained in the third module into the methamphetamine addict detection network model, and use the back propagation algorithm to update and optimize the weight parameters and bias parameters of each layer in the methamphetamine addict detection network model to obtain an updated methamphetamine addict detection network model;
[0036] The fifth module is used to iteratively train the methamphetamine addict detection network model updated by the fourth module until the loss function of the methamphetamine addict detection network model reaches a minimum;
[0037] The sixth module is used to iteratively verify the methamphetamine addict detection network model after iterative training using the test set obtained in the third module until the classification accuracy is optimal, thereby obtaining a trained methamphetamine addict detection network model.
[0038] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0039] 1. Since the present invention adopts steps (1) to (6), it uses EEG signals to detect methamphetamine addicts from the perspective of cognitive science, thus solving the time validity problem of urine detection; the cost of EEG acquisition equipment is low, thus solving the technical problem of expensive equipment in the existing fMRI-based methamphetamine addict detection method; during the EEG acquisition process, the EEG signal is not affected by factors such as hair, thus solving the technical problem that the hair of the person to be detected will affect the detection accuracy in the existing fNIRS-based methamphetamine addict detection method;
[0040] 2. Since the present invention adopts steps (1) to (6), which use 64-channel EEG signals of the 10-20 standard, it can solve the technical problem of low spatial resolution in the existing EEG-based methamphetamine addict detection method;
[0041] 3. Since the present invention adopts steps (1) to (6), it uses artificial intelligence technology, and the average prediction accuracy across subjects can reach 86%, thus solving the feasibility problem of the existing EEG-based methamphetamine addict detection method;
[0042] 4. Since the present invention adopts step (3), it uses sample amplification technology to increase the sample size by 30 times, while reducing the specific influence of individual EEG. Therefore, it can solve the problem of low recognition efficiency caused by insufficient sample size and unclear features of existing deep convolutional network models. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a flow chart of a method for training a methamphetamine addict detection model of the present invention;
[0044] Figure 2 It is a network structure diagram of the methamphetamine addict detection network model of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0046] like Figure 1 As shown, the present invention provides a method for training a methamphetamine addict detection model, comprising the following steps:
[0047] (1) obtaining electroencephalogram (EEG) signals of multiple test subjects after they see visual evoked stimulus images;
[0048] Specifically, this step is as follows: first, in the Oddball experimental mode, 64-channel (10-20 international electrode standard system) EEG signals are collected after the test subject sees different visual evoked stimulus pictures (a total of 85 pictures in this example) (the interval between the two pictures is 2.8 to 3.8 seconds), and then the process is repeated after a predetermined time interval (which can be between 5 minutes and 10 minutes), so as to finally obtain the final EEG signal.
[0049] The visual induced stimulus pictures are divided into two types, namely standard stimulus pictures (which are pictures that have nothing to do with methamphetamine, in this example, they are 70 basketball pictures), and addiction bias pictures (which are pictures that are highly related to methamphetamine, such as pictures of drug-taking devices, methamphetamine itself, etc., in this example, 15 pictures are randomly selected from a set of 45 preset addiction bias pictures).
[0050] It should be noted that the 85 pictures presented to the test subject in the present invention are not arranged in a fixed order, and can be collected in any order to obtain the final multiple EEG signals.
[0051] (2) preprocessing the electroencephalogram signal corresponding to each subject to be tested obtained in step (1) to obtain a preprocessed electroencephalogram signal corresponding to each subject to be tested;
[0052] Specifically, this step is as follows: first, for each EEG signal corresponding to the subject to be tested, the average voltage of TP9 and TP10 channels is selected as the reference voltage, and then the voltage of all other 62 channels is subtracted from the reference voltage to obtain the EEG signal after reference removal. Then, the EEG signal is band-pass filtered from 1 to 30 Hz (the sampling frequency is downsampled to 250 Hz), and then the artifacts, signal drift and non-biological signals in the EEG signal after band-pass filtering are removed. Then, independent component analysis (ICA) is used to analyze the EEG signal. The electrooculogram (EOG) signal is removed by using an ICA method to obtain an EEG signal after the interference is removed; then, the EEG signal 200ms before and 1000ms after each standard stimulus picture is presented to the test subject is intercepted from the EEG signal after the interference is removed, thereby generating a sub-EEG signal corresponding to each standard stimulus picture, and the EEG signal 200ms before and 1000ms after each addiction deviation picture is presented to the test subject is intercepted, thereby generating a sub-EEG signal corresponding to each addiction deviation picture, and all the sub-EEG signals corresponding to all standard stimulus pictures and all the sub-EEG signals corresponding to all addiction deviation pictures together constitute the preprocessed EEG signal corresponding to the test subject.
[0053] The advantage of this step is that it can remove EEG artifacts in a streamlined manner and extract EEG signals induced by specific stimuli in batches.
[0054] (3) For the preprocessed EEG signals corresponding to each subject to be tested obtained in step (2), the voltage values a1, a2, ..., am of each sub-EEG signal corresponding to the standard stimulus picture are subtracted from the voltage values b1, b2, ..., bn of each sub-EEG signal corresponding to the addiction deviation picture, so as to obtain a data set corresponding to the subject to be tested and composed of multiple voltage difference values, namely {a1-b1, a1-b2, ..., a1-bn, a2-b1, a2-b2, ..., a2-bn, ..., am-b1, am-b2, ...am-bn}, where n represents the total number of sub-EEG signals corresponding to the addiction deviation picture, and m represents the total number of sub-EEG signals corresponding to the standard stimulus picture, and a total of 353319 data are obtained. The data sets of all subjects to be tested are divided into training set and test set in a ratio of 4:1;
[0055] The advantage of this step is that it expands the number of training samples used for deep convolutional neural network learning by about 30 times, thereby improving the generalization ability of deep convolutional neural networks. At the same time, the difference between the standard stimulus evoked potential and the addiction bias stimulus evoked potential weakens the individual differences between different subjects to a certain extent, more effectively reflects the inherent differences between the two types of subjects, and makes the data set have better classification characteristics.
[0056] (4) inputting the training set obtained in step (3) into the methamphetamine addict detection network model, and using the back propagation algorithm to update and optimize the weight parameters and bias parameters of each layer in the methamphetamine addict detection network model to obtain an updated methamphetamine addict detection network model;
[0057] Specifically, the initial value of the weight parameter is a random value output by a truncated normal distribution with a standard deviation of 0.1, and the initial value of the bias parameter is set to 0;
[0058] Specifically, in order to speed up the decrease of the loss value, the back propagation algorithm in this step uses Adam-Optimizer as the optimizer, because the optimizer has the advantages of momentum and adaptive learning rate.
[0059] (5) iteratively training the methamphetamine addict detection network model updated in step (4) until the loss function of the methamphetamine addict detection network model reaches a minimum;
[0060] The loss function L of the methamphetamine addict detection network model is:
[0061]
[0062] Where N represents the total number of samples in the training set (in this embodiment, it is 282655), K represents the number of categories in the training set (in this embodiment, it is 2), t i,k represents the prediction result after the i-th training sample of the k-th class is input into the methamphetamine addict detection network model, y i,k represents the true result corresponding to the i-th training sample of the k-th category, k∈[1,K], λ represents the degree of regularization, and its value is 0.01, W i,k It represents the weight parameter when the i-th training sample of the k-th category is input into the methamphetamine addict detection network model, which changes automatically with the training of the CNN methamphetamine addict detection network model.
[0063] (6) Using the test set obtained in step (3), the iteratively trained methamphetamine addict detection network model is iteratively verified until the classification accuracy is optimal, thereby obtaining a trained methamphetamine addict detection network model.
[0064] like Figure 2 As shown, the methamphetamine addict detection network model in the present invention adopts a convolutional neural network (CNN), and its specific structure is as follows:
[0065] The first layer is the input layer, whose input size is 300×62 EEG signals;
[0066] The second layer is a one-dimensional convolution layer with a convolution kernel size of 1×100 and 64 convolution kernels. Its input is the 300×62 EEG signal of the input layer, and its output dimension is 201×64.
[0067] The third layer is a maximum pooling layer with a stride of 2, an input dimension of 201×64, and an output dimension of 100×64.
[0068] The fourth layer is the convolution layer, whose convolution kernel size is 1×32, the number of convolution kernels is 128, its input dimension is 100×64, and its output dimension is 69×128.
[0069] The fifth layer is a maximum pooling layer with a stride of 2, an input dimension of 69×128, and an output dimension of 34×128.
[0070] The sixth layer is the convolution layer, whose convolution kernel size is 1×32, the number of convolution kernels is 256, its input dimension is 34×128, and its output dimension is 3×256.
[0071] The seventh layer is a maximum pooling layer with a stride of 2, an input dimension of 3×256, and an output dimension of 1×256.
[0072] The eighth layer is a Dropout layer with a ratio of 0.3 and an output dimension of 1×256.
[0073] The ninth layer is a fully connected layer with an input dimension of 1×256 and an output dimension of 1×2.
[0074] Experimental Results
[0075] The experiment was conducted with 70 standard trials and 15 addiction bias trials. In the experiment, the stimulus used was visual stimulus. The subjects observed the pictures in front of the computer screen and responded quickly. The standard stimulus pictures were 70 basketball pictures, recorded as S1, and 45 methamphetamine-related pictures, recorded as S2.
[0076] The present invention aims to identify whether the data comes from addicted subjects or normal subjects, and divides the training set into two types, S1 and S2. The prediction set is randomly selected. Since a single operation is accidental and considering the speed of the operation, the present invention selects five-fold cross validation, and tests five possible training sets and two possible prediction sets respectively. The results are as follows.
[0077] Table 1 Cross-validation results of random selection of prediction sets
[0078]
[0079] The results in Table 1 show that the prediction results are good. However, according to the actual situation, the present invention needs to divide the data set according to the number of subjects, use all the data of one-fifth of the subjects as the prediction set, and use the data of the remaining subjects as the training set, and perform five-fold cross-validation for five cycles. The results are as follows:
[0080] Table 2 Cross-validation results by number of subjects
[0081]
[0082] As shown in Table 2, the accuracy of the prediction set divided by the number of subjects is generally lower than that of random selection. This is because when randomly selecting data as a prediction set, the training set will contain other data of the subject, and the EEG waveforms of the same subject are similar, so the prediction accuracy is higher. Dividing the data by the number of subjects means that the model can only be built based on the data of other subjects, so the prediction accuracy is naturally lower.
[0083] In order to improve the performance of the methamphetamine addict detection network model, the present invention has expanded the training data. For example, in subject No. 201, S1 has 206 data, recorded as a1, a2, a3...a206, and S2 has 44 data, recorded as b1, b2, b3...b44. Take interpolation such as a1-b1, a1-b2...a1-b44, a2-b1, a2-b2...a2-b44 as new input features. After the S1-S2 difference, the total number of data is 353319, and the data format is mat format. It is nearly thirty times larger than the total number of three stimuli 11864. Five-fold cross validation was performed on the expanded data, and the results are shown in Table 3.
[0084] Table 3 Cross-validation results after amplification of data
[0085]
[0086] It can be observed from Table 3 that the data augmentation method is effective in improving the success rate, and the accuracy of the model has been further improved. In the future, we can continue to improve the data set, increase the number of samples of subjects, and collect more data as training sets.
[0087] The present invention utilizes the different characteristics of EEG waveforms of addicted subjects and normal subjects when facing stimulation to complete the binary classification problem of EEG data of addicted and normal subjects. When processing EEG data, the model and function of the computer-related configuration must be considered first.
[0088] Table 4 Hardware configuration
[0089]
[0090] The computer memory size and graphics card model selected by the present invention can basically meet the requirements of project data calculation, with fast calculation and smooth operation.
[0091] Table 5 Cross-validation running time
[0092]
[0093] As shown in Table 5, when the training set and prediction set are divided by the number of subjects, the shortest five-fold cross-validation time is the data training under S3 stimulation, which takes 370.565 seconds to run once. The longest time is the data operation of S1-S2 difference operation. This is because the amount of data expanded under S1-S2 difference operation is the largest, so it takes a long time. But overall, the operation time of the model is within an acceptable range, and the model is feasible.
[0094] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A training method for a methamphetamine addict detection model, It is characterized in that The following steps are involved: (1) obtaining electroencephalogram (EEG) signals of multiple test subjects after they see visual evoked stimulus images; (2) Preprocessing the electroencephalogram signal corresponding to each subject to be tested obtained in step (1) to obtain a preprocessed electroencephalogram signal corresponding to each subject to be tested; step (2) specifically comprises: first, for the electroencephalogram signal corresponding to each subject to be tested, selecting the average voltage of TP9 and TP10 channels as the reference voltage, and then subtracting the reference voltage from the voltages of all other 62 channels to obtain a de-referenced electroencephalogram signal, and then performing a 1 to 30 Hz bandpass filter on the electroencephalogram signal, and then removing artifacts, signal drift and non-biological signals from the bandpass filtered electroencephalogram signal, and then using an independent component analysis (ICA) method to remove the electroencephalogram signal. The electrooculographic interference is removed to obtain the electroencephalogram signal after the interference is removed; then, the electroencephalogram signal 200ms before and 1000ms after each standard stimulus picture is presented to the test subject is intercepted from the electroencephalogram signal after the interference is removed, so as to generate a sub-electroencephalogram signal corresponding to each standard stimulus picture, and the electroencephalogram signal 200ms before and 1000ms after each addiction deviation picture is presented to the test subject is intercepted, so as to generate a sub-electroencephalogram signal corresponding to each addiction deviation picture, and all the sub-electroencephalogram signals corresponding to all standard stimulus pictures and all the sub-electroencephalogram signals corresponding to all addiction deviation pictures together constitute the preprocessed electroencephalogram signal corresponding to the test subject; (3) For the preprocessed EEG signals corresponding to each subject to be tested obtained in step (2), the voltage values a1, a2, ..., am of each sub-EEG signal corresponding to the standard stimulus picture are subtracted from the voltage values b1, b2, ..., bn of each sub-EEG signal corresponding to the addiction deviation picture, so as to obtain a data set corresponding to the subject to be tested and composed of multiple voltage difference values, namely {a1-b1, a1-b2, ..., a1-bn, a2-b1, a2-b2, ..., a2-bn, ..., am-b1, am-b2, ...am-bn}, and the data sets of all subjects to be tested are divided into a training set and a test set in a ratio of 4:1, where n represents the total number of sub-EEG signals corresponding to the addiction deviation pictures, and m represents the total number of sub-EEG signals corresponding to the standard stimulus pictures; (4) Inputting the training set obtained in step (3) into the methamphetamine addict detection network model, and using the back propagation algorithm to update and optimize the weight parameters and bias parameters of each layer in the methamphetamine addict detection network model to obtain an updated methamphetamine addict detection network model; the methamphetamine addict detection network model adopts a convolutional neural network, and its specific structure is as follows: The first layer is the input layer, whose input size is 300×62 EEG signals; The second layer is a one-dimensional convolution layer, whose convolution kernel size is 1×100, the number of convolution kernels is 64, its input is the 300×62 EEG signal of the input layer, and its output dimension is 201×64; The third layer is the maximum pooling layer, whose stride is 2, its input dimension is 201×64, and its output dimension is 100×64; The fourth layer is the convolution layer, whose convolution kernel size is 1×32, the number of convolution kernels is 128, its input dimension is 100×64, and its output dimension is 69×128; The fifth layer is the maximum pooling layer with a stride of 2, an input dimension of 69×128, and an output dimension of 34×128; The sixth layer is a convolutional layer, whose convolution kernel size is 1×32, the number of convolution kernels is 256, its input dimension is 34×128, and its output dimension is 3×256; The seventh layer is the maximum pooling layer, whose stride is 2, its input dimension is 3×256, and its output dimension is 1×256; The eighth layer is the Dropout layer, whose ratio is 0.3 and whose output dimension is 1×256; The ninth layer is a fully connected layer, whose input dimension is 1×256 and whose output dimension is 1×2; (5) Iteratively training the methamphetamine addict detection network model updated in step (4) until the loss function of the methamphetamine addict detection network model reaches a minimum; the loss function L of the methamphetamine addict detection network model is: Where N is the total number of samples in the training set, K is the number of categories in the training set, and t i,k represents the prediction result after the i-th training sample of the k-th class is input into the methamphetamine addict detection network model, y i,k represents the true result corresponding to the i-th training sample of the k-th category, k∈[1,K], λ represents the degree of regularization, and its value is 0.01, W i,k represents the weight parameter when the i-th training sample of the k-th category is input into the methamphetamine addict detection network model, which changes automatically with the training of the CNN methamphetamine addict detection network model; (6) Using the test set obtained in step (3), the iteratively trained methamphetamine addict detection network model is iteratively verified until the classification accuracy is optimal, thereby obtaining a trained methamphetamine addict detection network model.
2. The method for training a methamphetamine addict detection model according to claim 1, It is characterized in that Step (1) specifically includes first collecting 64-channel EEG signals after the test subject sees different visual evoked stimulus pictures in the oddball experimental mode, and then repeating the process after a predetermined time interval, so as to finally obtain the final EEG signal.
3. The method for training a methamphetamine addict detection model according to claim 1 or 2, It is characterized in that The visual induced stimulus pictures include standard stimulus pictures and addiction-deviant pictures, wherein the standard stimulus pictures are pictures that are completely irrelevant to methamphetamine, and the addiction-deviant pictures are pictures that are highly related to methamphetamine.
4. The method for training a methamphetamine addict detection model according to claim 3, It is characterized in that In step (4), the initial value of the weight parameter is a random value output by a truncated normal distribution with a standard deviation of 0.1, and the initial value of the bias parameter is set to 0; The back propagation algorithm uses Adam-Optimizer as the optimizer.
5. A training system for a methamphetamine addict detection model, It is characterized in that include: The first module is used to obtain electroencephalogram signals of multiple test subjects after they see visual induced stimulus pictures; The second module is used to preprocess the EEG signal corresponding to each person to be tested obtained by the first module to obtain the preprocessed EEG signal corresponding to each person to be tested; the second module is specifically, first, for the EEG signal corresponding to each person to be tested, the average voltage of TP9 and TP10 channels is selected as the reference voltage, and then the voltage of all other 62 channels is subtracted from the reference voltage to obtain the de-referenced EEG signal, and then the EEG signal is band-pass filtered from 1 to 30 Hz, and then the artifacts, signal drift and non-biological signals in the band-pass filtered EEG signal are removed, and then the independent component analysis (ICA) method is used to remove the EEG signal Then, from the electroencephalogram signal after the interference is removed, the electroencephalogram signal 200ms before and 1000ms after each standard stimulus picture is presented to the test subject is intercepted, so as to generate a sub-electroencephalogram signal corresponding to each standard stimulus picture, and the electroencephalogram signal 200ms before and 1000ms after each addiction deviation picture is presented to the test subject is intercepted, so as to generate a sub-electroencephalogram signal corresponding to each addiction deviation picture, and all the sub-electroencephalogram signals corresponding to all standard stimulus pictures and all the sub-electroencephalogram signals corresponding to all addiction deviation pictures together constitute the preprocessed electroencephalogram signal corresponding to the test subject; The third module is used for, for the preprocessed EEG signals corresponding to each subject to be tested obtained in the second module, respectively subtracting the voltage values a1, a2, ..., am of each sub-EEG signal corresponding to the standard stimulus picture from the voltage values b1, b2, ..., bn of each sub-EEG signal corresponding to the addiction deviation picture, so as to obtain a data set corresponding to the subject to be tested and consisting of multiple voltage difference values, that is, {a1-b1, a1-b2, ..., a1-bn, a2-b1, a2-b2, ..., a2-bn, ..., am-b1, am-b2, ...am-bn}, and dividing the data sets of all subjects to be tested into a training set and a test set in a ratio of 4:1, wherein n represents the total number of sub-EEG signals corresponding to the addiction deviation picture, and m represents the total number of sub-EEG signals corresponding to the standard stimulus picture; The fourth module is used to input the training set obtained in the third module into the methamphetamine addict detection network model, and use the back propagation algorithm to update and optimize the weight parameters and bias parameters of each layer in the methamphetamine addict detection network model to obtain an updated methamphetamine addict detection network model; the methamphetamine addict detection network model adopts a convolutional neural network, and its specific structure is as follows: The first layer is the input layer, whose input size is 300×62 EEG signals; The second layer is a one-dimensional convolution layer, whose convolution kernel size is 1×100, the number of convolution kernels is 64, its input is the 300×62 EEG signal of the input layer, and its output dimension is 201×64; The third layer is the maximum pooling layer, whose stride is 2, its input dimension is 201×64, and its output dimension is 100×64; The fourth layer is the convolution layer, whose convolution kernel size is 1×32, the number of convolution kernels is 128, its input dimension is 100×64, and its output dimension is 69×128; The fifth layer is the maximum pooling layer with a stride of 2, an input dimension of 69×128, and an output dimension of 34×128; The sixth layer is a convolutional layer, whose convolution kernel size is 1×32, the number of convolution kernels is 256, its input dimension is 34×128, and its output dimension is 3×256; The seventh layer is the maximum pooling layer, whose stride is 2, its input dimension is 3×256, and its output dimension is 1×256; The eighth layer is the Dropout layer, whose ratio is 0.3 and whose output dimension is 1×256; The ninth layer is a fully connected layer, whose input dimension is 1×256 and whose output dimension is 1×2; The fifth module is used to iteratively train the methamphetamine addict detection network model updated by the fourth module until the loss function of the methamphetamine addict detection network model reaches the minimum; the loss function L of the methamphetamine addict detection network model is: Where N is the total number of samples in the training set, K is the number of categories in the training set, and t i,k represents the prediction result after the i-th training sample of the k-th class is input into the methamphetamine addict detection network model, y i,k represents the true result corresponding to the i-th training sample of the k-th category, k∈[1,K], λ represents the degree of regularization, and its value is 0.01, W i,k represents the weight parameter when the i-th training sample of the k-th category is input into the methamphetamine addict detection network model, which changes automatically with the training of the CNN methamphetamine addict detection network model; The sixth module is used to iteratively verify the methamphetamine addict detection network model after iterative training using the test set obtained in the third module until the classification accuracy is optimal, thereby obtaining a trained methamphetamine addict detection network model.
