Neurological disease rehabilitation period medication intelligent management system and digital prescription generation method

Through contrast enhancement and semantic label processing, the information loss and misidentification problems caused by light interference and blurred handwriting in handwritten prescriptions are solved, and the intelligent management of medication for neurology and digital prescription generation is realized.

CN120564952AActive Publication Date: 2025-08-29Mianyang 404 Hospital
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202511077503.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-01
Publication Date
2025-08-29
Estimated Expiration
2045-08-01

AI Technical Summary

Technical Problem

In the prior art, handwritten prescription recognition technology has problems with information loss or misidentification caused by light interference and blurred handwriting, especially in the process of medical term scene segmentation, which leads to incomplete or incorrect prescription information.

Method used

The contrast enhancement of handwritten prescriptions is achieved through scanning devices, semantic labels of drug names are extracted and medical context embedded based on the neurologic disease map, combining fuzzy reasoning and multi-objective optimization, and digital prescriptions are generated to reduce handwriting structure loss and terminology misidentification.

Benefits of technology

It effectively reduces the impact of light interference on handwriting structure recognition, ensures the medical semantic accuracy of drug names, improves the accuracy and reliability of prescription generation, and avoids information loss or misidentification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120564952A_ABST
    Figure CN120564952A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent medication management system in a neurological disease convalescence period and a digital prescription generation method, and relates to the technical field of medical data processing. Contrast enhancement is performed on an illumination interference area of a handwritten prescription to obtain a target handwritten prescription, and enhancement cost of handwriting structure loss in a contrast enhancement process is determined; extracting a semantic label of each drug name in the target handwritten prescription, performing clinical compatibility on the semantic labels of different drug names based on fuzzy reasoning to obtain label membership degrees of different drug names, and further determining semantic label loss generated during medical term segmentation in a semantic label extraction process; and performing multi-target optimization on the medical semantic compensation features of the semantic tag according to the enhancement cost and the semantic tag loss to obtain a semantic compensation vector of the semantic tag, and generating a digital prescription of the neurological disease based on the semantic compensation vector. According to the invention, the lost cost constraint can be identified in the handwriting prescription transcription process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of medical data processing technology, and more specifically, to an intelligent management system for medication during the recovery period of neurological diseases and a method for generating digital prescriptions. Background Art

[0002] With the continuous development of medical and health management technology, the generation of digital prescriptions has become an important means to improve the efficiency of drug management. Especially in the recovery period of neurological diseases, patients' medication needs become more complex, and the automated recognition and management of handwritten prescriptions become particularly important. Traditional handwritten prescriptions often rely on doctors' manual writing, and drug information records are cumbersome and prone to errors. The intelligent prescription generation system based on digital technology can not only improve the safety and accuracy of drug use, but also alleviate the shortage of medical resources and reduce the occurrence of medical errors to a certain extent.

[0003] In the existing technology, handwritten prescription recognition technology mainly relies on optical character recognition technology, but its recognition accuracy is still limited by many factors. Light interference and blurred handwriting are common problems, which directly lead to the loss or misrecognition of prescription information. Existing technology usually solves these problems through image preprocessing and enhancement algorithms, but these methods cannot completely avoid the loss of handwritten handwriting structure and may still cause partial loss or misrecognition of prescription information. In addition, prescriptions usually contain a large number of medical terms and professional names, and the current handwritten prescription recognition system has difficulties in accurately identifying specific terms in the medical field, especially in the segmentation process of medical terminology scenes. Existing technology often cannot effectively distinguish and extract these terms, resulting in missegmentation or inaccurate processing of terms. Therefore, how to effectively reduce the loss of handwriting structure in the handwritten prescription transcription process has become a difficult problem that needs to be solved urgently by current technology. Summary of the Invention

[0004] The present application provides an intelligent management system for medication during the recovery period of neurological diseases and a method for generating digital prescriptions, which can realize the cost constraint of recognition loss during the transcription process of handwritten prescriptions.

[0005] In a first aspect, the present application provides a method for generating digital prescriptions for neurological diseases, which is used in an intelligent management system for medication during the recovery period of neurological diseases to generate digital prescriptions. The method comprises the following steps: Collecting handwritten prescriptions for neurological diseases using a scanning device, performing contrast enhancement on the light interference area of ​​the handwritten prescription to obtain a contrast-enhanced target handwritten prescription, and then determining the enhancement cost of handwriting structure loss during the contrast enhancement process; Extract the semantic labels of each drug name in the target handwritten prescription, embed all semantic labels into medical context based on the preset neurological disease atlas, and obtain the semantic vector of each semantic label; Based on fuzzy reasoning and combining all semantic vectors, the semantic labels of different drug names are clinically matched to obtain the label membership of different drug names. Then, the semantic label loss caused by medical term scene segmentation during the semantic label extraction process is determined by combining all label memberships and the co-occurrence probability between various drugs in the neurological disease prescription library. A multi-objective optimization is performed on the medical semantic compensation features of all semantic labels based on the enhancement cost and the semantic label loss, thereby obtaining a semantic compensation vector for each semantic label, and generating a digital prescription for neurological diseases based on all the semantic compensation vectors.

[0006] Preferably, performing contrast enhancement on the light interference area of ​​the handwritten prescription to obtain a contrast-enhanced target handwritten prescription specifically includes: Analyzing pixel distribution of the handwritten prescription through a grayscale histogram to identify light interference areas; Adopting an adaptive gamma correction algorithm to perform hierarchical contrast enhancement on the light interference area; The enhanced handwritten prescription is binarized to obtain a contrast-enhanced target handwritten prescription.

[0007] Preferably, determining the enhancement cost of handwriting structure loss during contrast enhancement specifically includes: Extract the edge feature map of the original handwritten prescription and mark the stroke intersections and turning points as topological nodes; Compare the structural differences of topological nodes in the edge feature graph before and after enhancement, and then locate the handwriting break area; The enhancement cost of handwriting structure loss during contrast enhancement is determined according to the pixel loss rate of the handwriting broken area.

