New psychoactive substance non-targeted recognition method, product, electronic equipment and device
Through a new multi-channel psychoactive substance recognition model, the GL-MCNN cascade module is used to extract the characteristics of Raman spectral data, which solves the problems of low NPS recognition accuracy and poor NPS recognition effect in the prior art, and achieves high-accuracy NPS recognition.
Patent Information
- Application Number
- CN202510049778.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-05-02
AI Technical Summary
The accuracy of the identification of NPS by existing new psychoactive substances (NPS) detection technology based on Raman spectroscopy still needs to be improved, especially the recognition effect of structurally mutated NPS is poor.
A new multi-channel psychoactive substance recognition model is adopted, which includes sequentially connected GL-MCNN cascade modules, fully connected layers and output layers. The GL-MCNN cascading module extracts the global and local features of Raman spectral data through global branches and local branches, and obtains output features through fusion units to improve recognition accuracy.
The batch recognition of multiple substances to be identified is achieved, the anti-noise ability is improved, the original Raman spectral data with more noise can be adapted to the original Raman spectral data, more detailed features are extracted, and Raman feature peaks of different categories of NPS are effectively captured, thereby improving the recognition accuracy of new psychoactive substances, including high accuracy recognition of structurally mutated NPS.
Smart Images

Figure CN119920304A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of new psychoactive substance detection, and in particular to a method, product, electronic equipment and device for non-targeted identification of new psychoactive substances. Background Art
[0002] New Psychoactive Substance (NPS) is defined as "substances of abuse that are not controlled by the United Nations drug conventions but may pose a threat to public health". According to different chemical structures, NPS are divided into synthetic cannabinoids, synthetic cathinones, phenethylamines, tryptamines, piperazines, aminoindones, phencyclidines, benzodiazepines, fentanyl analogs, plant-derived substances and other substances. According to the relevant report of the European Monitoring Center for Drugs and Drug Addiction (EMCDDA), from 2016 to 2022, about 50 NPS with structural variations appeared in the drug market every year. The rapid change of NPS has brought great challenges to public safety management and aroused widespread concern from the international community. New methods are urgently needed to achieve rapid screening and early warning of NPS. Non-targeted identification of new psychoactive substances refers to the comprehensive analysis of chemical substances in samples by specific technical means without pre-setting target substances, so as to identify possible unknown or emerging psychoactive substances.
[0003] In recent years, Raman spectroscopy has been widely used in the field of NPS detection due to its advantages such as fingerprint feature recognition, no need for special sample preparation, and fast and simple operation. In 2019, Gerace E et al. (cited from Gerace E, Seganti F, Luciano C, Lombardo T, Di Corcia D, Teifel H, Vincenti M, Salomone A, Drug Alcohol Rev, 2019, 38 (1): 50-56) used a portable Raman spectrometer to conduct on-site detection of a variety of drug samples, and used spectral matching to assist manual spectrum interpretation, which can non-destructively detect a variety of targets including NPS, but its matching accuracy is low, which in turn limits the detection efficiency and automation level. In 2023, the inventors of this application proposed a new method for identifying drugs by combining a deep learning model with surface-enhanced Raman spectroscopy technology, which has high accuracy and efficiency, but did not study the structural variants of drugs (cited from Huang Rui, Peng An, Hu Jiaxiang, Zhou Yi, Hu Weihao, Chinese Science: Chemistry, 2023, 53 (5): 861-873). In the same year, Lai et al. (cited from Lai YT, Wei PK, Kuo CY, Cheng JY, Sensors and Actuators B: Chemical, 2023, 375: 132923) embedded the convolutional neural network module into the independently developed Raman spectrometer, and realized the identification of 12 illegal drugs (including existing and structural variant targets), but the sample types were limited and insufficient to cope with the ever-changing structural diversity of NPS. It can be seen that the existing Raman spectroscopy-based NPS detection technology has room for improvement in the recognition accuracy of NPS, especially for structural variant NPS, which has poor recognition effect. Summary of the invention
[0004] The present invention aims to solve the technical problem that the recognition accuracy of NPS by the existing Raman spectroscopy-based NPS detection technology needs to be improved, especially the recognition effect of structural variation NPS is poor, and provide a non-targeted identification method, product, electronic equipment and device for new psychoactive substances.
[0005] In order to achieve the above-mentioned purpose of the present invention, according to the first aspect of the present invention, the present invention provides a method for non-targeted identification of new psychoactive substances, comprising: obtaining Raman spectral data of multiple substances to be identified; respectively inputting the multiple Raman spectral data into multiple input channels of a pre-trained new psychoactive substance identification model to obtain identification results of multiple substances to be identified; the new psychoactive substance identification model comprises a GL-MCNN cascade module, a fully connected layer and an output layer connected in sequence; the GL-MCNN cascade module comprises a plurality of cascaded GL-MCNN modules, each GL-MCNN module comprises a global branch, a local branch and a fusion unit, wherein the global branch is used to extract the global features of the input features of each GL-MCNN module, the local branch is used to extract the local features of the input features of each GL-MCNN module from different scales, and the fusion unit is used to fuse the global features and the local features to obtain the output features of the GL-MCNN module.
[0006] In order to achieve the above-mentioned purpose of the present invention, according to the second aspect of the present invention, the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of a non-targeted identification method of new psychoactive substances described in the first aspect of the present invention.
[0007] In order to achieve the above-mentioned purpose of the present invention, according to the third aspect of the present invention, the present invention provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a method for non-targeted identification of new psychoactive substances as described in the first aspect of the present invention.
[0008] In order to achieve the above-mentioned purpose of the present invention, according to the fourth aspect of the present invention, the present invention provides a non-targeted identification device for new psychoactive substances, which is used to implement a non-targeted identification method for new psychoactive substances described in the first aspect of the present invention, including: a data acquisition module, which acquires Raman spectrum data of multiple substances to be identified; an identification module, which inputs multiple Raman spectrum data into multiple input channels of a pre-trained new psychoactive substance identification model, and obtains identification results of multiple substances to be identified; the new psychoactive substance identification model includes a GL-MCNN cascade module, a fully connected layer and an output layer connected in sequence; the GL-MCNN cascade module includes multiple cascaded GL-MCNN modules, each GL-MCNN module includes a global branch, a local branch and a fusion unit, wherein the global branch is used to extract the global features of the input features of each GL-MCNN module, the local branch is used to extract the local features of the input features of each GL-MCNN module from different scales, and the fusion unit is used to fuse the global features and the local features to obtain the output features of the GL-MCNN module.
[0009] Beneficial technical effects of the present invention:
[0010] 1. A multi-channel new psychoactive substance identification model is provided, which can simultaneously identify and process the Raman spectral data of multiple substances to be identified, thus realizing batch identification.
[0011] 2. In the new psychoactive substance recognition model, each GL-MCNN module uses the global branch and the local branch in parallel to obtain global features and local features respectively. In the local branch, convolution kernels of different sizes are used to extract local features of the GL-MCNN module input features from different scales, which can effectively deal with the differences in intensity and position between the characteristic peaks of new psychoactive substances, improve the anti-noise ability, and adapt to the original Raman spectral data with more noise, so that it does not need to be preprocessed before entering the model. At the same time, more detailed features are extracted, effectively capturing the Raman spectral characteristics of the parent nucleus structure of different categories of new psychoactive substances. Raman characteristic peaks; In order to avoid the new psychoactive substance identification model from confusing similar samples, the present invention introduces a global branch in parallel in the GL-MCNN module to extract the overall features of the Raman spectral data; multiple GL-MCNN modules are connected in a cascade manner, which can extract more detailed features and effectively capture the Raman characteristic peaks of the parent nucleus structure of different categories of new psychoactive substances, thereby improving the accuracy of new psychoactive substance identification. By using the GL-MCNN cascade module, not only can the existing NPS be non-targeted identified, but also the NPS with structural variations can be identified with a higher accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1It is a schematic flow chart of a method for non-targeted identification of new psychoactive substances in a preferred embodiment of the present invention;
[0013] Figure 2 This is a schematic diagram of the network structure of a new psychoactive substance recognition model in a preferred embodiment of the present invention;
[0014] Figure 3 It is the confusion matrix and t-SNE diagram of the validation set after the training of the new psychoactive substance recognition model of the present invention;
[0015] Figure 4 This is a schematic diagram of the validation set confusion matrix of the traditional NPS classification model;
[0016] Figure 5 It is a schematic structural diagram of an electronic device in a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0017] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0018] In the description of the present invention, it is necessary to understand that the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0019] In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a mechanical connection or an electrical connection, or it can be the internal connection between two components. It can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to the specific circumstances.
[0020] The execution subject of the non-targeted identification method of a new psychoactive substance provided by the present invention includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided in the embodiment of the present application. In other words, a non-targeted identification method of a new psychoactive substance can be executed by software or hardware installed on a terminal device or a server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0021] The present invention discloses a method for non-targeted identification of new psychoactive substances. In a preferred embodiment, Figure 1 As shown, including:
[0022] Step S1, obtaining Raman spectrum data of a plurality of substances to be identified.
[0023] In this embodiment, a Raman spectrometer can be used to obtain Raman spectrum data of the substance to be identified, and one or more Raman spectrum data can be input into a pre-trained new psychoactive substance identification model. The Raman spectrometer can be the Enwave ProTT-EZRaman-A7 portable Raman spectrometer of Enwave Corporation of the United States. The substance to be identified may be a new psychoactive substance, or it may not be a new psychoactive substance. The Raman spectrum data of each substance to be identified is a two-dimensional matrix, with wave numbers and scattering intensities corresponding to the wave numbers. The Raman spectrum data includes the scattering intensity of each wave number within a preset wave number range. In one example, the preset wave number range is 2339-250cm -1 , including 2090 wave numbers, the Raman spectrum data is a matrix of 2 rows and 2090 columns.
[0024] Step S2, inputting a plurality of Raman spectral data into a plurality of input channels of a pre-trained new psychoactive substance recognition model respectively to obtain recognition results of a plurality of substances to be recognized.
[0025] The new psychoactive substance recognition model can identify multiple categories such as synthetic cannabinoids, synthetic cathinones, phenethylamines, tryptamines, piperazines, aminoindones, phencyclidines, benzodiazepines, fentanyl analogs, plant-derived substances, and other substances. When the substance to be identified is a substance that has been identified in the training of the new psychoactive substance recognition model, the recognition result of the substance to be identified includes the name of the NPS category to which the substance to be identified belongs, the name of the new psychoactive substance, and the confidence probability. When the substance to be identified is a substance that has not been identified in the training of the new psychoactive substance recognition model, but the NPS category to which it belongs has been identified in the training, the recognition result of the substance to be identified includes the name of the NPS category to which the substance to be identified belongs and the confidence probability. When the substance to be identified is an NPS category that has not been identified in the training of the new psychoactive substance recognition model, the recognition result of the substance to be identified is other substances.
[0026] Reference Figure 2 ,The new psychoactive substance recognition model includes a GL-MCNN cascade module, a fully connected layer and an output layer that are connected in sequence.
[0027] like Figure 2 As shown, the GL-MCNN cascade module includes multiple cascaded GL-MCNN modules, each GL-MCNN module includes a global branch, a local branch and a fusion unit, the global branch is used to extract the global features of the input features of each GL-MCNN module, the local branch is used to extract the local features of the input features of each GL-MCNN module from different scales, and the fusion unit is used to fuse the global features and the local features to obtain the output features of the GL-MCNN module.
[0028] In this embodiment, the GL-MCNN module represents a global-local multi-scale convolutional neural network (MCNN) module. Figure 2As shown, the global branch includes a global pooling layer. Preferably, in the global branch of each GL-MCNN module, the global pooling layer is used to obtain the average eigenvalue of each channel in the input features of each GL-MCNN module, and the average eigenvalues of all channels in the input features of each GL-MCNN module are used to form an average feature map, and the average feature map is used as the global feature. The global pooling layer calculates the average value of all eigenvalues of the channels corresponding to each substance to be identified in the input features of the GL-MCNN module to which it belongs, that is, the average eigenvalue, and uses the average eigenvalue to represent the global features of the model. Specifically, the global pooling layer converts the input spectral data of size (Channels, C) × sequence length (Lengths, L) into an average feature map of C×1, that is, the weight of each pixel position of the input data is operated by 1 / L, and then the information of the input spectrum is summarized into a single value, and finally the average feature of the entire feature map is obtained. This feature extraction method can realize the perception of the overall morphology of the Raman spectrum, while weakening the noise value in the Raman spectrum. The global pooling process of each channel is expressed as:
[0029]
[0030] Among them, the number of channels C is the number of channels that the new psychoactive substance recognition model can process, that is, the number of Raman spectral data that can be processed and the number of substances that can be identified. L represents the number of eigenvalues of each channel in the input features of the GL-MCNN module to which the global pooling layer belongs, i represents the eigenvalue index of each channel, and P i represents the eigenvalue.
[0031] In this embodiment, in order to enable the local branch to extract the local features of the Raman spectrum of the substance to be identified from different scales, and to effectively deal with the differences in intensity and position between characteristic peaks, preferably, as Figure 2 As shown, the local branches include:
[0032] The first processing branch includes a maximum pooling layer, a first activation function unit and a first convolution connected in sequence, wherein the step sizes of the maximum pooling layer and the first convolution are inconsistent. The maximum pooling layer and the first convolution are both one-dimensional, the pooling kernel size of the maximum pooling layer is 4, the step size is 2, the convolution kernel size of the first convolution layer is 1, the step size is 1, and the first activation function unit is preferably, but not limited to, a ReLU function.
[0033] The second processing branch includes a second convolution, a second activation function unit and a third convolution connected in sequence, wherein the step sizes of the second convolution and the third convolution are inconsistent. The second convolution and the third convolution are both one-dimensional. The convolution kernel size of the first convolution is 8 and the step size is 2. The convolution kernel size of the third convolution is 7 and the step size is 1. The second activation function unit is preferably, but not limited to, a ReLU function.
[0034] The third processing branch includes a fourth convolution, a third activation function unit and a fifth convolution connected in sequence, wherein the step sizes of the fourth convolution and the fifth convolution are inconsistent. The fourth convolution and the fifth convolution are both one-dimensional. The convolution kernel size of the fourth convolution is 14 and the step size is 2. The convolution kernel size of the fifth convolution is 13 and the step size is 1. The third activation function unit is preferably, but not limited to, a ReLU function.
[0035] The local fusion layer is used to fuse the features output by the first processing branch, the second processing branch and the third processing branch to obtain the local fusion feature. Specifically, the local fusion layer adds the features output by the first processing branch, the second processing branch and the third processing branch at the element level.
[0036] Batch normalization layer, which performs batch normalization on the local fusion features to obtain local features.
[0037] Among them, the convolution kernels of the first convolution, the second convolution, the third convolution, the fourth convolution and the fifth convolution have different sizes and different step sizes. The three channels of the first processing branch, the second processing branch and the third processing branch are parallel, and local features are extracted from different scales, which can extract the detailed features of the Raman spectrum to a large extent. Compared with CNN that uses a single convolution kernel to extract features, MCNN can avoid the influence of noise signals and improve the robustness to noise in the original Raman spectrum data, so that there is no need to filter and preprocess the original Raman spectrum data, thereby improving processing efficiency. NPS belonging to the same category and having the same parent core structure in chemical structure have the same or similar Raman characteristic peaks, so that untrained NPS substances can be detected and identified.
[0038] In a preferred embodiment, the fusion unit in each GL-MCNN module is used to perform element-wise addition of global features and local features to construct a feature representation of the potential information in the Raman spectrum.
[0039] Table 1 shows the network structure of a GL-MCNN module in an example new psychoactive substance recognition model.
[0040] Table 1 Network structure of GL-MCNN module
[0041]
[0042]
[0043] Table 2 shows a schematic diagram of the network structure of a new psychoactive substance recognition model in an example. A total of 10 GL-MCNN modules are cascaded, and the output layer activation function is the Sofmax function.
[0044] Table 2 Schematic diagram of the network structure of the new psychoactive substance recognition model
[0045]
[0046] In the above example, the new psychoactive substance recognition model can obtain feature information for each substance to be identified through feature extraction operations of 10 GL-MCNN modules. Then a fully connected layer is used to organize and summarize the information. At the bottom of the neural network, the softmax function is used as the activation function of the output layer:
[0047]
[0048] Among them, Softmax(C i' ) represents the output probability of the i'th NPS category, C i is the output feature of the i'th NPS category output by the fully connected layer, It is the sum of all category outputs in the output layer. By adjusting the output threshold of the model, it can adapt to different classification tasks.
[0049] Thanks to the comprehensive feature extraction capability and efficient information recognition level of the deep learning model, the new psychoactive substance identification model can input Raman spectral data samples of a large number of NPS samples and output the classification results at one time. At the same time, the multi-channel model structure makes the feature extraction process of different data samples independent, so that the model is more robust to noise interference. It can be considered that when the Raman spectra of some NPS collected on-site are affected by multiple factors such as the environment and sample purity, the interference of this influence on the classification results will be weakened and will not spread to the feature extraction process of other spectra collected on-site. Therefore, the model has efficient information processing capabilities and the ability to reduce the interference of abnormal data on material analysis results.
[0050] In a preferred embodiment, in order to avoid the large difference in the number of samples in each category of NPS during training, which may lead to category bias in the new psychoactive substance recognition model and the inability to correctly predict the category of the sample, preferably, during the training process of the new psychoactive substance recognition model, the new psychoactive substance recognition model is trained using an enhanced Raman spectroscopy sample set. The number of samples in each NPS category is balanced in the enhanced Raman spectroscopy sample set.
[0051] In this embodiment, in order to increase the diversity of the data set, help the model better adapt to data changes, and improve the generalization performance of the model, the process of obtaining the enhanced Raman spectrum sample set includes:
[0052] Step A: obtaining an original Raman spectrum sample set, wherein the original Raman spectrum sample set includes original Raman spectrum samples of multiple NPS categories.
[0053] Step B: generating a plurality of new samples, and adding the plurality of new samples to the original Raman spectrum sample set to obtain an enhanced Raman spectrum sample set.
[0054] The generation process of each new sample includes: randomly selecting two original Raman spectrum samples belonging to the same new psychoactive substance category from the original Raman spectrum sample set, randomly sampling a value from the beta distribution as the fusion weight λ, λ∈[0,1], fusing the two selected original Raman spectrum samples based on the fusion weight λ to obtain a new sample, screening the new samples, and retaining the qualified new samples.
[0055] In order to avoid the adverse effects of new samples on model training, preferably, the screening process is as follows: obtain the Raman spectrum characteristic peaks of new samples of each NPS category; if the Raman spectrum characteristic peaks of the new sample are not within the characteristic peak interval of the NPS category, the new sample is discarded; if the Raman spectrum characteristic peaks of the new sample fall within the characteristic peak interval of the NPS category, the category label of the new sample is set to the NPS type, and the new sample is added to the original Raman spectrum sample set.
[0056] In this embodiment, the two selected original Raman spectrum samples are fused based on the fusion weight λ to obtain a new sample, including: assuming that the two selected original Raman spectrum samples are (x i ,y i ) and (x j ,y j ), where x i , x j Represent the wave number sequence of the original Raman spectrum sample i and the Raman spectrum sample j, y i ,y j Represent the scattering intensity sequence of the original Raman spectrum sample i and the Raman spectrum sample j respectively, then the wave number sequence of the new sample is and the scattering intensity series They are:
[0057]
[0058] The above method generates new samples by linearly combining the original samples Enhanced sample set.
[0059] In this embodiment, the training process of the new psychoactive substance identification model includes:
[0060] Step a: obtaining an original Raman spectrum sample set, and obtaining an enhanced Raman spectrum sample set based on the original Raman spectrum sample set according to the above method, and dividing the enhanced Raman spectrum sample set into a training data set and a verification data set.
[0061] In one example, the original Raman spectrum sample set includes Raman spectrum data of 756 NPS samples. The 756 NPS samples contain 245 NPS types, including 236 standard substances and 520 seized samples. The 236 NPS standard substances include 90 synthetic cannabinoids, 70 synthetic cathinones, 36 phenethylamines, 19 fentanyl analogs, 9 tryptamines, 7 phencyclidines, and 5 piperazines. The above standards were purchased from Shanghai Institute of Criminal Science and Technology (Shanghai, China) with a purity of more than 98%. The actual seized samples include 156 synthetic cannabinoids, 248 synthetic cathinones, 87 phenethylamines, 17 tryptamines, and 12 phencyclidines. The seized samples were all seized by the local police. In the process of obtaining the Raman spectrum data of the NPS samples, a portable Raman spectrometer was used with an acquisition time of 20-60s and a number of acquisitions of 5-30 times. To ensure the accuracy of the Raman peak, the peak position of the spectrometer is calibrated every 3 hours using a calibration sample. A category label is set for each raw Raman spectrum sample data according to the type name of the NPS sample.
[0062] In an example, the number of enhanced Raman spectroscopy sample sets is 700, 7 NPS categories are set, each NPS category includes 100 enhanced Raman spectroscopy samples, 80% of which are used as model training data sets and the remaining 20% are used as validation data sets.
[0063] Step b: construct the network structure of the new psychoactive substance recognition model and initialize the network parameters.
[0064] Step c, using the training data set to train the network of the new psychoactive substance recognition model. During the training process, the cross entropy loss is calculated using the recognition results output by the training model and the category labels of the samples. The network parameters of the model are updated using the gradient automatic back propagation method based on the cross entropy loss until the number of training times reaches a preset maximum number, or the cross entropy loss is greater than a preset loss threshold, then the training is stopped.
[0065] Step d, using the verification set to verify the trained new psychoactive substance recognition model, after successful verification, output the network parameters of the new psychoactive substance recognition model after successful verification, and after failure of verification, return to execute step c.
[0066] In the verification process of step d, since the number of samples in each category in the training and verification data sets is balanced, this section uses the accuracy index to evaluate the performance of the model. When trained to the 138th layer, the classification accuracy of the model on the verification set tends to be stable, that is, the model has a strong fitting ability and can effectively learn the mapping relationship between NPS spectral data and NPS categories. The loss function value of the model decreases to less than 1.2 with the increase in the number of training times and remains stable, which shows that the model converges well. Even in the case of a more complex NPS structure, by extracting and identifying the sequence features in the spectral data, the model can give a more accurate material analysis result.
[0067] Figure 3 (a) shows the validation set confusion matrix of the new psychoactive substance identification model provided by the present invention. It can be seen that the model has a classification accuracy of 100.00% for the NPS Raman spectra in the validation set, and has accurate category analysis capabilities. To further evaluate the performance of the model, this paper takes out the output of the second-to-last layer of the model and uses the t-SNE algorithm to perform dimensionality reduction processing. The output layer of the deep learning model generally corresponds directly to the number of task categories, while the output of the second-to-last layer is generally a feature vector closely related to the task. By reducing the high-dimensional vector of this layer to two dimensions through t-SNE, the model's ability to distinguish between various types of samples can be intuitively presented on the coordinate plane. The t-SNE dimensionality reduction picture of the classification task is shown below. Figure 3 As shown in (b), after the spectral data in the validation set are processed by the model, samples of different categories are mapped into separate feature vector distributions. It can be seen that the model has a good effect in distinguishing different categories of NPS in the validation set.
[0068] At the same time, in order to compare the effects of the new psychoactive substance identification model of the present invention (abbreviated as GL-MCNN model) and the traditional classification model on the NPS classification task, three traditional machine learning methods, namely K nearest neighbor (KNN), support vector machine (SVM) and random forest (RF), and convolutional neural network (CNN) model were used to train and verify the same data set. The results are shown in Figure 2. Figure 4 As shown in Table 3. The accuracy of each type of NPS is the proportion of samples with accurate prediction to the total number of samples in that type.
[0069] Table 3 Classification accuracy of GL-MCNN model and traditional classification model for each type of NPS
[0070]
[0071] comprehensive Figure 4The prediction results of the four traditional classification models for 7 types of NPS, CNN and KNN models showed higher accuracy. Among the 140 NPS samples in the validation set, CNN and KNN models misclassified 12 samples, RF model misclassified 15 samples, and SVM model performed the worst, misclassifying 23 samples. Figure 3 (a) It can be seen that the GL-MCNN model correctly predicted all 140 NPS samples. As can be seen from Table 3, the GL-MCNN model achieved an accuracy of 100.00% in 7 categories, while the CNN, KNN, SVM and RF models only achieved 100.00% accuracy in 3 categories. Overall, the recognition accuracy of the NPS validation set for the CNN and KNN models in the traditional classification models was 91.43%, the RF model was 89.29%, and the SVM model was the lowest, only 83.57%. This is because traditional machine learning contains fewer trainable parameters, its feature extraction ability is limited, and it is difficult to capture key features related to the target species from the Raman spectra measured in complex states. Even the CNN and KNN models, which performed best in the traditional models, still had a significant gap in classification accuracy and stability on the validation set compared with the GL-MCNN model. This is because CNN has low robustness to noise and is difficult to cope with possible environmental noise. In summary, the GL-MCNN model shows higher accuracy and stability in the non-targeted recognition task of NPS, which is better than the traditional classification model.
[0072] The present invention also provides a non-targeted identification device for new psychoactive substances, which is used to implement the above-mentioned non-targeted identification method for new psychoactive substances. In a preferred embodiment, the device comprises:
[0073] A data acquisition module, which acquires Raman spectrum data of multiple substances to be identified;
[0074] The identification module inputs the multiple Raman spectral data into multiple input channels of the pre-trained new psychoactive substance identification model to obtain the identification results of multiple substances to be identified;
[0075] Among them, the new psychoactive substance identification model includes a GL-MCNN cascade module, a fully connected layer, and an output layer connected in sequence;
[0076] The GL-MCNN cascade module includes multiple cascaded GL-MCNN modules, each GL-MCNN module includes a global branch, a local branch and a fusion unit, the global branch is used to extract the global features of the input features of each GL-MCNN module, the local branch is used to extract the local features of the input features of each GL-MCNN module from different scales, and the fusion unit is used to fuse the global features and the local features to obtain the output features of the GL-MCNN module.
[0077] In this embodiment, the data acquisition module and the identification module correspond one-to-one to step S1 and step S2 of a non-targeted identification method for new psychoactive substances, respectively, and will not be repeated here.
[0078] The present invention also discloses a computer program product, including a computer program. When the computer program is executed by a processor, it implements the steps of the above-mentioned method for non-targeted identification of new psychoactive substances provided by the present invention. The computer program product should be understood as a software product that mainly implements its solution through a computer program, such as a program product integrated in the cloud or a software library.
[0079] The present invention also discloses an electronic device. In one embodiment, the electronic device includes at least one processor; and a memory connected to the at least one processor in communication; wherein:
[0080] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a non-targeted identification method for a new psychoactive substance provided by the present invention.
[0081] like Figure 5 , which is a schematic diagram of the structure of an electronic device for a method for non-targeted identification of new psychoactive substances provided by an embodiment of the present invention. The electronic device may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a program for a method for non-targeted identification of new psychoactive substances.
[0082] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, and executes or executes the programs or modules stored in the memory 11 (for example, executing a non-targeted identification method for new psychoactive substances, etc.), and calls the data stored in the memory 11 to execute various functions of the electronic device and process data.
[0083] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of a new psychoactive substance non-targeted identification method program, etc., but also can be used to temporarily store data that has been output or is to be output.
[0084] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0085] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0086] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0087] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0088] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited by this structure.
[0089] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0090] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", "an implementation", "a preferred implementation" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0091] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A non-targeted identification method for new psychoactive substances, characterized in that: include: Acquiring Raman spectrum data of multiple substances to be identified; Inputting a plurality of Raman spectral data into a plurality of input channels of a pre-trained new psychoactive substance recognition model respectively to obtain recognition results of a plurality of substances to be recognized; The new psychoactive substance recognition model includes a GL-MCNN cascade module, a fully connected layer, and an output layer connected in sequence; The GL-MCNN cascade module includes multiple cascaded GL-MCNN modules, each GL-MCNN module includes a global branch, a local branch and a fusion unit, wherein the global branch is used to extract the global features of the input features of each GL-MCNN module, the local branch is used to extract the local features of the input features of each GL-MCNN module from different scales, and the fusion unit is used to fuse the global features and the local features to obtain the output features of the GL-MCNN module.
2. A non-targeted identification method for new psychoactive substances as claimed in claim 1, characterized in that: The global branch includes a global pooling layer.
3. A non-targeted identification method for new psychoactive substances as claimed in claim 2, characterized in that: In the global branch of each GL-MCNN module, the global pooling layer is used to obtain the average feature value of each channel in the input features of each GL-MCNN module, and the average feature map is formed by using the average feature values of all channels in the input features of each GL-MCNN module, and the average feature map is used as the global feature.
4. A non-targeted identification method for new psychoactive substances as claimed in claim 1, 2 or 3, characterized in that: The local branches include: A first processing branch includes a maximum pooling layer, a first activation function unit, and a first convolution connected in sequence, wherein the step sizes of the maximum pooling layer and the first convolution are inconsistent; A second processing branch includes a second convolution, a second activation function unit, and a third convolution connected in sequence, wherein the step sizes of the second convolution and the third convolution are inconsistent; A third processing branch includes a fourth convolution, a third activation function unit, and a fifth convolution connected in sequence, wherein the step sizes of the fourth convolution and the fifth convolution are inconsistent; A local fusion layer, used to fuse the features output by the first processing branch, the second processing branch, and the third processing branch to obtain a local fusion feature; Batch normalization layer, which performs batch normalization on local fusion features to obtain local features; Among them, the convolution kernel sizes of the first convolution, the second convolution, the third convolution, the fourth convolution and the fifth convolution are different.
5. A non-targeted identification method for new psychoactive substances as claimed in claim 4, characterized in that: The fusion unit is used to perform element-wise addition of global features and local features.
6. A non-targeted identification method for new psychoactive substances as described in claim 1, 2, 3 or 5, characterized in that: In the process of training the new psychoactive substance recognition model, the enhanced Raman spectroscopy sample set is used to train the new psychoactive substance recognition model.
7. A non-targeted identification method for new psychoactive substances as claimed in claim 6, characterized in that: The process of obtaining the enhanced Raman spectroscopy sample set includes: Obtaining a set of original Raman spectrum samples; Generate multiple new samples, and add the multiple new samples to the original Raman spectrum sample set to obtain an enhanced Raman spectrum sample set; The generation process of each new sample includes: randomly selecting two original Raman spectrum samples belonging to the same new psychoactive substance category from the original Raman spectrum sample set, randomly sampling a value from the beta distribution as a fusion weight, fusing the two selected original Raman spectrum samples based on the fusion weight to obtain a new sample, screening the new samples, and retaining the new samples that pass the screening.
8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of a method for non-targeted identification of new psychoactive substances as described in any one of claims 1 to 7 are implemented.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, A memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a method for non-targeted identification of new psychoactive substances as described in any one of claims 1 to 7.
10. A non-targeted identification device for new psychoactive substances, used to implement a non-targeted identification method for new psychoactive substances according to any one of claims 1 to 7, characterized in that: include: A data acquisition module, which acquires Raman spectrum data of multiple substances to be identified; The identification module inputs the multiple Raman spectral data into multiple input channels of the pre-trained new psychoactive substance identification model to obtain the identification results of multiple substances to be identified; Among them, the new psychoactive substance identification model includes a GL-MCNN cascade module, a fully connected layer, and an output layer connected in sequence; The GL-MCNN cascade module includes multiple cascaded GL-MCNN modules, each GL-MCNN module includes a global branch, a local branch and a fusion unit, the global branch is used to extract the global features of the input features of each GL-MCNN module, the local branch is used to extract the local features of the input features of each GL-MCNN module from different scales, and the fusion unit is used to fuse the global features and the local features to obtain the output features of the GL-MCNN module.
Citation Information
Cited By
Pesticide residue detection method based on Raman spectrum and deep learning and electronic equipment
CN120490045A