Automatic medicine identification system based on computer vision

Through the computer vision-based automatic drug recognition system, the identity and degradation features in drug images are separated, which solves the accuracy problem of drug identity recognition and quality assessment and realizes the safety supervision of drugs throughout their life cycle.

CN120689631AActive Publication Date: 2025-09-23SUZHOU MUNICIPAL HOSPITAL

Patent Information

Application Number
CN202511047258.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-29
Publication Date
2025-09-23
Estimated Expiration
2045-07-29

AI Technical Summary

Technical Problem

Existing technologies make it difficult to accurately identify the identity of a drug and assess its quality when its appearance changes, and are unable to effectively distinguish high-quality counterfeit and inferior drugs.

Method used

A computer vision-based automatic drug recognition system is adopted to separate the intrinsic identity vector and degradation state vector from the drug image through the feature extraction module. Combined with the identity recognition, quality assessment and risk screening modules, it realizes drug identity recognition, quality assessment and identification of counterfeit and inferior drugs.

Benefits of technology

It achieves the accuracy and robustness of drug identity identification, provides objective quantitative evaluation of drug quality and efficient identification of counterfeit and inferior drugs, and improves the safety supervision capabilities of drugs throughout their life cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120689631A_ABST
    Figure CN120689631A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic medicine identification system based on computer vision, and relates to the technical field of computer technology and artificial intelligence, and the system comprises a feature extraction module which is used for extracting an intrinsic identity vector and a degradation state vector from an obtained digital image of a to-be-identified medicine; the identity recognition module is used for generating an identity recognition result of the medicine according to the intrinsic identity vector and a preset classifier network; the quality evaluation module is used for generating a quality quantitative score of the medicine according to the degradation state vector and a preset degradation tolerance threshold value; and the risk discrimination module is used for generating a shoddy drug risk discrimination clue according to the degradation state vector, a preset certified product degradation mode library and a preset mode difference threshold. According to the invention, through a unique confrontation training mechanism, the system can respectively extract the characteristics representing the inherent identity of the medicine and the characteristics representing the appearance degradation state of the medicine from a single image, and the accuracy and robustness of recognition are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer technology and artificial intelligence, and in particular to an automatic drug recognition system based on computer vision. Background Art

[0002] In the field of drug safety regulation, rapid and accurate drug identification is fundamental to ensuring public drug safety. Traditional drug identification technologies, whether manual verification or early computer vision systems, primarily rely on matching static features of drug appearance. However, these methods have the following shortcomings: The physical state of drugs is not static. During storage, transportation, and use, they can degrade to varying degrees due to environmental factors such as temperature, humidity, and light, causing changes in appearance. Traditional identification systems often confuse these degradation-induced changes with the drug's identity, potentially leading to misidentification of a deteriorated but otherwise authentic drug or inability to determine its usability. Existing technologies generally lack the ability to quantitatively assess drug quality. When a drug undergoes a change in appearance, it is difficult for regulators or users to visually determine whether the severity of the degradation has exceeded the limit for safe use. For high-quality counterfeit drugs with sophisticated manufacturing processes, their appearance is almost identical to the original products when they leave the factory, making it difficult for traditional static identification methods to effectively identify them. Although these counterfeit drugs have similar appearances, differences in their internal excipients and production processes lead to essential differences in their aging and degradation processes under the influence of environmental factors. This difference in the dynamic process is a key clue that traditional methods cannot capture; Therefore, there is an urgent need for an intelligent solution that can go beyond the limitations of static recognition, accurately determine the identity of drugs, evaluate their real-time appearance and quality, and gain insight into their internal physical processes to identify the risks of high-quality counterfeit and inferior products. Summary of the Invention

[0003] The purpose of the present invention is to provide a computer vision-based automatic drug recognition system to solve the problems raised in the above background technology.

[0004] The technical solution of the present invention is a computer vision-based automatic drug recognition system, comprising: A feature extraction module is used to extract an intrinsic identity vector and a degradation state vector from the acquired digital image of the drug to be identified; wherein the intrinsic identity vector represents the intrinsic identity information of the drug, and the degradation state vector represents the degradation information of the drug's appearance; An identity recognition module, configured to generate an identity recognition result of the drug based on the intrinsic identity vector and a preset classifier network; a quality assessment module, configured to generate a quality quantification score of the drug based on the degradation state vector and a preset degradation tolerance threshold; The risk identification module is used to generate risk identification clues for counterfeit and inferior drugs based on the degradation state vector, a preset genuine degradation pattern library and a preset pattern difference threshold.

