A method and device for detecting pre-disease stage based on data dimension upgrading and deep learning

By constructing a data detection classification model based on data dimensionality enhancement and deep learning, the problems of high cost, low accuracy and incomplete detection in pre-disease detection are solved, and accurate identification and efficient detection of different stages of pre-disease are achieved. The universality and generalization ability of the model are enhanced.

CN118471541BInactive Publication Date: 2024-08-30SICHUAN NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410930937.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology has the problems of high cost, low accuracy and insufficient comprehensive detection in pre-disease detection. Traditional medical imaging and genetic testing rely on medical resources, psychological assessment is greatly affected by subjectivity, and deep learning models can only be classified into two types. The distribution is not wide enough and the generalization ability is not high.

Method used

Using methods based on data dimensionality enhancement and deep learning, a data detection classification model is constructed through Transformer encoder, one-dimensional convolution and one-dimensional pooling layer, MLP multi-layer perceptron and dilated convolutional neural network, and the multi-parameter Gaussian kernel function is used and covariance matrix to increase the data dimension, and combine it with the cross-entropy loss function for multi-task optimization training to identify different stages of disease prevention.

Benefits of technology

It improves the accuracy and speed of identifying medical indicator data at different stages of pre-disease, lowers the detection threshold, enhances the universality and generalization ability of the model, and gets rid of the dependence on prior medical knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118471541B
    Figure CN118471541B
Patent Text Reader

Abstract

The present invention relates to a method and device for detecting the stage of non-disease based on data dimension upgrading and deep learning, aiming to solve the technical problem that the prior art can only complete the binary classification recognition task of non-disease state and healthy state, but cannot recognize the stage of non-disease. It includes: a data dimension upgrading characterization module and a data detection classification model. The data dimension upgrading characterization module performs dimension upgrading and compression encoding on the medical indicator data of different detection categories at different stages; the data detection classification model operates on the compressed and encoded data, and constructs a model cognitive matrix to determine the stage of non-disease. The present invention can improve the feature richness of the data and differentially characterize different types of medical indicator data at different stages of non-disease. By constructing a multi-task optimization and dual-input data detection classification model, the accuracy of classification and recognition can be improved while being driven only by medical indicator data without relying on prior knowledge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data classification, and in particular relates to a method and device for detecting a pre-disease stage based on data dimension upgrading and deep learning. Background Art

[0002] Pre-illness is an important concept in medical theory, which refers to a state in which some potential diseases have not yet worsened or have obvious symptoms. Pre-illness is neither a completely healthy state nor an obvious disease with obvious symptoms, but a state in which various medical indicators of the body have already shown potential illness. If this unbalanced physical state is not corrected in time, the human body may develop a disease with obvious symptoms. Therefore, the prevention and early treatment of pre-illness are extremely important. Nowadays, by using modern science and technology and a large number of medical indicators, it is possible to determine the stage of pre-illness and prevent the occurrence of diseases.

[0003] The pre-disease stage can be divided into the following five categories:

[0004] 1. Prenatal stage: This stage refers to the body not yet showing obvious pathological changes and is in a relatively complete healthy state. Various body indicators, functions and systems are still normal.

[0005] 2. Undiagnosed stage: This stage refers to the stage where the body has already experienced a certain degree of imbalance in hormones, functions, and body functions, but no significant pathological changes or overt symptoms have yet appeared. This stage can be regarded as the incubation period or prodromal period of the disease, and the human body begins to enter a sub-healthy state.

[0006] 3. Pre-transmission stage: This stage means that the disease has already shown signs, but the impact on other organs is not very serious, and the disease is still in the early stages.

[0007] 4. Pre-severe stage: This stage usually refers to the period when the disease has further developed and the condition is relatively serious, but has not yet reached its peak.

[0008] 5. Unrecovered stage: This stage means that although the disease has been contained to a certain extent, the body has not yet fully recovered and the risk of recurrence still exists.

[0009] In the existing technology, when identifying and classifying the stage of being healthy, traditional medical imaging and genetic testing methods are often used, supplemented by medical prior knowledge to achieve the purpose of detecting whether the disease exists; some people also use common psychological assessments and lifestyle assessments to distinguish and identify the healthy state and the completely healthy state; and in the current booming development of artificial intelligence, deep learning and machine learning models and algorithms are beginning to be applied to the task of detecting and identifying the disease.

[0010] Existing technologies and technical problems:

[0011] 1. Although methods based on traditional medical imaging and genetic testing have achieved good results in the field of disease detection and identification, the large amount of medical resources required for medical imaging and genetic testing indirectly leads to high time costs. In addition, such methods are highly dependent on the prior knowledge of medical workers, which makes the cost of disease detection relatively high.

[0012] 2. The accuracy of the detection and identification methods based on psychological assessment and lifestyle assessment is not high enough and difficult to quantify. It is also greatly influenced by the subjective influence of the person being tested and has certain limitations.

[0013] 3. The method of constructing a disease-free detection and identification model based on deep learning and machine learning can only complete the binary classification task of disease-free and healthy states, and cannot identify the stage of disease-free status. Similarly, some disease-free detection models of the same type are too single in the type of data collected for disease-free identification. Most of them only collect information for disease-free detection from a single aspect such as pulse, tongue, and face, which makes the data type distribution not wide enough and the detection not comprehensive enough, which easily leads to low generalization ability and universality of the detection model. Summary of the invention

[0014] In order to solve the technical problems existing in the above-mentioned prior art, the present invention provides a method and device for detecting the pre-disease stage based on data dimensionality upgrading and deep learning.

[0015] The technical solution of the present invention to solve the above technical problems is as follows: a method for detecting the pre-disease stage based on data dimension upgrading and deep learning, comprising:

[0016] S1: Based on multiple healthy stages, obtain the medical indicator data of each detection category in all healthy stages to obtain a first data set, perform dimension-upgrading representation and encoding on the first data set based on the first input port of the model to obtain first-category coded data; sequentially obtain complete medical indicator data of each detection category in a healthy stage until the medical indicator data of all healthy stages are obtained to form a second data set, perform dimension-upgrading representation and encoding on the second data set based on the second input port of the model to obtain second-category coded data;

[0017] S2: construct a data detection and classification model, which includes: a Transformer encoder, a one-dimensional convolution and one-dimensional pooling layer unit, an MLP multi-layer perceptron and a hole convolution neural network layer; input the first type of encoded data and the second type of encoded data into the data detection and classification model respectively, and execute the preset rounds of S3-S5 in a loop, iteratively train the data detection and classification model to obtain a trained data detection and classification model, and identify and analyze the medical indicator data to be detected according to the trained data detection and classification model to complete the identification of the pre-disease stage;

[0018] S3: receiving the first type of coded data and the second type of coded data, and performing feature recognition on the first type of coded data and the second type of coded data respectively by using the Transformer encoder, the one-dimensional convolution and one-dimensional pooling layer units and the MLP multi-layer perceptron to obtain a plurality of first type feature data and a plurality of second type feature data; and concatenating all the second type feature data to obtain a cognitive feature matrix;

[0019] S4: marking the cognitive feature matrix according to the stage of non-disease from which the complete medical indicator data of each detection category originates, and performing convolution operation on the marked cognitive feature matrix using the atrous convolutional neural network layer to obtain a stage identification value;

[0020] S5: Calculate the standard deviation value of the first category feature data and the standard deviation value of the stage identification value respectively to obtain a first standard deviation value and a second standard deviation value; update the cross entropy loss function of the data detection and classification model based on the first standard deviation value and the second standard deviation value, calculate the first loss value and the second loss value according to the cross entropy loss function, and perform joint parameter optimization on the data detection and classification model according to the first loss value and the second loss value to form multi-task optimization training.

[0021] Furthermore, in the above S1, the medical indicator data of each detection category in all pre-disease stages include: blood indicators, heart-related indicators, blood vessel-related indicators, inflammation indicators, homocysteine ​​indicators, electrocardiographic indicators, biochemical indicators, muscle strength and endurance indicators, immune function indicators and psychological indicators.

[0022] Furthermore, in the above S1, the first data set is represented and encoded by increasing the dimension, and the first type of encoded data is obtained as follows:

