Training method and device of classification model, equipment, storage medium and program product
By adjusting parameters and calculating loss values in a multi-label classification model, the problem of inaccurate classification caused by feature imbalance is solved, and the accuracy of data classification is improved, especially in the identification of lesions in medical images and the filtering of nuisance calls.
Patent Information
- Application Number
- CN202111441458.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2041-11-30
AI Technical Summary
Existing multi-label classification models struggle to accurately classify data with imbalanced features, particularly in scenarios such as lesion identification in medical images and harassing call filtering, where classification results are inaccurate.
By acquiring sample data, determining adjustment parameters, and adjusting the sample prediction probability based on the distribution of data labels, the loss value is calculated and the classification model is trained to improve classification accuracy.
It effectively avoids the problem of inaccurate classification results caused by imbalanced data features, and improves the accuracy of lesion identification and nuisance call filtering in medical data.
Smart Images

Figure CN114330499B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of machine learning, and in particular, to a classification model training method and device, equipment, a storage medium and a program product. BACKGROUND
[0002] Data classification is a process of classifying data by its attributes or characteristics. Identifying the value of different levels of data and correctly analyzing the data is the basis for obtaining correct analysis results.
[0003] In related technologies, the data to be classified is usually input into a general classification model, and the classification model classifies the data based on the characteristics of the data to be classified.
[0004] However, when multiple data to be classified have feature imbalance, such as when judging the lesion type of a medical image, most of the data to be classified are non-medical images, and only a small part are medical images with lesions, the classification model will often tend to judge that the data to be classified belongs to the case corresponding to the classification result with a larger feature ratio - that is, the data to be classified belongs to a natural image. Therefore, it is difficult to obtain an accurate classification result when classifying data. SUMMARY
[0005] Embodiments of the present application provide a classification model training method, device, equipment, storage medium and program product, which can avoid the problem of inaccurate classification results caused by uneven feature attributes of data to be detected, and improve the accuracy of classification. The technical solution is as follows.
[0006] In one aspect, a classification model training method is provided, the method comprising:
[0007] Obtaining sample data, the sample data being data in a data set, the data in the data set being labeled with a data label, the data label being used to indicate the reference classification of the data with a label value;
[0008] Determining an adjustment parameter based on the label value distribution of the data label in the data set, the adjustment parameter being an auxiliary parameter applied in a loss calculation process;
[0009] Classifying the sample data by a classification model to obtain a sample prediction probability of the sample data corresponding to the data label;
[0010] Balancing the loss determination process of the sample prediction probability with the adjustment parameter to obtain a loss value;
[0011] The classification model is trained based on the loss value, and a data classification model is obtained, which is used for classifying target data in the range of the data label.
[0012] In another aspect, a training device of a classification model is provided, and the device comprises:
[0013] An acquisition module is configured to acquire sample data, the sample data being data in a data set, the data in the data set being labeled with a data label, and the data label being used to indicate a reference classification of the data by a label value;
[0014] A determination module is configured to determine an adjustment parameter based on a label value distribution of the data label in the data set, the adjustment parameter being an auxiliary parameter applied in a loss calculation process;
[0015] A prediction module is configured to perform classification prediction on the sample data by a classification model to obtain a sample prediction probability of the sample data corresponding to the data label;
[0016] An adjustment module is configured to perform balance adjustment on a loss determination process of the sample prediction probability by the adjustment parameter to obtain a loss value;
[0017] A training module is configured to train the classification model based on the loss value to obtain a data classification model, the data classification model being used for classifying target data in the range of the data label.
[0018] In another aspect, a computer device is provided, comprising a processor and a memory, the memory storing at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by the processor to implement the training method of the classification model according to any one of the above embodiments of the present application.
[0019] In another aspect, a computer readable storage medium is provided, the storage medium storing at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by a processor to implement the training method of the classification model according to any one of the above embodiments of the present application.
[0020] In another aspect, a computer program product or computer program is provided, comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device perform the training method of the classification model according to any one of the above embodiments.
[0021] The technical scheme provided by the embodiments of the present application has at least the following beneficial effects:
[0022] According to the label value distribution of the data label in the data set, the adjustment parameter is determined, the loss value is obtained by adjusting the loss determination process of the sample prediction probability through the adjustment parameter, the classification model is trained by the loss value, the training process of the classification model is realized, and the data classification model is obtained. In application, the target data to be classified is input into the above data classification model to obtain the classification result. Through the above method, the adjustment parameter is determined based on the data in the data set and the data corresponding to the data label, and the obtained sample data is analyzed, which can avoid the problem of inaccurate classification result caused by unbalanced data feature attributes in the data set, and improve the accuracy of classification. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical scheme in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0024] Figure 1 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
[0025] Figure 2 is a flowchart of a training method of a classification model provided by an exemplary embodiment of the present application;
[0026] Figure 3 is a flowchart of a training method of a classification model provided by another exemplary embodiment of the present application;
[0027] Figure 4 is a flowchart of a training method of a classification model provided by another exemplary embodiment of the present application;
[0028] Figure 5 is a flowchart of a training method of a classification model provided by an exemplary embodiment of the present application;
[0029] Figure 6 is a schematic diagram of a network model part of the training method of the classification model provided by an exemplary embodiment of the present application;
[0030] Figure 7 is a structural block diagram of a training device of a classification model provided by an exemplary embodiment of the present application;
[0031] Figure 8is a structural block diagram of a training device of a classification model provided by another exemplary embodiment of the present application.
[0032] Figure 9 is a structural block diagram of a server provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0033] For the purpose, technical solutions and advantages of the present application to be clearer, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0034] First, the terms involved in the embodiments of the present application are briefly introduced.
[0035] Artificial Intelligence (AI): is to use digital computers or digital computer-controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science, which aims to understand the essence of intelligence and produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence is to design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.
[0036] Artificial intelligence technology is a comprehensive discipline, involving a wide range of fields, both hardware and software technologies. Artificial intelligence basic technologies generally include technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.
[0037] Machine Learning (ML): is a multi-disciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, etc. It is a special study of how computers simulate or implement human learning behavior to acquire new knowledge or skills, and reorganize existing knowledge structure to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental approach to making computers intelligent, and its applications are widespread in various fields of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning, etc.
[0038] In the related art, the data to be classified is usually input into a general classification model, and the classification model performs multi-label classification on the data based on the features of the data to be classified. However, when performing multi-label classification by the above method, when there is a feature imbalance in multiple data to be detected, for example, when judging the lesion type of a medical image, when the data to be classified is mostly non-medical images, and only a small part is medical images with lesions, the classification model will often tend to judge that the data to be classified belongs to the case corresponding to the classification result with a larger feature ratio, that is, the data to be classified belongs to a natural image, and therefore a more accurate classification result cannot be obtained when performing multi-label classification.
[0039] In the embodiments of the present application, a training method of a classification model is provided to avoid the problem of inaccurate classification results caused by unbalanced data feature attributes in a data set and improve the accuracy of classification. The training method of the classification model trained by the present application includes at least one of the following scenarios when applied.
[0040] I. Applied in the medical field
[0041] In the medical field, a medical database stores a large number of medical records and pathological images with lesions and a small number of medical records and pathological images without lesions. When analyzing the medical data (pathology, pathological images, etc.) of a patient, the medical data is input into a classification model as data to be classified to obtain the lesion condition corresponding to the medical data. However, the patient may have slightly abnormal indicators but no related lesions. Illustratively, the training method of the classification model provided in the present application is used to analyze the data labels corresponding to the data in the data set (medical record library, pathological image library, etc.), determine the adjustment parameter, adjust the sample prediction probability by the adjustment parameter to obtain the loss value, and train the classification model by the loss value, so that the data classification model trained can better identify whether the medical data to be classified has a lesion. When applied, the medical data to be classified is input into the data classification model, and the lesion condition corresponding to the medical data to be classified can be more accurately obtained. Avoiding the problem that the data classification model tends to judge that the medical data to be classified has a lesion because the medical records and pathological images with lesions stored in the data set account for a large proportion, and more accurate judgment of the lesion condition also helps doctors better analyze the patient's condition.
[0042] II. Applied in information filtering scenarios
[0043] The spam call has become a problem that troubles the operators and mobile phone users, seriously affecting people's normal life and the social image of the operators. The effect of filtering spam calls based on user marking is limited, and many spam calls "escape" the filtering and continue to reach the mobile terminal. At the same time, some cases of being maliciously marked or being marked as "spam calls" due to similar numbers also occur from time to time. Illustratively, the training method of the classification model provided in the present application is used to analyze the data tags corresponding to the data in the data set (spam call marking library), determine the adjustment parameters, adjust the sample prediction probability through the adjustment parameters to obtain the loss value, and train the classification model with the loss value, so that the data classification model obtained by training can better identify whether the data to be classified is a spam call. When applied, the data to be classified is input into the data classification model, and the corresponding marking condition of the data to be classified can be more accurately obtained.
[0044] It is worth noting that the above application scenarios are only illustrative examples, and the training method of the classification model provided in the present embodiment can also be applied to other scenarios, which are not limited by the present embodiment.
[0045] Secondly, the implementation environment involved in the present embodiment is described, and illustratively, please refer to Figure 1 The implementation environment involves a terminal 110 and a server 120, and the terminal 110 and the server 120 are connected through a communication network 130.
[0046] In some embodiments, an application program with a data acquisition function is installed in the terminal 110. In some embodiments, the terminal 110 is used to send target data to the server 120. The server 120 can classify the target data through a data classification model to output a classification result, and feed back the classification result to the terminal 110 for display.
[0047] The data classification model is obtained by training in the following manner: determining an adjustment parameter according to a label value corresponding to a data label, obtaining a loss value based on a sample prediction probability corresponding to sample data and the adjustment parameter, training a classification model based on the loss value, and thereby obtaining the data classification model. Illustratively, the data set stores n data, and the n data correspond to data labels indicated by label values, for example: a data label corresponding to a label value of "0" indicates that the data corresponding to the data label is "without a lesion"; or a data label corresponding to a label value of "1" indicates that the data corresponding to the data label is "with a lesion". Based on the obtained sample data, the sample prediction probability is predicted by matching the sample label corresponding to the sample data with the n data labels corresponding to the data in the data set to which the sample data belongs; the loss value is determined based on the sample prediction probability and the adjustment parameter; the classification model is trained based on the loss value, and the data classification model is obtained. The above process is an example of a non-unique case of the data classification model training process.
[0048] It is worth noting that the above terminal includes but is not limited to mobile terminals such as mobile phones, tablet computers, portable laptop computers, smart voice interaction devices, smart home appliances, and vehicle-mounted terminals, and can also be implemented as a desktop computer; the above server can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and big data and artificial intelligence platforms, etc. Basic cloud computing services.
[0049] Among them, cloud technology refers to a kind of hosting technology that unifies a series of resources such as hardware, application programs and network in a wide area network or local area network to realize data calculation, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on cloud computing business model application, which can form a resource pool, and can be used on demand, flexibly and conveniently. Cloud computing technology will become an important support. The background service of the technical network system needs a large amount of calculation and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, every item may have its own identification mark in the future, and needs to be transmitted to the background system for logical processing. Different levels of data will be processed separately, and various industry data will need strong system support, which can only be realized through cloud computing.
[0050] In some embodiments, the above-mentioned server can also be implemented as a node in a blockchain system. Blockchain is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm and other computer technologies. Blockchain, essentially a decentralized database, is a chain of data blocks associated using cryptographic methods, each containing information about a batch of network transactions, used to verify the validity of the information (anti-fake) and generate the next block. The blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.
[0051] In combination with the above-mentioned introduction of terms and application scenarios, the training method of the classification model provided by the present application is described. For example, as shown in Figure 2 The method includes the following steps.
[0052] Step 210, obtaining sample data.
[0053] The sample data is data in a data set. The data set is a set of multiple data, which can be a set of data in a database, data set, or storage space, or all or part of the data in any one database, data set, or storage space. Illustratively, the data set includes at least one of image data, text data, and audio data. The data set can store one type of data (e.g., text data or image data) or multiple types of data (e.g., text data and image data). Optionally, the data set can include multiple categories based on the different types of data stored in the data set. For example, a medical data set, a news data set, etc.
[0054] Optionally, the sample data is at least one data randomly selected from the data set. For example, there are multiple data stored in the data set, and at least one data is randomly selected from the multiple data as sample data, i.e., at least one data is randomly selected from the data set as sample data in an equal probability selection manner.
[0055] Illustratively, taking a medical data set as an example, at least one of the following methods is used to obtain sample data from the data set.
[0056] 1. Obtaining sample data from an existing data set.
[0057] The existing data set includes both open data set that can be known and accessed by the public, such as the Structured Analysis of the Retinal (STARE) database, the Retinal vessel image set for estimation of widths database, and the like common fundus image database, and a synthetic data set composed of at least two data sets, such as a synthetic data set obtained by combining public or non-public medical data, wherein the data in the synthetic data set can be all public data or non-public data, or can be obtained by combining part of the public data and part of the non-public data. Based on the above open data set or synthetic data set, one or more data are obtained as sample data, and the process of obtaining sample data is completed.
[0058] 2. Obtaining sample data from the data set obtained after preprocessing.
[0059] Optionally, considering that different characteristics correspond to different data when analyzing the data, the existing data set can be preprocessed first, and sample data is obtained from the data set after preprocessing.
[0060] In an optional embodiment, data augmentation operation is performed on the initial data to obtain candidate data, and normalization operation is performed on the candidate data to obtain the data set.
[0061] The initial data refers to the data before preprocessing. Optionally, the initial data has the characteristics of small quantity and large exposure difference, and preprocessing is performed on the initial data to reduce the adverse effects in the initial data.
[0062] The data augmentation operation is also referred to as data expansion operation, which means that more data value is generated from limited data without substantially increasing the data, so that the data can obtain better diversity. Illustratively, taking the data expansion operation on image data as an example, the data expansion operation on the image includes: (1) geometric transformation operation, that is, geometric transformation is performed on the image data, for example, flipping operation, rotating operation, cropping operation, deformation operation, scaling operation, and the like, wherein the above geometric transformation operations can be in a random manner (for example, random rotation, random cropping, and the like) or in a fixed manner (for example, fixed angle rotation, fixed scaling, and the like); (2) color transformation operation, that is, part of the content of the image data is adjusted, for example, noise operation, color transformation, and the like. After the initial data is subjected to the above data set augmentation operation, candidate data is obtained, and the candidate data has obvious improvement in the breadth of the data compared with the initial data.
[0063] The normalization operation is to map data into the same scale. Illustratively, taking the normalization operation on image data as an example, first, each pixel in the data image is determined, then the mean of the pixels in the data image is calculated, the standard deviation corresponding to the data image is determined based on the mean (i.e., the sum of squares of the difference between each pixel and the mean of the pixels, divided by the number of pixels), and each pixel in the image data is subtracted from the mean of the pixels and divided by the above standard deviation to realize the normalization operation of the data image.
[0064] The above is only an illustrative example, and the embodiments of the present application are not limited thereto.
[0065] The data in the data set corresponds to a data label, which is used to indicate the data feature corresponding to the data. Illustratively, the sample data is obtained from the data set, and the data label corresponding to the sample data is the sample label.
[0066] Optionally, when the data label indicates the data feature corresponding to the data, the data label indicates the reference classification of the data in the form of label value, i.e., the data label is used to indicate the reference classification of the data in the form of label value.
[0067] The label value refers to the data label being distinguished in the form of a numerical value. Illustratively, the data label is represented in the form of binary, for example, when the label value is "0", it represents "no", when the label value is "1", it represents "yes"; or when the label value is "01", it represents the first data label, when the label value is "10", it represents the second data label, when the label value is "11", it represents the third data label, and when the label value is "00", it represents the fourth data label.
[0068] Optionally, when the data label is distinguished in the form of text (such as Chinese words or English words, etc.), the text form is converted into the form of label value based on the difference between the data labels corresponding to different data. Illustratively, the data label corresponding to A data is "lesion A", and the data label corresponding to B data is "lesion B", and the different data labels are distinguished by different label values. For example, the data label "lesion A" corresponding to A data is converted into the label value "10", and the data label "lesion B" corresponding to B data is converted into "11". Optionally, when the data label corresponding to C data is "lesion A", since the data label corresponding to C data is the same as the data label corresponding to A data, the label value obtained by converting the data label corresponding to C data is "01". The above is only an illustrative example, and the embodiments of the present application are not limited thereto.
[0069] In step 220, based on the distribution of the label value of the data label in the data set, an adjustment parameter is determined.
[0070] wherein the adjustment parameter is an auxiliary parameter applied in the loss calculation process.
[0071] The label value distribution situation is used to indicate the situation obtained by analyzing the label values corresponding to different data labels.
[0072] Illustratively, when the label values corresponding to the data labels are binary or the data labels are converted into binary, the label values corresponding to each data label are analyzed, and according to the pre-set first value, the label value distribution situation can be determined. For example, the pre-set first value is "1", and the label values corresponding to the plurality of data labels are "001", "010", "100", "101", and "110", respectively. The label values corresponding to the plurality of data labels are analyzed, and first, the number of first values in the label values corresponding to each data label is determined, which is "1", "1", "1", "2", and "2", respectively. Then, based on the number of first values corresponding to each data label, all data labels are comprehensively analyzed to determine the label value distribution situation, for example, the label value distribution situation is the sum of the first values divided by the number of data labels, that is, the label value is 1.4 (7 ÷ 5 = 1.4). The above is only an illustrative example, and the embodiments of the present application are not limited thereto.
[0073] In step 230, the sample data is classified and predicted by the classification model to obtain a sample prediction probability of the data label corresponding to the sample data.
[0074] Classification is a process of classifying existing data according to the attributes or characteristics of the data, and a classification model is a model used to implement the classification process, also known as a classifier. Through the classification model, data can be divided according to the attributes and characteristics of the data. Common classification models include: a convolutional neural network image classification model (CNN), a logistic regression model, a decision tree model, etc.
[0075] In order to improve the classification accuracy of the classification model, the classification model is usually trained based on the sample data on the basis of the classification model, for example: the classification model is taken as a to-be-trained model, and the classification model is trained under one or more sample data, so that the classification model can better identify the classification category of the data and improve the classification accuracy of the classification model.
[0076] In an optional embodiment, the sample data is obtained randomly from the data set, and the sample data is input into the classification model. The classification model can match the sample data with the data in the data set, and output the sample prediction probability. The sample prediction probability is the prediction result of the sample data and the plurality of data labels output by the classification model.
[0077] Illustratively, the sample data is input into the classification model, the classification model matches the sample data with the data labels corresponding to the data in the data set, and determines the sample prediction probability according to the matching results of the sample data and each data label. For example, the data set M stores a plurality of data, and the data labels corresponding to the plurality of data include data label a, data label b and data label c. The sample data m is obtained from the data set M, and the sample data m is matched with the data label a, the data label b and the data label c respectively, and the sample prediction probabilities obtained are 0.1, 0.2 and 0.7 respectively.
[0078] In step 240, the loss value is obtained by adjusting the loss determination process of the sample prediction probability with the adjustment parameter.
[0079] The sample prediction probability is the result obtained after matching the sample data with the data in the data set. The sample prediction label is used to indicate the difference between the sample data predicted by the classification model and the data matched therewith, and can reflect the difference between the prediction label corresponding to the sample data predicted by the classification model and the real label corresponding to the sample data (the real label belongs to the data label).
[0080] In the process of solving the loss value according to the sample prediction probability, there may be a problem of uneven distribution of features of the data in the data set. Illustratively, the data set is 1000 images obtained on any website, and the images include landscape images, person images, building images, medical images, etc. When the target of classifying the images is to determine the category of the lesion (used to indicate the part of the body where the pathological change occurs) from the 1000 images, since the lesion belongs to medical terminology and is more suitable for medical picture analysis process, the probability of the lesion existing in the images obtained at random is small, so the classification model tends to judge that the image does not have a lesion. When a certain image is an image with a lesion, the classification model also tends to judge that the image does not have a lesion, i.e. the judgment is wrong.
[0081] Considering the above-mentioned feature imbalance problem of the data, the adjustment parameter is introduced into the loss value determination process, and the sample prediction probability is adjusted by the adjustment parameter, which can assist in adjusting the influence of different features corresponding to different data on the classification model, so as to determine the loss value.
[0082] In an optional embodiment, the loss value is calculated by a loss function, and the loss function is a pre-set function. The sample prediction probability and the adjustment parameter are substituted into the loss function to calculate the loss value.
[0083] Illustratively, the sample prediction probability output by the classification model is obtained, and the sample prediction probability includes the prediction probability corresponding to each data in the data set and the sample data.
[0084] Illustratively, the data set is M, the data stored in the data set includes data m1, data m2, and data m3, the sample data is N, the sample prediction probability corresponding to the sample data N and the data m1, the data m2, and the data m3 is 0.7, 0.1, and 0.2, respectively, and the sample prediction probability and the adjustment parameter are substituted into the loss function to determine the loss value corresponding to the sample data N. In addition, the above sample prediction probability is described by taking the soft label output by the classification model as an example. In some embodiments, the sample prediction probability output by the classification model can also be implemented as a hard label, that is, the sample data N is input into the classification model, and the classification model outputs the sample prediction probability corresponding to the three data labels a, b, and c as "1, 0, 0", which is not limited in this embodiment.
[0085] In step 250, the classification model is trained by the loss value to obtain a data classification model.
[0086] The data classification model is used to classify the target data in the data label range.
[0087] In an optional embodiment, based on the loss value, the model parameters of the classification model are adjusted to obtain a candidate classification model; and in response to that the training of the candidate classification model based on the loss value reaches a training target, the data classification model is obtained.
[0088] Illustratively, the model parameters of the classification model are adjusted to reduce the loss value, such as using the gradient descent method to reduce the loss value, or using the back propagation algorithm to reduce the loss value, and the like.
[0089] Optionally, based on the loss value corresponding to one sample data, the model parameters of the classification model can be adjusted at least once. When there are multiple sample data, the model parameters of the classification model need to be adjusted multiple times. The purpose of adjusting the model parameters of the classification model is to obtain a trained data classification model. Illustratively, in the process of adjusting the model parameters of the classification model to obtain the data classification model, the model that has been adjusted but has not yet reached the condition of the data classification model can be referred to as a candidate classification model, that is, the candidate classification model is the model obtained after adjusting the model parameters of the classification model. Because the training is not complete, the candidate classification model is an intermediate state model.
[0090] Illustratively, a plurality of sample data is randomly obtained from the data set, and the classification model is trained on the premise that the classification model is trained once for each sample data. For example, the loss value corresponding to each sample data is determined after determining the adjustment parameter and performing probability prediction and loss calculation on each sample data; then, the candidate classification model is obtained after the first loss value corresponding to the first sample data is used to adjust the classification model for the first time; and then, the candidate classification model is trained by using the second loss value corresponding to the second sample data. Alternatively, the same sample data can also be used to train the classification model once or multiple times. The above is only an illustrative example, and the embodiments of the present application are not limited in this regard.
[0091] Alternatively, in the process of training the candidate classification model by using the loss value, the data classification model can be obtained because the training of the candidate classification model reaches the training target. Illustratively, the training target at least includes the following case.
[0092] 1. In response to the loss value reaching a convergence state, the candidate classification model obtained through the last iteration training is used as the data classification model.
[0093] Illustratively, the loss value reaching the convergence state is used to indicate that the numerical value of the loss value obtained by the loss function no longer changes or the change amplitude is less than a preset threshold. For example, the loss value corresponding to the nth sample data is 0.1, and the loss value corresponding to the (n+1)th sample data is also 0.1. It can be considered that the loss value reaches the convergence state, and the candidate classification model adjusted by the loss value corresponding to the nth sample data or the (n+1)th sample data is used as the data classification model, thereby realizing the training process of the classification model.
[0094] 2. In response to the number of times of obtaining the loss value reaching a number threshold, the candidate classification model obtained through the last iteration training is used as the data classification model.
[0095] Illustratively, one loss value can be obtained once, and the number of times of obtaining the loss value used to train the classification model is preset. When one sample data corresponds to one loss value, the number of times of obtaining the loss value is the number of sample data. Alternatively, when one sample data corresponds to a plurality of loss values, the number of times of obtaining the loss value is the number of loss values. For example, it is preset that one loss value can be obtained once, and the number threshold of the times of obtaining the loss value is 10. When the number threshold of the times of obtaining the loss value is reached, the candidate classification model adjusted by the last loss value is used as the data classification model, or the candidate classification model adjusted by the minimum loss value in the process of adjusting the loss value for 10 times is used as the data classification model, thereby realizing the training process of the classification model.
[0096] In an optional embodiment, the target data is input into the data classification model, and the classification result corresponding to the target data is determined.
[0097] The classification result is used to indicate a label category to which the target data belongs.
[0098] The target data is data to be classified. Illustratively, after obtaining the data classification model, the data classification model is applied, the target data is classified by the data classification model, the matching condition of the target data with each data corresponding to the data classification model is determined, and the label category is determined.
[0099] The label category is used to indicate the category condition of the target data. Illustratively, the target data is a cell nucleus pathology image, the cell nucleus pathology image is input into the classification model for classification, and the classification result corresponding to the cell nucleus pathology image is determined. Illustratively, the cell nucleus pathology image is matched with a plurality of pre-set data labels, and when the matching probability exceeds a pre-set threshold, the data label is determined as the classification result corresponding to the cell nucleus pathology image. The classification result can indicate the label category (the category corresponding to the data label) of the target data. Alternatively, the data label can have multiple indication conditions according to the corresponding label value, for example: the label value of the matched data label indicates that the cell nucleus pathology image has A lesions, G lesions, and I lesions. The above is only an illustrative example, and the embodiments of the present application are not limited in this regard.
[0100] In summary, sample data is obtained, the data in the data set to which the sample data belongs is respectively labeled with a data label, the data label indicates the reference classification of the data through the label value, the label value distribution of the data label in the data set is determined according to the label values corresponding to the plurality of data labels in the data set, the adjustment parameter in the loss value calculation process of the classification model is determined through the label value condition, the sample prediction probability is obtained after the classification model classifies and predicts the sample data, and is used to represent the matching result of the sample data and the data label. The loss value is obtained after the loss determination process of the sample prediction probability is balanced by the adjustment parameter, the classification model is trained by the loss value, the training process of the classification model is realized, and the data classification model is obtained. In application, the target data to be classified is input into the above data classification model to classify the target data. Through the above method, the adjustment parameter is determined based on the data in the data set and the data label corresponding to the data, the sample data is analyzed, the problem of inaccurate classification result caused by unbalanced data feature attributes in the data set can be avoided, and the accuracy of classification is improved.
[0101] In an optional embodiment, the data label includes a first label and a second label based on the label value, and the process of determining the adjustment parameter is based on the value distribution corresponding to the first label and the second label respectively. Illustratively, as shown in Figure 3 the aboveFigure 2 The illustrated embodiment can also be implemented as steps 310 to 360.
[0102] Step 310, obtaining sample data.
[0103] The sample data is data in a data set, and the data in the data set corresponds to a data label indicating the data characteristics corresponding to the data. Optionally, the data label indicates the reference classification of the data by using the label value when indicating the data characteristics corresponding to the data, i.e., the data label is used to indicate the reference classification of the data by using the label value. The label value refers to the data label being distinguished in the form of a numerical value.
[0104] Step 320, determining the first value distribution of the first type of label and the second value distribution of the second type of label based on the label value corresponding to the data label and the number of data in the data set.
[0105] Illustratively, the number of data in the data set is fixed, for example, in one analysis process, the number of data in the data set is 100, and the first value distribution of the first type of label and the second value distribution of the second type of label are determined based on 100 data in one analysis process.
[0106] The label value of the data label includes the first value or the second value. Optionally, the first value and the second value are numerical values determined according to a pre-set value rule, for example, the label value adopts a binary form, and the first value is set as "1" and the second value is set as "0"; or the first value is set as "0" and the second value is set as "1".
[0107] The first type of label and the second type of label are divided based on the difference in the label value. In an optional embodiment, the first type of label and the second type of label are determined according to the first value or the second value based on the label value. In response to the presence of at least one first value in the label value corresponding to the data label, the data label is determined as the first type of label; in response to the presence of the second value in the label value corresponding to the data label, the data label is determined as the second type of label.
[0108] Optionally, the first type of label and the second type of label are determined based on the number of the first value or the second value. Illustratively, the label value corresponding to the data label is represented in binary form, the pre-set value rule is that the first value is "1" and the second value is "0", and the first type of label and the second type of label are determined according to the relationship between the first value or the second value in the label value and the number threshold condition through the pre-set number threshold condition, wherein the number threshold condition includes at least one of the following situations.
[0109] 1. The quantity threshold condition is that when the number of first values is not less than the quantity threshold, the data label corresponding to the label value of the tag is a first class label.
[0110] The quantity threshold is a positive integer. Illustratively, the pre-set quantity threshold is 3, and when the number of first values is not less than 3 (i.e., the number of first values is greater than or equal to 3), the data label corresponding to the label value of the tag is a first class label. For example, the label value corresponding to the data label is "0011110", wherein the number of first values "1" is 4, which is greater than the pre-set quantity threshold 3, so the data label is determined to be a first class label; or, the label value corresponding to the data label is "0010100", wherein the number of first values "1" is 2, which is less than the pre-set quantity threshold 3, so the data label is not a first class label.
[0111] Alternatively, the pre-set quantity threshold is 1, and when the number of first values is not less than 1 (i.e., the number of first values is greater than or equal to 1), the data label corresponding to the label value of the tag is a first class label. For example, when the label value is "01", it represents data label a1, when the label value is "10", it represents data label a2, when the label value is "11", it represents data label a3, and when the label value is "00", it represents data label a4. Among them, the label value "01", the label value "10", and the label value "11" meet the condition that the number of first values in the label value is not less than 1, so the data label a1 corresponding to the label value "01", the data label a2 corresponding to the label value "10", and the data label a3 corresponding to the label value "11" are first class labels.
[0112] 2. The quantity threshold condition is that when the number of second values is less than the quantity threshold, the data label corresponding to the label value of the tag is a second class label.
[0113] The quantity threshold is a positive integer. Illustratively, the pre-set quantity threshold is 2, and when the number of second values is less than 2, the data label corresponding to the label value of the tag is a second class label. For example, the label value corresponding to the data label is "0011110", wherein the number of second values "0" is 3, which is greater than the pre-set quantity threshold 2, so the data label is not a second class label; or, the label value corresponding to the data label is "0111", wherein the number of second values "0" is 1, which is less than the pre-set quantity threshold 2, so the data label is a second class label.
[0114] Optionally, the preset quantity threshold is 1, and when the quantity of the second values is less than 1 (i.e., the quantity of the second values is 0), the data label corresponding to the label value is the second type of label. For example, when the label value is "01", the quantity of the second values "0" is 1, which is equal to (not less than) the preset quantity threshold 1, so the data label is not the second type of label; or the label value corresponding to the data label is "000", the quantity of the second values "0" is 0, which is less than the preset quantity threshold 1, so the data label is the second type of label.
[0115] Optionally, when the type of the data label is the first type of label or the second type of label, in a case where the type of a certain data label does not satisfy the first type of label, the data label is determined to be the second type of label. The above is only an illustrative example, and the embodiments of the present application are not limited thereto.
[0116] In an optional embodiment, the label value corresponding to the data label is analyzed, the quantity of the first values in the label value corresponding to each data label is determined, the average of the quantity of the first values corresponding to the data set is determined as the first value distribution, the quantity of the second type of label is determined, and the average of the quantity of the second type of label corresponding to the data set is determined as the second value distribution.
[0117] Optionally, the label value is determined in advance according to the type of the data label. In the case of binary label value, when the type of the data label to be represented is four, the label value can be represented in the form of "00", "01", "10" and "11"; when the type of the data label to be represented is eight, the label value can be represented in the form of "000", "001", "010", "011", "100", "101", "110" and "111"; optionally, when the type of the data label to be represented is six, the label value is determined in a preset manner from the above-mentioned eight label value forms, for example, "000", "001", "010", "011", "100" and "101" are preset as the six label values corresponding to the data label.
[0118] When the eight types of data labels are analyzed, if the first value is "1", the number of the first value in the eight label values "000", "001", "010", "011", "100", "101", "110" and "111" is determined, and the number of the first value is respectively 0, 1, 1, 2, 1, 2, 2 and 3. Illustratively, after the number of the first value is determined, according to the number of data in the data set (for example, the number of data in the data set is 20), the sum of the number of the first value is taken as the dividend (0+1+1+2+1+2+2+3=10), the number of data in the data set is taken as the divisor, and the average (quotient) obtained by solving is determined as the first value distribution, that is, the first value distribution is 10 / 20=0.2. Illustratively, the second type of label is the label without the first value, and the second type of label is "000" in the eight label values, and the number of the second type of label is 1. The number of the second type of label is taken as the dividend, the number of data in the data set is taken as the divisor, and the average (quotient) obtained by solving is determined as the second value distribution, that is, the second value distribution is 1 / 20=0.05.
[0119] In step 330, the adjustment parameter is determined based on the first value distribution and the second value distribution.
[0120] In an optional embodiment, the adjustment parameter includes a first parameter corresponding to the first value distribution and a second parameter corresponding to the second value distribution. The first parameter corresponding to the first type of label is determined based on the first type of label, the first value distribution and the number of data labels; and the second parameter corresponding to the second type of label is determined based on the second type of label, the second value distribution and the number of data labels.
[0121] Optionally, the first parameter and the second parameter include at least one of the following determination methods.
[0122] 1. Obtained by formula calculation.
[0123] Optionally, the calculation formula of the adjustment parameter is as follows.
[0124]
[0125] Wherein, r is used to indicate the adjustment parameter; l is used to indicate the label distribution; c is used to indicate the number of data labels.
[0126] The first parameter and the second parameter can be calculated by the above formula. When calculating the first parameter, the first parameter is represented by r1; the label distribution corresponding to the first parameter is the first value distribution l1; and the number of data labels is c, so the first parameter can be determined based on the number l1 of the first value distribution and the number c of data labels. When calculating the second parameter, the second parameter is represented by r2; the label distribution corresponding to the first parameter is the number l2 of the first value distribution; and the number of data labels is c, so the first parameter can be determined based on the number l2 of the first value distribution and the number c of data labels.
[0127] 2. Adjusting the first parameter to obtain the second parameter.
[0128] Alternatively, after the first parameter is calculated by using the above adjustment parameter formula, the second parameter is determined based on the first value distribution and the second value distribution according to the first parameter. Illustratively, the first value distribution is 2.9, the second value distribution is 0.3, and the number of data labels is 80. The first parameter r1 calculated by using the above adjustment parameter formula is about 0.038 (2.9 / 80-2.9). Comparing the number corresponding to the first value distribution and the number corresponding to the second value distribution, because 2.9 is greater than 0.3, the number of the first type of labels corresponding to the first value distribution in the data is greater than the number of the second type of labels corresponding to the second value distribution, so the first value distribution has a greater influence on the classification model, and accordingly, the number of the first parameter corresponding to the first value distribution is greater than the number of the second parameter corresponding to the second value distribution, that is, the number of the adjusted second parameter is less than the number of the first parameter. Based on the number of the first parameter r1 being 0.038, the number of the second parameter is adjusted, for example, the number of the second parameter is adjusted to 0.01 or 0.008, etc. The above is only an illustrative example, and the embodiments of the present application are not limited in this regard.
[0129] Step 340, classifying and predicting the sample data by the classification model to obtain a sample prediction probability of the data label corresponding to the sample data.
[0130] The sample prediction probability is a prediction result of sample data output by a classification model and a plurality of data labels respectively corresponding to the sample data. Illustratively, after the sample data X is input into the classification model, the classification model matches the sample data X with the data labels respectively, wherein the data labels are four, and the label values corresponding to the data labels are "00", "01", "10" and "11" respectively. It is known that the sample matching probabilities obtained after matching the sample data X with the above four data labels are 0.1, 0.2, 0.2 and 0.5 respectively. When the first value is 1, based on the division standard between the first type of label and the second type of label (there is at least one first value in the label value corresponding to the first type of label; there is no first value in the label value corresponding to the second type of label), it is determined that the first type of label is "01", "10" and "11"; and the second type of label is "00". Optionally, the sample prediction probability corresponding to the first type of label is involved in the loss value calculation.
[0131] In step 350, the loss determination process of the sample prediction probability is balancedly adjusted by the adjustment parameter to obtain the loss value.
[0132] In an optional embodiment, the first loss determination process of the sample prediction probability is balancedly adjusted by the first parameter to determine the first loss; the second loss determination process of the sample prediction probability is balancedly adjusted by the second parameter to determine the second loss; and the sum of the first loss and the second loss is taken as the loss value.
[0133] Optionally, in order to adjust the influence of different types of labels (the first type of label and the second type of label) on the sample prediction probability, the sample prediction probability is balancedly adjusted by corresponding different parameters (the first parameter and the second parameter) respectively. Illustratively, taking the sample prediction probability corresponding to the first type of label as an example, after the first parameter is determined, the process of adjusting the first loss determination process of the sample prediction probability by the first parameter is determined by using the first loss formula.
[0134]
[0135] wherein, L + is used to indicate the first loss of the first type of label in the first loss determination process; p is the sample prediction probability; r + is the first parameter corresponding to the first type of label.
[0136] Illustratively, after the second parameter is determined, the process of adjusting the second loss determination process of the sample prediction probability by the second parameter is determined by using the second loss formula.
[0137]
[0138] wherein, L -L is used to indicate the second loss of the second class label in the second loss determination process; p is the sample prediction probability; r is the first parameter corresponding to the first class label. - L is used to indicate the second loss of the second class label in the second loss determination process; p is the sample prediction probability; r is the first parameter corresponding to the first class label.
[0139] Optionally, the first loss L of the first class label in the first loss determination process is obtained + and the second loss L of the second class label in the second loss determination process is obtained - Then, the first loss L of the first class label is added to the second loss L of the second class label, that is: + -
[0140] L = L + + L -
[0141] Wherein, L is used to indicate the loss value, and p is the loss value corresponding to the sample prediction probability.
[0142] In an optional embodiment, the above loss value determination process is applied to a binary case, wherein the first class label is "1"; the second class label is "0", and the above first loss formula and second loss formula are deformations of the following formula.
[0143]
[0144]
[0145] Wherein, L + ' is used to indicate the first loss under the binary; y is the first class label; p is the sample prediction probability; r + is the first parameter corresponding to the first class label.
[0146] L - ' is used to indicate the second loss under the binary; 1-y is the second class label (since it is under the binary, the first class label y is 1, so 1-y is used to represent the second class label); r - is the second parameter corresponding to the second class label.
[0147] Step 360, training the classification model by the loss value to obtain a data classification model.
[0148] Based on the above calculation formula, after determining the loss value of the classification model, the classification model is trained based on the loss value.
[0149] In an optional embodiment, the model parameters of the classification model are adjusted based on the loss value to obtain a candidate classification model; and the data classification model is obtained in response to that the training of the candidate classification model based on the loss value reaches a training target. Illustratively, the model parameters of the classification model are adjusted to reduce the loss value, such as using a gradient descent method to reduce the loss value, or using a back propagation algorithm to reduce the loss value, and the like.
[0150] Optionally, the classification model is trained by using a stochastic gradient descent (SGD) method, a gradient is calculated for each randomly selected sample data, the training speed is relatively fast, and the calculation efficiency is relatively high. Illustratively, the initial learning rate of the classification model is set to 0.001, and a momentum of 0.9 and a reduction rate of 0.0001 are used to gradually reduce the learning. Optionally, each data in the data set is used as sample data to participate in the training process of the classification model, each data set includes a plurality of data (for example, a data set includes 16 image data), and the data in the data set is passed through the classification model multiple times. For example, 400 epochs are trained, wherein an epoch is used to indicate that all data in the data set is completely passed through the classification model once as sample data.
[0151] In an optional embodiment, the target data is input into the data classification model to determine the classification result corresponding to the target data.
[0152] The classification result is used to indicate the label category to which the target data belongs.
[0153] The target data is data to be classified. Illustratively, after obtaining the data classification model, the data classification model is applied, the target data is passed through the data classification model, the target data is classified by the data classification model, the matching condition of each data corresponding to the target data and the data classification model is determined, and the label category is determined.
[0154] In summary, according to the label value distribution of the data labels in the data set, the adjustment parameters are determined according to the label value distribution, the sample prediction probability is obtained after the classification model classifies and predicts the sample data, the loss value is obtained after the sample prediction probability is balanced by the adjustment parameters, and the data classification model is obtained by training the classification model based on the loss value. By the above method, the problem that the classification result is inaccurate due to the unbalanced data feature attributes in the data set can be avoided, and the accuracy of classification is improved.
[0155] In the embodiments of the present application, the process of determining the adjustment parameter according to the label value is described. The data label according to the difference of the label value includes a first type of label and a second type of label (for example, according to the difference in the number of first values in the label value). Based on the label value corresponding to the data label and the number of data in the data set, the first value distribution of the first type of label and the second value distribution of the second type of label are determined. Based on the first value distribution and the second value distribution, the adjustment parameter for adjusting the influence degree of the sample prediction probability on the classification model is determined. Adjusting the sample prediction probability obtained in the prediction process of the classification model by the adjustment parameter can effectively avoid the problem of inaccurate classification effect caused by the imbalance between the number of the first type of label and the second type of label in the data set.
[0156] In an optional embodiment, the classification prediction of the sample data by the classification model is determined by the feature vector corresponding to the sample data. Illustratively, as shown in Figure 4 the above Figure 2 The step 230 in the embodiment shown above can also be implemented as steps 410 to 430.
[0157] Step 410: performing convolution operation on the sample data by the classification model to obtain at least two feature vectors corresponding to the sample data.
[0158] Illustratively, the sample data is a sample image, and the classification model adopts a classification convolutional neural network, for example, a residual network (ResNet), a split attention network (ResNest), a two-dimensional object recognition network (VGG), etc.
[0159] In an optional embodiment, the information features are divided according to the difference between the at least two information features; and the at least two information features are respectively subjected to convolution operation by the convolution module in the classification model to obtain the feature vector corresponding to the sample data.
[0160] Optionally, the sample image is input into the classification model, the classification model spontaneously pays attention to different information based on the differences between the information features in the sample image, and divides the information features. Based on the division result, the classification model performs at least one convolution operation on the at least two information features through a convolution module. Illustratively, the convolution module is a convolution layer in a classification convolutional neural network, and the input sample image is in RGB format (Red; Green; Blue). The convolution kernel in the convolution layer is convolved with the input sample image to obtain a feature vector corresponding to the sample data. Wherein, the convolution kernel represents the meaning of weight in the classification convolutional neural network, and the convolution operation of the convolution kernel and the input sample image means that the weight corresponding to the convolution kernel is multiplied by the pixel at the corresponding position in the sample image. Based on the multiplication result, a feature vector corresponding to the sample data is obtained.
[0161] Step 420, performing weight analysis on the at least two feature vectors through the classification model to determine the weight results corresponding to the at least two feature vectors.
[0162] Illustratively, after obtaining the at least two feature vectors corresponding to the sample image according to the classification model, in order to improve the learning ability of the classification model, weight analysis is performed on the feature vectors to determine the weight results corresponding to the at least two feature vectors respectively. Based on the weight results, the influence of different feature vectors on the classification model can be determined.
[0163] Step 430, based on the weight results, classifying and predicting the sample data to determine the sample prediction probability of the data label corresponding to the sample data.
[0164] In an optional embodiment, based on the weight results, the at least two feature vectors are fused to determine a sample vector corresponding to the sample data; the sample vector is matched with a data label set to determine the sample prediction probability of the data label corresponding to the sample data.
[0165] Optionally, after determining the multiple feature vectors corresponding to the sample image and the weight results corresponding to each feature vector, the at least two feature vectors are fused based on the at least two feature vectors and the weight results corresponding to each feature vector to determine the representation results of the at least two feature vectors.
[0166] Illustratively, four feature vectors are extracted from the sample image, and the weight results corresponding to the four feature vectors are determined. The four feature vectors and the corresponding weight results are weighted (weighted average operation or weighted summation operation) to complete the nonlinear combination operation of the four feature vectors.
[0167] Optionally, the representation results corresponding to the at least two feature vectors are spliced to determine a sample vector corresponding to the sample data. Illustratively, the representation results corresponding to the at least two feature vectors are spliced in a vector splicing manner, thereby determining the sample vector of the sample data corresponding to the at least two feature vectors.
[0168] The data label set is a set of data labels, that is, the data label set includes at least one data label.
[0169] Optionally, each data set corresponds to a data label set, and the data label set includes at least one data label for indicating the same feature of part or all of the data in the data set. Illustratively, the A data set includes data A1, data A2, data A3, data A4, and data A5, the A data set corresponds to an a data label set, and the a data label set includes data labels a1 and a2, wherein data A1, data A2, and data A3 are labeled with data label a1, that is, data A1, data A2, and data A3 have the same feature and can be embodied by data label a1; similarly, data A4 and data A5 are labeled with data label a2, that is, data A4 and data A5 have the same feature and can be embodied by data label a2. Optionally, the data in the data set has a corresponding data label, and different data can correspond to the same data label. When some or several data in the data set do not have the same feature as other data, the data can be divided by using the identification mode of other labels.
[0170] In summary, according to the label value distribution of the data labels in the data set, the label value distribution of the data labels in the data set is determined, the adjustment parameter is determined by the label value distribution, and the sample prediction probability is obtained after the classification model classifies and predicts the sample data. The loss value is obtained after the sample prediction probability is balanced by the adjustment parameter, and the data classification model is obtained by training the classification model with the loss value. Through the above method, the problem of inaccurate classification results caused by unbalanced data feature attributes in the data set can be avoided, and the accuracy of classification can be improved.
[0171] In the embodiments of the present application, the process of classifying sample data is described. The classification model performs convolution operation on the obtained sample data through the convolution module to obtain at least two feature vectors corresponding to the sample data, then analyzes the weights of the at least two feature vectors to determine the weight results corresponding to the at least two feature vectors, and classifies and predicts the sample data based on the weight results to determine the sample prediction probability of the data label corresponding to the sample data. Through the above method, the sample data is more comprehensively analyzed from the global to the part, which is helpful for the training process of the classification model.
[0172] In an optional embodiment, the data can be classified by the above-mentioned data classification model, that is, each target data can correspond to one or more classification labels, so as to realize the process of multi-label classification of data. As shown in Figure 5 illustrated, the training method of the classification model is applied to the classification of fundus fluorescence angiography image data, and the process of training the data classification model by the training method of the classification model includes: (1) a data processing part 510; (2) a network model part 520; and (3) a loss function part 530.
[0173] (1) Data processing part 510
[0174] Fluorescein fundus angiography (FFA, Fluorescein Fundus Angiography) is one of the common examination methods for diagnosing fundus diseases in current ophthalmology, which can record the dynamic changes of fundus by the fluorescence emitted by intravenous injection of fluorescein in the blood flow in the eye.
[0175] As an example, in view of the characteristics of a small number of fundus images and large exposure differences, data enhancement and data normalization operations are performed on the fundus images. As an example, the fundus image is taken as a sample image, and random rotation, scaling and mirror operations are performed on the sample image to expand the scope of the sample image. Then, each pixel of the sample image is subtracted from the mean value of the image and divided by the standard deviation of the sample image to realize the normalization operation, so as to reduce the image attribute changes caused by different analysis instruments.
[0176] (2) Network model part 520
[0177] As shown in Figure 6 , the classification model is a CNN network. As an example, the ResNest model is used as the CNN network to illustrate the process of classifying sample data.
[0178] As an example, the sample data is a sample image. First, the sample image 610 is input into the ResNest model in the format of (h, w, c), where h represents the height of the sample image 610, w represents the width of the sample image 610, and c represents the number of channels of the sample image 610 (generally referring to RGB three channels).
[0179] Afterwards, the sample image 610 is input into different cardinal modules 620 (Cardinal1 to Cardinalk) respectively. Optionally, different cardinal modules have the same parameters for comprehensive analysis of the sample image 610 from multiple angles. Different cardinal modules 620 include m splits 630 (split1 to splitm), and different splits 630 focus on different information in the sample image 610. For example, the sample image is a pathological image, split 1 focuses on information related to A lesion in the pathological image, and split 2 focuses on information related to B lesion in the pathological image. Illustratively, the way in which different splits 630 focus on lesion information can be pre-set or spontaneously performed by different splits 630 (spontaneous process: different splits perform different initializations, and as different splits analyze different sample images, the performance of the classification model improves accordingly, and the splits can spontaneously focus on more different information), wherein the information focused on by different splits 630 can have a repetitive relationship, for example, split i and split j focus on the same information, or the information focused on by split i and split j overlaps. In addition, different splits 630 have their own transformation methods, for example, in split 1, there are independent convolution modules 640 (for example, 1x1 convolution module and 3x3 convolution module). Optionally, after the sample image 610 is subjected to 1x1 convolution module to obtain a feature vector, the feature vector is further subjected to 3x3 convolution module for further convolution, thereby increasing the nonlinear fitting capability of split 1.
[0180] Taking cardinal module 1 as an example, in cardinal module 1, after the sample image 610 is subjected to convolution operation by the convolution modules 640 of the m splits 630 (split1 to splitm) respectively, a plurality of feature vectors are obtained, and the plurality of feature vectors are subjected to split attention module 650 (Split Attention) to obtain the representation corresponding to cardinal module 1. Illustratively, split 1 focuses on information related to A lesion in the above-mentioned pathological image, split 2 focuses on information related to B lesion in the pathological image, and split m focuses on information related to M lesion in the pathological image. The lesion information focused on by the above-mentioned split 1 to split m constitutes the information of the sample image, and the feature vectors corresponding to the lesion information focused on by the m splits 630 are subjected to the split attention module 650 to fully fuse different information, thereby obtaining the representation corresponding to the cardinal module 1. Similarly to the cardinal module 1, the cardinal module 2 to the cardinal module k obtain the respective representations corresponding to the cardinal module 2 to the cardinal module k through the above-mentioned splits 630, convolution modules 640 and split attention module 650.
[0181] In the process of inputting the sample image 610 into each base module, the number of channels of the sample image changes, that is, the format of the sample image after passing through the base module is (h, w, c' / k), c' is pre-set, and is usually greater than c. In the operation of c' / k / r in the 1x1 convolution module, r represents a shrinkage factor, which is used to reduce the dimension of the feature information and then restore the dimension, so as to maintain the most valuable information in the sample image.
[0182] Finally, after the representations output by the base module 1 to the base module k are spliced through the splicing module 660, the global information of the sample image is combined to pass through the 1x1 convolution module 670, and the sample vector corresponding to the sample image is obtained. The sample vector is obtained by analyzing the same sample image by different base modules, and the cross-channel interaction and information integration between different base modules are realized through the 1x1 convolution module 670.
[0183] In an optional embodiment, at least one feature vector is obtained by each convolution module. Each convolution module is regarded as a channel, for example, in the above-mentioned ResNest model, there are k base modules, m groups in each base module, and 1x1 convolution module and 3x3 convolution module (that is, two convolution modules) in each group. Therefore, there are 2xkxm channels in the ResNest model. Optionally, a channel attention mechanism is used to determine the weight corresponding to each channel, and important channels are emphasized by giving them higher weights.
[0184] In an optional embodiment, the above-mentioned ResNest model is used multiple times in the process of analyzing the sample image. After the feature vector is obtained by extracting the vector of the sample image, in order to avoid the problem of unbalanced classification of the feature vector, feature selection operation is performed on at least two feature vectors. Illustratively, down-sampling operation is performed on at least two feature vectors. For example, the size of the sample image is 1, after the sample image passes through the above-mentioned ResNest model, a down-sampling module is used to make the size of the sample image become 1 / 4, and after the sample image with the size of 1 / 4 passes through the above-mentioned ResNest model again, a down-sampling module is used to make the size of the sample image become 1 / 8 of the original sample image. The above process is repeated. When the sample image with the size of 1 is subjected to the repeated down-sampling process to have a size of 1 / 32, it means that the sample image is subjected to multiple operations at four levels of [1 / 4, 1 / 8, 1 / 16, 1 / 32].
[0185] The above is only an illustrative example, and the embodiments of the present application are not limited in this regard.
[0186] After the ResNest model, the classification result (classification 1 to classification n) corresponding to the sample image is output.
[0187] (3) Loss function part 530
[0188] Illustratively, in order to match the output dimension of the network with the lesion types of the data for a complex multi-label task, each item of the output corresponds to a type of lesion. The seven main types of lesions in the fundus fluorescein angiography image data include leakage, permeability, accumulation, staining, masking, no perfusion, and vascular abnormalities. A sample image includes one or more of the main types of lesions.
[0189] If there are multiple lesions in a fundus fluorescein angiography image, for example, the output vector is [0, 1, 0, 1, 1, 1, 0], and the corresponding lesion order is leakage, permeability, accumulation, staining, masking, no perfusion, and vascular abnormalities, then the image has four types of lesions, namely, permeability, staining, masking, and no perfusion. However, multi-label classification is prone to serious class imbalance problems, for example, most fundus images obtained using fluorescence angiography have leakage, permeability, accumulation, and staining problems, while about half of the images have masking, no perfusion, and vascular abnormalities problems. This indicates that the first four types of lesions have a serious positive and negative sample imbalance problem, which makes the network more inclined to determine that there is the lesion. Therefore, in order to solve the positive and negative sample imbalance problem, an asymmetric loss function (ASL, Asymmetric Loss) is used to optimize the classification model to obtain a data classification model.
[0190] Optionally, the sample image is labeled with a data label, and the data label includes a positive label or a negative label, for example, the positive label is used to indicate that the sample image has a lesion, and the negative label is used to indicate that the sample image has no lesion; or the positive label is used to indicate that the sample image has no lesion, and the negative label is used to indicate that the sample image has a lesion. Illustratively, when the sample image has a lesion, the sample image is a positive sample, and when the sample image has no lesion, the sample image is a negative sample, that is, the positive sample and the negative sample are used to indicate two kinds of samples with opposite attributes, the positive sample is a sample image with a lesion, and the negative sample is a sample image without a lesion.
[0191] Optionally, when the positive label is used to indicate that the sample image has a lesion, the type of the lesion can be represented by the label value corresponding to the data label. Illustratively, the lesion order is pre-set when the data set is made, and the lesion order is leakage, permeability, accumulation, staining, masking, no perfusion, and vascular abnormalities. The data label of a sample image is "0100100", and each digit in the data label constitutes a label value corresponding to the data label. According to the data label "0100100" and the pre-set lesion order, it can be determined that the sample image is a positive sample (there is "1" in the label value), and the lesion of the sample image includes permeability and masking.
[0192] Generally, the scheme based on the binary cross entropy loss function (BCE, Binary Cross Entropy) will encounter a serious positive and negative sample imbalance problem. The ASL loss function can effectively solve the positive and negative sample imbalance problem and optimize the classification model. Illustratively, the expression of the ASL loss function is as follows.
[0193] L ASL =L + +L -
[0194] Wherein, L ASL is used to indicate the loss value corresponding to the ASL loss function; L + is used to indicate the positive sample loss; L - is used to indicate the negative sample loss, that is, the ASL loss function is composed of two parts of the positive sample loss and the negative sample loss. The positive sample loss is used to indicate the loss value of the positive sample after passing through the classification model, and the negative sample loss is used to indicate the loss value of the negative sample after passing through the classification model. Based on the sum of the positive sample loss and the negative sample loss, the loss value corresponding to the loss function can be determined.
[0195] Illustratively, the positive sample loss L + and the negative sample loss L - are determined based on the data label corresponding to the sample image. Illustratively, the positive sample loss L + and the negative sample loss L - are calculated by the following formula.
[0196]
[0197]
[0198] Wherein, L + is the positive sample loss; p is the sample prediction probability; r + is the adjustment parameter corresponding to the positive sample; L - is the negative sample loss; r - is the adjustment parameter corresponding to the negative sample. Optionally, in the process of determining the loss value, there is a process of matching the labels (label 1 to label n) corresponding to the sample image and the classification results (classification 1 to classification n). When the label corresponding to the sample image is represented in binary form (0 and 1), that is, the label 1 to the label n is indicated by 0 or 1, the representation of the label 1 to the label n in the above loss value formula has been omitted.
[0199] The sample prediction probability is a probability obtained by the classification model predicting the sample image. Optionally, when the sample image is a positive sample, the classification model can still determine that the positive sample corresponds to a negative label in the data label, for example: the positive sample is a sample image with a lesion, and the negative label is used to indicate that the sample image has no lesion. The positive sample is input into the classification model, and the classification model outputs the probability corresponding to the positive label and the probability corresponding to the negative label, wherein the probability corresponding to the positive label is the sum of the probabilities of including each kind of lesion in the positive sample (the sum of the probabilities of including leakage, see-through, accumulation, staining, shielding, no perfusion or vascular abnormality lesions in the sample image).
[0200] Optionally, the adjustment parameter r (r + and r - ) is related to the number of lesions corresponding to the positive sample, and the sample prediction probability is the prediction probability corresponding to the positive label. For example: after inputting the sample image into the classification model, the probabilities of the sample image having leakage, see-through, accumulation, staining, shielding, no perfusion or vascular abnormality lesions are 0.2, 0.03, 0.4, 0.01, 0.05, 0.03, 0.04 and 0.2 respectively, and the prediction probability corresponding to the positive label is 0.96 (0.2+0.03+0.4+0.01+0.05+0.03+0.04+0.2=0.96). The negative label is the probability of the classification model determining that the sample image has no lesion, which is 0.04. The training process of the classification model is a process of making the judgment process of the classification model on the positive label, the negative label and each lesion in the positive label more accurate as much as possible.
[0201] By adjusting the values of r + and r - , the influence of positive samples and negative samples on the network can be effectively adjusted. For natural images (non-lesion images), there are very few positive labels in an image, and most of them are negative labels, so r + <r - . When the training method of the above classification model is applied to the medical field (for example: the fluoroscopy data often comes from diagnosing patients), most of the sample images have at least one lesion, and the positive samples of the lesions are significantly more than the negative samples, so r + >r - . By using the above ASL loss function to optimize the classification model, the classification model can more balancedly learn the knowledge of positive and negative samples, and reduce the influence of quantity imbalance.
[0202] In summary, according to the label value distribution of the data label in the data set, the adjustment parameter is determined, the loss value is obtained by performing balanced adjustment on the loss determination process of the sample prediction probability through the adjustment parameter, the classification model is trained by using the loss value, the training process of the classification model is realized, and the data classification model is obtained. In application, the target data to be classified is input into the above data classification model to obtain a classification result. Through the above method, the problem of inaccurate classification result caused by unbalanced data feature attributes in the data set can be avoided, and the accuracy of classification is improved.
[0203] In the embodiment of the application, the training method of the classification model is applied to the lesion recognition scene in the medical field, which can effectively solve the class imbalance problem of fluorescence angiography data, automatically classify various lesions of the fundus, and effectively identify the lesion types, which can provide doctors with subsequent diagnosis work and lay a good foundation for eye disease diagnosis, and assist in improving the diagnosis accuracy of doctors.
[0204] Figure 7 is a structural block diagram of a training device of a classification model provided by an exemplary embodiment of the application, as Figure 7 shown, the device includes the following parts:
[0205] The acquisition module 710 is configured to acquire sample data, the sample data being data in a data set, the data in the data set being annotated with a data label, and the data label being used to indicate the reference classification of the data with a label value.
[0206] The determination module 720 is configured to determine an adjustment parameter based on the label value distribution of the data label in the data set, the adjustment parameter being an auxiliary parameter applied in the loss calculation process.
[0207] The prediction module 730 is configured to classify and predict the sample data by using a classification model to obtain a sample prediction probability of the sample data corresponding to the data label.
[0208] The adjustment module 740 is configured to perform balanced adjustment on the loss determination process of the sample prediction probability by using the adjustment parameter to obtain a loss value.
[0209] The training module 750 is configured to train the classification model by using the loss value to obtain a data classification model, and the data classification model is used to classify target data in the range of the data label.
[0210] As Figure 8 shown, in an optional embodiment, the data label based on the label value includes a first type of label and a second type of label.
[0211] The determining module 720 is further configured to determine a first value distribution of the first type of label and a second value distribution of the second type of label based on the label value corresponding to the data label and the number of data in the data set; and determine the adjustment parameter based on the first value distribution and the second value distribution.
[0212] In an optional embodiment, the label value of the data label includes a first value or a second value.
[0213] The determining module 720 is further configured to analyze the label value corresponding to the data label, determine the number of the first value in the label value corresponding to each data label, determine an average value of the number of the first value corresponding to the number of data in the data set as the first value distribution, determine the number of the second type of label, and determine an average value of the number of the second type of label corresponding to the number of data in the data set as the second value distribution.
[0214] In an optional embodiment, the adjustment parameter includes a first parameter corresponding to the first value distribution and a second parameter corresponding to the second value distribution.
[0215] The determining module 720 is further configured to determine the first parameter corresponding to the first type of label based on the first type of label, the first value distribution, and the number of data labels, and determine the second parameter corresponding to the second type of label based on the second type of label, the second value distribution, and the number of data labels.
[0216] In an optional embodiment, the adjusting module 740 is further configured to balance the first loss determination process of the sample prediction probability by using the first parameter to determine a first loss, balance the second loss determination process of the sample prediction probability by using the second parameter to determine a second loss, and take the sum of the first loss and the second loss as the loss value.
[0217] In an optional embodiment, the prediction module 730 includes:
[0218] The convolution unit 731 is configured to perform a convolution operation on the sample data by using the classification model to obtain at least two feature vectors corresponding to the sample data.
[0219] The analysis unit 732 is configured to perform weight analysis on the at least two feature vectors by using the classification model to determine a weight result corresponding to the at least two feature vectors.
[0220] The prediction unit 733 is configured to perform classification prediction on the sample data based on the weight result, and determine a sample prediction probability of the sample data corresponding to the data label.
[0221] In an optional embodiment, the prediction unit 733 is further configured to fuse the at least two feature vectors based on the weight result, and determine a sample vector corresponding to the sample data; and match the sample vector with a data label set to determine the sample prediction probability of the sample data corresponding to the data label, the data label set being a set of data labels.
[0222] In an optional embodiment, the prediction unit is further configured to fuse the at least two feature vectors based on the weight result, and determine a representation result of the at least two feature vectors; and splice the representation result to determine a sample vector corresponding to the sample data.
[0223] In an optional embodiment, the sample data includes at least two information features.
[0224] The convolution unit 731 is further configured to divide the information features according to differences between the at least two information features; and perform convolution operation on the at least two information features respectively through a convolution module in the classification model to obtain a feature vector corresponding to the sample data.
[0225] In an optional embodiment, the apparatus is further configured to determine the data label as a first type of label in response to the first value being present in at least one label value corresponding to the data label; and determine the data label as a second type of label in response to the second value being present in all label values corresponding to the data label.
[0226] In an optional embodiment, the training module 750 is further configured to adjust model parameters of the classification model based on the loss value to obtain a candidate classification model; and obtain the data classification model in response to training of the candidate classification model based on the loss value reaching a training target.
[0227] In an optional embodiment, the training module 750 is further configured to determine the candidate classification model obtained through the last iteration training as the data classification model in response to the loss value reaching a convergence state; or determine the candidate classification model obtained through the last iteration training as the data classification model in response to a number of times of obtaining the loss value reaching a number threshold.
[0228] In an optional embodiment, the apparatus is further configured to perform a breadth promotion operation on initial data to obtain candidate data; and perform a normalization operation on the candidate data to obtain the data set.
[0229] In an optional embodiment, the apparatus is further configured to input the target data into the data classification model, and determine a classification result corresponding to the target data, the classification result being used to indicate a label category to which the target data belongs.
[0230] It should be noted that the training apparatus of the classification model provided in the above embodiments is only used as an example for the division of the above functional modules. In actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the training apparatus of the classification model provided in the above embodiments and the training method of the classification model belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be described here.
[0231] Figure 9 A structural diagram of a server provided by an example embodiment of the present application is shown. The server 900 includes a central processing unit (CPU) 901, a system memory 904 including a random access memory (RAM) 902 and a read only memory (ROM) 903, and a system bus 905 connecting the system memory 904 and the central processing unit 901. The server 900 also includes a mass storage device 906 for storing an operating system 913, application programs 914, and other program modules 915.
[0232] The mass storage device 906 is connected to the central processing unit 901 through a mass storage controller (not shown) connected to the system bus 905. The mass storage device 906 and its associated computer readable medium provide non-volatile storage for the server 900. That is, the mass storage device 906 can include a computer readable medium (not shown) such as a hard disk or a compact disc read only memory (CD-ROM) drive.
[0233] Without loss of generality, the computer readable medium can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other solid state memory technology, CD-ROM, Digital Versatile Disc (DVD), or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. It should be understood by those skilled in the art that computer storage media does not limit to the above-mentioned several types. The system memory 904 and the mass storage device 906 mentioned above can be collectively referred to as memory.
[0234] According to various embodiments of the present application, the server 900 can also run on a remote computer connected to the network through a network connection such as the Internet. That is, the server 900 can be connected to the network 912 through the network interface unit 911 connected to the system bus 905, or can be connected to other types of networks or remote computer systems (not shown) using the network interface unit 911.
[0235] The above-mentioned memory further includes one or more programs, one or more programs are stored in the memory and are configured to be executed by the CPU.
[0236] Embodiments of the present application also provide a computer device including a processor and a memory, the memory storing at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the training method of the classification model provided by each method embodiment.
[0237] Embodiments of the present application also provide a computer readable storage medium, the computer readable storage medium storing at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the training method of the classification model provided by each method embodiment.
[0238] The embodiment of the present application further provides a computer program product or computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the training method of the classification model in any of the above-mentioned embodiments.
[0239] Optionally, the computer readable storage medium can include a read only memory (ROM), a random access memory (RAM), a solid state disk (SSD), an optical disk, or the like. The random access memory can include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0240] Those of ordinary skill in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by a program instructing relevant hardware to complete, and the program can be stored in a computer readable storage medium. The above-mentioned storage medium can be a read only memory, a magnetic disk or an optical disk.
[0241] The above-mentioned is only optional embodiments of the present application, and does not limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for training a classification model, characterized in that, The method is performed by a terminal and includes: Obtaining sample data, the sample data being data in a data set, the data in the data set corresponding to a data label, the data label being used to indicate a reference classification of data with a label value, the sample data including medical image data, the data label being used to indicate whether the medical image data has a lesion, the data label including a first class label and a second class label based on the label value; Determining a first value distribution of the first class label and a second value distribution of the second class label based on a number of label values corresponding to the data label and a number of data in the data set; Determining an adjustment parameter based on the first value distribution and the second value distribution; wherein a first parameter corresponding to the first class label is determined based on the first class label, the first value distribution, and a number of data labels; a second parameter corresponding to the second class label is determined based on the second class label, the second value distribution, and the number of data labels, the adjustment parameter including the first parameter and the second parameter, and the data set including a medical data set; Performing classification prediction on the sample data through a classification model to obtain a sample prediction probability of the sample data corresponding to the data label; Balancing the loss determination process of the sample prediction probability with the adjustment parameter to obtain a loss value; Training the classification model through the loss value to obtain a data classification model, the data classification model being used to classify target data in the range of the data label, the target data being medical image data, and the data classification model being used to determine a lesion classification result of the medical image data.
2. The method of claim 1, wherein, The label value of the data label includes a first value or a second value. The determination of the first value distribution of the first class label and the second value distribution of the second class label based on the number of label values corresponding to the data label and the number of data in the data set includes: Analyzing the label values corresponding to the data label to determine the number of first values in the label values corresponding to each data label; and determining an average value of the number of first values corresponding to the number of data in the data set as the first value distribution. Determining the number of second class labels; and determining an average value of the number of second class labels corresponding to the number of data in the data set as the second value distribution.
3. The method of claim 1, wherein, The calculation formula of the adjustment parameter is as follows: Wherein, r is used to indicate an adjustment parameter; l is used to indicate a label distribution; and c is used to indicate a number of data labels.
4. The method of claim 1, wherein, The balancing of the loss determination process of the sample prediction probability with the adjustment parameter to obtain a loss value includes: Balancing a first loss determination process of the sample prediction probability with the first parameter to determine a first loss; Balancing a second loss determination process of the sample prediction probability with the second parameter to determine a second loss; and The sum of the first loss and the second loss is taken as the loss value.
5. The method of claim 4, wherein, The process of adjusting the first loss determination process of the sample prediction probability by the first parameter adopts the following first loss formula for determination: wherein, a first loss for indicating the first class label in the first loss determination process; p is the sample prediction probability; is a first parameter corresponding to the first class label. The process of adjusting the second loss determination process of the sample prediction probability by the second parameter adopts the following second loss formula for determination: wherein, a second loss for indicating the second class label in the second loss determination process; p is the sample prediction probability; is a second parameter corresponding to the second class label.
6. The method according to any one of claims 1 to 5, characterized in that, The process of determining the sample prediction probability of the sample data corresponding to the data label by classifying and predicting the sample data through the classification model comprises: The process of performing convolution operation on the sample data through the classification model to obtain at least two feature vectors corresponding to the sample data; The process of determining the weight result corresponding to the at least two feature vectors through weight analysis of the at least two feature vectors by the classification model; The process of classifying and predicting the sample data based on the weight result to determine the sample prediction probability of the sample data corresponding to the data label.
7. The method of claim 6, wherein, The process of determining the sample prediction probability of the sample data corresponding to the data label based on the weight result comprises: The process of fusing the at least two feature vectors based on the weight result to determine the sample vector corresponding to the sample data; The process of matching the sample vector with a data label set to determine the sample prediction probability of the sample data corresponding to the data label, wherein the data label set is a set of data labels.
8. The method of claim 7, wherein, The process of fusing the at least two feature vectors based on the weight result to determine the sample vector corresponding to the sample data comprises: The process of fusing the at least two feature vectors based on the weight result to determine the representation result of the at least two feature vectors; The process of splicing the representation result to determine the sample vector corresponding to the sample data.
9. The method of claim 6, wherein, The sample data comprises at least two information features. The process of performing convolution operation on the sample data through the classification model to obtain at least two feature vectors corresponding to the sample data comprises: The process of dividing the information features according to the differences between the at least two information features; The process of performing convolution operation on the at least two information features through the convolution module in the classification model to obtain the feature vectors corresponding to the sample data.
10. The method of claim 1, wherein, The method further comprises: In response to the presence of at least one first value in the label value corresponding to the data label, determining the data label as a first type of label; In response to the presence of the second value in the label value corresponding to the data label, determining the data label as a second type of label.
11. The method according to any one of claims 1 to 5, characterized in that, The process of training the classification model through the loss value to obtain a data classification model comprises: The process of adjusting the model parameters of the classification model based on the loss value to obtain a candidate classification model; In response to the training of the candidate classification model based on the loss value reaching a training target, obtaining the data classification model.
12. The method of claim 11, wherein, The process of obtaining the data classification model in response to the training of the candidate classification model based on the loss value reaching a training target comprises: In response to the loss value reaching a convergence state, the candidate classification model obtained through the last iteration training is taken as the data classification model. Or, In response to the number of times of obtaining the loss value reaching a number threshold, the candidate classification model obtained through the last iteration training is taken as the data classification model.
13. The method according to any one of claims 1 to 5, characterized in that, Before the sample data is obtained, the method further includes: performing a breadth promotion operation on the initial data to obtain candidate data; performing a normalization operation on the candidate data to obtain the data set.
14. The method according to any one of claims 1 to 5, characterized in that, After the data classification model is obtained by training the classification model based on the loss value, the method further includes: inputting the target data into the data classification model to determine a classification result corresponding to the target data, the classification result being used to indicate a label category to which the target data belongs.
15. An apparatus for training a classification model, the apparatus comprising: The apparatus includes: an obtaining module configured to obtain sample data, the sample data being data in a data set, the data in the data set being annotated with a data label, the data label being used to indicate a reference classification of data by a label value, the sample data including medical image data, the data label being used to indicate whether the medical image data has a lesion, the data label including a first label and a second label based on the label value; a determining module configured to determine a first value distribution of the first label and a second value distribution of the second label based on a number of label values corresponding to the data label and a number of data in the data set; determine an adjustment parameter based on the first value distribution and the second value distribution; wherein a first parameter corresponding to the first label is determined based on the first label, the first value distribution, and the number of data labels; a second parameter corresponding to the second label is determined based on the second label, the second value distribution, and the number of data labels, the adjustment parameter including the first parameter and the second parameter, and the data set including a medical data set; a prediction module configured to perform classification prediction on the sample data by a classification model to obtain a sample prediction probability of the sample data corresponding to the data label; an adjustment module configured to balance the loss determination process of the sample prediction probability by the adjustment parameter to obtain a loss value; a training module configured to train the classification model by the loss value to obtain a data classification model, the data classification model being used to classify target data within the range of the data label, the target data being medical image data, and the data classification model being used to determine a lesion classification result of the medical image data.
16. A computer device, comprising: The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, a code set, or an instruction set, the at least one instruction, the at least one program, the code set, or the instruction set being loaded and executed by the processor to implement the training method of the classification model according to any one of claims 1 to 14.
17. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, at least one program, a code set or an instruction set, which are loaded and executed by the processor to implement the training method of the classification model according to any one of claims 1 to 14.
18. A computer program product, characterised in that, The computer program or instructions are executed by the processor to implement the training method of the classification model according to any one of claims 1 to 14.
Citation Information
Patent Citations
Class and feature distribution-based method for detecting concept drift in multi-tag data stream
CN106934035A
Attribute prediction model training method and attribute prediction method and device
CN112528023A