Basic group classification model training method and system and basic group classification method and system
Patent Information
- Application Number
- CN202280102583.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-14
- Publication Date
- 2025-08-12
AI Technical Summary
Machine learning/deep learning models have poor generalization capabilities in gene sequencer applications, resulting in good results during the training process but reduced accuracy in actual applications.
By pre-training the base classification model, generating pseudo labels and constructing a loss function, the model is updated to improve generalization ability. Specific steps include pre-training based on sample brightness data, obtaining pseudo labels, constructing a cross-entropy loss function and updating model parameters.
It improves the generalization ability and accuracy of the base classification model in the application of gene sequencers, and overcomes the problem of poor generalization ability of the model.
Smart Images

Figure CN120476433A_ABST
Abstract
Description
Base classification model training method and system, base classification method and system Technical Field
[0001] The present disclosure relates to the field of base classification, and in particular to a base classification model training method and system, and a base classification method and system. Background Art
[0002] With the development of artificial intelligence technology, machine learning / deep learning models have been widely used in life sciences and biomedicine.
[0003] Gene sequencing technology is a core component of emerging biotechnology. Basecalling is the most critical component of gene sequencer algorithms, and its accuracy directly determines sequencing quality. Currently, machine learning / deep learning models used in gene sequencers suffer from poor generalization capabilities because the input data does not satisfy the independent and identically distributed assumption. This can lead to models performing well during training but experiencing reduced accuracy in actual applications.
[0004] Summary of the Invention
[0005] The technical problem to be solved by the present disclosure is to overcome the defect of poor generalization ability of machine learning / deep learning models in gene sequencer applications in the prior art, and to provide a training method and system for a base classification model, and a base classification method and system.
[0006] The present disclosure solves the above technical problems through the following technical solutions:
[0007] A method for training a base classification model, comprising:
[0008] Pre-training a base classification model based on first sample data, where the first sample data includes first sample brightness data and corresponding base categories;
[0009] inputting the second sample data into a base classification model and outputting a base category corresponding to the second sample data, wherein the second sample data includes second sample brightness data;
[0010] Obtaining a pseudo label corresponding to the second sample data;
[0011] The base classification model is updated based on the base category corresponding to the second sample data and the pseudo label corresponding to the second sample data.
[0012] Preferably, the step of obtaining a pseudo label corresponding to the second sample data includes:
[0013] Obtaining the output of a specific layer of the base classification model;
[0014] performing clustering based on the output of a specific layer of the base classification model;
[0015] Generate a pseudo label corresponding to the second sample data based on the clustering result.
[0016] Preferably, the step of obtaining a pseudo label corresponding to the second sample data includes:
[0017] Obtaining a corresponding confidence score of a base category corresponding to the second sample data;
[0018] Selecting a number of second sample data and corresponding base categories according to the confidence level;
[0019] Semi-supervised learning is performed based on the remaining second sample data after the selection, the selected second sample data, and the corresponding base categories, and pseudo labels corresponding to the remaining second sample data are generated.
[0020] Preferably, the step of updating the base classification model based on the base category corresponding to the second sample data and the pseudo label corresponding to the second sample data includes:
[0021] Constructing a loss function based on the base category corresponding to the second sample data and the pseudo label corresponding to the second sample data;
[0022] The base classification model is updated according to the calculation result of the loss function.
[0023] Preferably, the step of updating the base classification model according to the loss function calculation result specifically includes:
[0024] Determine whether the loss function is less than a preset threshold:
[0025] If not, updating the base classification model and returning to the step of inputting the second sample data into the base classification model;
[0026] If so, stop updating the base classification model.
[0027] Preferably, when the base classification model is a machine learning model, the sample brightness data includes the brightness data of the current sample position, the corresponding sample brightness data of the neighborhood of the current sample position, and the corresponding sample brightness data of the period before and after the current sample position. The sample brightness data is obtained by taking pictures of the bases contained in the sample, and the period is the photographing period of each base contained in the sample.
[0028] Preferably, when the base classification model is a deep learning model, the sample brightness data includes the brightness data of each sample position in any field of view, the corresponding sample brightness data of the neighborhood of each sample position, and the corresponding sample brightness data of the period before and after each sample position. The sample brightness data is obtained by photographing the bases contained in the sample, and the period is the photographing period of each base contained in the sample.
[0029] A base classification method, comprising:
[0030] Obtain sample brightness data to be classified;
[0031] Inputting the obtained sample brightness data to be classified into a base classification model for processing, wherein the base classification model is trained using any of the above-mentioned base classification model training methods;
[0032] Output the base category corresponding to the sample brightness data to be classified.
[0033] A training system for a base classification model, the system comprising:
[0034] A pre-training module, configured to pre-train a base classification model based on first sample data, wherein the first sample data includes first sample brightness data and corresponding base categories;
[0035] a classification module, configured to input the second sample data into a base classification model and output a base category corresponding to the second sample data, wherein the second sample data includes second sample brightness data;
[0036] a pseudo-label generating module, configured to obtain a pseudo-label corresponding to the second sample data;
[0037] An updating module is used to update the base classification model based on the base category corresponding to the second sample data and the pseudo label corresponding to the second sample data.
[0038] A base classification system, comprising:
[0039] An acquisition module is used to obtain brightness data of samples to be classified;
[0040] a processing module, configured to input the obtained sample brightness data to be classified into a base classification model for processing, wherein the base classification model is obtained using the training system of the base classification model;
[0041] The output module is used to output the base category corresponding to the sample brightness data to be classified.
[0042] An electronic device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the training method for a base classification model described in any one of the above items or the base classification method described above are implemented.
[0043] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the training method of the base classification model described in any one of the above items or the base classification method described above are implemented.
[0044] The positive progress of the present disclosure is that: the present disclosure generates pseudo labels through a pre-trained base classification model, constructs a loss function through the pseudo labels, and updates the base classification model according to the loss function, thereby overcoming the defect of poor generalization ability of the base classification model in the application of gene sequencers. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] FIG1 is a diagram showing the effect of a multi-sample sequencing process provided by an exemplary embodiment of the present disclosure.
[0046] FIG2 is a flowchart of a method for training a base classification model provided by an exemplary embodiment of the present disclosure.
[0047] FIG3 is a partial flow chart of a method for training a base classification model provided by an exemplary embodiment of the present disclosure.
[0048] FIG4 is a schematic diagram of a K-means method provided by an exemplary embodiment of the present disclosure.
[0049] FIG5 is a schematic diagram of a scatter plot result of a K-means method provided by an exemplary embodiment of the present disclosure.
[0050] FIG6 is a schematic diagram illustrating an implementation of a method for training a base classification model provided by an exemplary embodiment of the present disclosure.
[0051] FIG7 is a partial flow chart of a method for training a base classification model provided by an exemplary embodiment of the present disclosure.
[0052] FIG8 is another schematic diagram of an implementation of a method for training a base classification model provided by an exemplary embodiment of the present disclosure.
[0053] FIG9 is a flowchart of another training method for a base classification model provided by an exemplary embodiment of the present disclosure.
[0054] FIG10 is a schematic diagram of one-dimensional sample brightness data provided by an exemplary embodiment of the present disclosure.
[0055] FIG11 is a schematic diagram of multi-dimensional sample brightness data provided by an exemplary embodiment of the present disclosure.
[0056] FIG12 is a schematic diagram of the physical distribution of a base sequencing chip provided by an exemplary embodiment of the present disclosure.
[0057] FIG13 is a flowchart of a base classification method provided by an exemplary embodiment of the present disclosure.
[0058] FIG14 is a module diagram of a training system for a base classification model provided by an exemplary embodiment of the present disclosure.
[0059] FIG15 is a module diagram of a base classification system provided by an exemplary embodiment of the present disclosure.
[0060] FIG16 is a schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0061] The present disclosure is further illustrated below by way of examples, but the present disclosure is not limited to the scope of the examples.
[0062] An exemplary embodiment of the present disclosure provides a training method for a base classification model. Base classification is an indispensable step in the gene sequencing process. Base categories mainly include multiple types, namely adenine (A), guanine (G), cytosine (C), thymine (T), and uracil (U). Various base sequences can be assembled through the above base categories.
[0063] The samples for base classification in the present embodiment may include nucleic acid clusters, amino acid clusters, DNA, RNA, etc., which can be specifically determined according to the actual application scenario. Taking nucleic acid clusters as an example, nucleic acid clusters are large-scale molecular clusters obtained by performing nucleic acid amplification on base sequences during gene sequencing. The gene sequencing in the present embodiment preferably adopts DNA nano ball (DNB, DNA nanoball) sequencing, and the nucleic acid clusters obtained by DNB sequencing can be characterized by DNB. The gene sequencing method used in the present embodiment is not limited to DNB sequencing, which is only used as an example, and the matching method can be selected according to the actual application scenario.
[0064] The following is a further explanation of DNB sequencing. DNB sequencing is a high-throughput sequencing technology. The core of this technology is to circularize genomic DNA fragments into single-stranded circular DNA, and then use rolling circle amplification (RCA technology) to make the circular single-stranded DNA form multiple copies of single-stranded DNA connected end to end, and freely fold into a nanosphere structure in the solution, namely DNA nanosphere (DNB). Due to the mutual repulsion of the negative charge carried by the DNB itself, the interaction between individual DNBs can be reduced, making the DNB individuals independent of each other. Based on DNB sequencing technology, the DNB number of each matrix point has at least several hundred copies. These copies are aggregated to produce a strong signal, which allows the base category to be identified from the original image through the DNB brightness data.
[0065] The sample brightness data in this embodiment can be obtained using n-color sequencing, where n represents the number of imaging colors. Taking DNB as an example, if 2-color sequencing is used, two raw images are captured for each base in the DNB; if 4-color sequencing is used, four raw images are captured for each base in the DNB. The sequencing principle is that the four ATCG bases exhibit different excitation reactions, resulting in different brightness data. Therefore, after acquiring the raw image, the brightness data is read to determine the base type.
[0066] If only one DNA strand is measured, and this DNA strand contains 100 bases, after DNB is generated by RCA technology, the 2-color sequencing technology needs to take 200 photos of the DNB, with each 2 photos being a cycle, and the brightness data of every two original images can determine the category of one base; the 4-color sequencing technology needs to take 400 photos of the DNB, with each 4 photos being a cycle, and the brightness data of every four original images can determine the category of one base.
[0067] For example, if 100 DNA strands are being sequenced, each containing 100 bases, and DNBs are generated from these 100 DNA strands using RCA, these DNBs are then adsorbed to designated locations on the sequencing chip. Assume that the field of view of the sequencing camera covers the area capturing these 100 DNBs. Using two-color sequencing, all DNBs must be imaged 200 times, with two images representing one cycle. The brightness data from each pair of raw images can be used to determine the class of the first base of each DNB. After these 200 images are captured, the class of each 100 bases is sequentially read, completing the base sequencing of these 100 DNBs. Using four-color sequencing, all DNBs must be imaged 400 times, with four images representing one cycle. The brightness data from each pair of raw images can be used to determine the class of the first base of each DNB. After these 400 images are captured, the class of each 100 bases is sequentially read, completing the base sequencing of these 100 DNBs.
[0068] See Figure 1, which shows the sequencing process of multiple DNBs. Each circle represents a DNB, and the sequencing results of each circle are shown in the numbers on the figure.
[0069] If multiple DNA strands are to be tested and each DNA strand is of different length, the base classification and sequencing steps can be performed by cutting the DNA strands to a uniform length.
[0070] 2 , the training method of the base classification model includes:
[0071] S1. Pre-training a base classification model based on first sample data, where the first sample data includes first sample brightness data and corresponding base categories;
[0072] Among them, the base classification model is usually a machine learning model (including traditional machine learning models: neural network, support vector machine, decision tree, etc.; recurrent neural network: RNN, LSTM) or a deep learning model (convolutional neural network CNN). There are three methods for obtaining the brightness data of the first sample and the corresponding base category: (1) a large number of sample original images and the corresponding base categories after base classification and calibration according to the original algorithm of the sequencer can be obtained from the Sam file; (2) in the subsequent training process of the base classification model, a large number of sample original images and the corresponding base categories after base classification and calibration according to the base classification model can be obtained from the Sam file; (3) a large number of sample original images and the corresponding base categories of (1) and (2) above are taken as a union, which can be obtained from the Sam file. The base classification model is pre-trained with the first sample data to obtain the model parameters. Among them, the Sam file is a file generated by a general tool in the field of base classification technology. At this time, the pre-trained base classification model has a certain degree of base classification capability.
[0073] S2. Inputting the second sample data into a base classification model, and outputting a base category corresponding to the second sample data, wherein the second sample data includes second sample brightness data;
[0074] Inputting the second sample data into a pre-trained base classification model will output the base category corresponding to the second sample data. For example, selecting multiple sample original images and inputting the brightness data of the original images into a pre-trained base classification model will output the base categories corresponding to the multiple sample original images based on the current base classification model.
[0075] S3. Obtain a pseudo label corresponding to the second sample data;
[0076] S4. Update the base classification model based on the base category corresponding to the second sample data and the pseudo label corresponding to the second sample data.
[0077] Furthermore, in one embodiment, step S4 specifically includes:
[0078] Constructing a loss function based on the base category corresponding to the second sample data and the pseudo label corresponding to the second sample data;
[0079] A cross-entropy loss function is constructed based on the base category corresponding to the second sample data and the pseudo-label corresponding to the second sample data to measure the similarity between the corresponding base category and the pseudo-label. Those skilled in the art will appreciate that the loss function is not limited to the cross-entropy loss function, and the specific loss function is selected based on actual circumstances.
[0080] The base classification model is updated according to the calculation result of the loss function.
[0081] Among them, the parameters of the base classification model are updated according to the results of the cross entropy loss function, and the base classification model is tuned.
[0082] In this embodiment, pseudo labels are generated by a pre-trained base classification model, a cross-entropy loss function is constructed using the pseudo labels, and the base classification model is updated according to the cross-entropy loss function, thereby overcoming the defect of poor generalization ability of the base classification model in gene sequencer applications.
[0083] Furthermore, in one embodiment, referring to FIG. 3 , obtaining a pseudo label corresponding to the second sample data includes:
[0084] S3011, obtaining the output of the specific layer of the base classification model;
[0085] S3012, performing clustering based on the output of the specific layer of the base classification model;
[0086] S3013: Generate a pseudo label corresponding to the second sample data based on the clustering result.
[0087] Among them, steps S3011 to S3013 generate pseudo labels through self-supervised learning. In this embodiment, the self-supervised learning method preferably adopts DeepCluster (deep clustering), and clustering is to iteratively group the features of the second sample data, i.e., the sample brightness data, using k-means (standard clustering algorithm). Those skilled in the art should understand that the self-supervised learning method is not limited to DeepCluster, and the specific self-supervised learning method is selected according to the actual situation. A plurality of second sample data, i.e., a plurality of sample brightness data, are input into a pre-trained base classification model, and a method such as K-means is used to perform unsupervised clustering on a plurality of corresponding outputs of any layer (any layer is not limited to the first layer, the middle layer, or the last layer) in the base classification model to generate pseudo labels corresponding to the second sample data. For example, referring to FIG4 , a cycle of the middle layer (the penultimate layer) in the base classification model is selected. In this example, the output brightness feature data corresponding to the last cycle is selected, and the output brightness feature data is normalized. The normalized data is respectively generated as a scatter plot by dimensionality reduction and K-means clustering methods. It should be understood by those skilled in the art that the dimensionality reduction method may include but is not limited to PCA and TSNE. The generated scatter plot is the result of the pseudo-label generated by clustering the feature data output by the second sample data in the penultimate layer. Among them, the shape classification of the scatter plot generated by clustering is determined by the clustering result. Referring to FIG5 , the left side of FIG5 is the category displayed by the label information, and the right side of FIG5 is the result of base classification using the K-means clustering method. The category displayed by the label information is highly consistent with the result of base classification generated by the clustering method, and is close to the category of the real base.
[0088] In addition, referring to FIG6 , the specific implementation of the above steps is as follows: First, according to the above-mentioned sample brightness data acquisition method, the first sample brightness data (represented by the first DNB brightness data in the figure) and the base category corresponding to the first sample brightness data are obtained to pre-train the base classification model. At this time, the base classification model already has a certain degree of base classification capability. Secondly, the second sample brightness data (represented by the second DNB brightness data in the figure) is input into the pre-trained base classification model to obtain the base category corresponding to the second sample brightness data and the output of any layer of the base classification model. At this time, the output of any layer of the base classification model is clustered to generate pseudo labels. A loss function is constructed using the base category corresponding to the second sample brightness data and the pseudo label corresponding to the second sample brightness data, and the parameters of the base classification model are updated using the loss function.
[0089] In this embodiment, the sample brightness data features of the second sample are clustered, and the clustering results are used as pseudo labels. A cross-entropy loss function is constructed by combining the output base classification results of the base classification model with the base category pseudo labels corresponding to the second sample data. The base classification model is updated according to the cross-entropy loss function to achieve online update of the model parameters.
[0090] Furthermore, in one embodiment, referring to FIG. 7 , obtaining a pseudo label corresponding to the second sample data includes:
[0091] S3021. Obtaining the corresponding confidence of the base category corresponding to the second sample data;
[0092] S3022. Selecting a number of second sample data and corresponding base categories according to the confidence level;
[0093] S3023: Perform semi-supervised learning based on the remaining second sample data after selection, the selected second sample data, and the corresponding base categories, and generate pseudo labels corresponding to the remaining second sample data.
[0094] Among them, steps S3021 to S3023 generate pseudo labels through semi-supervised learning. Those skilled in the art should understand that the semi-supervised learning method can adopt label spreading, label propagation, and Noisy Student. The semi-supervised learning method is not limited to the above three methods. The specific semi-supervised learning method is selected according to the actual situation. A plurality of second sample data, i.e., a plurality of sample brightness data, are obtained and input into the pre-trained base classification model to obtain the corresponding base classification. Before entering the semi-supervised learning stage, the output base classification is first selected. Each output base classification result is assigned a probability value. The Softmax function is commonly used to select input sample data with higher confidence and the corresponding output base classification, and the data is selected according to a preset number. The remaining second sample data after selection, i.e., the remaining sample brightness data, is retained, and the base classification results of the remaining second sample data are removed. Semi-supervised learning is performed on the remaining second sample data based on the selected data and the base classification results, so that the remaining second sample data generates corresponding pseudo labels.
[0095] In addition, referring to Figure 8, the specific implementation of the above steps is: first, according to the above-mentioned sample brightness data acquisition method, the first sample brightness data (characterized by the first DNB brightness data in the figure) and the base category corresponding to the first sample brightness data are obtained to pre-train the base classification model. At this time, the base classification model already has a certain degree of base classification ability. Second, the second sample brightness data (characterized by the second DNB brightness data in the figure) is input into the pre-trained base classification model to obtain the base category corresponding to the second sample brightness data. Third, the input sample data with higher confidence and the corresponding output base classification are selected from the second sample brightness data and the corresponding base category output by the model. Fourth, the base classification results of the remaining second sample brightness data are removed. Based on the selected results, semi-supervised learning is performed on the remaining second sample brightness data, so that the remaining second sample brightness data generates corresponding pseudo labels. Finally, a loss function is constructed, and the parameters of the base classification model are updated through the loss function. In this embodiment, a pre-trained base classification model is input into the second sample data, and semi-supervised learning is performed on input sample data with higher confidence from the output corresponding base classification results, the corresponding output base classification, and the remaining second sample data. A small number of data with existing classification results are combined with the unclassified data in the remaining second samples, and a cross-entropy loss function is constructed. The base classification model is updated according to the cross-entropy loss function, thereby overcoming the defect of poor generalization ability of the base classification model in the application of gene sequencers.
[0096] Furthermore, in one embodiment, referring to FIG. 9 , after step S4, the method further includes:
[0097] S5. Determine whether the loss function is less than a preset threshold:
[0098] If not, updating the base classification model and returning to the step of inputting the second sample data into the base classification model;
[0099] If so, stop updating the base classification model.
[0100] A preset threshold is set for the constructed cross-entropy loss function. A determination is made as to whether the cross-entropy loss function is less than the threshold. If not, this indicates that the base classification model training has not yet met the preset expectations, and the parameters of the base classification model are updated. If so, this indicates that the base classification model has met the preset expectations, and updating the base classification model is stopped. At this point, the parameters of the base classification model are the preset optimal parameters, indicating successful model training.
[0101] In this embodiment, by judging the relationship between the cross-entropy loss function and the preset threshold, the parameters of the base classification model are updated, so that the parameters of the base classification model are updated to the optimal level and then stopped, thereby overcoming the defect of poor generalization ability of the base classification model in the application of gene sequencers.
[0102] Furthermore, in one embodiment, referring to FIG10 , when the base classification model is a machine learning model, the sample brightness data includes the brightness data of the current sample position, the corresponding sample brightness data of the 8-neighborhood of the current sample position, and the corresponding sample brightness data of the periods before and after the current sample position. The sample brightness data is acquired by photographing the bases contained in the sample, and the period is the photographing period of each base contained in the sample.
[0103] The input data is one-dimensional data, including the brightness data of the current sample position to be measured (see A1 in Figure 10). In addition, it is necessary to obtain the corresponding sample brightness data of the 8 neighborhoods of the current sample position (see B1 to B8 in Figure 10) and the sample brightness data corresponding to the cycles before and after the current sample position (see C1 to C2 in Figure 10, C1 is the sample brightness data corresponding to the cycle before the current sample position; C2 is the sample brightness data corresponding to the cycle after the current sample position). The reason is that the sample brightness data of the neighborhood position and the sample brightness data corresponding to the cycles before and after the current sample position have a certain degree of influence on the currently measured sample brightness data. Inputting the above three at the same time can improve the accuracy of base classification.
[0104] Taking DNB as an example, when measuring a DNB (ACGTTCGAGATCCCTAG…..GTCU), when measuring the first base A, not only the brightness data of the current DNB is needed, but also the brightness data of the corresponding DNBs in the 8-neighborhood and the brightness data of the DNBs corresponding to the periods before and after the DNB position are needed as input features of the model.
[0105] In some special cases, the input data also includes background brightness data at the location of the current sample.
[0106] In addition, one-dimensional data is often used in traditional machine learning (such as neural networks, support vector machines, decision trees, etc.) and recurrent neural networks such as RNN and LSTM.
[0107] In this embodiment, not only the brightness data of the sample to be tested is selected, but also the brightness data of the samples in the neighborhood and previous and next cycles are selected, so as to reduce the interference in the classification of bases in the sample to be tested, thereby improving the accuracy of the base classification model during the training process.
[0108] Furthermore, in one embodiment, n*n*2 (2 represents the use of 2-color sequencing technology with 2 channels) or n*n*4 (4 represents the use of 4-color sequencing with 4 channels) samples can be measured, where n can be an odd number greater than 1. For example, referring to Figure 11, a 3*3*2 area is shown, and the brightness data of the 2-color sequencing technology is selected. When the base classification model is a deep learning model, the sample brightness data includes the brightness data of each sample position in any field of view, the corresponding sample brightness data of the neighborhood of each sample position, and the corresponding sample brightness data of the period before and after each sample position. The sample brightness data is obtained by taking pictures of the bases contained in the sample, and the period is the photographing period of each base contained in the sample.
[0109] The input data is multidimensional, including the brightness data of the current sample position to be measured. In addition, it is necessary to obtain the brightness data of the corresponding samples in the 8-neighborhood of the current sample position and the brightness data of the samples before and after the current sample position. The reason is that the brightness data of the samples at the neighboring positions and the brightness data of the samples before and after the current sample position have a certain degree of influence on the brightness data of the currently measured sample. Entering all three at the same time can improve the accuracy of base classification.
[0110] In addition, referring to Figure 12, a base sequencing chip generally contains multiple lanes, each lane has multiple FOVs (field of view of the sequencing camera), each FOV has blocks, and the FOV is composed of blocks separated by multiple track lines. The brightness data also includes all the brightness data of a certain area (such as a block, FOV or a lane).
[0111] For example, when measuring multiple samples, when measuring the first base of each sample, for the first base of each sample, not only the brightness data of the current sample is required, but also the brightness data of the corresponding samples in the 8-neighborhood and the brightness data of the corresponding samples in the periods before and after the sample position are required to eliminate interference when measuring base A.
[0112] In some special cases, the input data also includes background brightness data at the location of the current sample.
[0113] In addition, multidimensional data is often used in deep learning (such as convolutional neural networks (CNN)).
[0114] In this embodiment, not only the brightness data of the sample to be tested is selected, but also the brightness data of the samples in the neighborhood and previous and next cycles are selected, so as to reduce the interference in the base classification in the sample to be tested, thereby improving the accuracy of the base classification model during the training process, and overcoming the defect of poor generalization ability of the base classification model in the application of gene sequencers.
[0115] An exemplary embodiment of the present disclosure further provides a base classification method. Referring to FIG13 , the base classification method includes:
[0116] S101, obtaining sample brightness data to be classified;
[0117] S102, inputting the obtained sample brightness data to be classified into a base classification model for processing, wherein the base classification model is trained using the training method in Example 1;
[0118] S103: Output the base category corresponding to the sample brightness data to be classified.
[0119] The sample brightness data to be classified can be the brightness data of all bases on a single sample, or the brightness data of all bases on multiple samples. The sample brightness data is input into the trained base classification model in the above embodiment, and processed by the base classification model to finally generate the categories of all bases on a single sample or the categories of all bases on multiple samples, and sequencing is completed based on the obtained base categories.
[0120] In this embodiment, by inputting the sample data to be tested into the trained base classification model, a base sequence with higher accuracy can be obtained, thereby improving the accuracy of the base sequence test.
[0121] An exemplary embodiment of the present disclosure provides a base classification model training system, which is used to implement the training method in the above-mentioned embodiment. FIG14 shows a module diagram of this embodiment. Referring to FIG14 , the base classification model training system of this embodiment includes:
[0122] A pre-training module 11 is configured to pre-train a base classification model based on first sample data, wherein the first sample data includes first sample brightness data and corresponding base categories;
[0123] Among them, there are three methods for obtaining the brightness data of the first sample and the corresponding base categories: (1) a large number of sample original images and the corresponding base categories after base classification and calibration according to the original algorithm of the sequencer can be obtained from the Sam file; (2) in the subsequent training process of the base classification model, a large number of sample original images and the corresponding base categories after base classification and calibration according to the base classification model can be obtained from the Sam file; (3) a large number of sample original images and the corresponding base categories of (1) and (2) above are taken as a union, which can be obtained from the Sam file. The base classification model is pre-trained with the first sample data to obtain the model parameters. At this point, the pre-trained base classification model already has a certain degree of base classification capability.
[0124] a classification module 12, configured to input the second sample data into a base classification model and output a base category corresponding to the second sample data, wherein the second sample data includes second sample brightness data;
[0125] Inputting the second sample data into a pre-trained base classification model will output the base category corresponding to the second sample data. For example, selecting multiple sample original images and inputting the brightness data of the original images into a pre-trained base classification model will output the base categories corresponding to the multiple sample original images based on the current base classification model.
[0126] A pseudo label generating module 13, configured to obtain a pseudo label corresponding to the second sample data;
[0127] The updating module 14 is configured to update the base classification model based on the base category corresponding to the second sample data and the pseudo label corresponding to the second sample data.
[0128] Furthermore, in one embodiment, the update module 14 specifically includes
[0129] A loss function construction unit, configured to construct a loss function based on the base category corresponding to the second sample data and the pseudo label corresponding to the second sample data;
[0130] A cross-entropy loss function is constructed based on the base category corresponding to the second sample data and the pseudo-label corresponding to the second sample data to measure the similarity between the corresponding base category and the pseudo-label. The loss function is not limited to the cross-entropy loss function; the specific loss function is selected based on the actual situation.
[0131] A model updating unit is used to update the base classification model according to the calculation result of the loss function.
[0132] Among them, the parameters of the base classification model are updated according to the results of the cross entropy loss function, and the base classification model is tuned.
[0133] In this embodiment, pseudo labels are generated by a pre-trained base classification model, a cross-entropy loss function is constructed using the pseudo labels, and the base classification model is updated according to the cross-entropy loss function, thereby overcoming the defect of poor generalization ability of the base classification model in gene sequencer applications.
[0134] An exemplary embodiment of the present disclosure provides a base classification system, and FIG15 shows a schematic diagram of the modules of this embodiment. Referring to FIG15 , the base classification system of this embodiment includes:
[0135] The acquisition module 21 is used to acquire the sample brightness data to be classified;
[0136] The processing module 22 inputs the obtained sample brightness data to be classified into a base classification model for processing, wherein the base classification model is obtained using the training system of the above embodiment;
[0137] The output module 23 is used to output the base category corresponding to the sample brightness data to be classified.
[0138] The sample brightness data to be classified can be the brightness data of all bases in a single sample, or the brightness data of all bases in multiple samples. The sample brightness data is input into the trained base classification model in the above embodiment. The base classification model processes the data and generates the categories of all bases in a single sample or all bases in multiple samples. Sequencing is completed using the obtained base categories.
[0139] In this embodiment, by inputting the sample data to be tested into the trained base classification model, a base sequence with higher accuracy can be obtained, thereby improving the accuracy of the base sequence test.
[0140] An electronic device is shown in an example embodiment of the present disclosure. The electronic device can be expressed in the form of a computing device (for example, a server device), including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the training method of the base classification model provided in the above embodiment or the base classification method provided in the above embodiment can be implemented.
[0141] FIG16 shows a schematic diagram of the hardware structure of this embodiment. As shown in FIG16 , the electronic device 9 specifically includes:
[0142] At least one processor 91, at least one memory 92, and a bus 93 for connecting different system components (including the processor 91 and the memory 92), wherein:
[0143] The bus 93 includes a data bus, an address bus, and a control bus.
[0144] The memory 92 includes a volatile memory, such as a random access memory (RAM) 921 and / or a cache memory 922 , and may further include a read-only memory (ROM) 923 .
[0145] Memory 92 also includes a program / utility 925 having a set (at least one) of program modules 924, such program modules 924 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0146] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the training method of the base classification model provided in the above embodiment of the present disclosure or the base classification method provided in the above embodiment.
[0147] The electronic device 9 can further communicate with one or more external devices 94. Such communication can be performed via an input / output (I / O) interface 95. Furthermore, the electronic device 9 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 96. The network adapter 96 communicates with other modules of the electronic device 9 via a bus 93. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with the electronic device 9, including but not limited to microcode, device drivers, redundant processors, external disk drive arrays, RAID (RAID) systems, tape drives, and data backup storage systems.
[0148] It should be noted that while the above detailed description refers to several units / modules or sub-units / modules of the heating system, this division is merely exemplary and not mandatory. In practice, depending on the implementation of the present application, the features and functions of two or more units / modules described above may be embodied in a single unit / module. Conversely, the features and functions of a single unit / module described above may be further divided and embodied by multiple units / modules.
[0149] An exemplary embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the base classification model training method provided in the above embodiment or the base classification method provided in the above embodiment.
[0150] The readable storage medium may include, but is not limited to, a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0151] In a possible embodiment, the present disclosure can also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the training method of the base classification model provided by the above embodiment or the base classification method provided by the above embodiment.
[0152] The program code for executing the present disclosure may be written in any combination of one or more programming languages, and may be executed entirely on the user device, partially on the user device, as a standalone software package, partially on the user device and partially on a remote device, or entirely on the remote device.
[0153] While specific embodiments of the present disclosure have been described above, those skilled in the art will appreciate that these are merely illustrative and that the scope of protection of the present disclosure is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present disclosure, and such changes and modifications are intended to fall within the scope of protection of the present disclosure.
Claims
1. A training method for a base classification model, characterized in that: The method comprises: Pre-training a base classification model based on first sample data, where the first sample data includes first sample brightness data and corresponding base categories; inputting the second sample data into a base classification model and outputting a base category corresponding to the second sample data, wherein the second sample data includes second sample brightness data; Obtaining a pseudo label corresponding to the second sample data; The base classification model is updated based on the base category corresponding to the second sample data and the pseudo label corresponding to the second sample data.
2. The method for training a base classification model according to claim 1, wherein: The step of obtaining a pseudo label corresponding to the second sample data includes: Obtaining the output of a specific layer of the base classification model; performing clustering based on the output of a specific layer of the base classification model; Generate a pseudo label corresponding to the second sample data based on the clustering result.
3. The training method of the base classification model according to claim 1, wherein The step of obtaining a pseudo label corresponding to the second sample data includes: Obtaining a corresponding confidence score of a base category corresponding to the second sample data; Selecting a number of second sample data and corresponding base categories according to the confidence level; Semi-supervised learning is performed based on the remaining second sample data after the selection, the selected second sample data, and the corresponding base categories, and pseudo labels corresponding to the remaining second sample data are generated.
4. The training method of the base classification model according to claim 1, wherein The step of updating the base classification model based on the base category corresponding to the second sample data and the pseudo label corresponding to the second sample data includes: Constructing a loss function based on the base category corresponding to the second sample data and the pseudo label corresponding to the second sample data; The base classification model is updated according to the calculation result of the loss function.
5. The method for training a base classification model according to claim 4, wherein: The step of updating the base classification model according to the loss function calculation result specifically includes: Determine whether the loss function is less than a preset threshold: If not, updating the base classification model and returning to the step of inputting the second sample data into the base classification model; If so, stop updating the base classification model.
6. The training method for a base classification model according to claim 5, wherein: When the base classification model is a machine learning model, the sample brightness data includes the brightness data of the current sample position, the corresponding sample brightness data of the neighborhood of the current sample position, and the corresponding sample brightness data of the period before and after the current sample position. The sample brightness data is obtained by taking pictures of the bases contained in the sample, and the period is the photographing period of each base contained in the sample.
7. The base classification training method according to claim 5, wherein: When the base classification model is a deep learning model, the sample brightness data includes the brightness data of each sample position in any field of view, the corresponding sample brightness data of the neighborhood of each sample position, and the sample brightness data corresponding to the period before and after each sample position. The sample brightness data is obtained by photographing the bases contained in the sample, and the period is the photographing period of each base contained in the sample.
8. A base classification method, characterized in that: The method comprises: Obtain sample brightness data to be classified; Inputting the sample brightness data to be classified into a base classification model for processing, wherein the base classification model is trained using the training method according to any one of claims 1 to 6; Output the base category corresponding to the sample brightness data to be classified.
9. A training system for a base classification model, characterized in that: The system comprises: A pre-training module, configured to pre-train a base classification model based on first sample data, wherein the first sample data includes first sample brightness data and corresponding base categories; a classification module, configured to input the second sample data into a base classification model and output a base category corresponding to the second sample data, wherein the second sample data includes second sample brightness data; a pseudo-label generating module, configured to obtain a pseudo-label corresponding to the second sample data; An updating module is used to update the base classification model based on the base category corresponding to the second sample data and the pseudo label corresponding to the second sample data.
10. A base classification system, characterized in that: The system comprises: An acquisition module is used to obtain brightness data of samples to be classified; a processing module, configured to input the sample brightness data to be classified into a base classification model for processing, wherein the base classification model is obtained using the base classification model training system according to claim 8; The output module is used to output the base category corresponding to the sample brightness data to be classified.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements the training method of the base classification model according to any one of claims 1 to 7 or the base classification method according to claim 8.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the training method of the base classification model according to any one of claims 1 to 7 or the base classification method according to claim 8.