[0023] S1.1: Construct a multi-parameter Gaussian kernel function, and use the multi-parameter Gaussian kernel function to calculate the multi-parameter Gaussian kernel function values ​​between all medical indicator data in the first data set to obtain a kernel matrix; wherein the multi-parameter Gaussian kernel function is shown in the following formula:

[0024]

[0025] where x i and x j represents the medical indicator data of the same detection category in different stages of disease-free period, exp represents the calculation of exponential function value, ||x i -x j || means calculating x i and x j The Euclidean distance between them, σ, β and Bias all represent adjustable hyperparameters, and n represents the number of medical indicator data in a detection category;

[0026] S1.2: Centering the kernel matrix and calculating the transposed matrix of the kernel matrix;

[0027] S1.3: constructing two covariance matrices based on the kernel matrix and the transposed matrix, and solving the maximum correlation row and column vectors between the kernel matrix and the transposed matrix based on the maximum value coordinates of the covariance matrix;

[0028] S1.4: Concatenate the maximum correlation row and column vectors of the kernel matrix and the maximum correlation row and column vectors of the transposed matrix to obtain first-category coded data.

[0029] Furthermore, in the above S1.2, the centralization of the kernel matrix is ​​specifically as follows: calculating the mean of the multi-parameter Gaussian kernel function values ​​in each row and column of the kernel matrix, subtracting the corresponding mean from the multi-parameter Gaussian kernel function values ​​of each row and column of the kernel matrix, and realizing the centralization of the kernel matrix.

[0030] Furthermore, the above S3 is specifically:

[0031] S3.1: receiving a specified number of first-category coded data at one time, and receiving the second-category coded data in sequence according to the detection category, and using the Transformer encoder, the one-dimensional convolution and one-dimensional pooling layer units, and the MLP multi-layer perceptron to perform feature recognition on the first-category coded data and the second-category coded data, respectively, to obtain a plurality of first-category feature data and a plurality of second-category feature data;

[0032] S3.2: converting all the second-category feature data into vector data in Tensor format, and concatenating the converted vector data in sequence;

[0033] S3.3: After all the vector data are concatenated, the concatenated vector data are converted into a cognitive feature matrix of a fixed size.

[0034] Furthermore, in the above S4, the atrous convolutional neural network layer includes: two layers of layers.Conv2D neural network layers, one pooling layer, two layers of layers.Conv2D neural network layers and two fully connected layers.

[0035] Further, the above S5 is specifically:

[0036] S5.1: Obtain the first type of feature data and stage identification value, and solve the standard deviation of the first type of feature data and the stage identification value respectively to obtain batch_size first standard deviation values ​​and batch_size second standard deviation values; the standard deviation value is solved as shown in the following formula:

[0037]

[0038]

[0039] in, Indicates the first standard deviation value, std indicates the standard deviation calculation, output n1 Represents the first type of feature data, Batch_Size is the sample size of the single input data detection classification model, Indicates the second standard deviation value, output n2 Indicates the stage identification value;

[0040] S5.2: Based on the loss function, weight calculation is performed on the first standard deviation value and the second standard deviation value respectively to obtain a first weight value and a second weight value; the weight calculation is performed as shown in the following formula:

[0041]

[0042]

[0043] in, represents the first weight value, represents the second weight value, and sum represents a summation operation;

[0044] S5.3: Based on the obtained first weight value and second weight value, the first type of feature data and the stage identification value are assigned respectively, and a softmax operation is performed to obtain logits for calculating the loss value of the data detection classification model. n1 and logits n2 ; The softmax operation is shown as follows:

[0045]

[0046]

[0047] Among them, softmax represents the softmax function, logits_weight n1 Indicates the first weight value, logits_weight n2 represents the second weight value;

[0048] S5.4: Based on the first type of feature data and the stage recognition value after the weight assignment is completed, the cross entropy loss function is calculated respectively to obtain a first loss value and a second loss value. By adding the first loss value and the second loss value, the data detection classification model is jointly optimized in parameters. The calculation of the cross entropy loss function is shown in the following formula:

[0049]

[0050]

[0051] Among them, loss cn_std1 Represents the first loss value, loss cn_std2 represents the second loss value, Adam represents the Adam model optimizer, B_s represents the batch_size value of the input data detection classification model, one_hot represents the unique hot encoding of the label data, label i Indicates the detection category of the medical indicator data, label j represents various stages of non-disease, and log represents logarithmic calculation.

[0052] In a second aspect, in order to solve the above technical problems, the present invention also provides a non-disease stage detection device based on data dimension upgrading and deep learning, comprising:

[0053] A data dimension-upgrading coding module is used to obtain the medical indicator data of each detection category in all the disease-free stages based on multiple disease-free stages to obtain a first data set, perform dimension-upgrading representation and coding on the first data set based on the first input port of the model to obtain first-category coded data; sequentially obtain complete medical indicator data of each detection category in a disease-free stage until the medical indicator data of all the disease-free stages are obtained to form a second data set, perform dimension-upgrading representation and coding on the second data set based on the second input port of the model to obtain second-category coded data;

[0054] A model training module is used to construct a data detection and classification model, wherein the data detection and classification model includes: a Transformer encoder, a one-dimensional convolution and a one-dimensional pooling layer unit, an MLP multi-layer perceptron and a hole convolutional neural network layer; the first type of coded data and the second type of coded data are respectively input into the data detection and classification model, and the model training module is cyclically executed to the preset rounds of the parameter optimization module, and the data detection and classification model is iteratively trained to obtain a trained data detection and classification model; according to the trained data detection and classification model, the medical indicator data to be detected is identified and analyzed to complete the identification of the non-disease stage;

[0055] A cognitive feature matrix module is used to receive the first type of coded data and the second type of coded data, and use the Transformer encoder, one-dimensional convolution and one-dimensional pooling layer units and MLP multi-layer perceptron to perform feature recognition on the first type of coded data and the second type of coded data respectively to obtain a plurality of first type feature data and a plurality of second type feature data; and concatenate all the second type feature data to obtain a cognitive feature matrix;

[0056] A dilated convolutional neural network module is used to mark the cognitive feature matrix according to the stage of non-disease from which the complete medical indicator data of each detection category originates, and to perform a convolution operation on the marked cognitive feature matrix using the dilated convolutional neural network layer to obtain a stage identification value;

[0057] A parameter optimization module is used to respectively calculate the standard deviation value of the first category feature data and the standard deviation value of the stage identification value to obtain a first standard deviation value and a second standard deviation value; based on the first standard deviation value and the second standard deviation value, the cross entropy loss function of the data detection and classification model is updated, the first loss value and the second loss value are calculated according to the cross entropy loss function, and the data detection and classification model is jointly optimized according to the first loss value and the second loss value to form multi-task optimization training.

[0058] In the third aspect, in order to solve the above-mentioned technical problems, the present invention also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for detecting the pre-disease stage based on data dimensionality upgrading and deep learning of the present application is implemented.

[0059] In a fourth aspect, in order to solve the above-mentioned technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for detecting the pre-disease stage based on data dimensionality upgrading and deep learning of the present application is implemented.

[0060] The beneficial effects of the present invention are:

[0061] The present invention improves the dimension of one-dimensional medical indicator data so that multiple categories of medical indicator data can be differentially expressed in a high-dimensional space, and the feature richness and inter-class distinguishability between different categories of medical indicator data are improved as much as possible, so that medical indicator data of different detection categories at different stages of pre-disease can be accurately and quickly identified by the data detection classification model. The data detection classification model for classification and identification of pre-disease stages constructed based on multiple neural networks can accurately identify and refine different stages of pre-disease based on data-driven methods without prior medical knowledge, thereby improving the universality and generalization ability of the data detection classification model and lowering the threshold for pre-disease stage detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 A framework diagram of a method for detecting a disease-free stage based on data dimension upgrading and deep learning provided by an embodiment of the present invention;

[0063] Figure 2A flow chart of data dimension upgrading and encoding modules in a method for detecting a disease-free stage based on data dimension upgrading and deep learning provided by one embodiment of the present invention;

[0064] Figure 3 A neural network structure diagram of a data detection classification model in a method for detecting a disease-free stage based on data dimension upgrading and deep learning provided by an embodiment of the present invention;

[0065] Figure 4 An overall operation flow chart of a method for detecting pre-disease stages based on data dimensionality upgrading and deep learning provided for one embodiment of the present invention. DETAILED DESCRIPTION

[0066] The principles and features of the present invention are described below. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.