[0008] Preferably, extracting the semantic label of each drug name in the target handwritten prescription specifically includes: Use the pre-trained handwritten text recognition model to segment the target handwritten prescription into character phrases and extract the text features of the drug name; Perform semantic verification on the text features of drug names to remove spelling errors and non-drug related text features; The removed text features are standardized and encoded to generate semantic labels for each drug name.

[0009] Preferably, all semantic tags are embedded in medical context based on a preset neurological disease atlas to obtain a semantic vector for each semantic tag, specifically including: For each semantic label, associate the semantic label with the drug entity in the preset neurological disease atlas to generate the atlas node label of the semantic label; Generate an initial embedding vector of the semantic label according to the graph node label; The vector weight of the initial embedding vector is adjusted according to the contextual information of the target handwritten prescription, and the semantic vector of the semantic label is output, thereby obtaining the semantic vector of each semantic label.

[0010] Preferably, the semantic labels of different drug names are clinically matched based on fuzzy reasoning and all semantic vectors to obtain the label membership of different drug names, which specifically includes: Determine the cosine similarity between each semantic vector and then construct the relationship matrix of drug compatibility; Screening potential synergistic combinations in the relationship matrix based on a clinical compatibility rule library; The rationality of the synergistic combination is determined by fuzzy logic algorithm, and then the label membership of different drug names is obtained.

[0011] Preferably, determining the semantic label loss generated during the medical term scene segmentation during the semantic label extraction process by using all label memberships and the co-occurrence probability between various drugs in the neurological disease prescription database specifically includes: Count the co-occurrence probabilities between various drugs in the neurological disease prescription database and construct the co-occurrence probability matrix of drug combinations; Determining abnormal compatibility pairs with semantic deviations based on all label memberships and the co-occurrence probability matrix; The semantic label loss generated during the segmentation of medical terminology scenes in the semantic label extraction process is obtained by backtracking the deviation degree of the abnormal compatibility pair.

[0012] Preferably, performing multi-objective optimization on the medical semantic compensation features of all semantic labels based on the enhancement cost and the semantic label loss, and then obtaining the semantic compensation vector of each semantic label specifically includes: The semantic compensation features of all semantic labels are used as optimization variables, and the cost function is constructed with the goal of minimizing the enhancement cost and semantic label loss. Introducing the enhancement cost and the semantic label loss into the cost function in the form of weighted penalty terms; The cost function is iteratively solved by a preset optimization algorithm until it converges to an optimal solution, thereby obtaining a semantic compensation vector for each semantic label.

[0013] Preferably, the scanning device is a flatbed scanner.

[0014] In a second aspect, the present application provides an intelligent management system for medication during the recovery period of neurological diseases, the system including a digital prescription generation unit, the digital prescription generation unit including: an acquisition module configured to acquire handwritten prescriptions for neurological diseases using a scanning device, perform contrast enhancement on light-interferenced regions of the handwritten prescriptions to obtain a contrast-enhanced target handwritten prescription, and further determine an enhancement cost for handwriting structure loss during the contrast enhancement process; A processing module is used to extract the semantic labels of each drug name in the target handwritten prescription, and perform medical context embedding processing on all semantic labels based on a preset neurological disease atlas to obtain the semantic vector of each semantic label; The processing module is further configured to perform clinical matching of semantic labels of different drug names based on fuzzy reasoning combined with all semantic vectors to obtain label memberships of different drug names, and then determine the semantic label loss generated during medical term scene segmentation during the semantic label extraction process using all label memberships and the co-occurrence probabilities between various drugs in the neurological disease prescription library; An execution module is used to perform multi-objective optimization on the medical semantic compensation features of all semantic labels based on the enhancement cost and the semantic label loss, thereby obtaining a semantic compensation vector for each semantic label, and generating a digital prescription for neurological diseases based on all semantic compensation vectors.

[0015] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores code, and the processor is configured to obtain the code and execute the above-mentioned method for generating digital prescriptions for neurological diseases.

[0016] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned method for generating digital prescriptions for neurological diseases.

[0017] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects: In an embodiment of the present application, handwritten prescriptions for neurological diseases are collected by a scanning device, and contrast enhancement is performed on the light interference area of ​​the handwritten prescription to obtain a contrast-enhanced target handwritten prescription, and then the enhancement cost of the handwriting handwriting structure loss during the contrast enhancement process is determined; the semantic label of each drug name in the target handwritten prescription is extracted, and all semantic labels are embedded in the medical context based on a preset neurological disease atlas to obtain a semantic vector for each semantic label; the semantic labels of different drug names are clinically matched based on fuzzy reasoning and all semantic vectors to obtain label affiliations of different drug names, and then the semantic label loss generated during the medical term scene segmentation during the semantic label extraction process is determined through all label affiliations and the co-occurrence probability between various drugs in the neurological disease prescription library; multi-objective optimization is performed on the medical semantic compensation features of all semantic labels based on the enhancement cost and the semantic label loss to obtain a semantic compensation vector for each semantic label, and a digital prescription for neurological diseases is generated based on all semantic compensation vectors.

