Sample classification method, classifier training method, device and medium
By preprocessing and reducing mobility calibration of ion mobility spectrum data, extracting feature vectors and processing them using classifiers, the problems of high false alarm rate and low efficiency of sample classification in the prior art are solved, and higher classification accuracy and efficiency are achieved.
Patent Information
- Application Number
- CN202110065518.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-12-31
- Filing Date
- 2021-01-18
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2041-01-18
AI Technical Summary
When classifying samples, the existing ion migration spectrum technology has a high false alarm rate and requires manual selection of spectral characteristics, which is inefficient and the classification results are susceptible to environmental factors.
A sample classification method is proposed, by obtaining multiple samples of ion mobility spectral data, performing preprocessing and reducing mobility calibration, extracting feature vectors, and processing using a pre-trained classifier to determine the category of samples.
It improves the accuracy and efficiency of sample classification, reduces the requirements for operators, reduces the false alarm rate, and enhances the adaptability to environmental factors.
Smart Images

Figure CN114694771B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of rapid analysis and detection, and in particular to a sample classification method, a classifier training method, a device and a medium. Background Art
[0002] Ion mobility spectrometry (IMS) is a technique that characterizes and separates chemical ions based on the differences in the migration rates of different gas-phase ions in an electric field. In the past two decades, it has developed into a powerful analytical technique that can detect relatively low-concentration gas-phase samples at ambient temperature and pressure. It has many advantages, such as fast detection speed, small size, low power consumption, strong portability, and industrialization.
[0003] In the application process of ion mobility spectrometer, data processing methods (such as chemometric methods) are needed to convert spectral data with large amounts of information into interpretable results of interest to users. At present, when classifying samples of different categories, a classification system based on the peak matching method is usually used. This method uses the multi-capillary column-ion mobility spectrometry (MCC-IMS) peaks of known standard substances as templates and compares them with the peaks of the samples to be tested to determine the category of the samples to be tested. This method is simple and effective within a certain range. However, this method only considers the peak characteristics of a single sample, and does not consider the relationship between samples within the class and each category. When the peaks of the standard substances are relatively similar and the number of standard substances is large. This method has a more serious false alarm. Summary of the invention
[0004] According to an embodiment of the present disclosure, a sample classification method, a classifier training method, a device and a medium are proposed.
[0005] In one aspect of the present disclosure, a sample classification method is proposed, comprising: obtaining M sampling ion mobility spectrum data for a sample to be tested, where M is an integer greater than 1; determining pre-processed ion mobility spectrum data based on the M sampling ion mobility spectrum data; performing reduced mobility calibration on the pre-processed ion mobility spectrum data to obtain calibrated ion mobility spectrum data; extracting a feature vector of the sample to be tested based on the calibrated ion mobility spectrum data; and processing the feature vector using a pre-trained classifier to obtain a category label of the sample to be tested.
[0006] According to an embodiment of the present disclosure, the above-mentioned determination of pre-processed ion mobility spectrum data based on M sampling ion mobility spectrum data includes: determining, based on the M sampling ion mobility spectrum data, change information of the peak intensity of the reaction ion peak of the sample to be tested with M sampling numbers and the maximum value of the peak intensity of the reaction ion peak; based on the above change information, determining N sampling numbers from the M sampling numbers, the peak intensity of the reaction ion peak corresponding to the N sampling numbers being less than or equal to a first predetermined proportion of the maximum value of the above peak intensity, N being an integer greater than 1 and less than M; and, screening the N sampling ion mobility spectrum data corresponding to the above N sampling numbers.
[0007] According to an embodiment of the present disclosure, determining the pre-processed ion mobility spectrum data based on the M-times sampled ion mobility spectrum data also includes: calculating the signal intensities of the N-times sampled ion mobility spectrum data for the same migration time or combining the N-times sampled ion mobility spectrum data to obtain processed ion mobility spectrum data; and determining the pre-processed ion mobility spectrum data based on the processed ion mobility spectrum data.
[0008] According to an embodiment of the present disclosure, determining the pre-processed ion mobility spectrum data based on the processed ion mobility spectrum data includes: normalizing the signal intensity in the processed ion mobility spectrum data based on the maximum and minimum values of the signal intensity in the processed ion mobility spectrum data to obtain the pre-processed ion mobility spectrum data.
[0009] According to an embodiment of the present disclosure, the above-mentioned reduced mobility calibration of the pre-processed ion mobility spectrum data includes: performing reduced mobility calibration on the migration time in the pre-processed ion mobility spectrum data to convert the migration time into reduced ion mobility.
[0010] According to an embodiment of the present disclosure, the above-mentioned extraction of the characteristic vector of the sample to be tested based on the calibration ion mobility spectrum data includes: within a first predetermined interval of the reduced ion mobility in the calibration ion mobility spectrum data, obtaining the signal intensity corresponding to the reduced ion mobility once at every unit interval as an initial feature; and, based on the initial feature, determining the characteristic vector of the sample to be tested.
[0011] According to the embodiment of the present disclosure, the feature vector of the sample to be tested is determined based on the initial features, including: the initial feature set of the sample to be tested is composed of the positive mode initial features and the negative mode initial features of the sample to be tested. The positive mode initial features are the initial features obtained by processing the M sampling ion mobility spectrometry data of the positive mode, and the negative mode initial features are the initial features obtained by processing the M sampling ion mobility spectrometry data of the negative mode. And, the initial feature set is subjected to dimensionality reduction processing using the principal component analysis algorithm to obtain the feature vector.
[0012] According to an embodiment of the present disclosure, the pre-trained classifier includes a training set, and the training set includes sample feature vectors and category labels of multiple known samples. The processing of feature vectors using a pre-trained classifier includes: calculating the distance between each sample feature vector and feature vector in the training set; arranging multiple known samples in ascending order based on the distance to obtain a known sample sequence; selecting the first k known samples from the known sample sequence, where k is an integer greater than 1; and, when the category labels of the k known samples are the same, using the category labels of the k known samples as the category labels of the sample to be tested.
[0013] According to an embodiment of the present disclosure, the above-mentioned processing of the feature vector using a pre-trained classifier also includes: when the category labels of the k known samples include J non-repeating category labels, J is an integer greater than 1 and less than or equal to k, for each category label in the J category labels, based on the number of samples of the known samples for the category label in the k known samples, determining the weight of the category label; according to the weight of the category label, arranging the J category labels in descending order to obtain a category label sequence; and using the category label sequence as the category label of the sample to be tested.
[0014] According to the embodiment of the present disclosure, the above-mentioned processing of the feature vector using a pre-trained classifier also includes: when the category labels of the k known samples include J non-repeating category labels, J is an integer greater than 1 and less than or equal to k, for each known sample in the k known samples, according to the distance between the sample feature vector and the feature vector of the known sample, determine the weight of the known sample; for each category label in the J category labels, based on the weight of the known samples for the category label in the k known samples, calculate the weight of the category label. According to the weight of the category label, the J category labels are arranged in descending order to obtain a category label sequence; and the category label sequence is used as the category label of the sample to be tested.
[0015] According to an embodiment of the present disclosure, the weight of the category label is calculated based on the weight of the known samples for the category label among the k known samples, including: taking the weight of the known samples for the category label among the k known samples as the first weight; for each category label among the J category labels, based on the number of samples of the known samples for the category label among the k known samples, determining the second weight of the category label; and, based on the first weight and the second weight, calculating the weight of the category label.
[0016] In another aspect of the present disclosure, a method for training a classifier is proposed, including: obtaining P sampling sample ion mobility spectrum data for each known sample among a plurality of known samples; determining pre-processing sample ion mobility spectrum data based on the P sampling sample ion mobility spectrum data; performing reduced mobility calibration on the pre-processing sample ion mobility spectrum data to obtain calibration sample ion mobility spectrum data; and extracting a sample feature vector of the known sample based on the calibration sample ion mobility spectrum data. Wherein, P is an integer greater than 1. A training set is formed by the sample feature vectors and category labels of the above-mentioned plurality of known samples; and, the initial classifier is trained using the training set to obtain a target classifier, which is used to determine the category label of the sample to be tested.
[0017] According to the embodiment of the present disclosure, the above-mentioned determination of the pre-processed sample ion mobility spectrum data based on the P sampling sample ion mobility spectrum data includes: determining the change information of the peak intensity of the reaction ion peak of the known sample with the P sampling numbers and the maximum value of the peak intensity of the reaction ion peak based on the P sampling sample ion mobility spectrum data. Based on the change information, determine Q sampling numbers from the P sampling numbers, the peak intensity of the reaction ion peak corresponding to the Q sampling numbers is less than or equal to the second predetermined proportion of the maximum value of the peak intensity, Q is an integer greater than 1 and less than P; and, screen the Q sampling sample ion mobility spectrum data corresponding to the Q sampling numbers.
[0018] According to an embodiment of the present disclosure, the above-mentioned determination of the pre-processed sample ion mobility spectrum data based on the P-times sampled sample ion mobility spectrum data also includes: calculating the signal intensities of the Q-times sampled for the same migration time in the Q-times sampled sample ion mobility spectrum data or combining the Q-times sampled sample ion mobility spectrum data to obtain the processed sample ion mobility spectrum data of the known sample; and, based on the processed sample ion mobility spectrum data, determining the pre-processed sample ion mobility spectrum data of the known sample.
[0019] According to an embodiment of the present disclosure, the above-mentioned determination of the pre-processed sample ion mobility spectrum data based on the processed sample ion mobility spectrum data includes: normalizing the signal intensity in the processed sample ion mobility spectrum data based on the maximum and minimum values of the signal intensity in the processed sample ion mobility spectrum data to obtain the pre-processed sample ion mobility spectrum data.
[0020] According to an embodiment of the present disclosure, the above-mentioned reduced mobility calibration of the pre-processed sample ion mobility spectrum data includes: performing reduced mobility calibration on the migration time in the pre-processed sample ion mobility spectrum data to convert the migration time into reduced ion mobility.
[0021] According to an embodiment of the present disclosure, the above-mentioned extraction of the sample feature vector of the known sample based on the calibration sample ion mobility spectrum data includes: within a second predetermined interval of the reduced ion mobility in the calibration sample ion mobility spectrum data of the known sample, acquiring the signal intensity corresponding to the reduced ion mobility once at every unit interval as the sample initial feature; and, based on the sample initial feature, determining the sample feature vector of the known sample.
[0022] According to the embodiment of the present disclosure, the above-mentioned determination of the sample feature vector of the known sample based on the sample initial features includes: forming a sample initial feature set of the known sample by the positive mode sample initial features and the negative mode sample initial features of the known sample. Among them, the positive mode sample initial features are sample initial features obtained by processing the ion mobility spectrum data of the P times of sampled samples in the positive mode of the known sample, and the negative mode sample initial features are sample initial features obtained by processing the ion mobility spectrum data of the P times of sampled samples in the negative mode of the known sample. And, the sample initial feature set is subjected to dimensionality reduction processing using the principal component analysis algorithm to obtain the sample feature vector of the known sample.
[0023] According to an embodiment of the present disclosure, the initial classifier is a classifier constructed based on the k-nearest neighbor algorithm.
[0024] In another aspect of the present disclosure, an electronic device is provided, comprising a memory and at least one processor. The memory is used to store instructions. The at least one processor executes the instructions stored in the memory to implement the sample classification method described in any of the above embodiments.
[0025] In another aspect of the present disclosure, an electronic device is provided, comprising a memory and at least one processor. The memory is used to store instructions. The at least one processor executes the instructions stored in the memory to implement the training method of the classifier as described in any of the above embodiments.
[0026] In another aspect of the present disclosure, a computer-readable storage medium is provided, on which computer instructions are stored. When the computer instructions are executed by a processor, the sample classification method described in any of the above embodiments is implemented.
[0027] In another aspect of the present disclosure, a computer-readable storage medium is provided, on which computer instructions are stored. When the computer instructions are executed by a processor, the training method of the classifier described in any of the above embodiments is implemented.
[0028] In another aspect of the present disclosure, a computer program product is provided, comprising executable instructions, which, when executed by a processor, implement the sample classification method as described in any of the above embodiments.
[0029] In another aspect of the present disclosure, a computer program product is provided, comprising executable instructions, which, when executed by a processor, implement the classifier training method as described in any of the above embodiments.
[0030] According to the sample classification method of the embodiment of the present disclosure, for the ion mobility spectrum data of the multiple samples of the sample to be tested, the interference is removed through the pretreatment process, and the ion mobility spectrum data of the multiple samples are fused into the pretreatment ion mobility spectrum data that characterizes the relationship between the migration time and the signal intensity. Then, through the reduced mobility calibration process, the migration time in the pretreatment ion mobility spectrum data is converted into the reduced ion mobility, and the IMS fingerprint of the sample to be tested after considering the influence of environmental factors is obtained. On this basis, feature selection and extraction are performed to obtain a feature vector that can more accurately reflect the characteristics of the sample, and the feature vector is processed by a classifier to determine the category of the sample to be tested. It can be understood that there is no need for the user to manually perform feature selection and extraction during the processing, which can reduce the requirements for the operator and improve the classification efficiency. This process no longer uses the spectrum peak matching method for classification, and the classification processing process using the classifier can take into account the relationship between the sample to be tested and multiple categories. In addition, the pretreatment process and the calibration process can significantly improve the accuracy and environmental adaptability of the feature vector, thereby improving the accuracy of the classification result. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to better understand the embodiments of the present disclosure, the embodiments of the present disclosure will be described in detail according to the following drawings:
[0032] Figure 1 The application scenarios of the sample classification method and the classifier training method according to the embodiments of the present disclosure are schematically shown;
[0033] Figure 2 A flow chart schematically shows a sample classification method according to an embodiment of the present disclosure;
[0034] Figure 3 A flow chart schematically shows a method for training a classifier according to an embodiment of the present disclosure;
[0035] Figure 4 An example diagram schematically shows a training process and an application process of a classifier according to an embodiment of the present disclosure;
[0036] Figure 5 Schematically shows an example diagram of IMS data of P samples of a known sample according to an embodiment of the present disclosure;
[0037] Fig. 6A An example diagram schematically shows an IMS spectrum of a sample obtained by multiple sampling according to an embodiment of the present disclosure;
[0038] Figure 6BSchematically showing an example diagram of determining initial sample features after preprocessing and feature selection according to an embodiment of the present disclosure;
[0039] Figure 7 An example diagram schematically shows training set data according to an embodiment of the present disclosure; and
[0040] Figure 8 A block diagram of an electronic device according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0041] The specific embodiments of the present disclosure will be described in detail below. It should be noted that the embodiments described herein are only for illustration and are not intended to limit the present disclosure. In the following description, a large number of specific details are set forth in order to provide a thorough understanding of the present disclosure. However, it is apparent to those of ordinary skill in the art that these specific details need not be adopted to implement the present disclosure. In other examples, in order to avoid confusing the present disclosure, known structures, materials or methods are not specifically described.
[0042] Throughout the specification, references to "one embodiment," "an embodiment," "an example," or "an example" mean that a particular feature, structure, or characteristic described in conjunction with the embodiment or example is included in at least one embodiment of the present disclosure. Therefore, the phrases "in one embodiment," "in an embodiment," "an example," or "an example" appearing in various places throughout the specification do not necessarily all refer to the same embodiment or example. In addition, particular features, structures, or characteristics may be combined in one or more embodiments or examples in any appropriate combination and / or subcombination. In addition, those of ordinary skill in the art will appreciate that the term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0043] Figure 1 The application scenarios of the sample classification method and the classifier training method according to the embodiments of the present disclosure are schematically shown. It should be noted that: Figure 1 The examples shown are merely scenarios in which the embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0044] like Figure 1As shown, the application scenario 100 exemplarily shows an ion mobility spectrometer 110 and an electronic device 120. The ion mobility spectrometer 110 is used to collect ion mobility spectrometry data of a sample, and the electronic device 120 processes the ion mobility spectrometry data to identify and classify the sample. The electronic device 120 can be various devices with certain computing capabilities, such as servers, desktop computers, laptops, tablet computers, smart phones, etc., which are not limited here. In this embodiment, the ion mobility spectrometer 110 and the electronic device 120 are connected by wire or wirelessly. In other embodiments, the ion mobility spectrometer 110 and the electronic device 120 can be integrated in the same device, for example, the ion mobility spectrometer 110 can have a data processing function.
[0045] It should be noted that the sample classification method provided in the embodiment of the present disclosure can generally be executed by the electronic device 110. The classifier training method provided in the embodiment of the present disclosure can be executed by the electronic device 110, or by other electronic devices different from the electronic device 110 and capable of communicating with the electronic device 110 (for example, a server or server cluster that can communicate with the electronic device 110), that is, the sample classification method and the classifier training method provided in the embodiment of the present disclosure can be implemented on the same device or on different devices, and there is no limitation here.
[0046] In the process of classifying samples using ion mobility spectrometry, a classification system based on spectral peak matching is usually used. This method only considers the spectral peak characteristics of a single sample, and does not consider the relationship between samples within the class and each category. When the spectral peaks of the standard substances are relatively similar and the number of standard substances is large, the false alarm of this method is more serious. In some classification systems, it is necessary to manually select the characteristic areas of the spectra to represent the samples through manual observation, and manually extract the characteristic peaks, which requires professional knowledge and experience, is time-consuming, labor-intensive and inefficient. In addition, the ion migration dimension in the above classification systems all uses migration time to characterize the signal of the sample to be tested. However, when using migration time to characterize the signal of the sample to be tested, it is easily affected by the external environment, such as environmental pressure, temperature, etc., resulting in inaccurate classification results.
[0047] According to an embodiment of the present disclosure, a sample classification method is provided to further improve the accuracy of the sample classification method based on ion mobility spectrometry technology. The method is exemplarily described below by means of a legend. It should be noted that the sequence numbers of the steps in the following method are only used as representations of the operation for the purpose of description, and should not be regarded as indicating the order in which the steps are executed. Unless explicitly stated, the method does not need to be performed in the order shown.
[0048] Figure 2 The flowchart of the sample classification method according to the embodiment of the present disclosure is schematically shown.
[0049] like Figure 2 As shown, the sample classification method 200 may include the following steps S210 to S250.
[0050] Step S210, obtaining M sampling ion mobility spectrum data for the sample to be tested.
[0051] Exemplarily, M is an integer greater than 1. The above-mentioned M-times sampled ion mobility spectrum data may refer to the ion mobility spectrum data obtained by sampling the sample to be tested M times continuously. The ion mobility spectrum data for each sampling may include the corresponding relationship between the migration time and the signal intensity, and the ion mobility spectrum data for the continuous M samplings may include the corresponding relationship between the migration time, the sampling sequence number and the signal intensity.
[0052] Step S220: determining pre-processed ion mobility spectrum data based on the M times of sampled ion mobility spectrum data.
[0053] Exemplarily, the ion mobility spectrometry data for M consecutive samplings are preprocessed, such as filtering out redundant information, invalid information, etc., to obtain preprocessed ion mobility spectrometry data that can more significantly characterize the material characteristics of the sample to be tested. The preprocessed ion mobility spectrometry data includes the corresponding relationship between the migration time and the signal intensity, and is the result of fusing the ion mobility spectrometry data for multiple samplings.
[0054] Step S230 , performing reduced mobility calibration on the pre-processed ion mobility spectrum data to obtain calibrated ion mobility spectrum data.
[0055] Exemplarily, this step S230 can perform reduced mobility calibration on the migration time in the pre-processed ion mobility spectrum data to convert the migration time into reduced ion mobility. For example, the dimension of the migration time is s, and the dimension of the reduced ion mobility is cm. 2 V -1 s -1 The ion mobility spectrometry data calibrated by the reduced mobility calibration process takes the influence of environmental factors into account. The calibrated ion mobility spectrometry data may include the correspondence between the reduced ion mobility and the signal intensity, which can more accurately and significantly characterize the characteristics of the sample to be tested, and thus can be used as the IMS fingerprint of the sample to be tested.
[0056] Step S240: extracting a characteristic vector of the sample to be tested based on the calibration ion mobility spectrum data.
[0057] For example, feature selection and feature extraction operations can be performed based on the calibration ion mobility spectrum data to extract multiple eigenvalues that can characterize the characteristics of the sample to be tested to form a feature vector of the sample to be tested. In this process, it is also necessary to balance the number of eigenvalues and data processing efficiency to avoid low data processing efficiency due to the high dimension of the feature vector.
[0058] Step S250: Process the feature vector using a pre-trained classifier to obtain a category label of the sample to be tested.
[0059] Exemplarily, a multi-classifier may be used to process the feature vector, and the classifier may consider the relationship between the sample and multiple categories during the process of processing the feature vector of the sample to be tested, thereby outputting the category label of the sample to be tested. The category label of the sample to be tested is used to characterize the category to which the sample to be tested belongs.
[0060] Those skilled in the art will appreciate that, according to the sample classification method of the disclosed embodiment, for the ion mobility spectrum data of the multiple samples of the sample to be tested, interference is removed through the pretreatment process, and the ion mobility spectrum data of the multiple samples are fused into pretreatment ion mobility spectrum data that characterizes the relationship between migration time and signal intensity. Then, through the reduced mobility calibration process, the migration time in the pretreatment ion mobility spectrum data is converted into reduced ion mobility, and the IMS fingerprint of the sample to be tested after considering the influence of environmental factors is obtained. On this basis, feature selection and extraction are performed to obtain a feature vector that can more accurately reflect the characteristics of the sample, and the feature vector is processed using a classifier to determine the category of the sample to be tested. In this process, there is no need for the user to manually perform feature selection and extraction, which can reduce the requirements for the operator and improve the classification efficiency. This process no longer uses the spectrum peak matching method for classification, and the classification process using the classifier can take into account the relationship between the sample to be tested and multiple categories. In addition, the pretreatment process and the calibration process can significantly improve the accuracy and environmental adaptability of the feature vector, thereby improving the accuracy of the classification result.
[0061] According to an embodiment of the present disclosure, a method for training a classifier is also provided to train a classifier capable of classifying the above-mentioned sample to be tested. The method is exemplarily described below by means of a figure legend. It should be noted that the sequence number of each step in the following method is only used as a representation of the operation for the purpose of description, and should not be regarded as indicating the execution order of the various steps. Unless explicitly stated, the method does not need to be performed completely in the order shown.
[0062] Figure 3 The flowchart of the method for training a classifier according to an embodiment of the present disclosure is schematically shown.
[0063] like Figure 3As shown, the classifier training method 300 may include the following steps S310 to S360.
[0064] Step S310, for each known sample among the multiple known samples, taking known sample A as an example, obtaining P times of sample ion mobility spectrum data of known sample A.
[0065] Wherein, P is an integer greater than 1. Exemplarily, the P-times sampled sample ion mobility spectrum data refers to: the sample ion mobility spectrum data obtained by sampling a known sample A P times. Similar to the principle of obtaining the M-times sampled ion mobility spectrum data of the sample to be tested in the above text, the repeated parts are not repeated.
[0066] Step S320: based on the P sampling sample ion mobility spectrum data of the known sample A, determine the pre-processed sample ion mobility spectrum data of the known sample A.
[0067] Exemplarily, through the preprocessing process, the sample ion mobility spectrum data of P samples of the known sample A are fused into the preprocessed sample ion mobility spectrum data of the known sample A, and the preprocessed sample ion mobility spectrum data contains the corresponding relationship between the migration time and the signal intensity.
[0068] Step S330 , performing reduced mobility calibration on the pre-processed sample ion mobility spectrum data of the known sample A to obtain the calibration sample ion mobility spectrum data of the known sample A.
[0069] For example, through the reduced mobility calibration process, the migration time in the pre-processed sample ion mobility spectrum data can be converted into the reduced ion mobility, so as to calibrate the ion mobility spectrum data obtained under different environments. The calibration process is similar to the principle of calibrating the pre-processed ion mobility spectrum data of the sample to be tested in the above text, and the repeated parts are not repeated.
[0070] Step S340: extracting a sample feature vector of the known sample based on the calibration sample ion mobility spectrum data of the known sample A.
[0071] According to the above steps S310 to S340, sample feature vectors of multiple known samples can be obtained respectively.
[0072] Step S350, a training set is formed by the sample feature vectors and category labels of the above-mentioned multiple known samples.
[0073] Step S360: train the initial classifier using the training set to obtain a target classifier.
[0074] According to an embodiment of the present disclosure, the initial classifier may be a classifier constructed based on a k-nearest neighbor (kNN) algorithm.
[0075] According to an embodiment of the present disclosure, the trained target classifier can be used as the pre-trained classifier mentioned above to process the feature vector of the sample to be tested to determine the category label of the sample to be tested. This process has been described above and the repeated parts will not be repeated.
[0076] Those skilled in the art can understand that according to the training method of the classifier of the embodiment of the present disclosure, for the sample ion mobility spectrum data of each known sample sampled multiple times, interference is removed through the pretreatment process, and the sample ion mobility spectrum data of the multiple samples are fused into the pretreatment sample ion mobility spectrum data that characterizes the relationship between the migration time and the signal intensity. Then, through the reduced mobility calibration process, the migration time in the pretreatment sample ion mobility spectrum data is converted into the reduced ion mobility, and the IMS fingerprint of the known sample after considering the influence of environmental factors is obtained. On this basis, feature selection and extraction are performed to obtain a feature vector that can more accurately reflect the characteristics of the known sample and a training set can be constructed in combination with the sample category. Based on the training set, a target classifier with better classification performance can be trained. In this process, there is no need for the user to manually select and extract features, which can reduce the requirements for operators and improve classification efficiency. This process no longer uses the peak matching method for classification, and the training process of the classifier can take into account the relationship between multiple categories. In addition, the pretreatment process and the calibration process can significantly improve the accuracy and environmental adaptability of the feature vector, thereby improving the performance of the classifier.
[0077] It should be noted that the sample classification method and the classifier training method according to the embodiments of the present disclosure can be implemented in the same device or in different devices, and there is no limitation here.
[0078] The sample classification method and classifier training method provided by the present disclosure are exemplarily described below in conjunction with embodiments.
[0079] Figure 4 An example diagram schematically illustrates the training process and application process of a classifier according to an embodiment of the present disclosure.
[0080] like Figure 4 As shown, in the training process of the classifier, it can include: step S410, inputting known samples and category labels. Step S420, preprocessing. Step S430, feature selection and extraction. Step S440, determining the discriminant function. Step S450, error checking. Step S460, improving the discriminant function. In the application process of the classifier, it can include: step S410', obtaining data of the sample to be tested. Step S420', preprocessing. Step S430', feature selection and extraction. Step S440', classification decision.
[0081] First, the training process of the classifier is illustrated.
[0082] The above step S410 acquires IMS data of a plurality of known samples, and the IMS data is IMS data obtained by continuous multiple samplings. For each IMS data of a known sample, steps S420 to S430 are executed.
[0083] Taking the known sample A as an example, the preprocessing, feature selection and extraction process for each known sample is explained. The P sampling sample IMS data of the known sample A is obtained. In the preprocessing process of step S420, the P sampling sample IMS data of the known sample A can be preprocessed by filtering and noise reduction. Since any sample will experience the process of reaction ion peak-product ion peak-reaction ion peak during multiple sampling by the IMS device, and the signal intensity of the product ion peak can better characterize the characteristics of the sample, the IMS data of the reaction ion peak in the weaker signal intensity stage can be selected during the preprocessing process.
[0084] Exemplarily, first, based on the P sampling sample IMS data of the known sample A, determine the change information of the peak intensity of the reaction ion peak of the known sample A with the P sampling numbers and the maximum value of the peak intensity of the reaction ion peak. Then, based on the above change information, determine Q sampling numbers from the P sampling numbers, and the peak intensity of the reaction ion peak corresponding to the Q sampling numbers is less than or equal to a predetermined proportion of the maximum value of the peak intensity. Q is an integer greater than 1 and less than P. The Q sampling sample IMS data corresponding to the above Q sampling numbers are screened.
[0085] Further, according to the embodiment of the present disclosure, after obtaining Q times of sample IMS data of the known sample A, the Q times of sample IMS data can be processed in a variety of ways to obtain pre-processed sample IMS data.
[0086] In one method, the average signal intensity of Q samples at the same migration time in the Q sample IMS data of the known sample A is calculated to obtain the average sample IMS data of the known sample A as the processed sample IMS data. Thus, based on the processed sample IMS data of the known sample A, the pre-processed sample IMS data of the known sample A is determined. For example, the processed sample IMS data can be directly used as the pre-processed sample IMS data, or the processed sample IMS data can be further processed to obtain the pre-processed sample IMS data.
[0087] In another way, the cumulative value of the signal intensity of the Q samples for the same migration time in the Q sample IMS data of the known sample A is calculated to obtain the cumulative sample IMS data of the known sample A as the processed sample IMS data. Thus, based on the processed sample IMS data of the known sample A, the pre-processed sample IMS data of the known sample A is determined. For example, the processed sample IMS data can be directly used as the pre-processed sample IMS data, or the processed sample IMS data can be further processed to obtain the pre-processed sample IMS data.
[0088] In another way, the Q times of sample ion mobility spectrometry data are combined to obtain combined sample IMS data as processed sample IMS data. The combination includes splicing processing, for example, connecting the head of the second sampling sample IMS data in the Q times of sample IMS data to the tail of the first sampling sample IMS data, connecting the head of the third sampling sample IMS data to the tail of the second sampling sample IMS data, and so on.
[0089] Exemplarily, the signal intensity in the processed sample IMS data can be normalized based on the maximum and minimum values of the signal intensity in the processed sample IMS data of the known sample A to obtain the pre-processed sample IMS data of the known sample A.
[0090] Figure 5 An example diagram of P sampling sample IMS data of a known sample according to an embodiment of the present disclosure is schematically shown.
[0091] like Figure 5 As shown in the figure, in this example, P=15, the IMS spectra of samples with sampling numbers from 1 to 15 for known sample A are shown. The corresponding relationship between migration time and signal intensity is characterized in the IMS spectrum of samples with any sampling number. For example, the predetermined ratio is set to 20%. The sampling number of the sample is further screened according to the peak intensity of the reaction ion peak dropping to 20% of its maximum value. For example, Figure 5 The IMS spectra of samples with sampling numbers from 7 to 12 are screened out to form Q times of screened IMS data of the sample samples, where Q=6 in this example.
[0092] Exemplarily, for the Q sampling sample IMS data, the signal intensity of each of the 7 to 12 sample IMS spectra at the same migration time is averaged or accumulated to obtain the processed signal intensity for the migration time. By analogy, the processed signal intensity for each migration time can be obtained, and the relationship between the processed signal intensity and the migration time constitutes the processed sample IMS spectrum of the known sample A. The processed sample IMS spectrum is then normalized to the maximum and minimum values to obtain the pre-processed sample IMS spectrum of the known sample A. The pre-processing process for each other known sample is similar to the above and will not be repeated here.
[0093] Exemplarily, for the Q times of sample IMS data, the sample IMS spectra from 7 to 12 are spliced to obtain a processed sample IMS spectrum. For example, the head (the end with a smaller migration time) of the sample IMS spectrum with sampling number 8 is connected to the tail (the end with a larger migration time) of the sample IMS spectrum with sampling number 7, and the head (the end with a smaller migration time) of the sample IMS spectrum with sampling number 9 is connected to the tail (the end with a larger migration time) of the sample IMS spectrum with sampling number 8, and so on, to obtain a processed sample IMS spectrum. The processed sample IMS spectrum is then normalized to the maximum and minimum values to obtain a pre-processed sample IMS spectrum of a known sample A.
[0094] After the above pretreatment process, step S430 feature selection and extraction can be performed, which can be divided into a feature selection process and a feature extraction process. In the feature selection process, the pretreatment sample IMS data of each known sample (e.g., known sample A) is subjected to reduced mobility calibration so that the migration time is converted into reduced ion mobility. For example, the conversion relationship is shown in formula (1).
[0095]
[0096] Where K0 is the reduced ion mobility, and its dimension is cm 2 V -1 s -1 ; L is the length of the migration zone, its dimension is cm; U is the voltage across the migration zone, its dimension is V; t D is the migration time, with the dimension of s; p is the pressure of the migration gas, with the dimension of hPa; p0 is the standard pressure, with the dimension of hPa, and p0 is generally 131.2hPa; T is the temperature of the migration gas, with the dimension of K; T0 is the standard temperature, with the dimension of K, and T0 is generally 273.2K. It can be understood that the calibration sample IMS data obtained through the above calibration process takes into account factors such as temperature, pressure, and electric field in the environment, and has higher accuracy.
[0097] It can be understood that the embodiment of the present disclosure does not specifically limit the calibration method for pre-processed ion mobility spectrum data. The reduced ion mobility can be calibrated by formula (1), or by using a reactive ion peak (RIP) as an internal calibration peak, or by using a standard calibrant to calibrate the reduced ion mobility, as described below.
[0098] For example, when the parameters in formula (1) have a small change, it is inevitable that the calculation of the reduced mobility will be biased, thereby affecting the measurement and determination of the sample to be tested. Therefore, the embodiment of the present disclosure proposes a method of using a reactive ion peak (RIP) as an internal calibration peak to calculate the reduced mobility value of the sample peak, which can achieve better results when the external environment changes less or the external environment is at normal temperature and pressure.
[0099] For example, it is assumed that the reduced mobility of the RIP is known and is a constant. For example, when air is used as the carrier gas, the reduced mobility of the positive mode RIP is 2.06 cm 2 V -1 s -1 The reduced mobility of negative mode RIP is 2.22 cm 2 V -1 s -1 When the humidity of the carrier gas does not change much, the reduced mobility of the positive mode RIP and the reduced mobility of the negative mode RIP can be considered as constants.
[0100] Since the migration time of RIP can be measured, a coefficient F can be defined IMS The reduced mobility K 0,RIP and the migration time t of PIP D,RIP The product between .
[0101]
[0102] Among them, L is the length of the migration zone, and its dimension is cm; U is the voltage across the migration zone, and its dimension is V; p is the gas pressure of the migration gas, and its dimension is hPa; p0 is the standard air pressure, and its dimension is hPa, and p0 is generally 131.2hPa; T is the temperature of the migration gas, and its dimension is K; T0 is the standard temperature, and its dimension is K, and T0 is generally 273.2K.
[0103] Obviously, the coefficient F IMS It includes all the variable parameters in formula (1). When multiple samplings are performed continuously to obtain the sample IMS spectrum, the time for performing the multiple samplings is, for example, within a short time range, such as a few seconds or a few minutes. In this case, the state of the instrument can usually be regarded as unchanged within this short time range. Fig. 6A An example of a sample IMS spectrum obtained by multiple sampling within a short time range is shown. IMS can be considered as a constant. Combining formula (1) and formula (2), the reduced ion mobility K0 of the sample peak can be obtained, as shown in formula (3).
[0104]
[0105] In addition, the embodiments of the present disclosure also propose a method of using a standard object to calibrate the instrument. When using a standard object to calibrate the instrument, the coefficient F in formula (2) IMS It can be expressed as the reduced mobility K of the calibrant 0,REF and the migration time t of the calibrant D,REF The product between is shown in formula (4).
[0106] F IMS =K O,REF ×t D,REF Formula (4)
[0107] Then, by combining formula (3) and formula (4), the reduced ion mobility K0 can be obtained.
[0108] It can be understood that the correction methods mentioned above are all for the correction of reduced ion mobility. In the embodiments of the present disclosure, RIP can also be used as an internal calibration peak to calculate the difference between the migration time of the sample peak and the migration time of RIP as the characteristic value of the sample peak, thereby realizing the correction of the migration time.
[0109] Further, according to an embodiment of the present disclosure, the feature selection process may also include: within a predetermined interval of the reduced ion mobility in the calibration sample IMS data of each known sample, acquiring the signal intensity corresponding to the reduced ion mobility once every unit interval as the sample initial feature of the known sample.
[0110] For each known sample, the P times of sample IMS data for the known sample may include: P times of sample IMS data for the positive mode and P times of sample IMS data for the negative mode. The above-mentioned preprocessing process and calibration process are respectively performed on the P times of sample IMS data for the positive mode and the P times of sample IMS data for the negative mode, and the calibration sample IMS data for the positive mode and the calibration sample IMS data for the negative mode of the known sample can be obtained.
[0111] For example, after obtaining the calibration sample IMS data of known sample A (including the calibration sample IMS data of the positive mode and the calibration sample IMS data of the negative mode), for the calibration sample IMS data of the positive mode, the predetermined interval of the reduced ion mobility is set to: 0.86 cm 2 V -1 s -1 Up to 2.22cm 2 V -1 s -1 , unit interval: 0.01cm 2 V -1 s -1 For the negative mode calibration sample IMS data, the predetermined interval of reduced ion mobility is set to: 0.89 cm 2 V -1 s -1 Up to 2.10cm 2 V -1 s -1 , unit interval: 0.01cm 2 V -1 s -1 In the IMS spectrum of the calibration sample in the positive mode of known sample A, at the reduced ion mobility of 0.86 cm 2 V -1 s -1 Up to 2.22cm 2 V -1 s -1 The range is 0.01 cm. 2 V -1 s -1 Sampling points are selected at intervals, and the signal intensity corresponding to the sampling points is obtained as the initial sample characteristics of the positive mode. In the IMS spectrum of the calibration sample in the negative mode of the known sample A, at the reduced ion mobility of 0.89 cm 2 V -1 s -1 Up to 2.10cm 2 V -1 s -1 The range is 0.01 cm. 2 V -1 s -1 Sampling points are selected for the intervals, and the signal intensities corresponding to the sampling points are obtained as initial sample features of the negative mode.
[0112] Figure 6BThe following schematically shows an example of determining initial sample features after preprocessing and feature selection according to an embodiment of the present disclosure. The left side shows 15 IMS spectra of a known sample in a positive mode, the middle shows the IMS spectra of the preprocessed samples of the known sample, and the right side shows multiple initial sample features obtained after feature selection. Figure 6B As shown in the figure, after preprocessing and feature selection, the sample data features of the positive mode of a known sample are reduced from the original 4050*15 to 137 initial sample features, and the number of features is greatly reduced. This solves the problem that in some classification systems, the number of features representing each sample information is large, including a large amount of redundant information and repeated information.
[0113] After the feature selection process, the feature extraction process may be continued, that is, based on the sample initial features of each known sample, the sample feature vector of the known sample may be determined.
[0114] According to an embodiment of the present disclosure, the process of determining the sample feature vector of the known sample based on the sample initial features of each known sample may include: forming a sample initial feature set of the known sample by the positive mode sample initial features and the negative mode sample initial features of the known sample. Among them, the positive mode sample initial features are sample initial features obtained by processing the ion mobility spectrum data of P times of sampled samples in the positive mode of the known sample, and the negative mode sample initial features are sample initial features obtained by processing the ion mobility spectrum data of P times of sampled samples in the negative mode of the known sample, which have been explained above and will not be repeated here. Then, the principal component analysis (PCA) algorithm is used to perform dimensionality reduction processing on the sample initial feature set of the known sample to obtain the sample feature vector of the known sample.
[0115] Using the example above, a known sample obtains 137 initial sample features of the positive mode and 137 initial sample features of the negative mode. The two are concatenated to obtain a sample initial feature set containing 274 initial sample features. The PCA algorithm is used to reduce the dimension of the sample initial feature set, retaining the first 200 principal component information to obtain the sample feature vector of the known sample. The feature extraction method for each other known sample is similar. The training set can be composed of the sample feature vectors and category labels of multiple known samples. The linear discriminant analysis (LDA) method is used to maximize the category separation of the training set data to obtain the score matrix (Score matrix) of the training set.
[0116] Figure 7The example diagram of the training set data according to the embodiment of the present disclosure is schematically shown, showing the category labels of multiple known samples such as sample 1, sample 2, sample 3 and each feature value in the sample feature vector. The above steps S440 to S460 are based on the similar Figure 7 The training set data shown is used to train the initial classifier until convergence is achieved to obtain the target classifier.
[0117] After the classifier training is completed, continue to refer to Figure 4 , an exemplary description can be given of the application process of the classifier to identify the category of any sample to be tested.
[0118] In step S410', data of the sample to be tested is obtained, for example, M sampling IMS data of the sample to be tested is obtained. The process of preprocessing the M sampling IMS data in step S420' is the same as the process of preprocessing the P sampling sample IMS data in step S420 above. For example, it may include: based on the M sampling IMS data, determining the change information of the peak intensity of the reaction ion peak of the sample to be tested with the M sampling numbers and the maximum value of the peak intensity of the reaction ion peak; based on the above change information, determining N sampling numbers from the M sampling numbers, the peak intensity of the reaction ion peak corresponding to the N sampling numbers is less than or equal to a predetermined ratio of the maximum value of the above peak intensity (the predetermined ratio can be set according to actual needs), N is an integer greater than 1 and less than M; and screening the N sampling IMS data corresponding to the N sampling numbers. The above implementation method of screening out N sampling IMS data from M sampling IMS data can be similar to the implementation method of screening out Q sampling IMS data from P sampling IMS data above, and the repeated parts will not be repeated.
[0119] Furthermore, the average or cumulative value of the signal intensity of the N samples for the same migration time in the above-mentioned N sampled IMS data can also be calculated to obtain processed IMS data; or the N sampled IMS data can be combined to obtain processed IMS data; and based on the processed IMS data, the pre-processed IMS data is determined. For example, the signal intensity in the processed ion mobility spectrum data can be normalized based on the maximum and minimum values of the signal intensity in the processed ion mobility spectrum data to obtain pre-processed ion mobility spectrum data. The above-mentioned method of calculating the processed IMS data is similar to the implementation method of calculating the processed sample IMS data above, and the above-mentioned method of performing normalization is similar to the above-mentioned method of performing normalization, and the repeated parts will not be repeated.
[0120] After the above-mentioned pretreatment process, step S430' feature selection and extraction can be performed, which can be divided into a feature selection process and a feature extraction process. In the feature selection process, the pre-treated IMS data is calibrated for reduced mobility, and within a predetermined interval of the reduced ion mobility in the calibrated IMS data (the predetermined interval can be set according to actual needs), the signal intensity corresponding to the reduced ion mobility is obtained once every unit interval (the unit interval can be set according to actual needs) as the initial feature. In the feature extraction process, based on the initial feature, the feature vector of the sample to be tested is determined. It should be noted that the above-mentioned calibration process for the pre-treated IMS data is similar to the calibration process for the pre-treated sample IMS data mentioned above, the above-mentioned process for determining the initial features is similar to the above-mentioned process for determining the sample initial features, and the above-mentioned process for determining the feature vector is similar to the above-mentioned process for determining the sample feature vector, and the repeated parts will not be repeated.
[0121] Exemplarily, the above process of determining the feature vector of the sample to be tested based on the initial features may include: forming an initial feature set of the sample to be tested by the positive mode initial features and the negative mode initial features of the sample to be tested. Among them, the positive mode initial features are initial features obtained based on M times of sampling IMS data processing of the positive mode, and the negative mode initial features are initial features obtained based on M times of sampling IMS data processing of the negative mode. Then, the PCA algorithm is used to perform dimensionality reduction processing and LDA projection on the initial feature set to obtain the feature vector of the sample to be tested, which can also be called the score vector (tempScore) of the sample to be tested.
[0122] According to an embodiment of the present disclosure, the above-mentioned pre-trained classifier (i.e., the target classifier mentioned above) may include a training set. Figure 7 As shown, the training set includes sample feature vectors and category labels of multiple known samples.
[0123] When making classification decisions in step S440', first, the distance between each sample feature vector and feature vector in the training set is calculated.
[0124] For example, the Euclidean distances between the sample to be tested t and L known samples in the training set can be calculated respectively, as shown in formula (5), where L is an integer greater than 1.
[0125]
[0126] d t =(d t,1 , d t,2 , ..., d t,L )
[0127] Formula (5)
[0128] Among them, dt,i represents the distance between the sample to be tested t and the i-th known sample in the training set, Score(i,:) represents the sample feature vector (score vector) of the i-th known sample in the training set score matrix Score, d t It represents the distance vector formed by the distance between the sample to be tested t and all known samples in the training set, and L represents the number of known samples in the training set.
[0129] For another example, the Mahalanobis distances between the sample to be tested t and L known samples in the training set can be calculated respectively, as shown in formula (6), where L is an integer greater than 1.
[0130]
[0131] Among them, d t,i represents the distance between the sample to be tested t and the i-th known sample in the training set, Score(i,:) represents the sample feature vector (score vector) of the i-th known sample in the training set score matrix Score, S -1 Represents the inverse matrix of the covariance matrix of the training set score matrix Score, d t It represents the distance vector between the sample to be tested t and all samples in the training set, and L represents the number of known samples in the training set.
[0132] Then, according to an embodiment of the present disclosure, based on the above distances, multiple known samples are arranged in ascending order to obtain a known sample sequence. The first k known samples (k nearest neighbor samples) are selected from the known sample sequence, where k is an integer greater than 1. For example, the distance vector d t Sort the elements in from small to large, find the k (for example, k is 3) known samples closest to the sample t to be tested, and obtain the category labels corresponding to the k known samples.
[0133] In one case, the category labels of the k known samples are exactly the same, and the category labels of the k known samples can be directly used as the category labels of the samples to be tested.
[0134] In another case, the category labels of the k known samples are not exactly the same, that is, the category labels of the k known samples include J non-repeating category labels, and J is an integer greater than 1 and less than or equal to k. There are the following three ways to determine the category label of the sample to be tested.
[0135] In one method, for each of the J category labels, the weight of the category label is determined based on the number of known samples for the category label among the k known samples, and the J category labels are arranged in descending order according to the weight of the category label to obtain a category label sequence, and the category label sequence is used as the category label of the sample to be tested.
[0136] For example, for the jth category label among J non-repeating category labels, determine the number of known samples belonging to the jth category label among the k nearest neighbor known samples, where j is an integer greater than or equal to 1 and less than or equal to J. Based on the number of samples, determine the weight u of the jth category label j '. The larger the number of samples, the greater the weight u of the category label. j 'The larger the value, the weight u in one example j 'For example, it is proportional to the number of samples. By analogy, the weight of each category label in J non-repeated category labels can be obtained, thus forming a weight vector u'=(u1',…,u J '). Arrange the elements in the weight vector u' from large to small. Output the corresponding category labels and weights in sequence as the predicted classification results of the sample to be tested.
[0137] In another way, for each known sample among the k known samples, the weight of the known sample is determined according to the distance between the sample feature vector and the feature vector of the known sample. And for each category label among the J category labels, the weight of the category label is calculated based on the weight of the known samples for the category label among the k known samples. Then, the J category labels are arranged in descending order according to the weight of the category label to obtain a category label sequence; and the category label sequence is used as the category label of the sample to be tested.
[0138] For example, the weight of each known sample among k known samples can be calculated according to formula (7).
[0139] w i =1 / (0.05+d t,i )
[0140]
[0141] Among them, 0.05 is the adjustment coefficient, which can be set as needed. i is the category label weight of the i-th known sample among k known samples, d t,i represents the distance between the i-th known sample and the sample to be tested, w i ′ is w i The proportion of the total category label weight can be used as the weight of the i-th known sample.
[0142] For the jth category label among J non-repeated category labels, add the weights of the known samples belonging to the jth category label among the k nearest neighbor known samples to obtain the weight u of the jth category label j”, j is an integer greater than or equal to 1 and less than or equal to J. By analogy, the weight of each category label in J non-repeated category labels can be obtained, thereby forming a weight vector u”=(u1”,…,u J ”). Arrange the elements in the weight vector u” from large to small. Output the corresponding category labels and weights in sequence as the predicted classification results of the sample to be tested.
[0143] In another way, for the j-th category label among J non-repeated category labels, the weight u of the j-th category label is determined based on the number of samples and vector distance in the j-th category label. j For example, the weight u of the j-th category label obtained based on the vector distance j " is used as the first weight of the j-th category label, and the weight u of the j-th category label obtained based on the number of samples is j 'As the second weight of the j-th category label, based on the first weight u j " and the second weight u j 'Get the weight u of the j-th category label j For example, the first weight u j " and the second weight u j 'Add together to get the weight u of the j-th category label j , or the first weight u j " and the second weight u j 'Multiply to get the weight u of the j-th category label j By analogy, we can obtain the weight of each category label in J non-repeated category labels, thus forming a weight vector u = (u1, ..., u J ). Arrange the elements in the weight vector u from large to small. Output the corresponding category labels and weights in sequence as the predicted classification results of the sample to be tested.
[0144] In the existing classification system, when using kNN for classification decision, the voting method is used to classify unknowns, that is, among the k samples closest to the sample to be tested. Find the category to which most of the k samples belong, and assign the category to the unknown. This method may result in underreporting in practical applications. According to the above-mentioned classification decision process of the embodiment of the present disclosure, the weight of the neighboring sample is determined based on the distance between the neighboring sample and the sample to be tested, and the weight of each category label is determined based on the weight of the neighboring sample, so that the category label of the sample to be tested can be input in order from high to low according to the weight of the category label, so that the classification result is more reasonable and accurate.
[0145] It can be understood that the embodiment of the present disclosure provides an improved classification method based on linear discriminant analysis combined with k-nearest neighbor for IMS data classification. The method can automatically extract the IMS fingerprint of the sample without prior knowledge and establish a classification and discrimination model for samples of different categories. It has the characteristics of high efficiency and convenience. The introduction of weighted k-NN and reduced mobility correction makes the model established by the embodiment of the present disclosure have good accuracy and the ability to resist changes in the external environment (such as air pressure and temperature).
[0146] Exemplarily, the classification method provided by the present disclosure is used to classify the IMS data of 29 different fruit odors. The IMS spectra of 1059 fruit samples collected are randomly selected, and 67% of the samples are used as training sets, and the remaining samples are used as validation sets. The training set is used to optimize and establish the model, and the validation set is used to test the prediction ability of the model. The recognition results of the validation set are statistically analyzed. The classification accuracy and non-recognition rate are calculated. Table 1 lists the comparison of the classification results of the traditional peak matching method and the method proposed in the present disclosure.
[0147] Table 1
[0148] Classification method Peak matching method The sample classification method of the present disclosure Classification accuracy 82.2% 90.3% Unrecognized rate 8% 3.4%
[0149] Figure 8 A block diagram of an electronic device for implementing the method described above according to an embodiment of the present disclosure is schematically shown. Figure 8 The device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0150] like Figure 8 As shown, the device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0151] In RAM 803, various programs and data required for the operation of device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other through bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0152] According to an embodiment of the present disclosure, the device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The device 800 may further include one or more of the following components connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0153] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0154] According to an embodiment of the present disclosure, the electronic device described above may be used to implement a sample classification method and / or a classifier training method according to an embodiment of the present disclosure.
[0155] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0156] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0157] It will be appreciated by those skilled in the art that, although the present disclosure has been shown and described with reference to specific exemplary embodiments of the present disclosure, it will be appreciated by those skilled in the art that, without departing from the spirit and scope of the present disclosure as defined by the appended claims and their equivalents, various changes in form and detail may be made to the present disclosure. Therefore, the scope of the present disclosure should not be limited to the above-described embodiments, but should be determined not only by the appended claims, but also by the equivalents of the appended claims.
Claims
1. A sample classification method, comprising: Acquire M sampling ion mobility spectrum data for the sample to be tested, where M is an integer greater than 1; Determining preprocessed ion mobility spectrometry data based on the M times of sampled ion mobility spectrometry data; Performing reduced mobility calibration on the pre-processed ion mobility spectrum data to obtain calibrated ion mobility spectrum data; Extracting a characteristic vector of the sample to be tested based on the calibration ion mobility spectrum data; as well as Processing the feature vector using a pre-trained classifier to obtain a category label of the sample to be tested; Wherein, extracting the characteristic vector of the sample to be tested based on the calibration ion mobility spectrum data comprises: In a first predetermined interval of the reduced ion mobility in the calibration ion mobility spectrum data, acquiring a signal intensity corresponding to the reduced ion mobility at every unit interval as an initial feature; The initial feature set of the sample to be tested is formed by the positive mode initial feature and the negative mode initial feature of the sample to be tested, wherein the positive mode initial feature is an initial feature obtained by processing M times of sampling ion mobility spectrum data in the positive mode, and the negative mode initial feature is an initial feature obtained by processing M times of sampling ion mobility spectrum data in the negative mode; Based on the initial feature set, a feature vector of the sample to be tested is determined.
2. The method according to claim 1, wherein: The determining of the pre-processed ion mobility spectrum data based on the M times of sampled ion mobility spectrum data comprises: Based on the M sampling ion mobility spectrum data, determining the variation information of the peak intensity of the reactive ion peak of the sample to be tested with the M sampling numbers and the maximum value of the peak intensity; Based on the change information, determining N sampling numbers from the M sampling numbers, the peak intensities of the reactive ion peaks corresponding to the N sampling numbers being less than or equal to a first predetermined ratio of the maximum value, where N is an integer greater than 1 and less than M; and The N sampling ion mobility spectrometry data corresponding to the N sampling numbers are screened.
3. The method according to claim 2, wherein: The determining of the pre-processed ion mobility spectrum data based on the M times of sampled ion mobility spectrum data further comprises: Calculating the signal intensities of N samples of the N sampled ion mobility spectrum data for the same migration time or combining the N sampled ion mobility spectrum data to obtain processed ion mobility spectrum data; and The pre-processed ion mobility spectrometry data is determined based on the processed ion mobility spectrometry data.
4. The method according to claim 3, wherein: The determining the pre-processed ion mobility spectrometry data based on the processed ion mobility spectrometry data comprises: Based on the maximum value and the minimum value of the signal intensity in the processed ion mobility spectrum data, the signal intensity in the processed ion mobility spectrum data is normalized to obtain the pre-processed ion mobility spectrum data.
5. The method according to claim 1, wherein: The performing reduced mobility calibration on the pre-processed ion mobility spectrum data comprises: The migration time in the pre-processed ion mobility spectrum data is calibrated by reduced mobility to convert the migration time into reduced ion mobility.
6. The method according to claim 1, wherein: Based on the initial feature set, determining the feature vector of the sample to be tested: The initial feature set is processed by dimensionality reduction using a principal component analysis algorithm to obtain the feature vector.
7. The method according to claim 1, wherein: The pre-trained classifier includes a training set, and the training set includes sample feature vectors and category labels of respective multiple known samples; The processing of the feature vector by using a pre-trained classifier includes: Calculate the distance between each sample feature vector in the training set and the feature vector; Based on the distances, the plurality of known samples are arranged in ascending order to obtain a known sample sequence; Selecting first k known samples from the known sample sequence, where k is an integer greater than 1; and When the category labels of the k known samples are all the same, the category labels of the k known samples are used as the category labels of the sample to be tested.
8. The method according to claim 7, wherein: The processing of the feature vector by using a pre-trained classifier also includes: In the case where the category labels of the k known samples include J non-repeating category labels, J is an integer greater than 1 and less than or equal to k, For each of the J class labels, determining a weight of the class label based on the number of known samples for the class label among the k known samples; Arrange the J category labels in descending order according to the weights of the category labels to obtain a category label sequence; and The category label sequence is used as the category label of the sample to be tested.
9. The method according to claim 7, wherein: The processing of the feature vector by using a pre-trained classifier also includes: In the case where the category labels of the k known samples include J non-repeating category labels, J is an integer greater than 1 and less than or equal to k, For each known sample among the k known samples, determining a weight of the known sample according to a distance between a sample feature vector of the known sample and the feature vector; For each of the J category labels, based on the weights of the known samples for the category label among the k known samples, a weight of the category label is calculated; Arrange the J category labels in descending order according to the weights of the category labels to obtain a category label sequence; and The category label sequence is used as the category label of the sample to be tested.
10. The method according to claim 9, wherein: The step of calculating the weight of the category label based on the weight of the known samples for the category label among the k known samples includes: Using the weight of the known samples for the category label among the k known samples as the first weight; For each of the J class labels, determining a second weight of the class label based on the number of known samples for the class label among the k known samples; and The weight of the category label is calculated based on the first weight and the second weight.
11. A method for training a classifier, comprising: For each known sample among a plurality of known samples, obtaining P sampling sample ion mobility spectrum data; Determine the pre-processed sample ion mobility spectrum data based on the P sampling sample ion mobility spectrum data; Performing reduced mobility calibration on the pre-processed sample ion mobility spectrum data to obtain calibration sample ion mobility spectrum data; and extracting a sample feature vector of the known sample based on the calibration sample ion mobility spectrum data, where P is an integer greater than 1; The sample feature vectors and category labels of the plurality of known samples are used to form a training set; as well as Using the training set to train the initial classifier to obtain a target classifier, wherein the target classifier is used to determine the category label of the sample to be tested; Wherein, extracting the sample feature vector of the known sample based on the calibration sample ion mobility spectrum data comprises: In a second predetermined interval of the reduced ion mobility in the calibration sample ion mobility spectrum data, acquiring a signal intensity corresponding to the reduced ion mobility at every unit interval as an initial feature of the sample; The sample initial feature set of the known sample is formed by the positive mode sample initial feature and the negative mode sample initial feature of the known sample, wherein the positive mode sample initial feature is the sample initial feature obtained by processing the ion mobility spectrometry data of P times of sampling samples in the positive mode, and the negative mode sample initial feature is the sample initial feature obtained by processing the ion mobility spectrometry data of P times of sampling samples in the negative mode; Based on the sample initial feature set, a sample feature vector of the known sample is determined.
12. The method according to claim 11, wherein: The determining of the pre-processed sample ion mobility spectrum data based on the P sampling sample ion mobility spectrum data comprises: Based on the P sampling sample ion mobility spectrum data, determine the variation information of the peak intensity of the reaction ion peak of the known sample with the P sampling sequence numbers and the maximum value of the peak intensity; Based on the change information, determine Q sampling numbers from the P sampling numbers, the peak intensities of the reactive ion peaks corresponding to the Q sampling numbers being less than or equal to a second predetermined proportion of the maximum value, where Q is an integer greater than 1 and less than P; and The Q sampling sample ion mobility spectrum data corresponding to the Q sampling numbers are screened.
13. The method according to claim 12, wherein: The determining of the pre-processed sample ion mobility spectrum data based on the P times of sample ion mobility spectrum data also includes: Calculating the signal intensities of the Q samples for the same migration time in the Q samples ion mobility spectrum data or combining the Q samples ion mobility spectrum data to obtain processed sample ion mobility spectrum data; and The pre-processed sample ion mobility spectrum data is determined based on the processed sample ion mobility spectrum data.
14. The method according to claim 13, wherein: The determining the pre-processed sample ion mobility spectrum data based on the processed sample ion mobility spectrum data comprises: Based on the maximum value and the minimum value of the signal intensity in the processed sample ion mobility spectrum data, the signal intensity in the processed sample ion mobility spectrum data is normalized to obtain the pre-processed sample ion mobility spectrum data.
15. The method according to claim 11, wherein: The performing reduced mobility calibration on the pre-processed sample ion mobility spectrum data comprises: The migration time in the pre-processed sample ion mobility spectrum data is calibrated by reduced mobility so as to convert the migration time into reduced ion mobility.
16. The method according to claim 11, wherein: The determining the sample feature vector of the known sample based on the sample initial feature set comprises: The principal component analysis algorithm is used to perform dimension reduction processing on the initial feature set of the sample to obtain the sample feature vector.
17. The method according to claim 11, wherein: The initial classifier is a classifier constructed based on the k-nearest neighbor algorithm.
18. An electronic device, comprising: A memory for storing instructions; At least one processor: The at least one processor executes instructions stored in the memory to implement the method according to any one of claims 1 to 10.
19. An electronic device comprising: A memory for storing instructions; At least one processor: The at least one processor executes instructions stored in the memory to implement the method according to any one of claims 11-17.
20. A computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, implement the method according to any one of claims 1 to 10.
21. A computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, implement the method according to any one of claims 11-17.
Citation Information
Patent Citations
Astragalus membranaceus spectrogram feature extraction and production place identification method based on kernel principal component analysis
CN110097127A
Detection method for calibrating ion mobility spectrometer by utilizing multiple ion peaks
CN112098502A
Sample classification method and device, computer equipment, medium and program product
CN112116018A