[0067] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0068] The solution provided by the embodiment of the present invention can be applied to any application scenario requiring data storage. The solution provided by the embodiment of the present invention can be executed by any electronic device.

[0069] The embodiment of the present invention provides a possible implementation method, which provides a method for detecting the pre-disease stage based on data dimension upgrading and deep learning, which is applied to a computer device installed with the Tensorflow2.4 deep learning framework written in Python and running on the Windows operating system. The network includes a data dimension upgrading and encoding module and a data detection classification model. The method operation includes the following specific steps:

[0070] S1: Based on multiple healthy stages, obtain the medical indicator data of each detection category in all healthy stages to obtain a first data set, perform dimension-upgrading representation and encoding on the first data set based on the first input port of the model to obtain first-category coded data; sequentially obtain complete medical indicator data of each detection category in a healthy stage until the medical indicator data of all healthy stages are obtained to form a second data set, perform dimension-upgrading representation and encoding on the second data set based on the second input port of the model to obtain second-category coded data;

[0071] S2: construct a data detection and classification model, which includes: a Transformer encoder, a one-dimensional convolution and one-dimensional pooling layer unit, an MLP multi-layer perceptron and a hole convolution neural network layer; input the first type of encoded data and the second type of encoded data into the data detection and classification model respectively, and execute the preset rounds of S3-S5 in a loop, iteratively train the data detection and classification model to obtain a trained data detection and classification model, and identify and analyze the medical indicator data to be detected according to the trained data detection and classification model to complete the identification of the pre-disease stage;

[0072] S3: receiving the first type of coded data and the second type of coded data, and performing feature recognition on the first type of coded data and the second type of coded data respectively by using the Transformer encoder, the one-dimensional convolution and one-dimensional pooling layer units and the MLP multi-layer perceptron to obtain a plurality of first type feature data and a plurality of second type feature data; and concatenating all the second type feature data to obtain a cognitive feature matrix;

[0073] S4: marking the cognitive feature matrix according to the stage of non-disease from which the complete medical indicator data of each detection category originates, and performing convolution operation on the marked cognitive feature matrix using the atrous convolutional neural network layer to obtain a stage identification value;

[0074] S5: Calculate the standard deviation value of the first category feature data and the standard deviation value of the stage identification value respectively to obtain a first standard deviation value and a second standard deviation value; update the cross entropy loss function of the data detection and classification model based on the first standard deviation value and the second standard deviation value, calculate the first loss value and the second loss value according to the cross entropy loss function, and perform joint parameter optimization on the data detection and classification model according to the first loss value and the second loss value to form multi-task optimization training.

[0075] In the present invention, the disease-free stage includes five stages, specifically including: the pre-development stage, the pre-onset stage, the pre-transmission stage, the pre-severity stage and the pre-recovery stage. Among them, each stage is distinguished and judged by the specific data of ten detection categories, and these specific data are called medical indicator data in the present invention. Therefore, the ten medical indicator data of the present invention include blood indicators, heart-related indicators, blood vessel-related indicators, inflammation indicators, homocysteine ​​indicators, electrocardiographic indicators, biochemical indicators, muscle strength and endurance indicators, immune function indicators and psychological indicators.

[0076] Optionally, in S1, the first data set is represented and encoded by dimension-upgrading, and the first type of encoded data obtained is specifically:

[0077] S1.1: Construct a multi-parameter Gaussian kernel function, and use the multi-parameter Gaussian kernel function to calculate the multi-parameter Gaussian kernel function values ​​between all medical indicator data in the first data set to obtain a kernel matrix; wherein the multi-parameter Gaussian kernel function is shown in the following formula:

[0078]

[0079] where x i and x j represents the medical indicator data of the same detection category in different stages of disease-free period, exp represents the calculation of exponential function value, ||x i -x j || means calculating x i and x j The Euclidean distance between them, σ, β and Bias all represent adjustable hyperparameters, and n represents the number of medical indicator data in a detection category;

[0080] S1.2: Centering the kernel matrix and calculating the transposed matrix of the kernel matrix;

[0081] In the present invention, the kernel matrix is ​​centralized specifically as follows: the mean of the multi-parameter Gaussian kernel function values ​​in each row and column of the kernel matrix is ​​calculated, and the corresponding mean is subtracted from the multi-parameter Gaussian kernel function values ​​of each row and column of the kernel matrix to realize the kernel matrix centralization.

[0082] S1.3: constructing two covariance matrices based on the kernel matrix and the transposed matrix, and solving the maximum correlation row and column vectors between the kernel matrix and the transposed matrix based on the maximum value coordinates of the covariance matrix;

[0083] S1.4: Concatenate the maximum correlation row and column vectors of the kernel matrix and the maximum correlation row and column vectors of the transposed matrix to obtain first-category coded data.

[0084] In the present invention, after solving the kernel function value of the medical indicator data of a detection category at different stages of disease prevention by using a multi-parameter Gaussian kernel function, the corresponding kernel matrix M is constructed. G_k The kernel matrix is ​​shown as follows:

[0085]

[0086] Then the kernel function value of each row or column in the kernel matrix is ​​solved for the mean value to obtain the mean data NL (i,j) , get the mean data NL (i,j) As shown below:

[0087]

[0088] Among them, Sum represents the sum of data.

[0089] Divide each kernel function value in the kernel matrix by the mean data of each row and column in the kernel matrix to obtain the centralized kernel matrix M G_K , the centralized kernel matrix M G_K As shown below:

[0090]

[0091] Construct the kernel matrix M G_K The transposed matrix M G_K T , based on the kernel matrix M G_K and the transposed matrix M G_K T , calculate the first covariance matrix M G_Kcov1 and the second covariance matrix M G_Kcov2 , the first covariance matrix M G_Kcov1 and the second covariance matrix M G_Kcov2 As shown below:

[0092]

[0093]

[0094] Based on the first covariance matrix, find the non-diagonal data with the largest value in the Ith row, and record their positions L(M) in the first covariance matrix. G_Kcov1 ) and C(M G_Kcov1 ). and is expressed by the following formula:

[0095]

[0096] Among them, Max_k (L (M G_Kcov1 ) and C(M G_Kcov1 )) represents the coordinate position of the non-diagonal data with the largest value in the Ith row, and the I value is the row of the medical indicator data to be upgraded in the kernel matrix that participates in the kernel function value calculation the most times.

[0097] Based on the second covariance matrix, find the non-diagonal data with the largest value in the Jth column and record their coordinates L(M) in the covariance matrix. G_Kcov2 ) and C(M G_Kcov2 ). and is expressed by the following formula:

[0098]

[0099] Among them, Max_k (L (M G_Kcov2 ) and C(M G_Kcov2)) represents the coordinate position of the non-diagonal data with the largest value in the Jth column, and the J value is the column that participates in the kernel function value calculation the most times in the transposed matrix of the kernel function matrix of the required dimensionality-upgraded data.

[0100] Then, according to The recorded coordinate data is obtained from the kernel matrix M G_K Extract the row vector of the corresponding coordinates, and according to The recorded coordinate data is obtained from the transposed matrix M G_K T Extract the column vector of the corresponding coordinates and construct the corresponding first vector pair V_P i . As shown in the following formula:

[0101]

[0102] Wherein, Vec represents a vector, [L] is a row vector, and [C] is a column vector. In the present invention, and Respectively based on and The coordinates in M ​​are extracted G_K The row vector of the corresponding coordinates in M G_K T The corresponding column vectors in constitute the first vector pair.

[0103] Similarly, according to The recorded coordinate data is obtained from the transposed matrix M G_K T Extract the row vector corresponding to the coordinates, and from the kernel matrix M G_K Extract the column vector of the corresponding coordinates and construct the corresponding second vector pair V_P j . As shown in the following formula:

[0104]

[0105] in, and Respectively based on and The coordinates in M ​​are extracted G_K T The row vector of the corresponding coordinates in M G_K The corresponding column vectors in constitute the second vector pair.

[0106] The first vector pair and the second vector pair are combined to obtain the dimension-upgraded data based on four vectors. The dimension-upgraded data is shown in the following formula:

[0107]

[0108] in, Indicates merging the first vector pair and the second vector pair.