[0018] It can be seen that the present application performs multi-objective optimization on the medical semantic compensation features of all semantic labels through the enhancement cost and the semantic label loss, and then obtains the semantic compensation vector of each semantic label; first, by contrast enhancement of the illumination interference area of ​​the handwritten prescription and determining the enhancement cost of the handwritten handwriting structure loss during the contrast enhancement process, the influence of illumination interference on the recognition accuracy of the handwritten handwriting structure can be reduced. At the same time, the calculation mechanism of the enhancement cost is introduced to quantify the handwriting loss in the enhancement process, effectively avoiding the problem of prescription information loss or misidentification caused by relying solely on the enhancement algorithm, thereby ensuring that the original prescription content is recognized as completely and clearly as possible; secondly, by extracting the semantic labels of the drug names in the target handwritten prescription and embedding these labels into the medical context based on the preset neurological disease atlas, accurate medical semantic information can be given to each drug name in the prescription, overcoming the problem of inaccurate understanding of medical terminology in traditional handwritten prescription recognition technology, thereby effectively reducing the risk of misidentification of terminology; then, by combining all semantic vectors with fuzzy reasoning to perform clinical matching on the semantic labels of different drug names, it is possible Intelligently process the semantic relationships and interactions of drug names to ensure the semantic accuracy of drug names in medical scenarios. By calculating the label membership and the co-occurrence probability between drugs, the semantic label loss generated in the process of semantic label extraction and medical term scene segmentation is effectively reduced. This method optimizes the drug compatibility rules, improves the accuracy and reliability of prescription generation, and avoids the missegmentation of drug names and terms, thereby significantly enhancing the accuracy and intelligence level of the digital prescription generation system. Finally, by combining the enhancement cost and semantic label loss, multi-objective optimization is performed on the medical semantic compensation features of all semantic labels to accurately adjust the compensation vector of each semantic label. This optimization process can effectively reduce information loss or error in the prescription recognition process, ensuring that each drug name and its semantic label are accurately expressed in a specific medical context. Through multi-objective optimization, the scheme further improves the overall quality and reliability of prescription generation while maintaining semantic accuracy, avoiding the problem of inaccurate prescriptions or prescriptions that do not meet clinical needs due to label loss. In summary, the application scheme can achieve the cost constraint of recognition loss in the transcription process of handwritten prescriptions. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is an exemplary flow chart of a method for generating digital prescriptions for neurological diseases according to some embodiments of the present application; Figure 2 This is a schematic diagram of an application scenario of an intelligent management system for medication during the recovery period of neurological diseases according to some embodiments of the present application; Figure 3 is a schematic diagram of a process for determining tag membership according to some embodiments of the present application; Figure 4 is a structural diagram of a digital prescription generating unit according to some embodiments of the present application; Figure 5 It is a structural diagram of a computer device for implementing a method for generating digital prescriptions for neurological diseases according to some embodiments of the present application. DETAILED DESCRIPTION

[0020] In order to better understand the technical solution of the present application, the technical solution of the present application will be described in detail below with reference to the accompanying drawings and specific implementation methods.

[0021] refer to Figure 1 , which is an exemplary flow chart of a method for generating a digital prescription for a neurological disease according to some embodiments of the present application. The method 100 for generating a digital prescription for a neurological disease mainly includes the following steps: In step 101, a handwritten prescription for a neurological disease is collected by a scanning device, and contrast enhancement is performed on the light interference area of ​​the handwritten prescription to obtain a contrast-enhanced target handwritten prescription, and then the enhancement cost of the handwriting structure loss during the contrast enhancement process is determined.

[0022] In some embodiments, reference Figure 2 As shown in the figure, this figure is a schematic diagram of the application scenario of the intelligent management system for medication in the rehabilitation period of neurological diseases shown in some embodiments of the present application, wherein the acquisition device is responsible for collecting handwritten prescriptions and sending the data to the server for processing through the communication network. The server uses an intelligent algorithm to generate digital prescriptions and stores the results in a data storage device, realizing automated management from handwritten prescription collection to digital prescription generation.

[0023] It should be noted that the scanning device in this application is a flatbed scanner; in this application, handwritten prescriptions for neurological diseases are collected by scanning equipment, which specifically refers to the use of a flatbed scanner to acquire images of paper prescriptions to ensure high-resolution image acquisition under natural or auxiliary lighting conditions.

[0024] In some embodiments, contrast enhancement is performed on the light interference area of ​​the handwritten prescription to obtain a contrast-enhanced target handwritten prescription by using the following steps: Analyzing pixel distribution of the handwritten prescription through a grayscale histogram to identify light interference areas; Adopting an adaptive gamma correction algorithm to perform hierarchical contrast enhancement on the light interference area; The enhanced handwritten prescription is binarized to obtain a contrast-enhanced target handwritten prescription.

[0025] It should be noted that the layered contrast enhancement in this application refers to using different enhancement parameters to perform contrast enhancement on local areas according to the characteristics of different brightness areas in the image.

[0026] In the specific implementation, first, the pixel distribution of the handwritten prescription is analyzed by grayscale histogram, and then the illumination interference area can be identified in the following way, namely: the collected handwritten prescription image is grayscaled, and the conventional weighted average method (such as Y=0.299R+0.587G+0.114B, Y represents the brightness value of the pixel, R represents the red component value of the pixel, G represents the green component value of the pixel, and B represents the blue component value of the pixel) is used to convert the color image (Red-Green-Blue, RGB) into a single-channel grayscale image, construct its grayscale histogram, count the number of pixels corresponding to each grayscale value (0-255), divide the image into several local areas (such as 64×64 pixel blocks), and calculate the grayscale mean and standard deviation of each area. , if the grayscale mean of the area is lower than the average value of the whole image, or the standard deviation is much smaller than the standard deviation of the adjacent areas, then the area is determined to be a light interference area (such as a shadow area or a reflective area); secondly, the light interference area is subjected to layered contrast enhancement using an adaptive gamma correction algorithm, which can be implemented in the following manner, namely: for the identified light interference area, an adaptive gamma correction algorithm is used for layered enhancement, that is, the gamma value is dynamically adjusted according to the average grayscale in the area, a gamma value less than 1 is used to increase the brightness in the low-brightness area, and a gamma value greater than 1 is used to suppress overexposure in the high-brightness area, to ensure that the local contrast is improved and the structure is not distorted; then, the enhanced handwritten prescription is binarized to obtain a contrast-enhanced target handwritten prescription, which can be implemented in the following manner, namely: the enhanced handwritten prescription image is subjected to full Figure 2 The value processing uses the Otsu algorithm to adaptively set the threshold value to effectively separate the handwriting from the background and output the target image with enhanced contrast, that is, the target handwritten prescription.

[0027] In some embodiments, determining the enhancement cost of handwriting structure loss during contrast enhancement may be achieved in the following manner: Extract the edge feature map of the original handwritten prescription and mark the stroke intersections and turning points as topological nodes; Compare the structural differences of topological nodes in the edge feature graph before and after enhancement, and then locate the handwriting break area; The enhancement cost of handwriting structure loss during contrast enhancement is determined according to the pixel loss rate of the handwriting broken area.