[0005] Preferably, the feature extraction module, through an adversarial training mechanism, constrains the intrinsic identity vector to not contain information that can be used to determine the degradation state of the drug, and constrains the degradation state vector to not contain information that can be used to determine the identity of the drug, thereby achieving feature decoupling of the intrinsic identity vector and the degradation state vector.

[0006] Preferably, the quality assessment module is specifically used to: Calculating the L2 norm of the degradation state vector; Dividing the calculated L2 norm by the preset degradation tolerance threshold to obtain a relative degradation degree; Based on the relative extent of degradation, a mass quantified score of the drug is generated.

[0007] Preferably, the degradation tolerance threshold is derived from the degradation vector norm corresponding to the critical point of unqualified physical and chemical indicators calibrated in the pharmacopoeia standards or drug stability test data.

[0008] Preferably, the risk identification module is specifically used to: performing normalization processing on the degradation state vector to obtain a normalized degradation state vector; Calculating the cosine distance between the normalized degradation state vector and each normalized authentic degradation pattern vector in the authentic degradation pattern library; Determine the minimum value of the cosine distances to obtain a minimum pattern distance; The minimum pattern distance is compared with the preset pattern difference threshold to generate the counterfeit and inferior drug risk identification clue.

[0009] Preferably, the method for generating the counterfeit and inferior drug risk identification clues includes: When the minimum pattern distance is greater than the preset pattern difference threshold, a high-risk level clue is generated; When the minimum pattern distance is not greater than the preset pattern difference threshold, a low risk level clue is generated.

[0010] Preferably, the genuine degradation pattern library is derived from an accelerated aging experiment conducted on real drugs under preset conditions, and a set of degradation state vectors extracted during the life cycle of the drugs.

[0011] Preferably, the feature extraction module includes: the extracted intrinsic identity vector and the degradation state vector are jointly complete in information and sufficient to represent all visual information of the digital image of the drug to be identified.

[0012] The present invention provides an improved computer vision-based automatic drug identification system, which has the following improvements and advantages compared with the prior art: 1. This invention uses a unique adversarial training mechanism to enable the system to extract features representing the inherent identity of a drug and features representing its degradation state from a single image. This eliminates the interference of changes in the drug's appearance caused by factors such as aging and moisture. Even if the drug exhibits discoloration or cracking, the system can still accurately determine its true identity, significantly improving recognition accuracy and robustness. 2. This invention not only identifies the degradation state of a drug but also correlates it with the critical failure points of physical and chemical indicators determined in pharmacopoeias or drug stability experiments, generating a standardized, intuitive quality quantification score. This transforms the assessment of drug quality from subjective judgment to an objective, repeatable digital measurement, providing an automated decision-making basis for drug quality monitoring. 3. This invention identifies counterfeit and inferior drugs that are highly similar in appearance to authentic ones by analyzing the directional patterns of their degradation characteristics in high-dimensional space, rather than simply the degree of degradation. Because differences in materials and processes can cause the degradation paths of counterfeit and inferior drugs to deviate from those of authentic products, this invention effectively identifies these physical process-based anomalies by comparing the degradation patterns of the tested drug with a pre-set library of degradation patterns for authentic products, thereby accurately identifying high-risk counterfeit and inferior drugs. 4. This invention integrates three functional modules: identity recognition, quality assessment, and risk screening. It can simultaneously output the drug's identity result, quality score, and counterfeit risk level from a single drug image. This multi-dimensional comprehensive analysis capability provides solid technical support and comprehensive decision-making basis for the safety supervision of drugs throughout their life cycle, significantly surpassing the limitations of traditional single identification functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a flowchart of the system of the present invention; Figure 2 It is a flowchart of the method for generating clues for risk identification of counterfeit and inferior drugs of the present invention. DETAILED DESCRIPTION

[0014] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to specific embodiments. Example 1

