Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
With the application and popularization of the mobile internet, more and more users begin to conduct business online by means of mobile terminals. Taking the diagnosis of skin diseases by a remote medical system as an example, a patient user usually needs to take a focus image of the patient user by using a mobile terminal and send the focus image to a doctor's mobile terminal, so that the doctor can make a corresponding diagnosis according to the focus image of the user. However, since the size of the patient group is usually much larger than that of the doctor group, after the patient sends the lesion image to the doctor, the patient usually needs to wait in line for the diagnosis of the doctor, which results in long time consumption for disease diagnosis and low user experience.
In view of this, the present invention provides a disease prediction system and a disease prediction method through the following embodiments, which aim to automatically realize disease prediction and reduce time consumption for disease diagnosis by means of an artificial intelligence technique.
Referring to fig. 1, fig. 1 is a schematic diagram of a disease prediction system according to an embodiment of the present invention. As shown in fig. 1, the disease prediction system includes: the device comprises an information receiving and sending module, a word processing module, a model calling module and a block chain module.
As shown in fig. 1, a plurality of disease prediction models are stored in the blockchain module. Wherein, each disease prediction model is obtained by training a BP neural network model in advance, and each disease prediction model is used for predicting a skin disease. In addition, as shown in fig. 1, the plurality of disease prediction models are divided into a plurality of groups, the skin diseases predicted by the respective disease prediction models in each group of disease prediction models have the same symptoms, and the skin diseases predicted by the respective disease prediction models in different groups have different symptoms; each group of disease prediction models has a corresponding sample word vector associated with the symptom of the skin disease predicted by the group of disease prediction models.
For ease of understanding, symptoms such as skin disease a, skin disease b, and skin disease c are: and if the tinea macula and the pruritus occur, combining a disease prediction model A for predicting the skin disease a, a disease prediction model B for predicting the skin disease B and a disease prediction model C for predicting the skin disease C into a first group of disease prediction models. The sample word vectors corresponding to the disease prediction models are word vectors of the word string "moss spots and pruritus". Specifically, the word string "moss and itching" is input into a word vector extraction model (e.g., word2vec), and the word vector extraction model outputs a word vector of the word string.
Also for example, symptoms of skin disease d, e, f, and g are: and if the rash, the allergy and the pruritus occur, combining a disease prediction model D for predicting the skin disease D, a disease prediction model E for predicting the skin disease E, a disease prediction model F for predicting the skin disease F and a disease prediction model G for predicting the skin disease G into a second group of disease prediction models. The sample word vectors corresponding to the disease prediction models are word vectors of the character string "rash allergic and pruritic". Specifically, the word string "rash allergic and itching" is input to a word vector extraction model (e.g., word2vec), which outputs a word vector for the word string.
As shown in fig. 1, the information transceiver module is configured to receive a focus image and a textual description of a disease symptom uploaded by the user terminal through the 5G communication system, submit the textual description to the word processing module, and submit the focus image to the model calling module.
As shown in fig. 1, the word processing module is configured to extract keywords related to symptoms from the text description, generate word vectors of the keywords, and submit the word vectors to the model invoking module.
Optionally, in some specific embodiments, a plurality of groups of keywords are stored in the word processing module, each group of keywords includes a plurality of words or characters that are close to each other, and each group of keywords corresponds to one sub-word vector. For ease of understanding, for example, "rash, exanthema, blood rash" etc. are a first set of keywords, and the subword vectors corresponding to the set of keywords are the word vectors for "rash". For example, "moss spots, moss blocks, and plaque blocks" are the second group of keywords, and the sub-word vectors corresponding to the group of keywords are the word vectors of "moss spots". For another example, "pruritus, scratch" and the like are a third group of keywords, and the sub-word vector corresponding to the group of keywords is the word vector of "pruritus".
The word processing module is specifically configured to: sequentially aiming at each group of keywords, searching whether any word vector in the group of keywords is contained in the text description, if so, acquiring a sub-word vector corresponding to the group of keywords, and if not, not acquiring the sub-word vector corresponding to the group of keywords; after the processing is executed for each group of keywords, the obtained sub-word vectors are spliced into word vectors, and therefore the word vectors of the keywords are generated.
For ease of understanding, it is assumed by way of example that the text sent by the user terminal describes "red rash, particularly itching, often scratching" of the skin. First, the word processing module detects that the word description includes a word "rash" in the first group of keywords, and then the word processing module obtains sub-word vectors corresponding to the first group of keywords (i.e., word vectors of "rash"). Then, the word processing module detects that the word description does not include any keyword in the second group of keywords aiming at the second group of keywords, and the word processing module does not acquire the sub-word vector corresponding to the second group of keywords. Then, the word processing module detects that the word description includes a word "scratch" in the third group of keywords, and then the word processing module obtains a sub-word vector (i.e., a word vector of "pruritus") corresponding to the third group of keywords. After the word processing module executes the processing aiming at each group of keywords, a plurality of sub-word vectors are obtained, and the word processing module splices the sub-word vectors into one vector, so that the word vectors of the keywords in the word description are obtained.
As shown in fig. 1, the model calling module is configured to compare, according to the word vector submitted by the word processing module, the word vector with the respective sample word vector of each group of disease prediction models, so as to determine a sample word vector closest to the word vector.
Optionally, in some specific embodiments, the model invoking module, when determining the sample word vector closest to the word vector, is specifically configured to: sequentially calculating the vector distance between the sample word vector and the word vector according to the sample word vector corresponding to each group of disease prediction models; and after the vector distance between the word vector and each sample word vector is obtained, determining the sample word vector with the shortest vector distance as the sample word vector closest to the word vector.
It should be noted that the vector distance between two vectors may indicate the proximity between the two vectors, and the closer the two vectors are, the shorter the vector distance between the two vectors is. Thus, the sample word vector with the shortest vector distance is determined as the sample word vector closest to the word vector in the invention. It should be noted that the algorithm for calculating the vector distance is the prior art, and those skilled in the art can calculate the vector distance between the word vector and each sample word vector by referring to the existing vector distance algorithm.
As shown in fig. 1, the model invoking module is further configured to invoke a group of disease prediction models corresponding to the closest sample word vector from the block chain module, input the lesion image submitted by the information transceiver module into each disease prediction model in the group of disease prediction models to obtain a prediction result of each disease prediction model, and determine the skin disease type according to the prediction result of each disease prediction model.
For ease of understanding, for example, the model call module determines that the sample word vectors of the first set of disease prediction models are closest to the word vectors through the steps described above. Then, the model calling module calls a first group of disease prediction models from the block chain module, and inputs the focus images into a disease prediction model a, a disease prediction model B, and a disease prediction model C in the first group of disease prediction models, respectively, so as to obtain prediction results respectively output by the three disease prediction models: no, yes, no. Thus, the model call module determines that the skin disease type is b.
As shown in fig. 1, the model invoking module is further configured to submit the determined skin disease type to the information transceiver module, so as to feed back the skin disease type to the user terminal through the information transceiver module.
In the invention, a plurality of disease prediction models are divided into a plurality of groups, the skin diseases predicted by each disease prediction model in each group of disease prediction models have the same symptoms, and the skin diseases predicted by the disease prediction models in different groups have different symptoms; and each group of disease prediction models has a corresponding sample word vector associated with the symptom of the skin disease predicted by the group of disease prediction models. And after receiving the text description uploaded by the user, extracting the key words from the text description and generating word vectors of the key words. The sample word vector closest to the word vector is then matched. This corresponds to an accurate determination of a set of disease prediction models that are specifically used to predict the symptoms mentioned in the textual description. Then, the focus image is input into each disease prediction model in the group of disease prediction models to obtain the prediction result of each disease prediction model, so that the skin disease type is determined.
According to the invention, the disease prediction models are grouped, and a corresponding group of disease prediction models are matched through the word vectors, so that a group of disease prediction models most relevant to the user symptoms are determined, and the disease prediction models irrelevant to the user symptoms are excluded. Therefore, the method is favorable for improving the accuracy of disease prediction and reducing the possibility of prediction errors.
In addition, considering that certain two skin diseases have the same or similar symptoms, the disease prediction models for detecting these two skin diseases are located in the same group of disease prediction models. However, if the lesions of the two skin diseases are the same (for example, moss spots with similar colors may appear), when the lesion image uploaded by the user is one of the two skin diseases, the disease prediction models corresponding to the two skin diseases may be misjudged.
To further solve the above problem, optionally, in some embodiments, in a plurality of disease prediction models in the same group, there are two disease prediction models that are similar to each other, and the two skin diseases predicted by the two disease prediction models respectively have the same lesion expression, and the two disease prediction models are pre-marked with a special identifier.
After the prediction result of each disease prediction model is obtained, if one or two of the two disease prediction models which are similar modules each other output the prediction result of successful prediction, the model calling module is also used for submitting an information forwarding instruction to the information transceiving module; the information receiving and transmitting module responds to the information forwarding instruction and is also used for forwarding the focus image and the text description uploaded by the user terminal to the terminal equipment of the target doctor; the information receiving module is also used for receiving the skin disease type sent by the terminal equipment of the target doctor and forwarding the skin disease type to the user terminal.
For ease of understanding, it is exemplarily assumed that the disease prediction model B and the disease prediction model C in the first set of disease prediction models are used for detecting psoriasis and parapsoriasis, respectively, since the lesions of these two skin diseases behave similarly, and are prone to error by model detection. Thus, both disease prediction model B and disease prediction model C are labeled with a special identifier. If the lesion image is input into each disease prediction model in the first set of disease prediction models, the disease prediction model B and/or the disease prediction model C outputs a prediction result in the form of "yes". Since the disease prediction model B and the disease prediction model C carry special identification, it is necessary to send the text description and the focus image to a doctor for further diagnosis by the doctor. Thus, the possibility of detection errors of the disease prediction model can be reduced.
Optionally, in some embodiments, the disease prediction system further includes a model training module, and the model training module is configured to train each group of disease prediction models by:
preferably, the initial weight and the threshold of the BP neural network of the model training module are optimized by adopting a particle swarm algorithm, and a fitness function F of the particle swarm algorithm is defined as:
wherein, y
ARepresents the output value of the a-th sample in the BP neural network,
and E is the number of samples participating in the training of the BP neural network.
The smaller the fitness function value defined in the preferred embodiment is, the better the optimization result of the particle is.
In the calculation process of the particle swarm optimization, the speed and the position of the particles are updated according to the following formula:
VI(τ)=ωVI(τ-1)+z1r1(PI(τ-1)-XI(τ-1))+z2r2(P(τ-1)-XI(τ-1))
XI(τ)=XI(τ-1)+VI(τ)
in the formula, z1And z2Is a learning factor, ω is an inertial weight factor, r1And r2Is a random number, and r1,r2E (0, 1), let lIDenotes the I-th particle, V, in the particle populationI(τ -1) and XI(τ -1) are particles l, respectivelyIVelocity and position, V, after the (τ -1) th iteration updateI(τ) and XI(τ) are particles l, respectivelyISpeed and position, P, after the τ th iteration updateI(τ -1) represents a particle lIP (tau-1) represents the global optimal position of the particle swarm after the (tau-1) th iteration updating.
After each iteration update of the particle swarm algorithm, local strengthening optimization particles are selected from the particle swarm to carry out local optimization, and the method specifically comprises the following steps:
(1) selecting local reinforced optimization particles in the particle swarm, setting O (tau) to represent the local reinforced optimization particle set selected in the particle swarm after the tau iteration update,
representing the mean value of the fitness function of the particle swarm after the tau iteration update, and enabling the fitness function value of the particles in the particle swarm after the tau iteration update to be smaller than
As candidate particles for locally enhancing the optimization particles; let O '(tau) represent the candidate particle set of local enhanced optimization particles selected in the particle swarm after the iteration update of the tau, select the candidate particle with the minimum fitness function value in the set O' (tau) as the first local enhanced optimization particle to be added into the set O (tau), delete the selected local enhanced optimization particles in the set O '(tau), and match the candidate particles in the set O' (tau) according to the selected local enhanced optimization particlesScreening the particles, specifically:
l 'is'
GDenotes the G-th candidate particle in the set O '(τ), and l'
GFor the first selected locally reinforcing optimizing particle, X'
G(τ) represents particle l'
GLocation updated at the τ th iteration, Ω'
G(τ) represents particle l'
GLocating the local neighborhood Ω ' in the set O ' (τ) after the τ -th iteration update '
GThe candidate particles in (τ) are deleted from the set O '(τ), where Ω'
G(τ) is a particle l'
GA local area with d (tau) as the radius as the center, d (tau) is the neighborhood radius of the particle swarm after the tau iteration update, and the purpose is
d (0) is the initial neighborhood radius, τ is the current iteration update times, T
maxUpdating the maximum iteration number;
continuously selecting the candidate particles with the minimum fitness function value from the rest candidate particles in the set O ' (tau) according to the method as local enhancement optimizing particles to be added into the set O (tau), deleting the selected local enhancement optimizing particles from the set O ' (tau), and screening the candidate particles in the set O ' (tau) according to the selected local enhancement optimizing particles;
stopping the selection of the local enhanced optimization particles until no candidate particles exist in the set O' (tau), wherein the particles in the set O (tau) are the local enhanced optimization particles selected in the particle swarm;
(2) setting local enhanced optimization particles in the set O (tau) to perform local optimization in the following way:
is provided with
Represents the S-th locally enhanced optimization particle in the set O (tau),
indicating particle
At the location updated at the τ th iteration,
indicating particle
Local neighborhood after the τ th iteration update, an
To a position
A local neighborhood centered at d (τ) as radius
Representing local neighborhoods
After the τ -th iterative update of the particle, in the local neighborhood
In the random selection of the position
And
and particles were produced according to the following formula
New sub-position of (2):
in the formula,
indicating particle
The new sub-position generated after the tau-th iteration update,
representing local neighborhoods
The position with the minimum fitness function value is set
Representing local neighborhoods
The number K particles in (a) are,
representing local neighborhoods
The number L of particles in (b) is,
indicating particle
At the location updated at the τ th iteration,
indicating particle
Position updated at the τ th iteration;
is provided with
Representing local neighborhoods
Is updated at the τ th iteration, and
wherein,
indicating particle
At the location updated at the τ th iteration,
representing local neighborhoods
The number of particles in (a); is provided with
Representing local neighborhoods
A new set of sub-positions generated by the mesoparticle after the τ -th iteration update, and
defining a local neighborhood
The detection function after the τ th iteration is updated to
Then
The expression of (a) is:
in the formula,
representing local neighborhoods
The optimal spatial detection coefficient of the optical fiber,
representing the detection coefficients of the optimization space
Is determined as a function of
Representing local neighborhoods
The detection coefficient of the optimizing performance of the system,
detection coefficient for indicating optimizing performance
Is determined as a function of
Is provided with
Representing local neighborhoods
The number Z of particles in (1) is,
indicating particle
At the location updated at the τ th iteration,
indicating particle
The new sub-position generated after the tau-th iteration update,
indicating a location
The value of the corresponding fitness function is calculated,
indicating new sub-positions
A corresponding fitness function value;
when detecting a function
Then local neighborhood
Keeping the position of the middle particle after the tau iteration updating unchanged; when detecting a function
Then local neighborhood
The position of the medium particle is transformed into a new sub-position generated after the tau iteration update.
In the preferred embodiment, aiming at the condition that the convergence speed and the prediction accuracy of the BP neural network are easily influenced by the initial weight and the threshold, an improved particle swarm algorithm is adopted to optimize the initial weight and the threshold of the BP neural network, in the improved particle swarm algorithm, after each iteration update of a particle swarm, particles with higher optimization performance and more dispersed distribution are selected from the particle swarm as local enhanced optimization particles to enhance local optimization, a set local neighborhood search strategy of the local enhanced optimization particles can effectively search a local neighborhood, meanwhile, the diversity of particle positions is increased, each particle in the local neighborhood generates a new sub-position set in the local neighborhood according to the local neighborhood search strategy, a detection function of the local neighborhood is defined, and an optimization space detection coefficient in the detection function can effectively judge whether the new sub-position generated by the particle in the local neighborhood is larger than the original position of the particle in the local neighborhood or not In space, the optimizing performance detection coefficient in the detection function can effectively judge whether the new positions of the particles produced in the local neighborhood are better than the original positions of the particles in the local neighborhood or not, so that the particles in the local neighborhood are enabled to select the positions in a better position set according to the result of the detection function, the local optimizing precision of the particle swarm optimization is enhanced, the defects that the local searching capability of the particle swarm optimization is poor and the particles are easy to fall into local extreme values are overcome, and the optimizing capability is better.
Preferably, for each skin disease in a group of skin diseases having the same symptom, acquiring a focus image of the skin disease as a positive sample image, and acquiring focus images of other skin diseases in the group of skin diseases as negative sample images; inputting the positive sample image and the positive label into a preset BP neural network model, and inputting the negative sample image and the negative label into the BP neural network model, so as to train the BP neural network model; taking the trained BP neural network model as a disease prediction model for predicting the skin diseases; after a disease prediction model is trained for each skin disease in the set of skin diseases, a set of disease prediction models is obtained.
For ease of understanding, illustratively, during training of the first set of disease prediction models (assuming that disease prediction model a is used to predict ichthyosis, disease prediction model B is used to predict psoriasis, and disease prediction model C is used to predict parapsoriasis), to train the disease prediction model B, first a plurality (e.g., 10000) of lesion images of psoriasis are collected as positive sample images, and a positive label is marked for each positive sample image. A plurality (e.g., 2000) of zoophoid lesion images and a plurality (e.g., 2000) of parapsoriasis lesion images are collected simultaneously as negative sample images, and a negative label is marked for each negative sample image. In this way, each positive sample image and the positive label thereof are input into a preset BP neural network model, so that the BP neural network model is trained. Similarly, each negative sample image and its negative label are input into the BP neural network model, so as to train the BP neural network model. And finally, obtaining the trained BP neural network model. And taking the trained BP neural network model as a disease prediction model B for predicting psoriasis.
As described above, the present invention provides a disease prediction system. Hereinafter, the present invention proposes a disease prediction method based on the same inventive concept. The following embodiments can be cross-referenced with the above embodiments.
Referring to fig. 2, fig. 2 is a flowchart of a disease prediction method according to an embodiment of the present invention, which is applied to a disease prediction server. The disease prediction server stores a plurality of disease prediction models, each disease prediction model is obtained by training a BP neural network model in advance, and each disease prediction model is used for predicting a skin disease; the plurality of disease prediction models are divided into a plurality of groups, the skin diseases predicted by each disease prediction model in each group of disease prediction models have the same symptoms, and the skin diseases predicted by the disease prediction models in different groups have different symptoms; each group of disease prediction models has a corresponding sample word vector associated with the symptom of the skin disease predicted by the group of disease prediction models.
As shown in fig. 2, the disease prediction method includes the steps of:
step S21: and receiving the focus image and the text description of the disease symptoms uploaded by the user terminal through the 5G communication system.
Step S22: extracting keywords related to symptoms from the text description, and generating word vectors of the keywords.
Step S23: and comparing the word vector with the respective sample word vector of each group of disease prediction models according to the word vector, thereby determining the sample word vector closest to the word vector.
Step S24: and calling a group of disease prediction models corresponding to the closest sample word vector, inputting the focus image into each disease prediction model in the group of disease prediction models to obtain a prediction result of each disease prediction model, and determining the skin disease type according to the prediction result of each disease prediction model.
Step S25: and feeding back the determined skin disease type to the user terminal.
Optionally, in some embodiments, in the plurality of disease prediction models in the same group, there are two disease prediction models that are similar to each other, and the two skin diseases predicted by the two disease prediction models respectively have the same lesion representation.
After obtaining the prediction result of each disease prediction model, if one or two disease prediction models of the two disease prediction models which are similar modules each other output prediction results which are successfully predicted, the disease prediction method further comprises the following steps:
and forwarding the focus image and the text description uploaded by the user terminal to the terminal equipment of the target doctor, receiving the skin disease type sent by the terminal equipment of the target doctor, and forwarding the skin disease type to the user terminal.
Optionally, in some embodiments, the disease prediction server further stores a plurality of groups of keywords, each group of keywords includes a plurality of words or words that are close to each other, and each group of keywords corresponds to one sub-word vector. When the step S22 is executed, the following sub-steps are specifically executed:
substep S22-1: and sequentially searching whether any word vector in the group of keywords is contained or not from the text description aiming at each group of keywords, if so, acquiring the sub-word vector corresponding to the group of keywords, and if not, not acquiring the sub-word vector corresponding to the group of keywords.
Substep S22-2: after the processing is executed for each group of keywords, the obtained sub-word vectors are spliced into word vectors, and therefore the word vectors of the keywords are generated.
Optionally, in some specific embodiments, when the step S23 is executed, the following sub-steps are specifically executed:
substep S23-1: sequentially calculating the vector distance between the sample word vector and the word vector according to the sample word vector corresponding to each group of disease prediction models;
substep S23-2: and after the vector distance between the word vector and each sample word vector is obtained, determining the sample word vector with the shortest vector distance as the sample word vector closest to the word vector.
Alternatively, in some embodiments, each set of disease prediction models is trained by:
acquiring a focus image of a skin disease as a positive sample image and acquiring focus images of other skin diseases in a group of skin diseases as a negative sample image for each skin disease in the group of skin diseases having the same symptom; inputting the positive sample image and the positive label into a preset BP neural network model, and inputting the negative sample image and the negative label into the BP neural network model, so as to train the BP neural network model; taking the trained BP neural network model as a disease prediction model for predicting the skin diseases; after a disease prediction model is trained for each skin disease in the set of skin diseases, a set of disease prediction models is obtained.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.