A data classification and grading method based on artificial intelligence
Through K-nearest neighbor interpolation and reward function regularization technology, combined with Bayesian optimization algorithm, the overfitting problem caused by sample imbalance and missing values in medical data is solved, and the accuracy and robustness of the data classification and grading model are improved. , suitable for clinical and health management decision-making.
Patent Information
- Application Number
- CN202411110376.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-08-14
AI Technical Summary
During the construction process, medical data classification and grading models are prone to overfitting due to sample categories and missing values, which affects the generalization ability of the model.
Data completion is performed using K-nearest neighbor interpolation method, and the incentive model pursues simplicity and classification confidence in the loss function by introducing reward function regularization technology, and hyperparameter tuning is performed with Bayesian optimization algorithm to build a more robust data prediction model.
It effectively solves the problem of model overfitting, improves the accuracy and generalization ability of data classification and grading, reduces data waste, and provides more accurate classification or grading results in actual clinical and health management.
Smart Images

Figure CN118626918B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data classification, and in particular to a data classification and grading method based on artificial intelligence. Background Art
[0002] As the medical field rapidly accumulates large amounts of data, the size and complexity of this data exceeds the processing capabilities of traditional analysis methods. Artificial intelligence technology can process these huge data sets through automated feature extraction and pattern recognition, providing an efficient solution for the classification and grading of medical data. However, the accuracy and consistency of medical data classification and grading are crucial for diagnosis and treatment. The current mainstream technology is to build a data classification and grading model that can continuously learn and adapt to provide more reliable classification and grading results. However, the construction of data classification and grading models still faces many challenges, among which how to tune during the construction process is a key issue that needs to be addressed.
[0003] When existing solutions process diverse medical data, some samples cannot be used due to missing values, which makes the already scarce data even less. In the process of building a data classification and grading deep neural network model, the model is often overfitted due to reasons such as imbalanced sample categories and very few trainable samples in a large number of categories, that is, the model performs well on the training data, but has poor generalization ability on new and unseen data. In order to solve the overfitting problem existing in medical data, the present invention combines the characteristics of medical data and designs a data completion method of K-nearest neighbor interpolation to make full use of precious medical data. It also innovatively proposes a reward function regularization method, which aims to directly motivate the model to actively pursue an ideal state, such as model simplicity, classification confidence, etc. By introducing a reward term in the loss function, the model will autonomously weigh the model complexity and task-related performance indicators during the optimization process, thereby obtaining a better effect of preventing overfitting. Summary of the invention
[0004] The purpose of the present invention is to provide an artificial intelligence-based data classification and grading method to solve at least one of the above-mentioned technical problems. It adopts a K-nearest neighbor interpolation method and an innovative reward function regularization method, which can solve the problem of model overfitting in medical data multi-classification scenarios and improve the accuracy of the data classification and grading model.
[0005] The embodiment of the present invention is achieved as follows:
[0006] A data classification and grading method based on artificial intelligence, comprising:
[0007] The original medical data is collected, and the original medical data is preprocessed using a k-means clustering algorithm, and the data is allocated to different clusters to obtain a clustered medical data set.
[0008] The clustered medical data set is supplemented with a K-nearest neighbor interpolation method to obtain a complete clustered medical data set.
[0009] A medical data prediction model is constructed using convolutional neural networks and reward function-based regularization techniques.
[0010] The complete clustered medical data set is used to perform model training on the medical data prediction model.
[0011] Combined with the Bayesian optimization algorithm, hyperparameters of the medical data prediction model are tuned.
[0012] The medical data to be classified and graded is input into the medical data prediction model after hyperparameter tuning to obtain the classification and grading results.
[0013] In a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, the raw medical data is collected, the raw medical data is pre-processed using the k-means clustering algorithm, and the raw medical data is assigned to different clusters to obtain a clustered medical data set including:
[0014] Raw medical data is collected from a determined data source, wherein the data source includes at least one of a hospital database, an electronic health record, a medical imaging database, and biomarker data.
[0015] The original medical data is subjected to data standardization processing and converted into standard medical data in a unified form.
[0016] The cluster number k is determined, and all the standard medical data are divided into k clusters.
[0017] A distance assignment algorithm is executed to assign each data point corresponding to the standard medical data to the nearest cluster center.
[0018] The mean of each cluster is recalculated and the cluster center is updated until the change in the position of the cluster center is less than the set threshold, so that each data point is assigned to a specified cluster, and the standard medical data corresponding to all the data points are classified according to the cluster labels to form a clustered medical data set.
[0019] The technical effect is: the standardized medical data is clustered using the k-means clustering algorithm, each data point is assigned to the nearest cluster center through the distance assignment algorithm, and the cluster center is iteratively updated until convergence, ensuring the accuracy and stability of the clustering results, so that each data point can be assigned to a suitable cluster. The resulting clustered medical data set reflects the inherent pattern and structure of the data, and each cluster represents a collection of data points with similar characteristics and attributes. This clustered data set is helpful for subsequent data analysis and model building, and can better understand and utilize the inherent correlation of medical data.
[0020] In a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, the clustered medical data set is supplemented by the K-nearest neighbor interpolation method to obtain a complete clustered medical data set, which includes:
[0021] The locations of missing values in the original data matrix X of the clustered medical dataset are examined and identified.
[0022] The value of n_neighbors is chosen via cross-validation.
[0023] Use the n_neighbors nearest neighbors of each missing value to interpolate and calculate the interpolated value .
[0024] The interpolation value calculated Fill in the original data matrix X, , and obtain the complete clustered medical data set.
[0025] Its technical effect is that the K-nearest neighbor interpolation method can effectively fill in the missing values in the original data matrix, calculate the interpolation value by analyzing the n_neighbors nearest neighbors around each missing value, maintain the integrity of the data set, and ensure that all data can be included in the analysis and modeling, avoiding information loss and bias caused by missing data; by interpolating missing values, it can reduce the impact of bias and incompleteness in the data set on the analysis results, provide a more accurate and comprehensive data foundation for the subsequent establishment of a predictive model, and more stably support the data analysis and model building process.
[0026] In a preferred embodiment of the present invention, in the above-mentioned data classification and grading method based on artificial intelligence, the interpolation value is calculated by using the n_neighbors nearest neighbors of each missing value in the data set. include:
[0027] Calculate the n×n distance matrix D between all samples in the clustered medical dataset. Each element in the matrix Representation sample and samples The distance between them is calculated as , where n is the number of samples and m is the number of features. is the value of sample i on the kth feature, is the value of sample j on the kth feature.
[0028] For each missing value, find the nearest neighbor sample set of its non-missing value samples on feature j .
[0029] Calculate the nearest neighbor sample and The weight value between is calculated as .
[0030] Calculate the weighted mean of the nearest neighbor samples, the calculation formula is ,in, The nearest neighbor sample The value on feature j.
[0031] Multiply the value of the nearest neighbor sample by the corresponding weight and divide it by the sum of all weights to get the interpolated value .
[0032] The technical effect is that the method of interpolation based on the n_neighbors nearest neighbors of each missing value in the data set effectively improves the accuracy of the interpolation process and the integrity of the data by making full use of the similarity and weight information between samples.
[0033] In a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, the use of convolutional neural networks and regularization technology based on reward functions to construct a medical data prediction model includes:
[0034] The neural network structure of the medical data prediction model is defined, including the input layer, the first convolutional layer, the first maximum pooling layer, the second convolutional layer, the second maximum pooling layer, the first fully connected layer, the first Dropout layer, the second fully connected layer, the second Dropout layer and the output layer.
[0035] The size of the input layer is the number of features contained in the medical data.
[0036] The first convolutional layer applies multiple filters to extract low-level features of the input data, uses the ReLU activation function, and outputs a tensor with the same dimension as the input, with the number of channels increasing according to the number of filters.
[0037] The stride of the first maximum pooling layer is the same as the size of the pooling window, the height and width of the output tensor are halved, and the number of channels remains unchanged.
[0038] The first Dropout layer randomly disconnects a specified proportion of neurons during training to prevent overfitting.
[0039] The input of the first fully connected layer is a one-dimensional vector processed by the first Dropout layer, and the activation function uses ReLU.
[0040] The second convolutional layer extracts high-level features and uses the ReLU activation function. The dimension of the output tensor remains unchanged and the number of channels is increased.
[0041] The stride of the second maximum pooling layer is the same as the size of the pooling window, the height and width of the output tensor are halved, and the number of channels remains unchanged.
[0042] The second Dropout layer randomly disconnects a specified proportion of neurons during training.
[0043] The input of the second fully connected layer is a one-dimensional vector processed by the second Dropout layer, and a ReLU activation function is used. The dimension of the output tensor remains unchanged, and the number of channels is increased.
[0044] The input of the output layer is a one-dimensional vector processed by the second fully connected layer, and a softmax activation function is used. The number of output features is the number of classified categories.
[0045] A regularization term based on the reward function is added to the training loss function to obtain a revised medical data prediction model.
[0046] The technical effect is that the reward function introduced in the loss function is intended to directly motivate the model to actively pursue the ideal state, such as model simplicity, classification confidence, etc. Specifically, we replace the penalty term in the original loss function with the reward term to obtain a new loss function form. By actively correcting the medical data prediction model during the training process, the generalization ability is improved.
[0047] In a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, adding a regularization term based on a reward function to the training loss function includes: calculating the standard loss function ,in, is the classification loss function, is the penalty term for the model weight w, is the weight of the penalty term.
[0048] Using reward function Function replacement penalty , and get the comprehensive loss function , is the weight of the control reward item.
[0049] The reward function is defined as ,in, To control the hyperparameters of sparsity and classification clarity weights, The sparsity of the measurement model is defined as , The confidence of the measurement model in the classification result of the current sample is defined as .
[0050] Calculate the gradient of the comprehensive loss function with respect to each layer weight .
[0051] Get the final weight update formula , where η is the learning rate.
[0052] The technical effect is that when the sparsity of the model is good and the clarity of the predicted output is higher, the value of Reward(w,y_pred) is larger, resulting in a smaller loss function. Through the design of this reward function, we not only encourage the model to obtain a simple sparse solution, but also directly reward the model for its "high confidence" classification prediction of the sample. This mechanism is expected to improve the performance of the model on classification tasks and prevent overfitting.
[0053] In a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, the use of the complete clustered medical data set to perform model training on the medical data prediction model includes:
[0054] Read the complete clustered medical dataset ,in, is the feature vector of the i-th sample, is the label of the i-th sample.
[0055] The complete clustered medical dataset is divided into a training set and a validation set.
[0056] Repeat the steps of forward propagation, loss calculation, back propagation and parameter update using the training set until the loss function converges or a predetermined number of training times is reached.
[0057] Use the validation set to evaluate the performance of the model and adjust the model parameters, and save the trained model.
[0058] Its technical effect is: using a complete clustered medical data set for model training can optimize data utilization, improve generalization capabilities, and enhance model adaptability.
[0059] In a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, the hyperparameter tuning of the medical data prediction model in combination with the Bayesian optimization algorithm includes:
[0060] Define the hyperparameters that need to be tuned in the hyperparameter space, select an initial point from the hyperparameter space using random selection or Latin hypercube sampling, train the model and calculate the objective function value of the initial point.
[0061] Construct a Gaussian process surrogate model, use the hyperparameter values of the initial point and the corresponding objective function values to fit the Gaussian process model, and train the Gaussian process model.
[0062] Select the acquisition function and find the point in the hyperparameter space that maximizes the acquisition function as the new hyperparameter combination , in the new hyperparameter combination Train the medical data prediction model and calculate the objective function value of the acquisition function , update the data set and the Gaussian process model, and use the updated data set and the Gaussian process model to repeatedly train the medical data prediction model until the model converges.
[0063] Its technical effect is that the Bayesian optimization algorithm uses a Gaussian process proxy model to model the objective function (usually the loss function of the validation set), thereby performing efficient searches in the hyperparameter space. Compared with traditional grid search or random search methods, Bayesian optimization can dynamically adjust the next hyperparameter combination to be tried based on the existing hyperparameter values and the corresponding model performance, thereby finding the hyperparameter combination with the best performance more quickly. Combining the Bayesian optimization algorithm to tune the hyperparameters of the medical data prediction model can effectively improve the performance of the model and accelerate the convergence process of the model, thereby providing more accurate and reliable prediction results for the classification and grading of medical data.
[0064] In a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, the medical data to be classified and graded is input into the medical data prediction model after hyperparameter tuning to obtain the classification and grading results, which includes:
[0065] Medical data to be classified and graded are collected, and the medical data to be classified and graded are processed to be consistent with the format of the complete clustered medical data set.
[0066] The processed medical data to be classified is input into the medical data prediction model after hyperparameter tuning.
[0067] The medical data prediction model is used to infer the classified data, and the prediction result of the output layer is calculated through forward propagation to output the category label or category probability.
[0068] The classification level of the medical data to be classified is determined according to the output result of the medical data prediction model.
[0069] Its technical effect is that by applying the medical data prediction model to the medical data to be classified, it can play an important role in actual clinical or health management scenarios.
[0070] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the aforementioned artificial intelligence-based data classification and grading method.
[0071] The beneficial effects of the embodiments of the present invention are:
[0072] The clustered medical data set is supplemented with the K-nearest neighbor interpolation method to obtain a complete clustered medical data set, thereby reducing the waste of precious medical data and the probability of model overfitting.
[0073] In the process of building a medical data prediction model, the present invention introduces a regularization method based on a reward function, which leaves more freedom for the model and guides the model to actively pursue ideal states such as simplicity and decision clarity, rather than being passively punished and suppressed. At the same time, the design of the reward function can also flexibly incorporate prior information such as domain knowledge and model interpretability, making the regularization process more reasonable and natural.
[0074] The present invention uses the Bayesian optimization algorithm to tune the hyperparameters of the medical data prediction model, which can find the optimal hyperparameter combination more quickly, further improving the performance and prediction accuracy of the model. Compared with traditional grid search or random search methods, the Bayesian optimization of the present invention can effectively optimize the performance of the model under limited computing resources.
[0075] By applying the optimized medical data prediction model to the medical data to be classified, the present invention can quickly and accurately output the classification or grading results. It can be directly applied to actual clinical decision-making and health management, helping medical staff to better understand and use medical data and guide personalized treatment plans and health intervention measures. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0077] Figure 1 The present invention is a flowchart of the data classification and grading method based on artificial intelligence.
[0078] Figure 2Schematic diagram of the data classification and grading method based on artificial intelligence of the present invention.
[0079] Figure 3 The figure is a flow chart of a regularization scheme for a reward function in the artificial intelligence-based data classification and grading method of the present invention. DETAILED DESCRIPTION
[0080] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0081] Please refer to Figure 1 and Figure 2 The first embodiment of the present invention provides a data classification and grading method based on artificial intelligence, which includes: collecting original medical data, preprocessing the original medical data using a k-means clustering algorithm, and assigning them to different clusters to obtain a clustered medical data set; completing the clustered medical data set using a K-nearest neighbor interpolation method to obtain a complete clustered medical data set; using a convolutional neural network and a regularization technology based on a reward function to construct a medical data prediction model, and the loss function used in model training incorporates a reward function that takes into account both model sparsity and sample classification confidence to overcome the overfitting problem of the model; using the complete clustered medical data set to train the medical data prediction model; combining the Bayesian optimization algorithm to perform hyperparameter tuning on the medical data prediction model; inputting the medical data to be classified and graded into the hyperparameter-tuned medical data prediction model to obtain classification and grading results.
[0082] In a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, the original medical data is collected, the original medical data is pre-processed using the k-means clustering algorithm, and the data is assigned to different clusters to obtain a clustered medical data set, including: collecting original medical data from a determined data source, the data source includes at least one of a hospital database, an electronic health record (EHR), a medical imaging database, and biomarker data; performing data standardization processing on the original medical data and converting it into standard medical data in a unified form; determining the number of clusters k, and dividing all the standard medical data into k clusters; executing a distance allocation algorithm to assign each data point corresponding to the standard medical data to the nearest cluster center; recalculating the mean of each cluster and updating the cluster center until the change in the position of the cluster center is less than a set threshold, so that each data point is assigned to a specified cluster, and the standard medical data corresponding to all the data points are classified according to cluster labels to form a clustered medical data set.
[0083] Specifically, determining the number of clusters k includes the elbow method and the silhouette coefficient method.
[0084] The elbow method involves selecting a range of k values, usually starting from 1 and going up to 10 or more. For each k value, clustering is performed using the k-means algorithm and the sum of squared clustering errors is calculated. The sum of squared clustering errors (SSE) is plotted against the corresponding k value. The sum of squared clustering errors represents the sum of the squares of the distances from each data point to the center of the cluster to which it belongs. The curve formula for the sum of squared clustering errors is ,in, is the i-th cluster, is the center of the ith cluster, and x is a sample point that belongs to the ith cluster. As the k value increases, the sum of squares of clustering errors gradually decreases. When the k value increases to a certain point (i.e., the elbow point), the rate of decrease of the sum of squares of clustering errors slows down significantly. At this time, the k value is the appropriate number of clusters.
[0085] The silhouette coefficient method includes: The silhouette coefficient combines the compactness within the cluster and the separation between clusters to evaluate the clustering effect. The silhouette coefficient value range is [-1, 1], and the larger the value, the better the clustering effect. For each k value, the k-means algorithm is used for clustering and the silhouette coefficient is calculated. The k value and the corresponding silhouette coefficient value are plotted into a curve. The silhouette coefficient formula is , where a(i) is the average distance from data point i to other data points in the same cluster, and b(i) is the average distance from data point i to the nearest different cluster. The k value with the largest silhouette coefficient is selected as the optimal number of clusters.
[0086] A group of patients’ medical data, including age, gender, blood pressure, blood sugar, biomarker indicators, etc., were obtained from the hospital database, EHR, and biomarker data. After the above steps, the clustered medical data set is shown in Table 1:
[0087] Table 1: Example of clustering medical dataset
[0088]
[0089] The feature vector includes the age, gender, blood pressure, blood sugar and other characteristics of each patient; the cluster label indicates the cluster to which each patient belongs, such as 1, 2, 3, etc.
[0090] The technical effect is: the standardized medical data is clustered using the k-means clustering algorithm, each data point is assigned to the nearest cluster center through the distance assignment algorithm, and the cluster center is iteratively updated until convergence, ensuring the accuracy and stability of the clustering results, so that each data point can be assigned to a suitable cluster. The resulting clustered medical data set reflects the inherent pattern and structure of the data, and each cluster represents a collection of data points with similar characteristics and attributes. This clustered data set is helpful for subsequent data analysis and model building, and can better understand and utilize the inherent correlation of medical data.
[0091] In a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, the clustered medical data set is supplemented with the K-nearest neighbor interpolation method to obtain a complete clustered medical data set, which includes: checking and identifying the position of the missing values in the original data matrix X of the clustered medical data set, and the missing value position matrix ,in, represents the value of the i-th row and j-th column; select the value of n_neighbors through cross-validation; use the n_neighbors nearest neighbors of each missing value to interpolate and calculate the interpolated value ; The calculated interpolation value Fill in the original data matrix X, , and obtain the complete clustered medical data set.
[0092] Specifically, the method for selecting the value of n_neighbors includes: selecting a range of n_neighbors values, usually between 1 and 20; for each n_neighbors value, using cross-validation to evaluate the accuracy of the interpolation result; by observing the cross-validation score curve, selecting the n_neighbors value with the best cross-validation result, for example, when n_neighbors=10, the cross-validation score is the highest, and n_neighbors=10 is selected.
[0093] Its technical effect is that the K-nearest neighbor interpolation method can effectively fill in the missing values in the original data matrix, calculate the interpolation value by analyzing the n_neighbors nearest neighbors around each missing value, maintain the integrity of the data set, and ensure that all data can be included in the analysis and modeling, avoiding information loss and bias caused by missing data; by interpolating missing values, it can reduce the impact of bias and incompleteness in the data set on the analysis results, provide a more accurate and comprehensive data foundation for the subsequent establishment of a predictive model, and more stably support the data analysis and model building process.
[0094] In a preferred embodiment of the present invention, in the above-mentioned data classification and grading method based on artificial intelligence, the interpolation value is calculated by using the n_neighbors nearest neighbors of each missing value in the data set. Including: calculating the n×n distance matrix D between all samples in the clustered medical data set, each element in the matrix Representation sample and samples The distance between them is calculated as , where n is the number of samples and m is the number of features. is the value of sample i on the kth feature, is the value of sample j on the kth feature; for each missing value, find the nearest neighbor sample set of its non-missing value samples on feature j ; Calculate the nearest neighbor sample and The weight value between is calculated as ; Calculate the weighted mean of the nearest neighbor samples, the calculation formula is ,in, The nearest neighbor sample The value on feature j; multiply the value of the nearest neighbor sample by the corresponding weight and divide it by the sum of all weights to get the interpolated value .
[0095] The technical effect is that the method of interpolation based on the n_neighbors nearest neighbors of each missing value in the data set effectively improves the accuracy of the interpolation process and the integrity of the data by making full use of the similarity and weight information between samples.
[0096] In a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, the use of convolutional neural networks and reward function-based regularization technology to construct a medical data prediction model includes: defining a neural network structure of the medical data prediction model, including an input layer, a first convolutional layer, a first maximum pooling layer, a second convolutional layer, a second maximum pooling layer, a first fully connected layer, a first Dropout layer, a second fully connected layer, a second Dropout layer and an output layer; the size of the input layer is the number of features contained in the medical data. For image data (such as medical images), the input format is usually a three-dimensional tensor (batch_size, height, width, channels). For other types of data, the input format needs to be converted into a form suitable for CNN processing, for example, two-dimensional data can be regarded as a single-channel image; the first convolutional layer applies multiple filters (kernels) to extract low-level features of the input data, and the size of the convolution kernel (filter) is 3x3 or 5x5, using the ReLU activation function, outputting the same tensor dimension as the input, and the number of channels increasing according to the number of filters; the stride of the first maximum pooling layer is the same as the size of the pooling window, the height and width of the output tensor are halved, and the number of channels remains unchanged, which is used for spatial dimensionality reduction, reducing the number of parameters and calculations, while retaining the main features; the first Dropout layer randomly disconnects the neuron connections of a specified proportion during training to prevent overfitting; the input of the first fully connected layer is a one-dimensional vector processed by the first Dropout layer, and the activation function uses ReLU; the second convolutional layer extracts high-level features, using the ReLU activation function, the dimension of the output tensor remains unchanged, and the number of channels is increased; the second maximum pooling layer The stride of the layer is the same as the size of the pooling window, the height and width of the output tensor are halved, the number of channels remains unchanged, and spatial dimensionality reduction is performed again to reduce computational complexity; the second Dropout layer randomly disconnects a specified proportion of neuron connections during training to prevent overfitting; the input of the second fully connected layer is a one-dimensional vector processed by the second Dropout layer, and the ReLU activation function is used. The dimension of the output tensor remains unchanged, and the number of channels is increased; the input of the output layer is a one-dimensional vector processed by the second fully connected layer, and the softmax activation function is used. The number of output features is the number of classified categories; a regularization term based on a reward function is added to the training loss function to obtain a revised medical data prediction model.
[0097] The technical effect is that the reward function introduced in the loss function is intended to directly motivate the model to actively pursue an ideal state, such as model simplicity, classification confidence, etc. Specifically, the penalty term in the original loss function is replaced by the reward term to obtain a new loss function form. By actively correcting the medical data prediction model during the training process, the generalization ability is improved.
[0098] like Figure 3 As shown, in a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, adding a regularization term based on a reward function to the training loss function includes: calculating the standard loss function ,in, is a classification loss function, which is used to measure the error between the model prediction result and the true label, such as cross entropy. It is a penalty term for the model weight w, used to prevent overfitting, such as L1 / L2 norm, is the weight of the penalty term; using the reward function Function replacement penalty , and get the comprehensive loss function , is the weight controlling the reward term; the reward function is defined as ,in, To control the hyperparameters of sparsity and classification clarity weights, The sparsity of the measurement model is defined as , The confidence of the measurement model in the classification result of the current sample is defined as ; Calculate the gradient of the comprehensive loss function for each layer weight ; Get the final weight update formula , where η is the learning rate.
[0099] The technical effect is that when the sparsity of the model is better and the clarity of the predicted output is higher, The larger the value of , the smaller the loss function. Through the design of this reward function, not only the model is encouraged to obtain a simple sparse solution, but also the model is directly rewarded for its "high confidence" classification prediction of the sample. This mechanism is expected to improve the performance of the model on classification tasks and prevent overfitting.
[0100] In a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, the use of the complete clustered medical data set to train the medical data prediction model includes: reading the complete clustered medical data set ,in, is the feature vector of the i-th sample, is the label of the ith sample; the complete clustered medical dataset is divided into a training set and a validation set; the training set is repeatedly used for forward propagation, loss calculation, back propagation and parameter update steps until the loss function converges or a predetermined number of training times is reached; the validation set is used to evaluate the performance of the model and adjust the model parameters, and the trained model is saved.
[0101] Its technical effect is: using a complete clustered medical data set for model training can optimize data utilization, improve generalization capabilities, and enhance model adaptability.
[0102] In a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, the hyperparameter tuning of the medical data prediction model in combination with the Bayesian optimization algorithm includes: defining the hyperparameters that need to be tuned in the hyperparameter space, including the learning rate, the Dropout probability, and the λ in the Elastic Net regularization parameter. 1 , 2 At least one; set the search range of the hyperparameters in the hyperparameter space, learning rate η∈[0.0001,0.1], Dropout probability p∈[0.1,0.5], regularization parameter λ 1 ∈[0.01,1.0], regularization parameter λ 2 ∈[0.01,1.0]; for the specified performance indicator on the validation set, define the objective function; specifically, the loss function for minimizing the validation set is , where θ represents the set of all hyperparameters; use random selection or Latin hypercube sampling to select an initial point from the hyperparameter space, train the model and calculate the objective function value of the initial point; construct a Gaussian process surrogate model, use the hyperparameter values of the initial point and the corresponding objective function value to fit the Gaussian process model, and train the Gaussian process model; select an acquisition function, and find the point in the hyperparameter space that maximizes the acquisition function as a new hyperparameter combination , in the new hyperparameter combination The medical data prediction model is trained to calculate the objective function value of the acquisition function. , update the data set and the Gaussian process model, and use the updated data set and the Gaussian process model to repeatedly train the medical data prediction model until the model converges.
[0103] Its technical effect is that the Bayesian optimization algorithm uses a Gaussian process proxy model to model the objective function (usually the loss function of the validation set), thereby performing efficient searches in the hyperparameter space. Compared with traditional grid search or random search methods, Bayesian optimization can dynamically adjust the next hyperparameter combination to be tried based on the existing hyperparameter values and the corresponding model performance, thereby finding the hyperparameter combination with the best performance more quickly. Combining the Bayesian optimization algorithm to tune the hyperparameters of the medical data prediction model can effectively improve the performance of the model and accelerate the convergence process of the model, thereby providing more accurate and reliable prediction results for the classification and grading of medical data.
[0104] In a preferred embodiment of the present invention, in the above-mentioned artificial intelligence-based data classification and grading method, the medical data to be classified and graded is input into the medical data prediction model after hyperparameter tuning to obtain the classification and grading results, which includes: collecting the medical data to be classified and graded, and processing the medical data to be classified and graded to be consistent with the format of the complete clustered medical data set; inputting the processed medical data to be classified into the medical data prediction model after hyperparameter tuning; using the medical data prediction model to infer the data to be classified, calculating the prediction result of the output layer through forward propagation, and outputting the category label or category probability; and determining the classification and grading of the medical data to be classified according to the output result of the medical data prediction model.
[0105] Its technical effect is that by applying the medical data prediction model to the medical data to be classified, it can play an important role in actual clinical or health management scenarios.
[0106] A second embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the aforementioned artificial intelligence-based data classification and grading method.
[0107] The embodiment of the present invention aims to protect a data classification and grading based on artificial intelligence, and has the following effects:
[0108] 1. To address the problem of missing data, we invented a global data automatic completion technology that can intelligently fill in missing values based on the statistical characteristics of existing data, thereby reducing the impact of incomplete data on model performance.
[0109] 2. In order to reduce the randomness in the model training process, the present invention uses model regularization technology, integrates regularization technology and optimizes algorithm parameters and training process to improve the stability and repeatability of model training.
[0110] 3. The present invention also pays special attention to the interference problem of abnormal data. By inventing an effective retrieval technology in hyperparameter space, the present invention can identify and remove abnormal data points in the data preprocessing stage, thereby ensuring the quality and accuracy of model training. Through the comprehensive application of these strategies, the present invention can effectively improve the performance of data classification and grading models when facing new data, making them more accurate and efficient in classification and grading tasks.
[0111] The computer program product of the artificial intelligence-based data classification and grading method and device provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.
[0112] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is run, it can execute the above-mentioned artificial intelligence-based data classification and grading method, so that model training can be performed according to preset data classification and grading standards, thereby improving the accuracy of the data classification and grading model.
[0113] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0114] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A data classification and grading method based on artificial intelligence, characterized in that: include: Collecting original medical data, preprocessing the original medical data using a k-means clustering algorithm, and assigning the original medical data to different clusters to obtain a clustered medical data set; Using a K-nearest neighbor interpolation method to complete the clustered medical data set to obtain a complete clustered medical data set; Use convolutional neural networks and reward-based regularization techniques to build a medical data prediction model; Using the complete clustered medical data set to perform model training on the medical data prediction model; Combining the Bayesian optimization algorithm, performing hyperparameter tuning on the medical data prediction model; Inputting the medical data to be classified and graded into the medical data prediction model after hyperparameter tuning to obtain classification and grading results; The method of constructing a medical data prediction model by using a convolutional neural network and a regularization technology based on a reward function includes: Define the neural network structure of the medical data prediction model, including the input layer, the first convolutional layer, the first maximum pooling layer, the second convolutional layer, the second maximum pooling layer, the first fully connected layer, the first Dropout layer, the second fully connected layer, the second Dropout layer and the output layer; The size of the input layer is the number of features contained in the medical data; The first convolutional layer applies multiple filters to extract low-level features of the input data, uses a ReLU activation function, and outputs a tensor with the same dimensions as the input, with the number of channels increasing according to the number of filters; The stride of the first maximum pooling layer is the same as the size of the pooling window, the height and width of the output tensor are halved, and the number of channels remains unchanged; The first Dropout layer randomly disconnects a specified proportion of neurons during training to prevent overfitting; The input of the first fully connected layer is a one-dimensional vector processed by the first Dropout layer, and the activation function uses ReLU; The second convolutional layer extracts high-level features, uses the ReLU activation function, and keeps the dimension of the output tensor unchanged, but increases the number of channels; The stride of the second maximum pooling layer is the same as the size of the pooling window, the height and width of the output tensor are halved, and the number of channels remains unchanged; The second Dropout layer randomly disconnects a specified proportion of neuron connections during training; The input of the second fully connected layer is a one-dimensional vector processed by the second Dropout layer, and a ReLU activation function is used. The dimension of the output tensor remains unchanged, and the number of channels is increased. The input of the output layer is a one-dimensional vector processed by the second fully connected layer, a softmax activation function is used, and the number of output features is the number of classification categories; A regularization term based on the reward function is added to the training loss function to obtain a revised medical data prediction model; The adding of a regularization term based on a reward function into the training loss function includes: Calculate the standard loss function ,in, is the classification loss function, is the penalty term for the model weight w, is the weight of the penalty term; Using reward function Function replacement penalty , and get the comprehensive loss function , is the weight of the control reward item; The reward function is defined as ,in, To control the hyperparameters of sparsity and classification clarity weights, The sparsity of the measurement model is defined as , The confidence of the measurement model in the classification result of the current sample is defined as ; Calculate the gradient of the comprehensive loss function with respect to each layer weight ; Get the final weight update formula , where η is the learning rate.
2. The data classification and grading method based on artificial intelligence according to claim 1 is characterized in that: The raw medical data is collected, the raw medical data is preprocessed using a k-means clustering algorithm, and the raw medical data is allocated to different clusters to obtain a clustered medical data set including: Collecting raw medical data from a determined data source, the data source comprising at least one of a hospital database, an electronic health record, a medical imaging database, and biomarker data; Performing data standardization processing on the original medical data to convert them into standard medical data in a unified form; Determine the number of clusters k, and divide all the standard medical data into k clusters; Executing a distance assignment algorithm to assign each data point corresponding to the standard medical data to the nearest cluster center; The mean of each cluster is recalculated and the cluster center is updated until the change in the position of the cluster center is less than the set threshold, so that each data point is assigned to a specified cluster, and the standard medical data corresponding to all the data points are classified according to the cluster labels to form a clustered medical data set.
3. The data classification and grading method based on artificial intelligence according to claim 1 is characterized in that: The clustered medical data set is supplemented by using the K-nearest neighbor interpolation method to obtain a complete clustered medical data set including: Checking and identifying the locations of missing values in the original data matrix X of the clustered medical dataset; Select the value of n_neighbors through cross-validation; Use the n_neighbors nearest neighbors of each missing value to interpolate and calculate the interpolated value ; The interpolation value calculated Fill in the original data matrix X, , and obtain the complete clustered medical data set.
4. The data classification and grading method based on artificial intelligence according to claim 3 is characterized in that: Use the n_neighbors nearest neighbors of each missing value in the data set to interpolate and calculate the interpolated value include: Calculate the n×n distance matrix D between all samples in the clustered medical dataset. Each element in the matrix Representation sample and samples The distance between them is calculated as , where n is the number of samples and m is the number of features. is the value of sample i on the kth feature, is the value of sample j on the kth feature; For each missing value, find the nearest neighbor sample set of its non-missing value samples on feature j ; Calculate the nearest neighbor sample and The weight value between is calculated as ; Calculate the weighted mean of the nearest neighbor samples, the calculation formula is ,in, The nearest neighbor sample The value on feature j; Multiply the value of the nearest neighbor sample by the corresponding weight and divide it by the sum of all weights to get the interpolation value .
5. The data classification and grading method based on artificial intelligence according to claim 1 is characterized in that: The using the complete clustered medical data set to perform model training on the medical data prediction model includes: Read the complete clustered medical dataset ,in, is the feature vector of the i-th sample, is the label of the i-th sample; Dividing the complete clustered medical dataset into a training set and a validation set; Repeat the steps of using the training set to perform forward propagation, calculate loss, back propagation, and update parameters until the loss function converges or a predetermined number of training times is reached; Use the validation set to evaluate the performance of the model and adjust the model parameters, and save the trained model.
6. The data classification and grading method based on artificial intelligence according to claim 1 is characterized in that: The hyperparameter tuning of the medical data prediction model in combination with the Bayesian optimization algorithm includes: Define the hyperparameters that need to be tuned in the hyperparameter space; Select an initial point from the hyperparameter space using random selection or Latin hypercube sampling, train the model and calculate the objective function value at the initial point; Construct a Gaussian process surrogate model, use the hyperparameter values of the initial point and the corresponding objective function values to fit the Gaussian process model, and train the Gaussian process model; Select the acquisition function and find the point in the hyperparameter space that maximizes the acquisition function as the new hyperparameter combination , in the new hyperparameter combination The medical data prediction model is trained to calculate the objective function value of the acquisition function. , update the data set and the Gaussian process model, and use the updated data set and the Gaussian process model to repeatedly train the medical data prediction model until the model converges.
7. The data classification and grading method based on artificial intelligence according to claim 1 is characterized in that: The step of inputting the medical data to be classified and graded into the medical data prediction model after hyperparameter tuning to obtain the classification and grading results includes: Collecting medical data to be classified and graded, and processing the medical data to be classified and graded to be consistent with the format of the complete clustered medical data set; Inputting the processed medical data to be classified into the medical data prediction model after hyperparameter tuning; Use the medical data prediction model to infer the classified data, calculate the prediction result of the output layer through forward propagation, and output the category label or category probability; The classification level of the medical data to be classified is determined according to the output result of the medical data prediction model.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the artificial intelligence-based data classification and grading method as described in any one of claims 1 to 7 is implemented.