[0109] In summary, the present invention calculates the inner product between all medical indicator data through a multi-parameter Gaussian kernel function to form a kernel matrix, and then normalizes the kernel matrix to ensure that the data in the kernel matrix is ​​concentrated and the distribution characteristics of the dimensionalized data are complete. Data centralization is completed by subtracting the corresponding mean from each row and each column of the kernel matrix. The centralized kernel matrix is ​​then transposed and solved, and multiplied with its transposed matrix to obtain a first covariance matrix, and then its transposed matrix is ​​multiplied with it to obtain a second covariance matrix. Finally, since the off-diagonal values ​​of the first covariance matrix and the second covariance matrix represent the correlation between the corresponding vectors in the two matrices for calculating the covariance matrix, the dimensionality-increasing characterization method of the original data of the present invention is constructed by merging strongly correlated vectors. Therefore, and Indicates that based on M G_Kcov1 and M G_Kcov2 , find the largest off-diagonal value in each row and column. Its meaning is to find the same kind of data with the greatest correlation between each medical indicator data and itself. G_Kcov1 Find the maximum value in the Ith row of G_Kcov2 The maximum value is found in the Jth column of M, which is to find the covariance data with the greatest correlation with the Ith or Jth medical indicator data being upgraded, and so on. If the upgraded medical indicator data is used to calculate the kernel function value with other medical indicator data of the same type in a row in the kernel matrix, then the I value is the number of this row. Similarly, the method for finding the J value in the transposed matrix of the kernel matrix is ​​the same. Further, record these largest off-diagonal values ​​in M G_Kcov1 and M G_Kcov2 The position coordinates of V_P i In and Indicates based on and The position coordinates in the extract kernel matrix M G_K A row vector at the corresponding position in and a transposed matrix M G_K T The corresponding column vectors in , form a vector pair, namely the first vector pair. j Indicates extraction of M G_K T and M G_K Finally, the four vectors are concatenated to complete the dimensionality-enhanced representation of a certain medical indicator data based on the medical indicator data of the same detection category.

[0110] In the present invention, the steps of performing dimensionality-upgrading characterization on the first data set are the same as those of performing dimensionality-upgrading characterization on the second data set. Both of them realize dimensionality-upgrading characterization of medical indicator data through the above steps. However, when processing the first data set, the multi-parameter Gaussian kernel function is used to calculate the multi-parameter Gaussian kernel function values ​​between the medical indicator data under the same detection category in different disease-free stages. When processing the second data set, the multi-parameter Gaussian kernel function is used to calculate the multi-parameter Gaussian kernel function values ​​between the medical indicator data under different detection categories in a disease-free stage.

[0111] Optionally, in S2 of the present invention, the Keras class in the Tensorflow2.4 framework is used to build a data detection and classification model. The data detection and classification model has dual input ports, and mainly includes a Transformer encoder, one-dimensional convolution and one-dimensional pooling layer units, an MLP multi-layer perceptron, and a void convolutional neural network layer that can be used to identify subsequent cognitive feature matrices.

[0112] In this embodiment, the Transformer encoder includes a multi-head attention mechanism class. In the Transformer encoder, the data dual input port and the number of heads self.num_heads, as well as the input dimension self.depth of the medical indicator data that each head should receive are defined. The layers.Dense layer is further used to construct the weight matrix of Q (query vector), K (key vector), and V (value vector) for data extraction, and then the tf.reshape function and tf.transpose function are used to reshape and transpose the medical indicator data calculated by the weight matrix. Finally, the call function is defined to complete the data operation based on the multi-head attention mechanism class, including using tf.matmul and tf.nn.softmax to calculate and normalize the attention scores of Q (query vector) and K (key vector), and using tf.matmul, tf.reshape and tf.transpose to complete the superposition of the attention score and V (value vector), and complete the construction of the multi-head attention mechanism.

[0113] The Transformer encoder, one-dimensional convolution and one-dimensional pooling layer units, and MLP multi-layer perceptron are further defined, including the use of layers.Dense and layers.LayerNormalization to complete the forward propagation and normalization of data. The Dense layer uses the Relu activation function, and the layers.Dropout function is to prevent the Transformer encoder from overfitting. The layers.MaxPooling1D and layers.Conv1D functions with a step size of 2 are further used to complete the one-dimensional convolution and one-dimensional pooling of the encoded data output by the Transformer encoder (including the first type of encoded data and the second type of encoded data) to achieve the effect of further extracting and screening the encoded data. The convolution kernel size of layers.Conv1D is 1×1, and the activation function used is the Leaky_Relu activation function. Finally, the encoded data after screening and extraction was sent to an MLP multi-layer perceptron built with 4 fully connected layers. The number of nodes from the first to the fourth fully connected layers were 512, 256, 128, and 50, respectively. The last fully connected layer was further activated using the Relu function, and then the tf.nn.softmax function was used to complete the normalization operation to complete the model's calculation of the medical indicator data.

[0114] In this embodiment, the hole convolutional neural network part uses layers.Conv2D in the Tensorflow2.4 framework and sets its dilation_rate parameter, which is set to 3 in this paper, and uses layers.MaxPooling2D maximum pooling neural network to construct a hole convolutional neural network for cognitive feature matrix recognition. The advantage of using a hole convolutional neural network is that it can increase the convolution receptive field without increasing the number of model parameters, improve the context modeling ability of data, and prevent overfitting. The convolutional neural network uses a total of 8 layers of neural networks. The first two layers are layers.Conv2D neural networks with a convolution kernel size of 3×3, which realizes feature extraction of cognitive feature matrices, and the third layer is a pooling layer with a pooling kernel size of 2×2 constructed by layers.MaxPooling2D. The fourth and fifth layers are layers.Conv2D neural networks, whose convolution kernel size is 1×1. The use of 1×1 small convolution kernel is mainly to cut the calculation parameters of the model and improve the operation efficiency. The last two layers of the neural network are fully connected layers with 64 and 50 nodes respectively. tf.nn.softmax is used to operate the last fully connected layer, and tf.argmax is used to extract the data detection classification model to identify the stage of non-disease, so as to complete the judgment of the non-disease stage of the human body.

[0115] In summary, in this embodiment, the powerful feature extraction and contextual relationship modeling capabilities of the Transformer encoder are used to complete the attention encoding of the medical indicator data. Furthermore, one-dimensional convolution with a small convolution kernel and a one-dimensional pooling layer are used to refine the attention-encoded data while completing the parameter clipping of the model. Finally, the MLP multi-layer perceptron built with a fully connected layer is used to compress and encode the calculated data. The subsequent void convolutional neural network is based on the cognitive feature matrix composed of the spliced ​​model output values ​​to achieve accurate identification of various pre-disease stages, so as to build a complete data detection and classification model for the classification of medical indicator data.

[0116] Optional, S3 is:

[0117] S3.1: receiving a specified number of first-category coded data at one time, and receiving the second-category coded data in sequence according to the detection category, and using the Transformer encoder, the one-dimensional convolution and one-dimensional pooling layer units, and the MLP multi-layer perceptron to perform feature recognition on the first-category coded data and the second-category coded data, respectively, to obtain a plurality of first-category feature data and a plurality of second-category feature data;

[0118] S3.2: converting all the second-category feature data into vector data in Tensor format, and concatenating the converted vector data in sequence;

[0119] S3.3: After all the vector data are concatenated, the concatenated vector data are converted into a cognitive feature matrix of a fixed size.

[0120] In this embodiment, a specified number (set as Batch_Size in the present invention) of medical indicator data of the same type marked at different stages of disease-free are sent to the data detection classification model, and finally, according to the Transformer encoder, one-dimensional convolution and one-dimensional pooling layer unit and MLP multi-layer perceptron, Batch_Size vector data of size 1×50 are calculated and output, i.e., the first type of feature data. Since the data detection classification model is a dual-input model, at this time, another input port of the model is used to upgrade and encode a piece of medical indicator data that completely contains each detection category according to the step of S1 to obtain the second type of encoded data, and the second type of encoded data is sequentially calculated by the Transformer encoder, one-dimensional convolution and one-dimensional pooling layer unit and MLP multi-layer perceptron according to the detection category, and 10 (10 is the number of detection categories used in the present invention) 1×50 vectors are obtained in sequence. The tf.constant function is further used to convert the above 10 vectors into vectors in Tensor format, and then the tf.connect function is used to splice these Tensor vectors in the direction of aix=0. Finally, the tf.reshape function is used to convert the above vectors into a matrix of size 10×50. At this point, the corresponding cognitive feature matrix based on the original medical indicator data is constructed.