[0015] See also Figure 1, a computer vision-based automatic drug recognition system, comprising: A feature extraction module is used to extract an intrinsic identity vector and a degradation state vector from the acquired digital image of the drug to be identified; wherein the intrinsic identity vector represents the intrinsic identity information of the drug, and the degradation state vector represents the degradation information of the drug's appearance; An identity recognition module, used to generate a drug identity recognition result based on the intrinsic identity vector and a preset classifier network; A quality assessment module is used to generate a quantitative quality score of the drug based on the degradation state vector and a preset degradation tolerance threshold; The risk identification module is used to generate risk identification clues for counterfeit and substandard drugs based on the degradation state vector, the preset genuine product degradation pattern library, and the preset pattern difference threshold; An embodiment of the present invention provides a computer vision-based automatic drug identification system; the system integrates multiple functional modules and aims to transcend the limitations of traditional static recognition to achieve in-depth analysis of drug identity, quality, and even potential risks; the technical core of the system lies in its feature extraction module, which can simultaneously parse two essentially different but interrelated information from a single digital image of a drug: an intrinsic identity vector representing its unchanging core identity and appearance degradation information describing its current physical state; based on the output of the feature extraction module, the identity recognition module, quality assessment module, and risk screening module respectively utilize this decoupled information to work together, not only outputting accurate identity judgments, but also providing quantitative quality assessment and risk screening capabilities for counterfeit and substandard drugs, providing solid technical support and multi-dimensional decision-making basis for safety supervision of drugs throughout their life cycle; Example 2

[0016] The feature extraction module uses an adversarial training mechanism to constrain the intrinsic identity vector to not contain information that can be used to discern the drug degradation state, and to constrain the degradation state vector to not contain information that can be used to discern the drug identity, thereby achieving feature decoupling between the intrinsic identity vector and the degradation state vector; The feature extraction module includes: the extracted intrinsic identity vector and degradation state vector, which are jointly complete in information and sufficient to represent the entire visual information of the digital image of the drug to be identified; To realize the above system functions, the key technology lies in the training process of the feature extraction module, which is realized through a composite decoupling loss function. For end-to-end optimization, the formula is: ; The design of this function integrates the ideas of multi-task learning and generative adversarial networks. It aims to ensure the effectiveness of feature extraction while actively penalizing the leakage of different types of information in the feature vector, thereby forcing the pure separation of features. This design enables the model to learn the essential laws of change and invariance between identity and degradation, rather than just memorizing superficial phenomena. is the reconstruction and classification loss, is the orthogonal decoupling loss, It is a dimensionless hyperparameter used to balance the performance of the main task and the strength of decoupling; To further clarify, The specific form is: ; This formula is composed of the image reconstruction loss and classification loss Weighted composition ensures the joint completeness of information; among them, Using the L1 norm, that is , which is used to penalize the pixel-level differences between the generated image and the original image. This constraint ensures that the intrinsic identity vector z and the degraded state vector d jointly contain all the visual information required to reconstruct the original image; Use cross entropy loss to penalize the identity classifier The prediction and true label of This constraint ensures that the vector z contains sufficient and efficient identity discrimination information; G represents the generator network, represents the input digital image of the drug to be identified, is the identity classifier network, It is the true identity label of the drug, and is a dimensionless hyperparameter used to balance the importance of the two tasks; Orthogonal decoupling loss It is the key mechanism to realize the core innovation of this invention, and its formula is defined as: ; The inherent logic of this loss term is to achieve feature decoupling through two parallel adversarial game processes; for this purpose, the identity discriminator network is introduced and degradation information discriminator network ; Identity Discriminator attempts to predict drug identity from the degradation vector d, while the encoder branch in the feature extraction module responsible for generating the degradation vector is optimized to generate The vector d cannot be identified, thus erasing the identity information from the vector d; degrading the information discriminator We attempt to predict whether the drug is in a degraded state from the intrinsic identity vector z. The classification label can be pre-set based on whether the training image is from a degraded sample. The encoder branch in the feature extraction module responsible for generating the identity vector is optimized to generate z without any degradation state clues, thereby erasing the degradation information from z. Among them, the first expectation It is for the branch of the degraded information encoder From the image The degradation vector d extracted from the calculation is used. Similarly, the second expectation term It is for the identity information encoder branch From the image It is calculated by the identity vector z extracted from After this adversarial training, the system eventually reaches an equilibrium where the intrinsic identity vector z is insensitive to phase changes, while the degradation state vector d is independent of the specific drug identity, achieving feature decoupling. Example 3