[0028] It should be noted that the handwriting break area in this application refers to the missing pixels on the handwriting edge and the falling off of topological nodes caused by brightness adjustment during the contrast enhancement process, resulting in discontinuous areas such as stroke interruption and connection breakage in the enhanced image, which is used to reflect the degree of damage to the integrity of handwriting structure recognition caused by image enhancement; the enhancement cost in this application is a cost indicator to measure the degree of damage to the integrity of the handwriting structure during the contrast enhancement process of handwritten prescription images.

[0029] In the specific implementation, first, the edge feature map of the original handwritten prescription is extracted, and the stroke intersections and turning points are marked as topological nodes. This can be achieved in the following way: the Canny edge detection algorithm in the prior art can be used to extract the edges of the original handwritten prescription image, identify the edge feature map of the handwriting, and then perform morphological analysis on the edge feature map. Combining pixel connectivity and curvature changes, the stroke intersections (multi-path pixel intersections) and turning points (points with significant curvature changes) in each character are marked as topological nodes to construct the structural skeleton of the handwriting; then, the structural differences of the topological nodes in the edge feature maps before and after enhancement are compared, and the handwriting break area is located. This can be achieved in the following way: the same edge extraction and topological node marking operations are performed on the enhanced image, and the images before and after enhancement are aligned through image registration (based on a preset topological node structure template). The edge feature maps are aligned, and on this basis, node-by-node comparison is performed to identify node areas with large position offset, topological break or disappearance, and the identified areas are used as handwriting break areas; finally, the enhancement cost of handwriting structure loss in the contrast enhancement process is determined according to the pixel loss rate of the handwriting break area, which can be achieved in the following way: for each handwriting break area, the change in the number of edge pixels within the node coverage before and after enhancement is counted, and the change is used as the pixel loss rate of the handwriting break area, that is, pixel loss rate = (original pixel number − enhanced pixel number) / original pixel number, and the pixel loss rates of all handwriting break areas are weighted, where the weight of each handwriting break area can be determined by the entropy weight method, which will not be repeated here, and the value obtained by the weighting process is finally used as the enhancement cost of handwriting structure loss in the contrast enhancement process.

[0030] It should also be noted that in this application, by comparing the topological changes in the handwriting structure before and after contrast enhancement of handwritten prescription images, the degree of damage to key handwriting information caused by image enhancement can be accurately evaluated, thereby providing an accurate basis for quantifying structural losses for subsequent semantic label compensation, avoiding character recognition errors or incomplete extraction of drug names due to excessive enhancement, and ensuring the recognition accuracy and reliability of medication information during the digital prescription generation process.

[0031] In step 102, the semantic label of each drug name in the target handwritten prescription is extracted, and all the semantic labels are embedded in the medical context based on the preset neurological disease atlas to obtain the semantic vector of each semantic label.

[0032] In some embodiments, extracting the semantic label of each drug name in the target handwritten prescription can be achieved by using the following steps: Use the pre-trained handwritten text recognition model to segment the target handwritten prescription into character phrases and extract the text features of the drug name; Perform semantic verification on the text features of drug names to remove spelling errors and non-drug related text features; The removed text features are standardized and encoded to generate semantic labels for each drug name.

[0033] It should be noted that the handwritten text recognition model in this application is a deep learning model used to automatically convert handwritten characters in images into text information. Its core technical principle is to combine convolutional neural networks and recurrent neural networks to extract spatial and temporal features in images, and realize character alignment and decoding by connecting temporal classifiers. Specifically, the convolutional neural network is responsible for extracting local handwriting feature maps from the image, the recurrent neural network captures the contextual dependencies between characters, and the temporal classifier layer realizes character sequence output without character segmentation and annotation, thereby adapting to the irregular layout and connected strokes in natural handwriting, and realizing high-accuracy recognition of continuous characters in handwritten prescriptions; the semantic label in this application refers to the standardized annotation information used to identify the meaning of entities in the text, which is used in this scheme to uniquely correspond to the drug name and express its medical semantic attributes.

[0034] In the specific implementation, first, the target handwritten prescription is segmented into characters and phrases using a pre-trained handwritten text recognition model. The text features of the drug name can be extracted in the following way: the target handwritten prescription image is input into the pre-trained handwritten text recognition model, and the convolution layer in the handwritten text recognition model is used to extract local features of the image. The temporal relationship between characters is captured through a recurrent neural network, and finally a continuous character sequence is decoded and output through a temporal classifier to achieve automatic segmentation of characters into phrases. Secondly, the text features of the drug name are semantically verified, and spelling errors and non-drug related text features are eliminated. This can be achieved in the following way: That is, the identified phrases are matched with medical professional dictionaries (such as the national pharmacopoeia), and word vector similarity calculation (such as using Word2Vec) is used to determine whether the fuzzy spelling words may be legal drug names. By setting a similarity threshold and jointly verifying with context rules (such as frequency description), spelling errors, non-drug entities or irrelevant phrases are eliminated; finally, the text features after elimination are standardized and encoded, and the semantic labels of each drug name are generated. This can be achieved in the following way, namely: for the retained text features, a unified standard coding system (such as pharmacopoeia coding) is queried, and each drug name is mapped to a unique, structured semantic label.

[0035] In some embodiments, all semantic tags are embedded in medical context based on a preset neurological disease atlas to obtain a semantic vector for each semantic tag. This can be achieved by: For each semantic label, associate the semantic label with the drug entity in the preset neurological disease atlas to generate the atlas node label of the semantic label; Generate an initial embedding vector of the semantic label according to the graph node label; The vector weight of the initial embedding vector is adjusted according to the contextual information of the target handwritten prescription, and the semantic vector of the semantic label is output, thereby obtaining the semantic vector of each semantic label.

[0036] It should be noted that the neurological disease atlas in this application is a structured knowledge carrier used to express the relationship between drug entities related to neurological diseases; the graph node label in this application refers to the drug entity node matched with the semantic label in the neurological disease atlas, which is used to characterize the semantic connection relationship between the semantic label and the medical entity in the graph; the semantic vector of the semantic label in this application is a low-dimensional vector representation generated by fusing the graph structure information and the prescription context characteristics.