[0121] Optionally, in S4, the atrous convolutional neural network layers include: two layers.Conv2D neural network layers, one pooling layer, two layers.Conv2D neural network layers, and two fully connected layers.

[0122] In this embodiment, first, according to the stage of non-disease from which the medical indicator data to be trained comes, the corresponding cognitive feature matrix is ​​labeled, and these labels mark the stage of non-disease corresponding to the medical data to be trained. Further, layers.Conv2D in the Tensorflow2.4 framework is used and its dilation_rate parameter is set, and the layers.MaxPooling2D function is used to construct a hollow convolutional neural network layer for recognizing the cognitive feature matrix. The hollow convolutional neural network layer uses a total of 8 layers of neural networks. The first two layers are layers.Conv2D neural networks with a convolution kernel size of 3×3, which realizes feature extraction of the cognitive feature matrix, and the third layer is a pooling layer with a pooling kernel size of 2×2 constructed by layers.MaxPooling2D. The fourth and fifth layers are layers.Conv2D neural networks, whose convolution kernel size is 1×1. The use of a small 1×1 convolution kernel is mainly to trim the calculation parameters of the model and improve operating efficiency. The last two layers of the neural network are fully connected layers with 64 and 50 nodes, respectively. The tf.nn.softmax function is used to operate the last fully connected layer, and the tf.argmax function is used to extract the recognition results of the hollow convolutional neural network layer for the disease-free stage based on the certification feature matrix.

[0123] In this embodiment, the stage identification value output by the dilated convolutional neural network layer based on the authentication feature matrix is ​​expressed by the following formula:

[0124]

[0125] Among them, softmax means normalizing the data after the above fully connected layer, that is, scaling the data according to the weight ratio so that their sum is one. Dence means using full connection to operate on the data input into the fully connected layer.

[0126] Optionally, S5 is specifically:

[0127] S5.1: Obtain the first type of feature data and stage identification value, and solve the standard deviation of the first type of feature data and the stage identification value respectively to obtain batch_size first standard deviation values ​​and batch_size second standard deviation values; the standard deviation value is solved as shown in the following formula:

[0128]

[0129]

[0130] in, Indicates the first standard deviation value, std indicates the standard deviation calculation, output n1Represents the first type of feature data, Batch_Size is the sample size of the single input data detection classification model, Indicates the second standard deviation value, output n2 Indicates the stage identification value;

[0131] S5.2: Based on the loss function, weight calculation is performed on the first standard deviation value and the second standard deviation value respectively to obtain a first weight value and a second weight value; the weight calculation is performed as shown in the following formula:

[0132]

[0133]

[0134] in, represents the first weight value, represents the second weight value, and sum represents a summation operation;

[0135] S5.3: Based on the obtained first weight value and second weight value, the first type of feature data and the stage identification value are assigned respectively, and a softmax operation is performed to obtain logits for calculating the loss value of the data detection classification model. n1 and logits n2 ; The softmax operation is shown as follows:

[0136]

[0137]

[0138] Among them, softmax represents the softmax function, logits_weight n1 Indicates the first weight value, logits_weight n2 represents the second weight value;

[0139] S5.4: Based on the first type of feature data and the stage recognition value after the weight assignment is completed, the cross entropy loss function is calculated respectively to obtain a first loss value and a second loss value. By adding the first loss value and the second loss value, the data detection classification model is jointly optimized in parameters. The calculation of the cross entropy loss function is shown in the following formula:

[0140]

[0141]

[0142] Among them, loss cn_std1 Represents the first loss value, loss cn_std2represents the second loss value, Adam represents the Adam model optimizer, B_s represents the batch_size value of the input data detection classification model, one_hot represents the unique hot encoding of the label data, label i Indicates the detection category of the medical indicator data, label j represents various stages of non-disease, and log represents logarithmic calculation.

[0143] In summary, in this embodiment, first, the tf.math.reduce_std function is used to calculate the standard deviation values ​​of the first type of feature data and the stage identification value. Further, the weights of the two different standard deviation values ​​are calculated respectively, and the corresponding weight values ​​are set in reverse. The first type of feature data and the stage identification value are assigned based on the weight values. Since a data sample is easy to identify, the standard deviation of the value output after the data detection classification model is calculated and the softmax operation is large, that is, the probability of the tested data being correctly predicted is high, and then the probability of it being predicted as other detection categories is low, so this set of predicted data (the predicted category of the predicted data is the same as the number of undiagnosed stages of the present invention, which is the number of undiagnosed stages 5 in the present invention) The standard deviation is large, on the contrary, if a sample is difficult to be classified, then the set of data predicted by the model is relatively close, that is, it cannot be accurately predicted by the model as data of a certain undiagnosed stage. By setting the attention weight, the purpose is to make the model focus on and learn the cognitive feature matrix that is difficult to detect and identify, so as to improve the accuracy and efficiency of the detection and classification module in identifying the stage of non-disease. Finally, based on the tf.losses.sparse_categorical_crossentropy function and the first type of feature data and stage identification value that completes the weight assignment, that is, two different types of logits, the cross entropy loss function based on the standard deviation value of the model output is used to calculate the two types of loss function values ​​of the model. Finally, based on the addition result of the two types of loss function values, the corresponding model parameters are jointly updated using the model optimizer to complete the multi-task optimization learning task.

[0144] First, under tf.GradientTape() as tape:, use the tape.gradient function to complete the gradient solution of the model. tf.GradientTape() as tape: allows TensorFlow to record all the operation data of the model, which is convenient for building calculation graphs and calculating the gradients of certain data tensors to complete the subsequent model parameter updates. Furthermore, the Adam optimizer built using the Tensorflow2.4 framework is used. The specific codes are optimizers.Adam and optimizer.apply_gradients to complete the parameter update of the data monitoring classification module. 0.0003 is set as the learning rate of the Adam optimizer, and the other two hyperparameters use the optimizer default values, that is, beta_1 is 0.9 and beta_2 is 0.999. The label data encoding of the two major types of input data detection classification models is uniformly using the tf.one_hot function.

[0145] Optionally, in S2 of the present invention, S3-S5 are executed cyclically, and the data detection classification model is trained to convergence according to the preset number of training rounds, and then the running file of the data detection classification model is stored. Subsequently, based on the data dimension upgrade and encoding method and the running file of the data detection classification model, the staged detection and identification of non-disease can be carried out quickly.

[0146] In this embodiment, an Epochs value of 100 is set. When the Epochs value is less than the set threshold value (100 in the present invention), the print function is used to dynamically output the accuracy, precision, recall, F1 score, number of training steps, and type of each data sample in real time, so as to facilitate real-time viewing of the training status of the data detection classification model. When the number of training times reaches the set value, the training of the data detection classification model is completed, and Keras.models.save_model is used to save the trained model file in a pre-specified folder. If it is necessary to directly complete the detection of the disease-free stage in the future, the model file can be directly called and the corresponding original can be input.

[0147] The embodiment of the present invention further provides a device for detecting a disease-free stage based on data dimension upgrading and deep learning. The device for detecting a disease-free stage based on data dimension upgrading and deep learning may include:

[0148] A data dimension-upgrading coding module is used to obtain the medical indicator data of each detection category in all the disease-free stages based on multiple disease-free stages to obtain a first data set, perform dimension-upgrading representation and coding on the first data set based on the first input port of the model to obtain first-category coded data; sequentially obtain complete medical indicator data of each detection category in a disease-free stage until the medical indicator data of all the disease-free stages are obtained to form a second data set, perform dimension-upgrading representation and coding on the second data set based on the second input port of the model to obtain second-category coded data;

[0149] A model training module is used to construct a data detection and classification model, wherein the data detection and classification model includes: a Transformer encoder, a one-dimensional convolution and a one-dimensional pooling layer unit, an MLP multi-layer perceptron and a hole convolutional neural network layer; the first type of coded data and the second type of coded data are respectively input into the data detection and classification model, and the model training module is cyclically executed to the preset rounds of the parameter optimization module, and the data detection and classification model is iteratively trained to obtain a trained data detection and classification model; according to the trained data detection and classification model, the medical indicator data to be detected is identified and analyzed to complete the identification of the non-disease stage;