[0017] The quality assessment module is specifically used to: calculate the L2 norm of the degradation state vector; divide the calculated L2 norm by a preset degradation tolerance threshold to obtain a relative degree of degradation; and generate a quantitative quality score of the drug based on the relative degree of degradation; The degradation tolerance threshold is derived from the degradation vector norm corresponding to the critical point of unqualified physical and chemical indicators calibrated in the pharmacopoeia standards or drug stability test data; The quality assessment module of the present invention combines abstract deep learning features with pharmaceutical standards with clear physical meanings. Its specific operating mechanism is to quantify the drug quality score. The calculation formula is as follows: ; This formula aims to convert the continuous degradation state vector inferred by the model Converted into an intuitive, standardized quality score; by introducing a physical threshold derived from pharmaceutical practice ,This formula establishes a quantitative association between the computer vision feature space and the physicochemical stability criteria of pharmaceuticals; in, is the quality quantification score of the final output; The feature extraction module of the present invention, which has been trained, receives a new image to be tested. When used as input, the output degradation state vector; is the L2 norm of the vector, and its value is positively correlated with the overall severity of drug degradation; is the degradation tolerance threshold, which is not obtained by model training but is calibrated through experiments. Its value comes from the pharmacopoeial standards or drug stability test data. It is the norm value of the degradation vector corresponding to when the key physical and chemical indicators of a specific drug reach the unqualified critical point. and They have the same physical dimensions, and their ratios are dimensionless values, which ensures the rigor of the formula; The function ensures that the score is non-negative; In practical applications, the calculation process of this module begins with calculating the degradation vector of the drug to be tested The L2 norm of the value objectively reflects the degree of deviation from the ideal state; based on this norm value, the degradation tolerance threshold is A division operation is performed to normalize the raw degradation metric to a relative degradation degree; the system ultimately subtracts this ratio from 1 to generate a mass fraction between 0 and 1. ;when The lower the score, the more serious the degradation. It means that the degradation degree of the drug has reached or exceeded the defined unacceptable critical point; This function provides an automated, digital decision-making basis for quality monitoring in drug circulation and use, significantly improving the level of drug safety. Example 4

[0018] See also Figure 2 The risk identification module is specifically used to: normalize the degradation state vector to obtain a normalized degradation state vector; calculate the cosine distance between the normalized degradation state vector and each normalized authentic degradation pattern vector in the authentic degradation pattern library; determine the minimum value of the cosine distance to obtain the minimum pattern distance; compare the minimum pattern distance with a preset pattern difference threshold to generate a risk identification clue for counterfeit and inferior drugs; The generation method of counterfeit and inferior drug risk identification clues includes: when the minimum pattern distance is greater than the preset pattern difference threshold, a high risk level is generated; when the minimum pattern distance is not greater than the preset pattern difference threshold, a low risk level clue is generated; The genuine product degradation pattern library is derived from accelerated aging experiments on real drugs under preset conditions, and the collection of degradation state vectors extracted during their life cycle; The risk identification module of the present invention provides a technical solution for identifying high-quality counterfeit and substandard drugs. Its discrimination logic is to analyze the directional pattern of the degradation vector rather than its intensity norm. The operating mechanism of this module is to compare the degradation pattern of the drug to be tested with a pre-established degradation pattern library of genuine products to generate a risk level. Many high-quality counterfeit and substandard drugs differ from genuine products due to differences in excipients or processes, resulting in their physical and chemical degradation pathways deviating from the genuine products. This difference is reflected in the direction of the degradation vector d in the high-dimensional feature space deviating from the genuine product cluster. This module aims to capture this feature difference based on physical processes to identify substandard products that are difficult to distinguish from the static appearance. The core of risk screening lies in the degradation vector of the drug to be tested. Degradation pattern library with genuine products For comparison, It is a method that conducts accelerated aging experiments on a large number of real drugs under preset temperature, humidity, light and other conditions, collects images of them throughout their life cycle, and then extracts a set of corresponding degradation vectors. Each genuine degradation pattern vector in the set is recorded as ; Discriminant process calculation With all genuine pattern vectors in the library The minimum cosine distance between them is expressed as: ; in, and express and The L2 norm of The minimum distance is compared with the preset mode difference threshold The threshold is set based on the statistical analysis of the intra-class distances within the degradation pattern library of genuine products and the inter-class distances of the degradation patterns of known counterfeit and inferior drugs, thereby determining a boundary that can effectively distinguish between normal and abnormal degradation pathways. When performing risk screening, the module's operation process is as follows: by calculating the degradation vector of the drug to be tested Degradation pattern library with genuine products All vectors in The minimum cosine distance between them is used to obtain the minimum pattern distance. This calculation process is designed to eliminate the influence of degradation severity (i.e., the modulus of the vector) and only compare the directional information; This minimum pattern distance is compared with the pattern difference threshold Comparison: When the minimum pattern distance is greater than the threshold, the system determines that the degradation pattern of the drug is abnormal and generates a high-risk clue; conversely, if the minimum pattern distance is not greater than the threshold, a low-risk clue is generated; This mechanism provides a high-precision identification method based on physical process differences, providing regulators with powerful technical means and greatly improving the accuracy and efficiency of combating counterfeit and substandard drugs.