[0037] In the specific implementation, for each semantic label, first, the semantic label is associated with the drug entity in the preset neurological disease atlas, and then the graph node label of the semantic label is generated. It can be implemented in the following way, that is, the Euclidean distance can be used to perform semantic similarity matching between the semantic label and the drug entity in the preset neurological disease atlas, and the semantic similarity matching result is used as the graph node label of the semantic label; then, the initial embedding vector of the semantic label is generated according to the graph node label. It can be implemented in the following way, that is, the conventional graph neural network model is used to embed the constructed graph node label, and an initial embedding vector containing its semantic relationship and drug entity structure information is generated for each semantic label. Specifically, the preset neurological disease atlas is represented as a graph structure containing drug entities (nodes) and their semantic associations (edges), and each semantic label corresponds to a node label in the graph. The graph convolutional network model is then used to train the graph structure. The graph convolutional network model represents the context structure between nodes by aggregating the features of adjacent nodes. The translation embedding model models the triples in the manner of "entity + relationship ≈ target entity". A low-dimensional embedding representation of each node is learned. During the training process, by minimizing the node similarity loss or the triplet distance loss, the model continuously adjusts the embedding parameters so that the generated initial embedding vector not only retains the basic semantics of the semantic label, but also embeds its structural position in the neurological disease map and upstream and downstream drug association information, providing a structural semantic basis for subsequent semantic compensation and context fusion; finally, the vector weight of the initial embedding vector is adjusted by the contextual information of the target handwritten prescription, and the semantic vector of the semantic label is output, thereby obtaining the semantic vector of each semantic label. This can be achieved in the following way, namely: first, the full text of the target handwritten prescription is semantically encoded, usually using a bidirectional encoder to extract the context representation of each word or phrase, and then fusing the context representation with the initial embedding vector output by the graph neural network. Common methods include the attention mechanism, that is, by calculating the similarity score between the semantic label embedding and the context vector, dynamic weights are assigned to different dimensions in the initial embedding vector, and then the initial embedding vector obtained by adjusting the dynamic weight is used as the semantic vector of the semantic label. Through the above method, the semantic vector of each semantic label can be obtained.

[0038] In step 103, the semantic labels of different drug names are clinically matched based on fuzzy reasoning combined with all semantic vectors to obtain the label membership of different drug names. Then, the semantic label loss generated during the medical term scene segmentation during the semantic label extraction process is determined through all label memberships and the co-occurrence probability between various drugs in the neurological disease prescription library.

[0039] In some embodiments, reference Figure 3As shown in FIG, this figure is a flow chart of determining label membership in some embodiments of the present application. In this embodiment, the semantic labels of different drug names are clinically matched based on fuzzy reasoning combined with all semantic vectors. The label membership of different drug names can be obtained by the following steps: In step 1031, the cosine similarity between the semantic vectors is determined, and then a relationship matrix of drug compatibility is constructed; In step 1032, potential synergistic combinations in the relationship matrix are screened based on a clinical compatibility rule library; In step 1033, the rationality of the synergistic combination is determined by a fuzzy logic algorithm, and then the label membership of different drug names is obtained.

[0040] It should be noted that the clinical compatibility in this application refers to the reasonable association and matching of different drugs according to clinical compatibility rules; the label affiliation in this application is an indicator to measure the reasonable degree of adaptability of the drug combination in a specific clinical scenario.

[0041] In specific implementation, first, the cosine similarity between each semantic vector is determined, and then the relationship matrix of drug compatibility is constructed. This can be implemented in the following way, namely: the semantic vector of each pair of drug names can be calculated using the cosine similarity formula to obtain the relationship value of the drug compatibility of each pair of drug names, and then the symmetric matrix composed of all the relationship values ​​is used as the relationship matrix of drug compatibility; then, the potential synergistic combinations in the relationship matrix are screened based on the clinical compatibility rule base. This can be implemented in the following way, namely: first, a structured clinical compatibility rule base is constructed, which contains information on the compatibility relationship, co-occurrence of indications, pharmacological synergy, and complementary toxic and side effects between drugs. In the implementation process, the system reads the drug pairs in the compatibility relationship matrix one by one, and matches them with the records in the rule base by name or code (such as anatomical-therapeutic code) to determine whether there are rule items with synergistic relationships, such as "drug A + drug B is used to treat disease X with enhanced efficacy" or "drug C + drug D can reduce the risk of adverse reactions". The matching process can be implemented by Boolean rule judgment and regular expression filtering, and finally the drug combinations that meet the synergistic conditions are screened out, and the screened drug combinations are used as The potential synergistic combinations in the relationship matrix; finally, the rationality of the synergistic combinations is determined by the fuzzy logic algorithm, and then the label membership of different drug names can be obtained. This can be achieved in the following way, namely: a fuzzy membership function can be set for the synergistic indicators defined in the clinical compatibility rule library, such as the degree of efficacy enhancement, the degree of complementary toxic and side effects, and the target overlap rate. Usually, a triangular or Gaussian function can be used to represent the fuzzy level of "low", "medium" and "high", and then the drug combination screened out in the compatibility relationship matrix is ​​used as input to extract its relevant index value (such as the inference in the atlas). Co-occurrence strength), fuzzified and input into the fuzzy inference system, and further fuzzy reasoning is performed based on the preset fuzzy rule library (such as "if the efficacy enhancement is high and the side effect complementarity is medium, then the rationality is high"). Common methods include the Mamdani model. The fuzzy inference results are then defuzzified to obtain the compatibility rationality value of each drug combination. All the compatibility rationality values ​​are then normalized, and the normalized value is used as the label membership of the corresponding drug combination. The label membership can reflect the compatibility adaptability of the drugs in the current disease context.