[0150] A cognitive feature matrix module is used to receive the first type of coded data and the second type of coded data, and use the Transformer encoder, one-dimensional convolution and one-dimensional pooling layer units and MLP multi-layer perceptron to perform feature recognition on the first type of coded data and the second type of coded data respectively to obtain a plurality of first type feature data and a plurality of second type feature data; and concatenate all the second type feature data to obtain a cognitive feature matrix;

[0151] A dilated convolutional neural network module is used to mark the cognitive feature matrix according to the stage of non-disease from which the complete medical indicator data of each detection category originates, and to perform a convolution operation on the marked cognitive feature matrix using the dilated convolutional neural network layer to obtain a stage identification value;

[0152] A parameter optimization module is used to respectively calculate the standard deviation value of the first category feature data and the standard deviation value of the stage identification value to obtain a first standard deviation value and a second standard deviation value; based on the first standard deviation value and the second standard deviation value, the cross entropy loss function of the data detection and classification model is updated, the first loss value and the second loss value are calculated according to the cross entropy loss function, and the data detection and classification model is jointly optimized according to the first loss value and the second loss value to form multi-task optimization training.

[0153] The device for detecting the pre-disease stage based on data dimensionality upgrading and deep learning in the embodiment of the present invention can execute the method for detecting the pre-disease stage based on data dimensionality upgrading and deep learning provided by the embodiment of the present invention, and the implementation principle is similar. The actions performed by each module and unit in the device for detecting the pre-disease stage based on data dimensionality upgrading and deep learning in each embodiment of the present invention correspond to the steps in the method for detecting the pre-disease stage based on data dimensionality upgrading and deep learning in each embodiment of the present invention. For the detailed functional description of each module of the device for detecting the pre-disease stage based on data dimensionality upgrading and deep learning, please refer to the description in the corresponding method for detecting the pre-disease stage based on data dimensionality upgrading and deep learning shown in the previous text, which will not be repeated here.

[0154] The present invention is described in detail below by way of examples.

[0155] Example 1

[0156] like Figure 1 As shown, the invention includes a data dimension-upgrading representation module and a data detection and classification model; the data dimension-upgrading and encoding module is as shown in Figure 1 As shown in the first six steps, these six steps are used to separately increase the dimensionality of various medical indicator data at different stages before illness, thereby improving their feature richness and inter-class distinguishability. Figure 1 The subsequent six steps are the steps of the data detection and classification model. The data detection and classification model includes a Transformer encoder part, one-dimensional convolution and one-dimensional pooling layer units, MLP multi-layer perceptron, and a void convolutional neural network that can be used to identify the subsequent cognitive feature matrix. Its function is to identify various types of medical indicator data after dimensionality increase and construct a cognitive feature matrix, and finally identify different stages of disease.

[0157] like Figure 2As shown, it is a step diagram for dimensionality enhancement of a single medical indicator data. First, the pd.read_csv function in the Pandas library in the Python programming language is used to read various medical indicator data saved in CSV format. These medical indicator data are saved in different CSV files according to different stages of disease and their detection categories, and then these refined various medical indicator data are marked separately. The data marking step is completed by the Split() function that comes with Python, and the label data of different classes are stored in different List lists, so as to complete the marking of medical indicator data of each detection category at different stages of disease. Subsequently, the kernel function of the present invention is used to calculate the kernel function value between all similar data points in the same stage of disease. This step is mainly based on the tf.norm() function to complete and form a kernel matrix. This step is mainly based on the tf.constant function and the tf.reshape function. Then, in order to ensure that the data in the kernel matrix is ​​concentrated and the distribution characteristics of the dimension-enhanced data are complete, the present invention decides to perform a centralization operation on it based on the kernel matrix. The data center is completed by subtracting the corresponding mean from each row and column of the kernel matrix. This step is mainly based on the tf.reduce_mean function. Then the kernel matrix that has been centered is transposed and multiplied with its transposed matrix to obtain the first covariance matrix. Then the transposed matrix is ​​multiplied with it to obtain the second covariance matrix. The solution of the transposed matrix is ​​based on the tf.transpose function, and the solution of the covariance matrix is ​​completed using the tf.matmul function. Finally, since the off-diagonal values ​​of the covariance matrix represent the correlation of the corresponding vectors in the two matrices for calculating the covariance matrix, the row and column vectors corresponding to the kernel matrix and its transposed matrix are found by finding the maximum values ​​of the Ith row and the Jth column in the two covariance matrices, except for the off-diagonal lines, and based on their coordinates in the covariance matrix, to construct a total of two strongly correlated vector pairs. The above I value and J value are the row values ​​or column values ​​of the required dimension-raising data in the kernel matrix and its transposed matrix that participate in the kernel function value calculation the most times. Find the maximum value of the covariance matrix. This step is mainly based on functions such as np.tril, np.fill_diagonal, and np.max in the Numpy library. Finally, the strongly correlated vector pairs are spliced ​​to complete the dimensionality characterization method of the medical indicator data of the present invention, so as to achieve the purpose of dimensionality increase of a certain medical indicator data. The tf.concat function is used for splicing vector pairs.

[0158] like Figure 3As shown, the data detection classification model has a dual input port, which is mainly composed of a Transformer encoder part, a one-dimensional convolution and a one-dimensional pooling layer unit, an MLP multi-layer perceptron, and a hollow convolutional neural network that can be used to identify the subsequent "cognitive feature matrix". A Transformer encoder is constructed in the data detection classification model. It includes a multi-head attention mechanism class, in which the dual data input ports and the number of multi-heads self.num_heads (set to 10 in this embodiment) are defined, as well as the data input dimension self.depth that each head should receive, which is set to 100 in the present invention. The layers.Dense layer is further used to construct the weight matrices of Q (query vector), K (key vector), and V (value vector) for data extraction, and then the tf.reshape function and the tf.transpose function are used to reshape and transpose the data calculated by the weight matrix. Finally, the call function is defined to complete the data operation based on the multi-head attention mechanism class, including using tf.matmul and tf.nn.softmax to calculate and normalize the attention scores of Q and K, and using tf.matmul, tf.reshape and tf.transpose to complete the superposition of attention scores and V, and complete the construction of the multi-head attention mechanism. Further define the encoder class and one-dimensional convolution and one-dimensional pooling layer units, MLP multi-layer perceptron part, including using layers.Dense and layers.LayerNormalization to complete the forward propagation of data and layer normalization operations. The Dense layer uses the Relu activation function, and the layers.Dropout function is to prevent the Transformer encoder from overfitting. Further use the layers.MaxPooling1D and layers.Conv1D functions with a step size of 2 to complete the one-dimensional convolution and one-dimensional pooling units of the output data of the Transformer encoder, and complete the further extraction and screening of feature data. The convolution kernel size of layers.Conv1D is 1×1, and the activation function is Leaky_Relu. Finally, the filtered and extracted feature data are sent to an MLP multi-layer perceptron built with 4 fully connected layers. The number of nodes from the first to the fourth fully connected layers are 512, 256, 128, and 50, respectively. The last fully connected layer is further activated using the Relu function, and then the tf.nn.softmax function is used to complete the normalization operation to complete the model's calculation of the medical indicator data.

[0159] Furthermore, at this time, another input port of the model is used to input a complete data containing various medical indicators and completing the dimension upgrade for each medical indicator, and the data detection classification model is input in sequence according to the category. Based on the output of the MLP multi-layer perceptron, 10 (10 is the number of different types of medical indicators used in the present invention, specifically including: blood indicators, heart-related indicators, blood vessel-related indicators, inflammation indicators, homocysteine ​​indicators, electrocardiographic indicators, biochemical indicators, muscle strength and endurance indicators, immune function indicators and psychological indicators) 1×50 vectors are obtained in sequence. The tf.constant function is further used to convert the above 10 vectors into vectors in Tensor format, and then the tf.connect function is used to splice these Tensor vectors in the direction of aix=0, and finally the tf.reshape function is used to convert the above vectors into a matrix of 10×50 size, so that the corresponding cognitive feature matrix based on the original medical indicator data is constructed.

