Diabetes prediction method based on genetic algorithm and one-dimensional convolutional neural network
By combining genetic algorithms and one-dimensional convolutional neural networks, feature selection and model training of diabetes data are solved, and high-dimensional, data imbalance and missing values in early diabetes screening are achieved, achieving higher diagnostic accuracy and efficiency.
Patent Information
- Application Number
- CN202510035845.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-04-18
AI Technical Summary
Traditional diabetes diagnosis methods cannot effectively solve the problems of high-dimensionality, data imbalance and missing values in early diabetes screening, resulting in a high risk of misdiagnosis and misdiagnosis.
The diabetes prediction method based on genetic algorithm and one-dimensional convolutional neural network is adopted to select feature data through genetic algorithms, and a diabetes prediction model is constructed and trained using one-dimensional convolutional neural network to solve the problem of data imbalance and missing values.
It significantly improves the accuracy and robustness of early diagnosis of diabetes, reduces misdiagnosis and misdiagnosis, and improves the accuracy and efficiency of screening.
Smart Images

Figure CN119851920A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of diabetes prediction, and in particular to a diabetes prediction method based on a genetic algorithm and a one-dimensional convolutional neural network. Background Art
[0002] Diabetes, as a chronic metabolic disease prevalent worldwide, poses a serious threat to human health. Its typical characteristic is the continuous increase in blood sugar levels, usually accompanied by insufficient insulin secretion or insulin resistance. Diabetes not only has a significant impact on the quality of life of patients, but is also closely related to a variety of serious complications (such as cardiovascular disease, nephropathy, neuropathy, retinopathy, etc.), which in turn leads to increased mortality and disability rates in patients. Therefore, early and accurate diagnosis of diabetes is of great significance for improving the prognosis of patients and improving their quality of life. However, the diagnosis process of diabetes faces many challenges. Traditional blood sugar detection methods often cannot fully reflect the metabolic status of patients, and there is a certain risk of misdiagnosis and missed diagnosis. At the same time, with the increase in the number of diabetic patients, especially in the early screening of prediabetes, how to efficiently and accurately screen out high-risk groups has become a problem that needs to be solved urgently. Early screening of diabetes is crucial to improving the quality of life of patients and reducing complications, but traditional classification methods face challenges in processing high-dimensional biomedical data. In recent years, with the rapid development of artificial intelligence and machine learning technologies, prediction models based on big data have gradually become a new way to screen and diagnose diabetes early. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a diabetes prediction method based on genetic algorithm and one-dimensional convolutional neural network, apply genetic algorithm and one-dimensional convolutional neural network (1DCNN) to early screening of diabetes, and solve the problems of high dimension, data imbalance and missing values that are common in diabetes data.
[0004] The objective of the present invention is achieved through the following technical solutions:
[0005] A diabetes prediction method based on genetic algorithm and one-dimensional convolutional neural network includes the following steps:
[0006] Obtain feature data from the PIDD diabetes prediction dataset and preprocess the feature data;
[0007] Use genetic algorithm to select features from preprocessed feature data;
[0008] A diabetes prediction model is constructed and trained, and the features selected by the genetic algorithm are input into the diabetes prediction model to obtain a prediction result.
[0009] Furthermore, the step of preprocessing the feature data specifically includes:
[0010] Missing value processing, calculate the average value of the non-missing values in the feature data F Use average Fill in each missing value in the feature data F;
[0011] Feature normalization, for each value x in the feature data F, is calculated as follows:
[0012]
[0013] Wherein, μ represents the mean of all data values in the feature data F, and σ represents the variance of all data values in the feature data F.
[0014] Furthermore, the step of performing feature selection on the preprocessed feature data using a genetic algorithm specifically includes:
[0015] Randomly generate P individuals to initialize the population, and the population is a set of P individuals;
[0016] Encode each individual. For an individual with N characteristics, encode it into a binary string of length N. Each individual is regarded as a chromosome with N gene bits, and each gene bit is used to represent whether the corresponding characteristic is selected;
[0017] The quality of each individual and the performance of the feature subset are evaluated by calculating the fitness function, which is calculated using the classification accuracy, as follows:
[0018]
[0019] Among them, S i Represents the currently selected feature subset, N acc Indicates the use of S i The number of samples classified correctly, N tol Indicates the total number of samples;
[0020] The parent individuals are selected according to the fitness function value of the individuals, and individuals with high fitness are given higher inheritance probability. i The formula for calculating the probability of being selected is as follows:
[0021]
[0022] Where P is the number of individuals in the population;
[0023] Cross the feature subsets of the two selected parent individuals to generate new individuals. Specifically, select a crossover point, exchange the parts of the two parent individuals after the crossover point, and generate two crossover individuals.
[0024] By randomly selecting a gene position of an individual and replacing it with the gene of the individual to randomly change it, a mutant individual is generated;
[0025] Adding the newly generated crossover individuals and mutation individuals to the original population to generate a new population;
[0026] Repeat the above steps, and stop generating new populations when there is no significant change in the population over multiple generations;
[0027] Finally, the feature subset corresponding to the individual with the highest fitness is output, that is, the optimal feature subset after optimization is output.
[0028] Furthermore, the diabetes prediction model is a one-dimensional convolutional neural network, specifically comprising:
[0029] Input layer: used to concatenate the input feature data into a multi-dimensional vector and input it into the model;
[0030] Convolution layer: Use a filter composed of several convolution kernels. Each convolution kernel slides on the input feature to perform a convolution operation. Each convolution kernel performs a convolution operation and outputs a feature map, which together completes the extraction of input data features.
[0031] Activation function: ReLU activation function is applied after the convolution layer;
[0032] Pooling layer: used to reduce the dimension of features while retaining the most important information;
[0033] Fully connected layer: used to flatten the output of the convolutional layer and the pooling layer, connect them to multiple neurons, and output binary classification results by learning the complex relationship between input features and output labels;
[0034] Output layer: It consists of 1 neuron and uses the Sigmoid activation function to output the prediction results.
[0035] Furthermore, the training of the diabetes prediction model includes:
[0036] The feature data in the training set were input into the diabetes prediction model. The binary cross entropy loss function was used during training, and the Adam optimizer was used to optimize the hyperparameters of the one-dimensional convolutional neural network. The training batch size was 32, the learning rate was 0.001, and the number of training times was 50.
[0037] The beneficial effects of the present invention are:
[0038] The diabetes prediction method provided by the present invention solves the data imbalance and missing value problems in diabetes classification by introducing a one-dimensional convolutional neural network (1DCNN) and combining it with an optimization algorithm, thereby improving the accuracy and robustness of early diagnosis of diabetes. First, the local feature extraction capability of 1DCNN enables the model to automatically discover the potential patterns of diabetes when processing high-dimensional complex data, significantly improving the screening accuracy. Secondly, the genetic algorithm (GA) is used for feature selection of data to optimize the classification accuracy and improve the overall efficiency of the method. This technology is particularly suitable for the imbalance problem in diabetes data and can effectively reduce misdiagnosis and missed diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is a flowchart of a diabetes prediction method based on genetic algorithm and one-dimensional convolutional neural network. DETAILED DESCRIPTION
[0040] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0041] See also Figure 1 , the present invention provides a technical solution:
[0042] A diabetes prediction method based on genetic algorithm and one-dimensional convolutional neural network, such as Figure 1 , including the following steps:
[0043] S1. Obtain feature data from the PIDD diabetes prediction dataset and preprocess the feature data.
[0044] The data set used in the present invention is the Pima Indian Diabetes dataset (PIDD) diabetes prediction data set from the UCI machine learning database. The research subjects are the Pima Indians near Phoenix, Arizona, and it contains 769 data and 9 features (pregnancy, blood sugar, blood pressure, skin thickness, insulin, BMI, diabetes system function, age, and whether or not the patient is a diabetic). The data set is a 769*9 two-dimensional data set, and the feature data can be directly obtained from the data set.
[0045] In this embodiment, the step of preprocessing the feature data specifically includes:
[0046] Missing value processing, calculate the average value of the non-missing values in the feature data F Use average Fill in each missing value in the feature data F;
[0047] Feature normalization, for each value x in the feature data F, is calculated as follows:
[0048]
[0049] Wherein, μ represents the mean of all data values in the feature data F, and σ represents the variance of all data values in the feature data F.
[0050] Mean imputation is a straightforward and effective technique for addressing missing values, which replaces missing values with the mean of the respective feature. This process ensures that missing values are replaced by a representative value (mean), thereby maintaining the overall distribution of features and minimizing the impact of missing data on subsequent analysis or modeling. Feature standardization ensures that attributes follow a Gaussian distribution, which is characterized by a mean of 0 and a variance of 1.
[0051] S2. Use genetic algorithm to perform feature selection on the preprocessed feature data.
[0052] In this embodiment, the step of performing feature selection on the preprocessed feature data using a genetic algorithm specifically includes:
[0053] S21. Randomly generate P individuals to initialize the population, where the population is a set of P individuals.
[0054] S22. Encode each individual. For an individual with N characteristics, encode it into a binary string of length N. Each individual is regarded as a chromosome with N gene positions, and each gene position is used to indicate whether the corresponding characteristic is selected. If the i-th position of the chromosome is 1, it means that the i-th characteristic is selected; if it is 0, it means that it is not selected.
[0055] S23, evaluating the quality of each individual and evaluating the performance of the feature subset by calculating the fitness function, wherein the fitness function is calculated using the classification accuracy, and the formula is as follows:
[0056]
[0057] Among them, S i Represents the currently selected feature subset, N acc Indicates the use of S i The number of samples classified correctly, N tol Represents the total number of samples.
[0058] S24, select parent individuals according to the fitness function value of the individual, and give individuals with high fitness a higher inheritance probability, S i The formula for calculating the probability of being selected is as follows:
[0059]
[0060] Where P is the number of individuals in the population. Parent individuals are selected based on the relative proportion of fitness values. The higher the fitness of an individual, the greater the probability of being selected.
[0061] S25. Cross the feature subsets of the two selected parent individuals to generate new individuals. Specifically, select a crossover point, exchange the parts of the two parent individuals after the crossover point, and generate two crossover individuals. For example, assuming that the two parent individuals are S1 = (1, 0, 1, 1, 0) and S2 = (0, 1, 0, 1, 1), and crossover is selected at the third position, then two offspring crossover individuals can be obtained: S1′ = (1, 0, 1, 1, 1), S2′ = (0, 1, 0, 1, 0).
[0062] S26. Generate a mutant individual by randomly selecting a gene position of an individual and negating it to the gene of the individual to randomly change it; for example, suppose an individual S = (1,0,1,1,0), mutate at the second position, that is, negate the value of the second gene position, and obtain a new mutant individual: S′ = (1,1,1,1,0). The mutation operation can increase the diversity of the population and prevent the algorithm from falling into a local optimum.
[0063] S27, adding the newly generated crossover individuals and mutation individuals to the original population to generate a new population.
[0064] S28. Repeat the above steps and stop generating new populations when there is no significant change in the population over multiple generations.
[0065] S29. Finally, the feature subset corresponding to the individual with the highest fitness is output, that is, the optimal feature subset after optimization is output.
[0066] Feature selection of data sets can improve model performance, reduce computational complexity, avoid overfitting, and enhance the interpretability and generalization of models. By removing redundant and irrelevant features, feature selection not only improves data quality, but also helps identify the most critical risk factors for prediction, thereby supporting more accurate diabetes diagnosis decisions. In addition, it can also reduce model training time and computational overhead, and improve the stability and reliability of the model on new data.
[0067] S3. Construct and train a diabetes prediction model, input the features selected by the genetic algorithm into the diabetes prediction model, and obtain a prediction result.
[0068] Furthermore, the diabetes prediction model is a one-dimensional convolutional neural network, specifically comprising:
[0069] Input layer: used to concatenate the input feature data into a multi-dimensional vector and input it into the model.
[0070] Convolution layer: Use a filter composed of several convolution kernels. Each convolution kernel slides on the input features to perform a convolution operation. Each convolution kernel performs a convolution operation and outputs a feature map to jointly extract the input data features. Each convolution kernel uses one-dimensional convolution to process structured data. These convolution kernels will automatically learn useful features in the data.
[0071] Activation function: Applying the ReLU activation function after the convolutional layer can effectively avoid the gradient vanishing problem and promote faster convergence.
[0072] Pooling layer: used to reduce the dimension of features while retaining the most important information. Pooling is used by selecting the maximum value in a local area.
[0073] Fully connected layer: used to flatten the output of the convolutional layer and the pooling layer, connect to multiple neurons, and output binary classification results by learning the complex relationship between input features and output labels.
[0074] Output layer: It consists of 1 neuron and uses Sigmoid activation function to output the prediction results. In the diabetes prediction task, the final output is a binary classification result (whether the patient has diabetes or not), and the output value is between 0 and 1. If the output value is close to 1, it means that the patient has diabetes; if it is close to 0, it means that the patient does not have diabetes.
[0075] One-dimensional convolutional neural network (1DCNN) has a strong local feature extraction capability when processing sequence data, and can efficiently capture subtle changes in the metabolic state of diabetic patients, which can further improve the classification accuracy and stability of the model. 1DCNN is applied to early screening for diabetes. Due to its advantages in high-dimensional data processing and local feature extraction, 1DCNN can accurately recognize patterns based on the sequence characteristics of biomedical data and optimize screening results.
[0076] Furthermore, the training of the diabetes prediction model includes:
[0077] The feature data in the training set were input into the diabetes prediction model. The binary cross entropy loss function was used during training, and the Adam optimizer was used to optimize the hyperparameters of the one-dimensional convolutional neural network. The training batch size was 32, the learning rate was 0.001, and the number of training times was 50. Among them, the Adam optimizer combines the advantages of momentum and adaptive learning rate, which can effectively accelerate model training. Selecting a moderate training batch size and learning rate during training can ensure that the model can be trained in a reasonable time and avoid gradient explosion or gradient disappearance.
[0078] The diabetes prediction method provided by the present invention solves the data imbalance and missing value problems in diabetes classification by introducing a one-dimensional convolutional neural network (1DCNN) and combining an optimization algorithm, and improves the accuracy and robustness of early diagnosis of diabetes. First, the local feature extraction capability of 1DCNN enables the model to automatically discover the potential pattern of diabetes when processing high-dimensional complex data, significantly improving the screening accuracy. Secondly, the genetic algorithm (GA) is used for feature selection of data, which optimizes the classification accuracy and improves the overall efficiency of the method. This technology is particularly suitable for the imbalance problem in diabetes data, and can effectively reduce the situation of misdiagnosis and missed diagnosis. Furthermore, early diagnosis can help diabetic patients get timely intervention, reduce the risk of complications, and reduce the economic burden of patients. Finally, the application of this technology not only improves the efficiency of diabetes screening, but also provides a feasible technical path for global diabetes prevention and control, promotes the rational allocation of medical resources, and has important public health significance.
[0079] This technical solution is expected to significantly improve the accuracy and efficiency of early diagnosis of diabetes by introducing a one-dimensional convolutional neural network (1DCNN) and combining it with an optimization algorithm. In particular, it can effectively overcome data imbalance and missing value problems when processing high-dimensional biomedical data. The application of this technology can not only improve the accuracy of diabetes screening, reduce the risk of misdiagnosis and missed diagnosis, but also provide strong support for screening of high-risk populations in prediabetes, thereby achieving early intervention, reducing the risk of complications, and alleviating patients' pain and economic burden. Therefore, it helps to reduce the occurrence of diabetes-related complications, reduce medical costs, and reduce the burden on the medical system and society. Early diagnosis and timely treatment can effectively prevent the development of diabetes, reduce hospitalization rates and the need for long-term treatment, thereby reducing the economic pressure on the country and individuals. In addition, diabetes prevention and management in healthy people will improve overall labor productivity and promote sustainable social and economic development. In general, this study not only helps to improve the level of public health, but also provides important technical support for global diabetes prevention and control, promotes the rational allocation of health management and medical resources, and brings significant economic and social benefits.
[0080] The above is only a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the concept described herein through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not deviate from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.
Claims
1. A diabetes prediction method based on genetic algorithm and one-dimensional convolutional neural network, characterized in that: The steps include: Obtain feature data from the PIDD diabetes prediction dataset and preprocess the feature data; Use genetic algorithm to select features from preprocessed feature data; A diabetes prediction model is constructed and trained, and the features selected by the genetic algorithm are input into the diabetes prediction model to obtain a prediction result.
2. The diabetes prediction method based on genetic algorithm and one-dimensional convolutional neural network according to claim 1, characterized in that: The step of preprocessing the feature data specifically includes: Missing value processing, calculate the average value of the non-missing values in the feature data F Use average Fill in each missing value in the feature data F; Feature normalization, for each value x in the feature data F, is calculated as follows: Wherein, μ represents the mean of all data values in the feature data F, and σ represents the variance of all data values in the feature data F.
3. The diabetes prediction method based on genetic algorithm and one-dimensional convolutional neural network according to claim 1, characterized in that: The characteristic data include pregnancy, blood sugar, blood pressure, skin thickness, insulin, BMI, diabetes system function, age and whether the patient is a diabetic.
4. The diabetes prediction method based on genetic algorithm and one-dimensional convolutional neural network according to claim 1, characterized in that: The step of performing feature selection on the preprocessed feature data using a genetic algorithm specifically includes: Randomly generate P individuals to initialize the population, and the population is a set of P individuals; Encode each individual. For an individual with N characteristics, encode it into a binary string of length N. Each individual is regarded as a chromosome with N gene bits, and each gene bit is used to represent whether the corresponding characteristic is selected; The quality of each individual and the performance of the feature subset are evaluated by calculating the fitness function, which is calculated using the classification accuracy, as follows: Among them, S i Represents the currently selected feature subset, N acc Indicates the use of S i The number of samples classified correctly, N tol Indicates the total number of samples; The parent individuals are selected according to the fitness function value of the individuals, and individuals with high fitness are given higher inheritance probability. i The formula for calculating the probability of being selected is as follows: Where P is the number of individuals in the population; Cross the feature subsets of the two selected parent individuals to generate new individuals. Specifically, select a crossover point, exchange the parts of the two parent individuals after the crossover point, and generate two crossover individuals. By randomly selecting a gene position of an individual and replacing it with the gene of the individual to randomly change it, a mutant individual is generated; Adding the newly generated crossover individuals and mutation individuals to the original population to generate a new population; Repeat the above steps, and stop generating new populations when there is no significant change in the population over multiple generations; Finally, the feature subset corresponding to the individual with the highest fitness is output, that is, the optimal feature subset after optimization is output.
5. The diabetes prediction method based on genetic algorithm and one-dimensional convolutional neural network according to claim 1, characterized in that: The diabetes prediction model is a one-dimensional convolutional neural network, specifically comprising: Input layer: used to concatenate the input feature data into a multi-dimensional vector and input it into the model; Convolution layer: Use a filter composed of several convolution kernels. Each convolution kernel slides on the input feature to perform a convolution operation. Each convolution kernel performs a convolution operation and outputs a feature map, which together completes the extraction of input data features. Activation function: ReLU activation function is applied after the convolution layer; Pooling layer: used to reduce the dimension of features while retaining the most important information; Fully connected layer: used to flatten the output of the convolutional layer and the pooling layer, connect them to multiple neurons, and output binary classification results by learning the complex relationship between input features and output labels; Output layer: It consists of 1 neuron and uses the Sigmoid activation function to output the prediction results.
6. A diabetes prediction method based on genetic algorithm and one-dimensional convolutional neural network according to claim 5, characterized in that: The training diabetes prediction model comprises: The feature data in the training set were input into the diabetes prediction model. The binary cross entropy loss function was used during training, and the Adam optimizer was used to optimize the hyperparameters of the one-dimensional convolutional neural network. The training batch size was 32, the learning rate was 0.001, and the number of training times was 50.