[0042] It should be noted that this application constructs a drug compatibility relationship matrix by introducing semantic vector similarity, so that the potential association between drugs can be measured at the semantic level, breaking through the limitations of literal matching. On this basis, the clinical compatibility rule library is combined to screen the drug combinations that may have synergistic effects in the relationship matrix, and medical knowledge is introduced to enhance the professionalism of drug association judgment. Then, the rationality of each group of drug combinations is calculated through the fuzzy logic algorithm, which has stronger adaptability in dealing with ambiguity and uncertainty in compatibility. The final label affiliation can reflect the compatibility adaptability of the drug in a specific clinical context, and can ensure that the generated prescription is more consistent and reasonable in semantic expression and clinical value, thereby improving the intelligence and accuracy of digital prescription construction.

[0043] In some embodiments, determining the semantic label loss generated during medical term scene segmentation during semantic label extraction by using all label memberships and co-occurrence probabilities between various drugs in a neurological disease prescription database specifically includes: Count the co-occurrence probabilities between various drugs in the neurological disease prescription database and construct the co-occurrence probability matrix of drug combinations; Determining abnormal compatibility pairs with semantic deviations based on all label memberships and the co-occurrence probability matrix; The semantic label loss generated during the segmentation of medical terminology scenes in the semantic label extraction process is obtained by backtracking the deviation degree of the abnormal compatibility pair.

[0044] It should be noted that the co-occurrence probability in this application refers to the probability that two drugs appear simultaneously in the same prescription in the neurological disease prescription library; the semantic label loss in this application refers to the degree of inconsistency between the semantic label and its expression in the actual medical context due to the semantic division error that occurs during the medical term scene segmentation process.

[0045] In specific implementation, first, the co-occurrence probability between various drugs in the neurological disease prescription library is counted, and the co-occurrence probability matrix of drug combinations can be constructed in the following way, namely: by traversing the existing historical prescriptions in the neurological disease prescription library, the probability of any two drugs co-occurring in the same prescription is calculated using the frequency statistics method, and further forming a co-occurrence probability matrix of drug combinations. The rationality of the clinical combined use of drugs can be reflected by the co-occurrence probability matrix; then, the abnormal compatibility pairs with semantic deviations are determined by all label memberships and the co-occurrence probability matrix, which can be implemented in the following way, namely: the elements in the co-occurrence probability matrix are compared with the label membership of the drug combination to identify abnormal compatibility combinations with high co-occurrence probability but low membership, or high membership but low co-occurrence probability, that is, drug combinations with large semantic deviations; finally, through the The semantic label loss generated during the segmentation of medical terminology scenes in the process of semantic label extraction can be obtained by back-tracing the deviation degree of abnormal compatibility pairs. This can be achieved in the following way, namely: the numerical deviation between the co-occurrence probability of each group of abnormal compatibility pairs and the membership of their corresponding labels can be calculated, and then combined with the context window information in the semantic vector generation process to locate the actual context of the corresponding drug name in the handwriting recognition text, and restore the word meaning relationship and semantic boundary division at that time through the existing bidirectional encoder. By comparing the context division with the drug description in the standard medical terminology dictionary, the semantic deviation caused by term segmentation error, word meaning ambiguity or improper phrase classification is identified, and the semantic deviation is mapped to the semantic label in the form of an error score, and the output error score is used as the semantic label loss generated during the segmentation of medical terminology scenes in the corresponding semantic label extraction process.

[0046] It should be noted that this application scheme constructs a drug co-occurrence probability matrix in the prescription library of neurological diseases, introduces the statistical laws of drug co-occurrence in real prescription data, and makes up for the problem that traditional semantic segmentation models lack medical context support. It also compares the compatibility relationship between drugs in combination with label membership, identifies the deviation between co-occurrence probability and semantic label expression, and then discovers the conflict between semantic understanding and medical knowledge, and realizes the accurate identification of abnormal semantic compatibility pairs. Further, based on the degree of deviation of abnormal compatibility pairs, it reversely traces the source of deviation in the semantic segmentation process, and quantifies the semantic label loss, and establishes a closed-loop mechanism from medical knowledge feedback to semantic segmentation quality optimization, thereby improving the accuracy and clinical rationality of term extraction, and achieving the technical effect of traceability, explainability and modifiability of the semantic extraction process.

[0047] In step 104, a multi-objective optimization is performed on the medical semantic compensation features of all semantic labels based on the enhancement cost and the semantic label loss, thereby obtaining a semantic compensation vector for each semantic label, and generating a digital prescription for neurological diseases based on all semantic compensation vectors.

[0048] In some embodiments, performing multi-objective optimization on the medical semantic compensation features of all semantic labels based on the enhancement cost and the semantic label loss, and then obtaining the semantic compensation vector for each semantic label can be achieved by the following steps: The semantic compensation features of all semantic labels are used as optimization variables, and the cost function is constructed with the goal of minimizing the enhancement cost and semantic label loss. Introducing the enhancement cost and the semantic label loss into the cost function in the form of weighted penalty terms; The cost function is iteratively solved by a preset optimization algorithm until it converges to an optimal solution, thereby obtaining a semantic compensation vector for each semantic label.

[0049] It should be noted that the semantic compensation feature in this application refers to an optimizable representation variable introduced to correct structural damage in the image enhancement process and recognition errors in the semantic label extraction process.