[0160] For the dilated convolutional neural network, we use layers.Conv2D in the Tensorflow2.4 framework and set its dilation_rate parameter, which is set to 3 in this paper. We also use layers.MaxPooling2D maximum pooling neural network to construct a dilated convolutional neural network for cognitive feature matrix recognition. The advantage of using dilated convolutional neural network is that it can increase the convolution receptive field without increasing the number of model parameters, improve the context modeling ability of data, and prevent overfitting. This convolutional neural network uses a total of 8 layers of neural networks. The first two layers are layers.Conv2D neural networks with a convolution kernel size of 3×3, which realize feature extraction of cognitive feature matrices, and the third layer is a pooling layer with a pooling kernel size of 2×2 constructed by layers.MaxPooling2D. The fourth and fifth layers are layers.Conv2D neural networks, whose convolution kernel size is 1×1. The use of 1×1 small convolution kernel is mainly to cut the calculation parameters of the model and improve the operation efficiency. The last two layers of the neural network are fully connected layers with 64 and 50 nodes respectively. tf.nn.softmax is used to operate the last fully connected layer, and tf.argmax is used to extract the data detection classification model to identify the stage of non-disease, so as to complete the judgment of the non-disease stage of the human body.

[0161] This data detection and classification model uses the powerful feature extraction and contextual relationship modeling capabilities of the Transformer encoder to complete the attention encoding of the data. Furthermore, the one-dimensional convolution with a small convolution kernel and one-dimensional pooling are used to refine the attention-encoded data while completing the parameter trimming of the model. Then, the MLP multi-layer perceptron built with a fully connected layer is used to compress and encode the calculated data. The subsequent void convolutional neural network is based on the cognitive feature matrix composed of the spliced ​​model output values ​​to achieve the purpose of accurately identifying each stage of pre-disease.

[0162] Example 2

[0163] like Figure 4 As shown, the specific steps and processes of this embodiment are as follows:

[0164] (1) In the original medical indicator data, according to different pre-disease stages (including: pre-disease stage, pre-onset stage, pre-transmission stage, pre-severity stage and pre-recovery stage), extract the same amount of medical indicator data of different categories and store them in different CSV format files. Furthermore, mark the data of different stages and categories in turn.

[0165] (2) Upgrade the dimension of each type of medical indicator data. First, the kernel function values ​​of the same type of data are calculated based on the multi-parameter Gaussian kernel function. This step is mainly performed using the tf.norm function. Then, multiple kernel function values ​​are stored in the corresponding kernel matrix and the corresponding centralization operation is performed. This step is mainly completed based on the functions provided by the Tensorflow2.4 framework such as tf.constant, tf.reshape, and tf.reduce_mean.

[0166] (3) Use the tf.transpose function in the Tensorflow2.4 framework to transpose the above-mentioned centralized kernel matrix, and use tf.matmul to multiply the kernel matrix and its transposed matrix to obtain the first covariance matrix, and further use tf.matmul to multiply its transposed matrix and its matrix to obtain the second covariance matrix. Subsequently, use the np.tril, np.fill_diagonal, np.argsort and other functions in the Numpy library to find the maximum values ​​of each of the two covariance matrices except the diagonal, and record the positions of these values ​​in the matrix. Finally, based on these position record data, find row and column vectors with strong correlation in the transposed matrix and the kernel matrix, and construct the corresponding vector pairs through the slicing operation in the Python language, and use tf.concat to splice them. At this point, the dimensionality of a certain medical indicator data has been upgraded, and by analogy, the dimensionality of all medical indicator data of different stages and categories has been upgraded.

[0167] (4) Use the Tensorflow2.4 framework to build the data detection and classification model of the present invention and construct the corresponding data cognitive feature matrix; the data detection and classification model mainly includes a Transformer encoder part, a one-dimensional convolution and one-dimensional pooling layer unit, an MLP multi-layer perceptron, and a hollow convolutional neural network layer that can be used to identify the subsequent "cognitive feature matrix". The Transformer encoder part mainly includes the definition of the attention mechanism class through the Tensorflow2.4 framework, which includes the number of multiple heads and the dimension of the input data accepted. In addition, it also includes the use of layers.Dense, layers.Dropout, layers.Normalization, tf.reshape, tf.matmul, tf.transpose and other neural networks and functions to complete the construction of the Transformer encoder. Further, the two types of neural networks, layers.MaxPooling1D and layers.Conv1D, are used to perform one-dimensional convolution and one-dimensional pooling units on the output data of the Transformer encoder to complete the further extraction and screening of feature data. The multilayer perceptron has 4 layers, all of which are composed of fully connected layers, using layers.Dense neural network. The number of nodes from the first to the fourth layer are 512, 256, 128, and 50 respectively. Their activation functions are all Relu activation functions, and data normalization is completed using tf.nn.softmax function.

[0168] For the atrous convolutional neural network part, we use layers.Conv2D in the Tensorflow2.4 framework and set its dilation_rate parameter, which is set to 3 in this paper. We also use layers.MaxPooling2D maximum pooling neural network and other neural networks and functions such as layers.Dense, tf.nn.softmax, and tf.argmax to construct a atrous convolutional neural network for cognitive feature matrix recognition and complete the recognition of the pre-disease stage.

[0169] (5) Training and parameter updating of data detection classification model. First, the data that has undergone data dimensioning is imported into the model in a random order to ensure that the data allows the model to be fully trained in each operation. This step is completed using the tf.data.Dataset.from_tensor_slices and shuffle functions that come with Tensorflow2.4. Subsequently, the number of data to be fed into the data detection classification model is specified based on the batch function. The Split function is used to extract the labels of the data to be fed into the data detection classification model. The data detection classification model uses the Adam optimizer that comes with Tensorflow2.4 to optimize the model. Its learning rate is set to 0.0003, and beta_1 and beta_2 both use their default recommended values, which are 0.9 and 0.999, respectively. The loss function used by the data detection classification model is the cross entropy loss function improved based on the standard deviation value of the model output of the present invention, and its operation subject is the tf.keras.losses.CategoricalCrossentropy function. The tf.one_hot function is used to encode the label data. Since the data detection and classification model is a multi-task optimization learning model, the data detection and classification model is jointly trained based on different types of data and their label data training data at different stages before illness and the cognitive feature matrix and its label data, and the parameters are updated.

[0170] (6) Performance display and preservation of the data detection classification model. After the joint training of the data detection classification model is completed, according to the set initial Epochs value, through the for loop and data enumeration, the complete medical indicator data (a total of 10 indicators) of the specified batch_size can be directly sent to the data detection classification model in sequence, and the output data of the data detection classification model can be accurately normalized using the tf.nn.softmax function. Further, based on the tf.argmax function, the maximum predicted value in the output data is extracted as the final stage-by-stage detection result of the disease-free stage. After the model training is completed according to the Epochs value, the above-mentioned detection results are further compared with the label data to construct the corresponding confusion matrix diagram, and the accuracy, recall rate, precision and other data of the data detection classification model are calculated based on the confusion matrix. The construction of the confusion matrix is ​​mainly completed using the heatmap function in the seaborn library. Finally, the Keras.models.save_model function is used to save the file of the data detection classification model to the specified folder, so that the file can be directly called later to complete the stage-by-stage detection of disease-free stage.

[0171] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the disclosure scope involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) by each other.

Claims

1. A method for detecting pre-disease stages based on data dimension upgrading and deep learning. It is characterized in that include: S1: Based on multiple healthy stages, obtain the medical indicator data of each detection category in all healthy stages to obtain a first data set, perform dimension-upgrading representation and encoding on the first data set based on the first input port of the model to obtain first-category coded data; sequentially obtain complete medical indicator data of each detection category in a healthy stage until the medical indicator data of all healthy stages are obtained to form a second data set, perform dimension-upgrading representation and encoding on the second data set based on the second input port of the model to obtain second-category coded data; S2: construct a data detection and classification model, which includes: a Transformer encoder, a one-dimensional convolution and one-dimensional pooling layer unit, an MLP multi-layer perceptron and a hole convolution neural network layer; input the first type of encoded data and the second type of encoded data into the data detection and classification model respectively, and execute the preset rounds of S3-S5 in a loop, iteratively train the data detection and classification model to obtain a trained data detection and classification model, and identify and analyze the medical indicator data to be detected according to the trained data detection and classification model to complete the identification of the pre-disease stage; S3: receiving the first type of coded data and the second type of coded data, and performing feature recognition on the first type of coded data and the second type of coded data respectively by using the Transformer encoder, the one-dimensional convolution and one-dimensional pooling layer units and the MLP multi-layer perceptron to obtain a plurality of first type feature data and a plurality of second type feature data; and concatenating all the second type feature data to obtain a cognitive feature matrix; S4: marking the cognitive feature matrix according to the stage of non-disease from which the complete medical indicator data of each detection category originates, and performing convolution operation on the marked cognitive feature matrix using the atrous convolutional neural network layer to obtain a stage identification value; S5: Calculate the standard deviation value of the first category feature data and the standard deviation value of the stage identification value respectively to obtain a first standard deviation value and a second standard deviation value; update the cross entropy loss function of the data detection and classification model based on the first standard deviation value and the second standard deviation value, calculate the first loss value and the second loss value according to the cross entropy loss function, and perform joint parameter optimization on the data detection and classification model according to the first loss value and the second loss value to form multi-task optimization training.

