Novel feature selection method suitable for disease diagnosis and based on horny lizard algorithm
By applying the horned lizard algorithm to select features in disease diagnosis, the efficiency and accuracy problems of traditional methods when dealing with complex medical data sets are solved, and faster and more efficient disease diagnosis model training is achieved.
Patent Information
- Application Number
- CN202510005727.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2045-01-03
AI Technical Summary
In disease diagnosis, traditional feature selection methods are difficult to effectively process complex medical data sets, resulting in long training time for model, high hardware resources consumption and low prediction accuracy.
A new feature selection method based on the horned lizard algorithm is adopted to simulate the survival strategies and behavioral patterns of horned lizards in the natural environment, optimize the feature selection process, and quickly locate the subset of features related to disease diagnosis.
It significantly reduces the model training time and hardware resource consumption, improves the prediction accuracy of the model, can better reflect the essential characteristics and internal laws of the disease, and reduces the occurrence of misdiagnosis and misdiagnosis.
Smart Images

Figure CN119400400A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of machine learning, and in particular, relates to a novel feature selection method based on a horned lizard algorithm suitable for disease diagnosis. Background Art
[0002] In today's medical field, disease diagnosis technology is undergoing profound changes and development. As a powerful data analysis tool, machine learning has shown great potential in disease diagnosis. For example, in the diagnosis of breast cancer and Parkinson's disease, by using a large amount of patients' physiological indicator data to build a machine learning model, doctors can make more accurate and efficient diagnostic decisions, thereby significantly improving the early detection rate of the disease and the success rate of treatment.
[0003] In the application process of machine learning, feature selection is a crucial stage. For breast cancer diagnosis-related datasets such as Breastcancer (original breast cancer dataset) and BreastEW (diagnostic breast cancer dataset), as well as Parkinsons dataset for Parkinson's disease diagnosis, they contain physiological index data of many patients. The feature dimensions of these data are often complex, covering multiple aspects from blood test indicators, imaging features to gene expression data. However, not all features are equally important for the diagnosis of the disease. Too many redundant or irrelevant features will not only increase the computational complexity of model training, resulting in a significant increase in the required hardware resources, including higher memory requirements, longer computing time, and stronger processor performance requirements, but may also introduce noise, reducing the prediction accuracy and generalization ability of the model.
[0004] Traditional feature selection methods have many limitations when dealing with such complex medical data sets. For example, some filtering-based feature selection methods, although computationally efficient, often ignore the correlation between features and make it difficult to select the optimal feature combination. Although the parcel feature selection method can take into account the interaction between features and models, it requires repeated training and evaluation of the model, which results in huge computational overhead and is inadequate for large-scale data sets.
[0005] The horned lizard algorithm is an emerging optimization algorithm that simulates the survival strategies and behavior patterns of horned lizards in the natural environment and has good global search capabilities and convergence speed. Applying the horned lizard algorithm to the feature selection stage can effectively overcome the shortcomings of traditional methods. Through the optimization search mechanism of the horned lizard algorithm, it is possible to quickly locate the feature subset most relevant to disease diagnosis in the huge feature space, which can significantly reduce the training time and hardware resource consumption of the model. At the same time, the features selected by the horned lizard algorithm can better reflect the essential characteristics and internal laws of the disease, thereby improving the prediction accuracy of the model. Summary of the invention
[0006] In summary, the present invention proposes a new feature selection method based on the horned lizard algorithm suitable for disease diagnosis, which applies the good search performance of the horned lizard algorithm to the feature selection problem, improves the model prediction accuracy, reduces the number of features and improves the model prediction efficiency.
[0007] The present invention is achieved through the following technical solutions: A novel feature selection method based on the Horned Lizard algorithm for disease diagnosis: The method specifically comprises the following steps: Step 1: setting a random number corresponding to the disease data set, wherein the number of random numbers of the disease data set is equivalent to the number of features of the disease data set, thereby generating a basic population agent according to the random number; Step 2: Binarize each agent and generate a new feature selection vector group; Step 3: Based on the results of step 2, use the new feature selection vector group to train and predict the model, and use the fitness function to judge the performance of the feature selection vector group to determine whether the population is the current optimal solution or the worst solution; Step 4: The basic population enters the HLOA algorithm for iteration. Each population enters one of the four strategies of the HLOA algorithm according to fixed rules. When a strategy is selected, each individual in each agent will be calculated and iterated according to the formula in the strategy, and the calculation result is the population agent in the new round of iteration. Step 5: Subtract the population before iteration from the population after iteration, and make a difference at each corresponding position to obtain a new difference vector group, which is the Euclidean distance vector group. Compare the new difference vector group with the threshold to obtain the feature selection vector group. Step 6: Based on the results of step 5, use the features after feature selection to train and predict the model, use the fitness function to determine the performance of the feature selection vector group, and determine whether the current population is the current optimal solution; Step 7: Repeat steps 5 and 6 until all iterations are completed, and output the selected optimal feature selection vector group and the corresponding model evaluation results.
[0008] Furthermore, in step 2, Compare the generated basic population proxy with the threshold. If it is smaller than the threshold, the feature selection vector at that position is 0, indicating that the feature is not selected; otherwise, it is 1, indicating that the feature is selected. The specific formula is as follows: (6) is the value of the feature selection vector group corresponding to the i-th feature in the first round, is the initial value generated for the i-th individual, is the comparison threshold; according to Formula 6, the binary Boolean value corresponding to the i-th individual can be obtained, and this Boolean value determines whether the i-th feature should be selected in the first round of calculation; That is, if , then in the first round of calculation, the i-th feature is selected; if , then the i-th feature is not selected in the first round of calculation.
[0009] Furthermore, in step three, the fitness function is as follows: (7) In formula 7 is the fitness function value, is the error rate of classification using the selected features, specifically the percentage of classification errors to the total number, with a value range of [0,1]. is the number of selected features, is the total number of features in the dataset, It is a parameter used to adjust the feature subset length and classification accuracy.
[0010] Furthermore, in step 4, The four strategies are concealment strategy, skin darkening or lightening strategy, blood spray strategy and mobile escape strategy: The concealment strategy is mathematically modeled as in Formula 1; (1) Where: is the new search agent position in the search space for the t+1th generation solution, is the best search agent of the tth generation; r1, r2, r3 and r4 are integer random numbers generated between 1 and the maximum number of search agents, and r1≠r2≠r3≠r4; , , and, The selected search agents are r1, r2, r3, and r4; represents the maximum number of iterations, t is the current number of iterations, σ is a randomly obtained binary value, 𝜕 is set to 2, c1, c2 are random numbers, c1≠c2; The skin darkening or lightening strategy is modeled and calculated by formula 2 and formula 3; (2) (3) in , , and is a random number; and are the worst and best search agents found, respectively, r1, r2, r3 and r4 are integer random numbers generated between 1 and the maximum number of search agents, and r1≠r2≠r3≠r4; , , and, is the selected search agent r1, r2, r3, r4, σ is a randomly obtained binary value; The blood ejection strategy motion equation is mathematically modeled as shown in Formula 4; (4) in is the new search agent position in the search space for the t+1th generation solution, The best search agent for the t generation, For the current search agent, represents the maximum number of iterations, t is the current number of iterations, g is the gravity of the earth, 0.009807 km∕s 2 , v0 is set to 1 seg, α is set to π / 2, and ε is set to 1E – 6; Mathematical modeling is performed for the mobile evasion strategy, as shown in Formula 5; (5) in is the new search agent position in the search space for the t+1th generation solution, is the best search agent in generation t, is a random number generated between [-1,1], ε is a random number generated by standard Cauchy distribution, and the mean and σ are set to 0 and 1 respectively. Search agent for the current one.
[0011] Furthermore, in step five, the specific formula is as follows: set up is the value of the tth round of iteration of the i-th individual, is the value of the t+1th round of iteration of the i-th individual, The value of the feature selection vector group corresponding to the i-th feature in the t+1 round, is the Euclidean distance of the i-th individual after iteration, is the comparison threshold; then: (8) (9) According to Formula 8 and Formula 9, the binary Boolean value corresponding to the i-th individual can be obtained, and the Boolean value determines whether the i-th feature should be selected in the t+1th round of calculation; if , then in the t+1th round of calculation, the i-th feature is selected; if , then in the t+1th round of calculation, the i-th feature is not selected.
[0012] Furthermore, in step six, the fitness function includes accuracy, recall, sensitivity, precision and F1 score.
[0013] Furthermore, in step 7, three classifiers, namely KNN, AdaBoostClassifier and RandomForestClassifier, are used to make predictions on the disease dataset to obtain corresponding prediction results to determine the accuracy of the overall model in disease diagnosis.
[0014] A novel feature selection system based on the Horned Lizard algorithm for disease diagnosis: The feature selection system comprises: an initialization module, a binarization module, a fitness calculation module, a horned lizard strategy module, a Euclidean distance calculation module, a fitness calculation module and a result output module; The initialization module is used to set the random number corresponding to the disease data set, the number of random numbers of the disease data set is equivalent to the number of features of the disease data set, so as to generate a basic population agent according to the random number; The binarization module binarizes each agent to generate a new feature selection vector group; The fitness calculation module uses a new feature selection vector group to train and predict the model according to the result of the binarization module, and uses a fitness function to judge the performance of the feature selection vector group to determine whether the population is the current optimal solution or the worst solution; After the basic population enters the HLOA algorithm for iteration, the horned lizard strategy module enters each population into one of the four strategies of the HLOA algorithm according to fixed rules; when a strategy is selected, each individual in each agent will be calculated and iterated according to the formula in the strategy, and the calculation result is the population agent in the new round of iteration; The Euclidean distance calculation module subtracts the population before iteration from the population after iteration, and makes a difference at each corresponding position to obtain a new difference vector group, which is the Euclidean distance vector group, and compares the obtained new difference vector group with the threshold to obtain a feature selection vector group. The fitness calculation module uses the features after feature selection to train and predict the model according to the result of the Euclidean distance calculation module, and uses the fitness function to judge the performance of the feature selection vector group and whether the current population is the current optimal solution; The result output module repeats the execution contents of the Euclidean distance calculation module and the fitness calculation module until all iterations are completed, and outputs the selected optimal feature selection vector group and the corresponding model evaluation result.
[0015] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0016] A computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the steps of the above method are implemented.
[0017] Beneficial effects of the present invention The features of the present invention after being screened by the horned lizard algorithm can better reflect the essential characteristics and internal laws of the disease; taking breast cancer diagnosis as an example, by screening out key features such as tumor marker levels and breast tissue density characteristics from a large number of physiological indicators, the model can more accurately judge the benign and malignant nature of the tumor and reduce the occurrence of misdiagnosis and missed diagnosis. In the diagnosis of Parkinson's disease, the horned lizard algorithm is used to determine important features such as changes in neurotransmitter levels in specific brain regions and motor function-related indicators, which helps to improve the model's ability to recognize early symptoms of Parkinson's disease and provide strong support for early intervention and treatment of patients.
[0018] On three different disease data sets at UCI, this feature selection method, combined with the KNN algorithm, the AdaBoostClassifier algorithm, and the RandomForestClassifier algorithm, can achieve higher classification prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 The present invention is a flow chart of the method. DETAILED DESCRIPTION
[0020] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] The experimental methods used in the following examples are conventional methods unless otherwise specified. The materials, reagents, methods and instruments used are conventional materials, reagents, methods and instruments in the art unless otherwise specified, and can be obtained through commercial channels by those skilled in the art.
[0022] A novel feature selection method based on the Horned Lizard algorithm for disease diagnosis: The method specifically comprises the following steps: Step 1: setting a random number corresponding to the disease data set, wherein the number of random numbers of the disease data set is equivalent to the number of features of the disease data set, thereby generating a basic population agent according to the random number; Randomly generate basic population agents. This step is built into the HLOA algorithm. Specifically, use code to generate random numbers. The size of the random numbers is between the set upper and lower bounds. The number of individuals in each group of agents or the number of random numbers in the agent is equivalent to the number of features in the dataset. The Breastcancer dataset generates 9 random numbers per group, the BreastEW dataset generates 30 random numbers per group, and the Parkinsons dataset generates 22 random numbers per group. Step 2: Binarize each agent and generate a new feature selection vector group. The specific method is to compare the generated basic population agent with the threshold. If it is smaller than the threshold, the feature selection vector at this position is 0, indicating that the feature is not selected; otherwise, it is 1, indicating that it is selected. The specific formula is as follows: (6) is the value of the feature selection vector group corresponding to the i-th feature in the first round, is the initial value generated for the i-th individual, is the comparison threshold. According to Formula 6, the binary Boolean value corresponding to the ith individual can be obtained, which determines whether the ith feature should be selected in the first round of calculation.
[0023] That is: if , then in the first round of calculation, the i-th feature is selected; if , then the i-th feature is not selected in the first round of calculation.
[0024] Taking the Breastcancer dataset as an example, assuming that the generated feature selection vector group is [1,1,1,1,0,0,0,0,0], then for this prediction, only the following physiological information of the patient is selected: mass thickness, cell size uniformity, cell shape uniformity, and edge adhesion. These four information are input into the model for training and prediction, while the physiological information: single epithelial cell size, naked nucleus, mild chromatin, normal nucleolus, and mitosis are discarded, that is, they do not participate in this training and prediction.
[0025] The same is true for the BreastEW and Parkinsons datasets.
[0026] Step 3: Based on the results of step 2, use the new feature selection vector group to train and predict the model, and use the fitness function to judge the performance of the feature selection vector group to determine whether the population is the current optimal solution or the worst solution; the fitness function is as follows: (7) In formula 7 is the fitness function value, is the error rate of classification using the selected features. In the present invention, it is the percentage of the number of classification errors to the total number, and its value range is [0,1]. is the number of selected features, is the total number of features in the dataset, It is a parameter used to adjust the feature subset length and classification accuracy.
[0027] Step 4: The basic population enters the HLOA algorithm for iteration. The specific iteration content is that each population will enter one of the four strategies of the HLOA algorithm according to certain rules, such as whether the iteration round is an even number or an odd number. When a strategy is selected, each individual in each agent will calculate and iterate according to the formula in the strategy, and the calculation result will be the population agent in the new round of iteration.
[0028] The HLOA algorithm is specifically: Horned Lizard Optimization Algorithm (HLOA), which is inspired by the behavior of horned lizards in nature and imitates the concealment, darkening or lightening of the skin, blood spraying, and movement to escape defense behaviors of horned lizards. Therefore, the four strategies are: (4.1) Concealment strategy: Cryptidity is the process by which organisms blend into their surroundings by mimicking features of the environment, such as color, texture, etc., or even by becoming translucent, making it difficult for predators or prey to detect or identify them. By observing the cryptic properties of organisms, mathematical modeling such as Formula 1 is performed.
[0029] (1) Where: is the new search agent position in the search space for the t+1th generation solution, is the best search agent of the tth generation; r1, r2, r3 and r4 are integer random numbers generated between 1 and the maximum number of search agents, and r1≠r2≠r3≠r4; , , and, The selected search agents are r1, r2, r3, and r4; represents the maximum number of iterations, t is the current number of iterations, σ is a randomly obtained binary value, 𝜕 is set to 2, c1, c2 are random numbers, c1≠c2.
[0030] (4.2) Skin darkening or lightening strategies: The horned lizard controls its skin changes to decide whether to reduce or increase the amount of solar energy it absorbs. Heat and light energy follow the law of conservation. Lighter colors reject more heat, and darker colors absorb more heat. Its skin change strategy is modeled and calculated by equations 2 and 3.
[0031] (2) (3) in , , and is a random number. and are the worst and best search agents found, respectively, r1, r2, r3 and r4 are integer random numbers generated between 1 and the maximum number of search agents, and r1≠r2≠r3≠r4; , , and, are the selected search agents r1, r2, r3, and r4, and σ is a randomly obtained binary value.
[0032] (4.3) Blood spray strategy Horned lizards defend themselves against enemies by ejecting blood from their eyes. The blood ejection defense mechanism can be represented as a projectile motion, and its motion equation is mathematically modeled as shown in Equation 4.
[0033] (4) in is the new search agent position in the search space for the t+1th generation solution, The best search agent for the t generation, For the current search agent, represents the maximum number of iterations, t is the current number of iterations, g is the gravity of the earth, 0.009807 km∕s 2 , v0 is set to 1 seg, α is set to π / 2, and ε is set to 1E – 6.
[0034] (4.4) Mobile evasion strategy In this strategy, the horned lizard performs random and rapid movements in the surrounding environment to escape the predator. The avoidance strategy is mathematically modeled as shown in Equation 5.
[0035] (5) in is the new search agent position in the search space for the t+1th generation solution, is the best search agent in generation t, is a random number generated between [-1,1], ε is a random number generated by standard Cauchy distribution, and the mean and σ are set to 0 and 1 respectively. Search agent for the current one.
[0036] Step 5: Subtract the population before iteration from the population after iteration, and make a difference at each corresponding position to obtain a new difference vector group, that is, the Euclidean distance vector group, and compare the new difference vector group with the threshold to obtain the feature selection vector group. Euclidean distance is: In mathematics, the Euclidean distance between two points in Euclidean space refers to the length of the line segment connecting the two points. For points in two-dimensional space, the Pythagorean theorem can be used to calculate the Euclidean distance between two points in the Cartesian coordinate system.
[0037] For example, for the point , The Euclidean distance between is: (6) Conversion method based on Euclidean distance: For two points on the number axis in one-dimensional space For example, its Euclidean distance can be calculated as follows: (7) For each individual in the population, it can be abstracted into a point on the number axis, and its value corresponds to its position on the number axis. For each individual, after one iteration, its value will change, and its corresponding position on the number axis will also change. Then, the Euclidean distance between the value of each individual before and after the iteration can be calculated.
[0038] In summary, the specific formula for obtaining the Euclidean distance vector group in step 5 is as follows: set up: is the value of the tth round of iteration of the i-th individual, is the value of the t+1th round of iteration of the i-th individual, The value of the feature selection vector group corresponding to the i-th feature in the t+1 round, is the Euclidean distance of the i-th individual after iteration, is the comparison threshold. Then: (8) (9) According to Formula 8 and Formula 9, the binary Boolean value corresponding to the i-th individual can be obtained, and the Boolean value determines whether the i-th feature should be selected in the t+1th round of calculation.
[0039] According to the exploration characteristics, the meaning of this conversion method is that when the exploration range is large enough, the exploration can be considered effective. In other words, when the Euclidean distance Greater than threshold When , the exploration is considered valid and the corresponding feature can be selected in this iteration. Otherwise, the exploration is considered invalid and the corresponding feature is not selected in this iteration.
[0040] That is: if , then in the t+1th round of calculation, the i-th feature is selected; if , then in the t+1th round of calculation, the i-th feature is not selected.
[0041] Taking the Breastcancer dataset as an example, assuming that the generated feature selection vector group is [0,0,0,0,1,1,1,1,1], then for this prediction, only the following physiological information of the patient is selected: single epithelial cell size, naked nucleus, mild chromatin, normal nucleolus, and mitosis; and these five information are input into the model for training and prediction, while the physiological information: mass thickness, cell size uniformity, cell shape uniformity, and edge adhesion are discarded and do not participate in this training and prediction.
[0042] The same is true for the BreastEW and Parkinsons datasets.
[0043] Step 6: Based on the results of step 5, use the features after feature selection to train and predict the model, use the fitness function to determine the performance of the feature selection vector group, and determine whether the current population is the current optimal solution; The fitness function includes precision, recall, sensitivity, accuracy and F1 score.
[0044] Step 7: Repeat steps 5 and 6 until all iterations are completed, and output the selected optimal feature selection vector group and the corresponding model evaluation results.
[0045] Use three classifiers, KNN, AdaBoostClassifier, and RandomForestClassifier, to make predictions on the disease dataset and obtain the corresponding prediction results to determine the accuracy of the overall model in disease diagnosis.
[0046] Example: Because the present invention is a feature selection method, in order to verify its performance, it is necessary to use a classifier for verification. The current experiments are based on the conclusions drawn by using three different classifiers (KNN (k=5) algorithm, AdaBoostClassifier (n_estimators=100) algorithm, and RandomForestClassifier (min_samples_split=5, min_samples_leaf=10) algorithm).
[0047] 1. Average classification accuracy (the higher the better): 1.1. Parameter setting: The judgment threshold is selected as 15, the initial value of the population size is 50, the number of iterations is set to 100, the classifier KNN (k=5) algorithm, AdaBoostClassifier (n_estimators=100) algorithm, and RandomForestClassifier (min_samples_split=5, min_samples_leaf=10) algorithm are selected, and the statistical results are averaged from 40 independent runs. The average classification accuracy is shown in Table 1: Table 1 is the evaluation classification accuracy, which is the algorithm running The average of the obtained accuracies is:
[0048] in: is the total number of times the algorithm runs, For the The best classification accuracy obtained by running the algorithm.
[0049] Table 1:
[0050] 1.2, the judgment threshold is selected as 15, the initial value of the population size is 50, the number of iterations is set to 100 times, and the statistical results are averaged from 40 independent runs. Six other feature selection methods are selected for comparison: binary locust optimization method (BGOA), binary locust optimization algorithm (BGOA-M), novel binary locust optimization method (NBGOA), binary dragonfly optimization (BDO), binary gray wolf optimization method (bGWOA) and novel binary particle swarm optimization (NBPSO), with the classifier KNN (k=5) algorithm, the average classification accuracy is shown in Table 2: Table 2:
[0051] 2. Average feature selection size (the smaller the data, the better): 2.1. Parameter setting: The judgment threshold is selected as 15, the initial value of the population size is 50, the number of iterations is set to 100, the classifier KNN (k=5) algorithm, AdaBoostClassifier (n_estimators=100) algorithm, and RandomForestClassifier (min_samples_split=5, min_samples_leaf=10) algorithm are selected, and the statistical results are averaged from 40 independent runs. The average feature selection size is shown in Table 3.
[0052] Table 3 shows the average feature selection size for the algorithm run The average number of feature selections corresponding to the best fitness function obtained is:
[0053] in: is the total number of times the algorithm runs, For the The number of features corresponding to the best fitness function in the first run, is the total number of features in the dataset.
[0054] Table 3:
[0055] 2.2, the judgment threshold is selected as 15, the initial value of the population size is 50, the number of iterations is set to 100 times, and the statistical results are averaged from 40 independent runs. Six other feature selection methods are selected for comparison: binary locust optimization method (BGOA), binary locust optimization algorithm (BGOA-M), novel binary locust optimization method (NBGOA), binary dragonfly optimization (BDO), binary gray wolf optimization method (bGWOA) and novel binary particle swarm optimization (NBPSO), with the classifier KNN (k=5) algorithm, and the average feature selection size is shown in Table 4: Table 4:
[0056] It can be seen that on the three different disease data sets of UCI, this feature selection method combined with the KNN algorithm, the AdaBoostClassifier algorithm, and the RandomForestClassifier algorithm can achieve higher classification prediction accuracy.
[0057] A novel feature selection system based on the Horned Lizard algorithm for disease diagnosis: The feature selection system comprises: an initialization module, a binarization module, a fitness calculation module, a horned lizard strategy module, a Euclidean distance calculation module, a fitness calculation module and a result output module; The initialization module is used to set the random number corresponding to the disease data set, the number of random numbers of the disease data set is equivalent to the number of features of the disease data set, so as to generate a basic population agent according to the random number; The binarization module binarizes each agent to generate a new feature selection vector group; The fitness calculation module uses a new feature selection vector group to train and predict the model according to the result of the binarization module, and uses a fitness function to judge the performance of the feature selection vector group to determine whether the population is the current optimal solution or the worst solution; After the basic population enters the HLOA algorithm for iteration, the horned lizard strategy module enters each population into one of the four strategies of the HLOA algorithm according to fixed rules; when a strategy is selected, each individual in each agent will be calculated and iterated according to the formula in the strategy, and the calculation result is the population agent in the new round of iteration; The Euclidean distance calculation module subtracts the population before iteration from the population after iteration, and makes a difference at each corresponding position to obtain a new difference vector group, which is the Euclidean distance vector group, and compares the obtained new difference vector group with the threshold to obtain a feature selection vector group. The fitness calculation module uses the features after feature selection to train and predict the model according to the result of the Euclidean distance calculation module, and uses the fitness function to judge the performance of the feature selection vector group and whether the current population is the current optimal solution; The result output module repeats the execution contents of the Euclidean distance calculation module and the fitness calculation module until all iterations are completed, and outputs the selected optimal feature selection vector group and the corresponding model evaluation result.
[0058] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0059] A computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the steps of the above method are implemented.
[0060] The memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory, ROM, a programmable read-only memory, PROM, an erasable programmable read-only memory, EPROM, an electrically erasable programmable read-only memory, EEPROM, or a flash memory. The volatile memory may be a random access memory, RAM, which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory static RAM, SRAM, dynamic random access memory dynamic RAM, DRAM, synchronous dynamic random access memory synchronous DRAM, SDRAM, double data rate synchronous dynamic random access memory double data rate SDRAM, DDR SDRAM, enhanced synchronous dynamic random access memory enhanced SDRAM, ESDRAM, synchronous connection dynamic random access memory synchlink DRAM, SLDRAM and direct memory bus random access memory direct rambus RAM, DR RAM. It should be noted that memory of the methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0061] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center through a wired method such as coaxial cable, optical fiber, digital subscriber line digital subscriber line, DSL or wireless such as infrared, wireless, microwave, etc. to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium such as a floppy disk, a hard disk, a tape, an optical medium such as a high-density digital video disc digital video disc, DVD, or a semiconductor medium such as a solid state hard disk solid state disc, SSD, etc.
[0062] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in a processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.
[0063] It should be noted that the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor can be combined to perform. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0064] The above is a detailed introduction to the novel feature selection method based on the horned lizard algorithm suitable for disease diagnosis proposed in the present invention, and the principles and implementation methods of the present invention are explained. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A novel feature selection method based on the horned lizard algorithm suitable for disease diagnosis, characterized by: The method specifically comprises the following steps: Step 1: setting a random number corresponding to the disease data set, wherein the number of random numbers of the disease data set is equivalent to the number of features of the disease data set, thereby generating a basic population agent according to the random number; Step 2: Binarize each agent and generate a new feature selection vector group; Step 3: Based on the results of step 2, use the new feature selection vector group to train and predict the model, and use the fitness function to judge the performance of the feature selection vector group to determine whether the population is the current optimal solution or the worst solution; Step 4: The basic population enters the HLOA algorithm for iteration. Each population enters one of the four strategies of the HLOA algorithm according to fixed rules. When a strategy is selected, each individual in each agent will be calculated and iterated according to the formula in the strategy, and the calculation result is the population agent in the new round of iteration. Step 5: Subtract the population before iteration from the population after iteration, and make a difference at each corresponding position to obtain a new difference vector group, which is the Euclidean distance vector group. Compare the new difference vector group with the threshold to obtain the feature selection vector group. Step 6: Based on the results of step 5, use the features after feature selection to train and predict the model, use the fitness function to determine the performance of the feature selection vector group, and determine whether the current population is the current optimal solution; Step 7: Repeat steps 5 and 6 until all iterations are completed, and output the selected optimal feature selection vector group and the corresponding model evaluation results.
2. The method according to claim 1, characterized in that: In step 2, Compare the generated basic population proxy with the threshold. If it is smaller than the threshold, the feature selection vector at that position is 0, indicating that the feature is not selected; otherwise, it is 1, indicating that the feature is selected. The specific formula is as follows: (6) is the value of the feature selection vector group corresponding to the i-th feature in the first round, is the initial value generated for the i-th individual, is the comparison threshold; according to Formula 6, the binary Boolean value corresponding to the i-th individual can be obtained, and this Boolean value determines whether the i-th feature should be selected in the first round of calculation; That is, if , then in the first round of calculation, the i-th feature is selected; if , then the i-th feature is not selected in the first round of calculation.
3. The method according to claim 2, characterized in that: In step three, the fitness function is as follows: (7) In formula 7 is the fitness function value, is the error rate of classification using the selected features, specifically the percentage of classification errors to the total number, with a value range of [0,1]. is the number of selected features, is the total number of features in the dataset, It is a parameter used to adjust the feature subset length and classification accuracy.
4. The method according to claim 3, characterized in that: In step four, The four strategies are concealment strategy, skin darkening or lightening strategy, blood spray strategy and mobile escape strategy: The concealment strategy is mathematically modeled as in Formula 1; (1) Where: is the new search agent position in the search space for the t+1th generation solution, is the best search agent of the tth generation; r1, r2, r3 and r4 are integer random numbers generated between 1 and the maximum number of search agents, and r1≠r2≠r3≠r4; , , and, The selected search agents are r1, r2, r3, and r4; represents the maximum number of iterations, t is the current number of iterations, σ is a randomly obtained binary value, 𝜕 is set to 2, c1, c2 are random numbers, c1≠c2; The skin darkening or lightening strategy is modeled and calculated by formula 2 and formula 3; (2) (3) in , , and is a random number; and are the worst and best search agents found, respectively, r1, r2, r3 and r4 are integer random numbers generated between 1 and the maximum number of search agents, and r1≠r2≠r3≠r4; , , and, is the selected search agent r1, r2, r3, r4, σ is a randomly obtained binary value; The blood ejection strategy motion equation is mathematically modeled as shown in Formula 4; (4) in is the new search agent position in the search space for the t+1th generation solution, The best search agent for the t generation, For the current search agent, represents the maximum number of iterations, t is the current number of iterations, g is the gravity of the earth, 0.009807 km∕s 2 , v0 is set to 1 seg, α is set to π / 2, and ε is set to 1E – 6; Mathematical modeling is performed for the mobile evasion strategy, as shown in Formula 5; (5) in is the new search agent position in the search space for the t+1th generation solution, is the best search agent in generation t, is a random number generated between [-1,1], ε is a random number generated by standard Cauchy distribution, and the mean and σ are set to 0 and 1 respectively. Search agent for the current one.
5. The method according to claim 4, characterized in that: The specific formula in step five is as follows: set up is the value of the tth round of iteration of the i-th individual, is the value of the t+1th round of iteration of the i-th individual, The value of the feature selection vector group corresponding to the i-th feature in the t+1 round, is the Euclidean distance of the i-th individual after iteration, is the comparison threshold; then: (8) (9) According to Formula 8 and Formula 9, the binary Boolean value corresponding to the i-th individual can be obtained, and the Boolean value determines whether the i-th feature should be selected in the t+1th round of calculation; if , then in the t+1th round of calculation, the i-th feature is selected; if , then in the t+1th round of calculation, the i-th feature is not selected.
6. The method according to claim 5, characterized in that: In step six, the fitness function includes accuracy, recall, sensitivity, precision and F1 score.
7. The method according to claim 6, characterized in that: In step 7, three classifiers, KNN, AdaBoostClassifier, and RandomForestClassifier, are used to make predictions on the disease dataset and obtain corresponding prediction results to determine the accuracy of the overall model in disease diagnosis.
8. A feature selection system according to any one of claims 1 to 7, which is suitable for disease diagnosis and is based on the novel feature selection method of the horned lizard algorithm, characterized in that: The feature selection system comprises: an initialization module, a binarization module, a fitness calculation module, a horned lizard strategy module, a Euclidean distance calculation module, a fitness calculation module and a result output module; The initialization module is used to set the random number corresponding to the disease data set, the number of random numbers of the disease data set is equivalent to the number of features of the disease data set, so as to generate a basic population agent according to the random number; The binarization module binarizes each agent to generate a new feature selection vector group; The fitness calculation module uses a new feature selection vector group to train and predict the model according to the result of the binarization module, and uses a fitness function to judge the performance of the feature selection vector group to determine whether the population is the current optimal solution or the worst solution; After the basic population enters the HLOA algorithm for iteration, the horned lizard strategy module enters each population into one of the four strategies of the HLOA algorithm according to fixed rules; when a strategy is selected, each individual in each agent will be calculated and iterated according to the formula in the strategy, and the calculation result is the population agent in the new round of iteration; The Euclidean distance calculation module subtracts the population before iteration from the population after iteration, and makes a difference at each corresponding position to obtain a new difference vector group, which is the Euclidean distance vector group, and compares the obtained new difference vector group with the threshold to obtain a feature selection vector group. The fitness calculation module uses the features after feature selection to train and predict the model according to the result of the Euclidean distance calculation module, and uses the fitness function to judge the performance of the feature selection vector group and whether the current population is the current optimal solution; The result output module repeats the execution contents of the Euclidean distance calculation module and the fitness calculation module until all iterations are completed, and outputs the selected optimal feature selection vector group and the corresponding model evaluation result.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium for storing computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
PID (Proportion Integration Differentiation) parameter optimization method based on improved horny lizard optimization algorithm
CN118170003A
Gene screening method and device
CN118366549A
Unmanned aerial vehicle (UAV) task allocation method based on improved kenen optimization algorithm
CN118981213A
Robot optimal path planning method based on improved angle exendin optimization algorithm
CN119223280A
Medical disease feature selection method based on improved salp swarm algorithm
US20230029947A1
Cited By
Knowledge graph automatic construction method based on evidence-based medicine
CN120032916A
Characteristic selection method and system based on improved hornink optimization algorithm
CN120336792A