[0050] In specific implementation, first, the semantic compensation features of all semantic labels are used as optimization variables, and a cost function is constructed with the goal of minimizing the enhancement cost and the semantic label loss. The enhancement cost and the semantic label loss are introduced into the cost function in the form of weighted penalty terms. This can be implemented in the following manner, namely: the semantic compensation features of all semantic labels can be used as optimization variables, and the goal of the cost function is to minimize the enhancement cost and the semantic label loss. The enhancement cost reflects the structural loss caused by the contrast enhancement process of the handwritten prescription image, such as handwriting breakage, and the semantic label loss represents the errors that occur in the semantic extraction process, such as incorrect term segmentation or semantic understanding deviation. The two are combined in a cost function, and the weighted penalty terms are used to reflect the damage to the image structure (such as pixel loss, handwriting interruption) and the impact on semantic accuracy (such as inaccurate label recognition). The purpose of weighting is to adjust the relative importance of the two costs according to actual conditions. It should be further explained that the cost function in this application = Q*enhancement cost + W*semantic label loss, Q and W represent weights, and Q and W determine which type of error (image structure damage or semantic recognition deviation) is given a higher priority in the optimization. Priority is corrected, and enhancement cost and semantic label loss are introduced into the cost function in the form of weighted penalty terms, which can be used to reflect the constraints of image structure damage and semantic recognition error on the compensation feature. Then, the cost function is iteratively solved using a preset optimization algorithm until it converges to an optimal solution, thereby obtaining a semantic compensation vector for each semantic label. This can be achieved by: using an optimization algorithm (such as particle swarm optimization) to iteratively solve the cost function. For each iteration, the algorithm calculates the value of the cost function based on the current optimization variable (i.e., the semantic compensation feature). Specifically, in each round of iteration, the algorithm evaluates the impact of the current semantic compensation feature on two objectives: how it reduces the loss of image structure (enhancement cost) and how it reduces the error of semantic labeling (semantic label loss). The value of the semantic compensation feature is then adjusted according to the optimization criterion (e.g., minimizing the cost function value), thereby gradually improving the compensation effect. During the iterative process, a preset convergence condition is used to determine when to stop the optimization process. For example, when the change in the cost function is less than a set threshold, it can be considered that the optimization has converged and reached the optimal solution. Finally, after multiple rounds of iterations, the optimization algorithm will output the final semantic compensation vector for each semantic label.

[0051] It should be noted that the present application scheme introduces two indicators, enhancement cost and semantic label loss, to conduct multi-objective optimization of semantic compensation features, thereby achieving the technical effect of improving the accuracy of image semantic expression and the integrity of visual structure. First, the enhancement cost is used to measure the structural damage (such as handwriting breakage and pixel loss) caused in the process of image contrast enhancement, and the semantic label loss is used to quantify the semantic deviation generated in medical term recognition, thereby achieving comprehensive constraints in both structural and semantic dimensions; secondly, by constructing the two costs into a unified cost function and setting a weighted penalty term, the optimization process has flexible control capabilities, and the trade-off between structural protection and semantic accuracy is dynamically adjusted according to the actual needs of the task; finally, with the help of the optimization algorithm, the cost function is iteratively solved, and the compensation vector of each semantic label is accurately output, thereby achieving the unity of image structure restoration and semantic information correction, providing a high-quality semantic representation basis for subsequent prescription understanding.

[0052] It should also be noted that generating digital prescriptions for neurological diseases based on all semantic compensation vectors means accurately converting handwritten prescriptions into structured and standardized digital prescriptions based on all semantic compensation vectors.

[0053] On the other hand, in some embodiments, the present application provides an intelligent management system for medication during the rehabilitation period of neurological diseases, which includes a digital prescription generation unit reference Figure 4 , which is a schematic diagram of the structure of a digital prescription generation unit according to some embodiments of the present application. The digital prescription generation unit 400 includes: a collection module 401, a processing module 402 and an execution module 403, which are described as follows: Acquisition module 401, in this application, is primarily used to collect handwritten prescriptions for neurological diseases using a scanning device, perform contrast enhancement on the light interference area of ​​the handwritten prescription, obtain a contrast-enhanced target handwritten prescription, and further determine the enhancement cost of handwriting structure loss during the contrast enhancement process; Processing module 402, in this application, is used to extract the semantic label of each drug name in the target handwritten prescription, perform medical context embedding processing on all semantic labels based on a preset neurological disease atlas, and obtain a semantic vector for each semantic label; The processing module 402 in the present application is further configured to perform clinical matching of semantic labels of different drug names based on fuzzy reasoning combined with all semantic vectors to obtain label membership of different drug names, and then determine the semantic label loss generated during medical term scene segmentation during the semantic label extraction process based on all label memberships and the co-occurrence probability between various drugs in the neurological disease prescription library; Execution module 403. In this application, execution module 403 is mainly used to perform multi-objective optimization on the medical semantic compensation features of all semantic labels based on the enhancement cost and the semantic label loss, and then obtain the semantic compensation vector of each semantic label, and generate a digital prescription for neurological diseases based on all semantic compensation vectors.

[0054] In addition, the present application also provides a computer device, which includes a memory and a processor, the memory storing a code, and the processor being configured to obtain the code and execute the above-mentioned method for generating digital prescriptions for neurological diseases.

[0055] In some embodiments, reference Figure 5 , which is a schematic diagram of the structure of a computer device for implementing a method for generating a digital prescription for neurological diseases according to some embodiments of the present application. The method for generating a digital prescription for neurological diseases in the above embodiment can be Figure 5 The computer device 500 shown in FIG. 5 is implemented as shown in FIG. 5 . The computer device 500 includes at least one processor 501 , a communication bus 502 , a memory 503 , and at least one communication interface 504 .

[0056] The processor 501 may be a general-purpose central processing unit (CPU) or an application-specific integrated circuit (ASIC).

[0057] The communication bus 502 may be used to transmit information between the aforementioned components.

[0058] The memory 503 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, a random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. The memory 503 may be independent and connected to the processor 501 via the communication bus 502. The memory 503 may also be integrated with the processor 501.

[0059] Memory 503 is used to store program code for executing the solution of the present application, and is controlled by processor 501 for execution. Processor 501 is used to execute the program code stored in memory 503. The program code may include one or more software modules. The method for generating a digital prescription for neurological diseases in the above embodiment can be implemented by processor 501 and one or more software modules in the program code in memory 503.

[0060] The communication interface 504 uses any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.

[0061] In a specific implementation, as an example, a computer device may include multiple processors, each of which may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0062] The aforementioned computer device can be a general-purpose computer device or a dedicated computer device. In a specific implementation, the computer device can be a desktop computer, a portable computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device. The embodiments of this application do not limit the type of computer device.

[0063] In addition, the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned method for generating digital prescriptions for neurological diseases.

[0064] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.

[0065] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.

Claims