[0019] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A computer vision-based automatic drug identification system, characterized in that: include: A feature extraction module is used to extract an intrinsic identity vector and a degradation state vector from the acquired digital image of the drug to be identified; wherein the intrinsic identity vector represents the intrinsic identity information of the drug, and the degradation state vector represents the degradation information of the drug's appearance; An identity recognition module, configured to generate an identity recognition result of the drug based on the intrinsic identity vector and a preset classifier network; a quality assessment module, configured to generate a quality quantification score of the drug based on the degradation state vector and a preset degradation tolerance threshold; The risk identification module is used to generate risk identification clues for counterfeit and inferior drugs based on the degradation state vector, a preset genuine degradation pattern library and a preset pattern difference threshold.

2. The computer vision-based automatic drug identification system according to claim 1, characterized in that: The feature extraction module, through an adversarial training mechanism, constrains the intrinsic identity vector to not contain information that can be used to discriminate the degradation state of the drug, and constrains the degradation state vector to not contain information that can be used to discriminate the identity of the drug, thereby achieving feature decoupling of the intrinsic identity vector and the degradation state vector.

3. The computer vision-based automatic drug identification system according to claim 1, characterized in that: The quality assessment module is specifically used for: Calculating the L2 norm of the degradation state vector; Dividing the calculated L2 norm by the preset degradation tolerance threshold to obtain a relative degradation degree; Based on the relative extent of degradation, a mass quantified score of the drug is generated.

4. The computer vision-based automatic drug identification system according to claim 3, characterized in that: The degradation tolerance threshold is derived from the degradation vector norm corresponding to the critical point of unqualified physical and chemical indicators calibrated in the pharmacopoeia standards or drug stability test data.

5. The computer vision-based automatic drug identification system according to claim 1, characterized in that: The risk identification module is specifically used to: performing normalization processing on the degradation state vector to obtain a normalized degradation state vector; Calculating the cosine distance between the normalized degradation state vector and each normalized authentic degradation pattern vector in the authentic degradation pattern library; Determine the minimum value of the cosine distances to obtain a minimum pattern distance; The minimum pattern distance is compared with the preset pattern difference threshold to generate the counterfeit and inferior drug risk identification clue.

6. The computer vision-based automatic drug identification system according to claim 5, characterized in that: The generation method of the counterfeit and inferior drug risk identification clues includes: When the minimum pattern distance is greater than the preset pattern difference threshold, a high-risk level clue is generated; When the minimum pattern distance is not greater than the preset pattern difference threshold, a low risk level clue is generated.

7. The computer vision-based automatic drug identification system according to claim 5, characterized in that: The genuine product degradation pattern library is derived from an accelerated aging experiment conducted on real drugs under preset conditions, and a collection of degradation state vectors extracted during the life cycle of the drugs.

8. The computer vision-based automatic drug identification system according to claim 1, characterized in that: The feature extraction module includes: the extracted intrinsic identity vector and the degradation state vector are jointly complete in information and sufficient to represent all visual information of the digital image of the drug to be identified.

Citation Information

Patent Citations

  • Drug identification system based on deep learning and identification method thereof

    CN107545150A

  • Drug classification method based on computer vision and artificial intelligence

    CN113837070A

  • Drug classification method based on pharmacometabonomics

    CN118658534A

  • Patient data management system based on cloud platform

    CN119418853A

  • Traditional Chinese medicine abnormal state recognition method, system and equipment and storage medium

    CN119622603A

Cited By

  • Fingerprint processing and identification method based on artificial intelligence

    CN121305624A

  • A fingerprint processing and recognition method based on artificial intelligence

    CN121305624B