2. According to claim 1, a method for detecting the pre-disease stage based on data dimension upgrading and deep learning, It is characterized in that In S1, the medical indicator data of each test category in all pre-disease stages include: blood indicators, heart-related indicators, blood vessel-related indicators, inflammation indicators, homocysteine ​​indicators, electrocardiographic indicators, biochemical indicators, muscle strength and endurance indicators, immune function indicators and psychological indicators.

3. According to claim 1, a method for detecting pre-disease stages based on data dimension upgrading and deep learning, It is characterized in that In S1, the first data set is represented and encoded by dimensionality increase, and the first type of encoded data is obtained as follows: S1.1: Construct a multi-parameter Gaussian kernel function, and use the multi-parameter Gaussian kernel function to calculate the multi-parameter Gaussian kernel function values ​​between all medical indicator data in the first data set to obtain a kernel matrix; wherein the multi-parameter Gaussian kernel function is shown in the following formula: where x i and x j represents the medical indicator data of the same detection category in different stages of disease-free period, exp represents the calculation of exponential function value, ||x i -x j || means calculating x i and x j The Euclidean distance between them, σ, β and Bias all represent adjustable hyperparameters, and n represents the number of medical indicator data in a detection category; S1.2: Centering the kernel matrix and calculating the transposed matrix of the kernel matrix; S1.3: constructing two covariance matrices based on the kernel matrix and the transposed matrix, and solving the maximum correlation row and column vectors between the kernel matrix and the transposed matrix based on the maximum value coordinates of the covariance matrix; S1.4: Concatenate the maximum correlation row and column vectors of the kernel matrix and the maximum correlation row and column vectors of the transposed matrix to obtain first-category coded data.

4. According to claim 3, a method for detecting pre-disease stages based on data dimension upgrading and deep learning, It is characterized in that In S1.2, the kernel matrix is ​​centralized specifically as follows: the mean of the multi-parameter Gaussian kernel function values ​​in each row and column of the kernel matrix is ​​calculated, and the corresponding mean is subtracted from the multi-parameter Gaussian kernel function values ​​in each row and column of the kernel matrix to achieve kernel matrix centralization.

5. According to claim 1, a method for detecting pre-disease stages based on data dimension upgrading and deep learning, It is characterized in that S3 is specifically: S3.1: receiving a specified number of first-category coded data at one time, and receiving the second-category coded data in sequence according to the detection category, and using the Transformer encoder, the one-dimensional convolution and one-dimensional pooling layer units, and the MLP multi-layer perceptron to perform feature recognition on the first-category coded data and the second-category coded data, respectively, to obtain a plurality of first-category feature data and a plurality of second-category feature data; S3.2: converting all the second-category feature data into vector data in Tensor format, and concatenating the converted vector data in sequence; S3.3: After all the vector data are concatenated, the concatenated vector data are converted into a cognitive feature matrix of a fixed size.

6. According to the method for detecting the pre-disease stage based on data dimension upgrading and deep learning in claim 1, in S4, the atrous convolutional neural network layer include: Two layers of layers.Conv2D neural network layers, one pooling layer, two layers of layers.Conv2D neural network layers, and two fully connected layers.

7. According to the method for detecting pre-disease stages based on data dimension upgrading and deep learning according to claim 1, S5 is specifically: S5.1: Obtain the first type of feature data and stage identification value, and solve the standard deviation of the first type of feature data and the stage identification value respectively to obtain batch_size first standard deviation values ​​and batch_size second standard deviation values; the standard deviation value is solved as shown in the following formula: in, Indicates the first standard deviation value, std indicates the standard deviation calculation, output n1 Represents the first type of feature data, Batch_Size is the sample size of the single input data detection classification model, Indicates the second standard deviation value, output n2 Indicates the stage identification value; S5.2: Based on the loss function, weight calculation is performed on the first standard deviation value and the second standard deviation value respectively to obtain a first weight value and a second weight value; the weight calculation is performed as shown in the following formula: in, represents the first weight value, represents the second weight value, and sum represents a summation operation; S5.3: Based on the obtained first weight value and second weight value, the first type of feature data and the stage identification value are assigned respectively, and a softmax operation is performed to obtain logits for calculating the loss value of the data detection classification model. n1 and logits n2 ; The softmax operation is shown as follows: Among them, softmax represents the softmax function, logits_weight n1 Indicates the first weight value, logits_weight n2 represents the second weight value; S5.4: Based on the first type of feature data and the stage recognition value after the weight assignment is completed, the cross entropy loss function is calculated respectively to obtain a first loss value and a second loss value. By adding the first loss value and the second loss value, the data detection classification model is jointly optimized in parameters. The calculation of the cross entropy loss function is shown in the following formula: Among them, loss cn_std1 Represents the first loss value, loss cn_std2 represents the second loss value, Adam represents the Adam model optimizer, B_s represents the batch_size value of the input data detection classification model, one_hot represents the unique hot encoding of the label data, label i Indicates the detection category of the medical indicator data, label j represents various stages of non-disease, and log represents logarithmic calculation.

8. A device for detecting pre-disease stages based on data dimension upgrading and deep learning. It is characterized in that include: A data dimension-upgrading coding module is used to obtain the medical indicator data of each detection category in all the disease-free stages based on multiple disease-free stages to obtain a first data set, perform dimension-upgrading representation and coding on the first data set based on the first input port of the model to obtain first-category coded data; sequentially obtain complete medical indicator data of each detection category in a disease-free stage until the medical indicator data of all the disease-free stages are obtained to form a second data set, perform dimension-upgrading representation and coding on the second data set based on the second input port of the model to obtain second-category coded data; A model training module is used to construct a data detection and classification model, wherein the data detection and classification model includes: a Transformer encoder, a one-dimensional convolution and a one-dimensional pooling layer unit, an MLP multi-layer perceptron and a hole convolutional neural network layer; the first type of coded data and the second type of coded data are respectively input into the data detection and classification model, and the model training module is cyclically executed to the preset rounds of the parameter optimization module, and the data detection and classification model is iteratively trained to obtain a trained data detection and classification model; according to the trained data detection and classification model, the medical indicator data to be detected is identified and analyzed to complete the identification of the non-disease stage; A cognitive feature matrix module is used to receive the first type of coded data and the second type of coded data, and use the Transformer encoder, one-dimensional convolution and one-dimensional pooling layer units and MLP multi-layer perceptron to perform feature recognition on the first type of coded data and the second type of coded data respectively to obtain a plurality of first type feature data and a plurality of second type feature data; and concatenate all the second type feature data to obtain a cognitive feature matrix; A dilated convolutional neural network module is used to mark the cognitive feature matrix according to the stage of non-disease from which the complete medical indicator data of each detection category originates, and to perform a convolution operation on the marked cognitive feature matrix using the dilated convolutional neural network layer to obtain a stage identification value; A parameter optimization module is used to respectively calculate the standard deviation value of the first category feature data and the standard deviation value of the stage identification value to obtain a first standard deviation value and a second standard deviation value; based on the first standard deviation value and the second standard deviation value, the cross entropy loss function of the data detection and classification model is updated, the first loss value and the second loss value are calculated according to the cross entropy loss function, and the data detection and classification model is jointly optimized according to the first loss value and the second loss value to form multi-task optimization training.

Citation Information

Patent Citations

  • Liver focus segmentation method based on convolutional neural network

    CN113034518A

  • Improved particle swarm parameter optimization method for glioma multi-task integrated network

    CN115222007A