1. A method for generating digital prescriptions for neurological diseases, used in an intelligent management system for medication during the recovery period of neurological diseases, characterized in that: The method comprises the following steps: Collecting handwritten prescriptions for neurological diseases using a scanning device, performing contrast enhancement on the light interference area of ​​the handwritten prescription to obtain a contrast-enhanced target handwritten prescription, and then determining the enhancement cost of handwriting structure loss during the contrast enhancement process; Extract the semantic labels of each drug name in the target handwritten prescription, embed all semantic labels into medical context based on the preset neurological disease atlas, and obtain the semantic vector of each semantic label; Based on fuzzy reasoning and combining all semantic vectors, the semantic labels of different drug names are clinically matched to obtain the label membership of different drug names. Then, the semantic label loss caused by medical term scene segmentation during the semantic label extraction process is determined by combining all label memberships and the co-occurrence probability between various drugs in the neurological disease prescription library. A multi-objective optimization is performed on the medical semantic compensation features of all semantic labels based on the enhancement cost and the semantic label loss, thereby obtaining a semantic compensation vector for each semantic label, and generating a digital prescription for neurological diseases based on all the semantic compensation vectors.

2. The method according to claim 1, wherein Performing contrast enhancement on the light interference area of ​​the handwritten prescription to obtain a contrast-enhanced target handwritten prescription specifically includes: Analyzing pixel distribution of the handwritten prescription through a grayscale histogram to identify light interference areas; Adopting an adaptive gamma correction algorithm to perform hierarchical contrast enhancement on the light interference area; The enhanced handwritten prescription is binarized to obtain a contrast-enhanced target handwritten prescription.

3. The method according to claim 1, wherein The enhancement cost of determining the loss of handwriting structure during contrast enhancement specifically includes: Extract the edge feature map of the original handwritten prescription and mark the stroke intersections and turning points as topological nodes; Compare the structural differences of topological nodes in the edge feature graph before and after enhancement, and then locate the handwriting break area; The enhancement cost of handwriting structure loss during contrast enhancement is determined according to the pixel loss rate of the handwriting broken area.

4. The method according to claim 1, wherein Extracting the semantic labels of each drug name in the target handwritten prescription specifically includes: Use the pre-trained handwritten text recognition model to segment the target handwritten prescription into character phrases and extract the text features of the drug name; Perform semantic verification on the text features of drug names to remove spelling errors and non-drug related text features; The removed text features are standardized and encoded to generate semantic labels for each drug name.

5. The method according to claim 1, wherein Based on the preset neurological disease atlas, all semantic labels are embedded in the medical context, and the semantic vectors of each semantic label are obtained, including: For each semantic label, associate the semantic label with the drug entity in the preset neurological disease atlas to generate the atlas node label of the semantic label; Generate an initial embedding vector of the semantic label according to the graph node label; The vector weight of the initial embedding vector is adjusted according to the contextual information of the target handwritten prescription, and the semantic vector of the semantic label is output, thereby obtaining the semantic vector of each semantic label.

6. The method according to claim 1, wherein Based on fuzzy reasoning and combining all semantic vectors, the semantic labels of different drug names are clinically matched, and the label membership of different drug names is obtained, including: Determine the cosine similarity between each semantic vector and then construct the relationship matrix of drug compatibility; Screening potential synergistic combinations in the relationship matrix based on a clinical compatibility rule library; The rationality of the synergistic combination is determined by fuzzy logic algorithm, and then the label membership of different drug names is obtained.

7. The method according to claim 1, wherein The semantic label loss generated during the segmentation of medical terminology scenes during the semantic label extraction process is determined by using all label memberships and the co-occurrence probability between various drugs in the neurological disease prescription database. Specifically, it includes: Count the co-occurrence probabilities between various drugs in the neurological disease prescription database and construct the co-occurrence probability matrix of drug combinations; Determining abnormal compatibility pairs with semantic deviations based on all label memberships and the co-occurrence probability matrix; The semantic label loss generated during the segmentation of medical terminology scenes in the semantic label extraction process is obtained by backtracking the deviation degree of the abnormal compatibility pair.

8. The method according to claim 1, wherein The medical semantic compensation features of all semantic labels are optimized multi-objectively based on the enhancement cost and the semantic label loss, thereby obtaining a semantic compensation vector for each semantic label. Specifically, the following is provided: The semantic compensation features of all semantic labels are used as optimization variables, and the cost function is constructed with the goal of minimizing the enhancement cost and semantic label loss. Introducing the enhancement cost and the semantic label loss into the cost function in the form of weighted penalty terms; The cost function is iteratively solved by a preset optimization algorithm until it converges to an optimal solution, thereby obtaining a semantic compensation vector for each semantic label.

9. The method according to claim 1, wherein The scanning device is a flatbed scanner.

10. An intelligent management system for medication during the recovery period of neurological diseases, the system includes a digital prescription generation unit, characterized in that: The digital prescription generating unit includes: an acquisition module configured to acquire handwritten prescriptions for neurological diseases using a scanning device, perform contrast enhancement on light-interferenced regions of the handwritten prescriptions to obtain a contrast-enhanced target handwritten prescription, and further determine an enhancement cost for handwriting structure loss during the contrast enhancement process; A processing module is used to extract the semantic labels of each drug name in the target handwritten prescription, and perform medical context embedding processing on all semantic labels based on a preset neurological disease atlas to obtain the semantic vector of each semantic label; The processing module is further configured to perform clinical matching of semantic labels of different drug names based on fuzzy reasoning combined with all semantic vectors to obtain label memberships of different drug names, and then determine the semantic label loss generated during medical term scene segmentation during the semantic label extraction process using all label memberships and the co-occurrence probabilities between various drugs in the neurological disease prescription library; An execution module is used to perform multi-objective optimization on the medical semantic compensation features of all semantic labels based on the enhancement cost and the semantic label loss, thereby obtaining a semantic compensation vector for each semantic label, and generating a digital prescription for neurological diseases based on all semantic compensation vectors.

Citation Information

Patent Citations

  • Traditional-Chinese-medicine prescription vector space mode method and device based on word co-occurrence

    CN108647236A

  • Text recognition method and system

    CN112862024A

  • Data processing method and system

    CN112883980A

  • Medical data document classification and marking system

    CN119621972A

  • Traditional Chinese medicine prescription data analysis method and device based on OCR (Optical Character Recognition) and large model

    CN119811698A