An Information-based Quality Control Method and System for Pharmaceutical Production

By calculating the distinction index of each pixel point in the drug image and clustering, the problem of the traditional Chinese medicine detection in traditional Chinese medicine is solved, and the accurate separation and uniformity detection of the drug area is achieved, which improves the accuracy and timeliness of the detection.

CN119809460BActive Publication Date: 2025-05-30JIANGSU ZHONGYOUXIN TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510293288.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-05-30
Estimated Expiration
2045-03-13

AI Technical Summary

Technical Problem

The prior art is susceptible to dust and background interference when testing drugs, and cannot accurately separate the drug area, resulting in inaccurate detection.

Method used

By calculating the distinction index of each pixel point, using the distinction index of the pixel point and the position coordinates for clustering, the optimal clustering results are obtained, each drug area is accurately obtained, and the drug uniformity is calculated, and the alarm is triggered when the uniformity exceeds the preset range.

Benefits of technology

It improves the accuracy of drug testing, reduces background interference, ensures accurate separation of drug areas, promptly detects and deals with potential problems, and reduces the risk of unqualified products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119809460B_ABST
    Figure CN119809460B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing, and particularly to a method and system for informatization control of drug production quality. The method includes: collecting a drug image, and calculating a discrimination index for each pixel point in the image; clustering the pixel points according to the discrimination index and position coordinates of the pixel points to obtain an optimal clustering result; calculating the drug uniformity according to the number of pixel points included in each clustering cluster in the optimal clustering result, and giving an alarm when the drug uniformity is not within a preset range. The present invention effectively solves the problem in the prior art that it is easily interfered by dust and background and cannot accurately separate the drug area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing. More specifically, the present invention relates to a method and system for informatization control of drug production quality. Background Art

[0002] During the production process of granular drugs, due to reasons such as granulation process, equipment wear, drying process, dust collection and dust removal system, and improper operation, the problem of excessive dust may occur, making it impossible to accurately detect whether the drugs meet the standards. In the granulation process, improper selection of adhesives, insufficient stirring time, or unreasonable setting of spray parameters will result in too much fine powder in the granules. In terms of equipment, the wear of cutting knives and templates will affect the quality of granules and generate more dust. If the drying temperature is inappropriate, the granules will be dry on the outside and wet on the inside or generate fine powder. If the dust collection and dust removal system is not reasonably designed or the efficiency of the dust collector is not high, it will not be able to effectively remove fine dust. During the operation process, improper operations such as pouring and mixing will also cause dust to fly. These dusts will make it difficult to observe the granularity of drugs in the image during drug detection, further resulting in more noise when using the image to evaluate granular drugs, or being unable to effectively distinguish the background and granular pixel points at positions with a large dust concentration.

[0003] Currently, the Chinese patent document with the authorization announcement number CN118150412B discloses a method and system for detecting and analyzing the particle size of drugs based on near-infrared spectroscopy. This method uses near-infrared spectroscopy detection. Based on the same absorbance of similar samples, the detection efficiency is greatly improved through a qualitative clustering model, and the particle size of particles outside the known particle size range is predicted through a partial least squares method model, so as to achieve online rapid and accurate detection of samples without damage and pollution.

[0004] The above method is easily interfered by dust and background, and cannot accurately separate the drug area to detect whether the drugs meet the standards. Summary of the Invention

[0005] To solve the problems in the prior art that it is easily interfered by dust and background and cannot accurately separate the drug area, the present invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides a method for informatization control of drug production quality, including: collecting drug images, calculating the discrimination index of each pixel point in the image; clustering the pixel points according to the discrimination index and position coordinates of the pixel points to obtain the best clustering result; calculating the drug uniformity according to the number of pixel points included in each clustering cluster in the best clustering result, and giving an alarm when the drug uniformity is not within the preset range; the calculating the discrimination index of each pixel point in the image specifically includes: calculating the drug membership value of each pixel point and the background membership value , , where represents the RGB vector of a pixel point , represents the standard RGB vector of the drug, represents the standard RGB vector of the background; calculate the discrimination index , , where represents the drug membership value of the pixel point , represents the background membership value of the pixel point .

[0007] Calculating the discrimination index through the drug membership value and background membership value of the pixel point increases the difference between the background and the drug, reducing the possibility of interference and misjudgment in subsequent calculations; performing clustering processing using the discrimination index and position information of the pixel point can obtain the best clustering result and accurately obtain each drug area. Calculating the drug uniformity based on the number of pixel points in each clustering cluster can detect whether the size of all drugs meets the standard. When the calculated drug uniformity exceeds the preset range, the system can automatically trigger an alarm to promptly prompt abnormal situations. This helps to quickly discover and handle potential problems during the production or quality control process, reducing the risk of unqualified products flowing into the market. The above solution solves the problem that the prior art is easily interfered by dust and background when detecting drugs and cannot accurately separate the drug area.

[0008] Preferably, the calculation of the drug uniformity is specifically as follows: According to the discrimination index of each pixel point in each clustering cluster in the best clustering result, all clustering clusters are divided into a background cluster and a drug cluster; calculate the drug uniformity , , where represents the number of pixel points included in the smallest drug cluster, represents the number of pixel points included in the largest drug cluster, represents the standard deviation of the number of pixel points included in all drug clusters.

[0009] By statistically analyzing the number of pixels in each drug cluster in the best clustering result and using the minimum value, maximum value, and standard deviation of the number of pixels in each drug cluster to calculate the drug uniformity, this method can objectively and accurately reflect the distribution of drugs in the image, avoiding the subjectivity of relying on manual experience for judgment. First, all clustering clusters are divided into a background cluster and a drug cluster according to the discrimination index of the pixel points, effectively excluding background interference and ensuring that the subsequent calculation of drug uniformity only focuses on the actual drugs.

[0010] Preferably, the clustering of pixel points to obtain the best clustering result specifically includes: constructing a pixel point vector, which is composed of the discrimination index and position coordinates of the pixel point; using the K-means clustering algorithm according to the vector to cluster all pixel points, where the value of K during clustering is iterated within to obtain the clustering results corresponding to each value of K; calculating the evaluation values of each clustering result, and taking the clustering result corresponding to the maximum evaluation value as the best clustering result; the evaluation value , , where T is the total number of pixel points in the drug image, is the discrimination index of pixel point c, v is the total number of clustering clusters in the best clustering result, is the vector constructed by the discrimination index and position coordinates of pixel point c, is the vector constructed by the discrimination index and position coordinates of the clustering center of the i-th clustering cluster, and the i-th clustering cluster does not include the clustering cluster where pixel point c is located, is the vector constructed by the discrimination index and position coordinates of the clustering center of the clustering cluster where pixel point c is located.

[0011] This method combines the discrimination index and position coordinates, and uses the K-means clustering and quantitative evaluation mechanism, which not only realizes the accurate classification of pixel points, provides a solid technical guarantee for the accurate calculation and real-time alarm of the subsequent drug uniformity, and thus shows significant beneficial effects in improving the detection accuracy, realizing automatic monitoring and enhancing the system robustness. Moreover, the best value of K is adaptively selected using the evaluation value, reducing the subjective interference of artificially setting the clustering clusters and ensuring the optimality of the clustering results.

[0012] Preferably, the acquisition of the drug image includes: setting a high-definition camera at a position perpendicular to the drug carrier plate.

[0013] The vertical arrangement ensures that the camera is directly facing the carrier plate, which can eliminate the perspective distortion caused by oblique viewing, thus ensuring that information such as the shape and size of the drug is captured truthfully.

[0014] Preferably, according to the discrimination index of each pixel point in each clustering cluster in the best clustering result, dividing all clustering clusters into a background cluster and a drug cluster includes: calculating the average discrimination index of all pixel points in each clustering cluster, and using the Otsu threshold segmentation method to divide all clustering clusters into a background cluster and a drug cluster.

[0015] By taking the average of the discrimination indices of all pixel points in each cluster, the overall characteristics of the cluster can be comprehensively reflected, reducing the influence of individual pixel outliers or noise on the determination result. Using the Otsu threshold segmentation method, an optimal threshold can be automatically obtained, which can maximize the between-class difference and accurately divide the cluster into a background cluster and a drug cluster. This method reduces the subjectivity of manually setting the threshold and improves the objectivity and consistency of the segmentation result.

[0016] Preferably, the is greater than the number of drugs.

[0017] Preferably, when the drug uniformity is not within the preset range, an alarm is triggered, including: triggering an alarm through the color of the alarm light and / or the sound of the alarm bell.

[0018] In a second aspect, the present invention also provides a drug production quality information management and control system, including: a memory and a processor, where a computer program is stored on the memory, and the processor executes the computer program to implement the above-mentioned drug production quality information management and control method.

[0019] The beneficial effects of the present invention are as follows: By calculating the discrimination index through the drug membership value and background membership value of pixel points, the difference between the background and drugs is increased, reducing the possibility of interference and misjudgment in subsequent calculations; Using the discrimination index and position information of pixel points for clustering processing can obtain the best clustering result and accurately obtain each drug area. Calculate the drug uniformity. When the calculated drug uniformity exceeds the preset range, the system can automatically trigger an alarm to promptly prompt abnormal situations. This helps to quickly discover and handle potential problems during production or quality control, reducing the risk of unqualified products flowing into the market. The above solution solves the problem that the prior art is easily interfered by dust and background when detecting drugs and cannot accurately separate the drug area. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features, and advantages of the exemplary embodiments of the present invention will become easily understood. In the drawings, several embodiments of the present invention are shown in an exemplary rather than restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts, where:

[0021] Figure 1 is a flowchart of a drug production quality information management and control method provided by an embodiment of the present invention;

[0022] Figure 2 is a block diagram of a drug production quality information management and control system provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0023] Next, the technical invention in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.

[0024] The following will describe in detail the specific implementation manners of the present invention in conjunction with the accompanying drawings.

[0025] Figure 1 It is a flowchart of a method for informatization control of drug production quality according to an embodiment of the present invention, including the following steps:

[0026] S101. Collect drug images and calculate the discrimination index of each pixel point in the images.

[0027] During the production process of a batch of drugs, these drugs are distributed on a carrier plate. In order to collect the most accurate image information of these drugs, it is necessary to set a high-definition camera at a position perpendicular to the carrier plate, which can eliminate the perspective distortion caused by oblique viewing, so as to ensure that information such as the shape and size of the drugs is captured truly. In some embodiments, some carrier plates are relatively long or large, and multiple high-definition cameras may need to be set, which will not be elaborated here.

[0028] In the collected drug images, in order to reduce the interference of the background on subsequent calculations, it is necessary to enhance the difference between the background and the drugs. In the present invention, the provided method is to calculate the drug membership value and the background membership value of each pixel point to calculate its discrimination index, and the discrimination index is an index that distinguishes whether the pixel point belongs to the background or the drug. The specific calculation process is as follows: Calculate the drug membership value of each pixel point and the background membership value , , where represents the RGB vector of the pixel point , represents the standard RGB vector of the drug, represents the standard RGB vector of the background; calculate the discrimination index , , where represents the drug membership value of the pixel point , represents the background membership value of the pixel point .

[0029] Calculating the drug membership value and the background membership value of each pixel point is to preliminarily determine whether the pixel point is more likely to belong to the drug or the background. If it belongs to the drug, its discrimination index is a value belonging to [0, 2]. If it belongs to the background, its discrimination index is a value belonging to [-2, 0]. By differentiating the exponential formula, the difference between the pixels belonging to the drug and the pixels belonging to the background is enhanced, and the problem of inaccurate separation of the background and the drug caused by more dust in drug production is solved.

[0030] S102: Cluster the pixels according to the discrimination index and position coordinates of the pixels to obtain the best clustering result.

[0031] The above solution specifically includes: constructing a pixel vector, which is composed of the discrimination index and position coordinates of the pixel; using the K-means clustering algorithm according to the vector to cluster all pixels, where the value of K during clustering iterates within to obtain the clustering results corresponding to each value of K; calculating the evaluation value of each clustering result, and taking the clustering result corresponding to the maximum evaluation value as the best clustering result; the evaluation value , , where T is the total number of pixels in the drug image, is the discrimination index of pixel c, v is the total number of clusters in the best clustering result, is the vector constructed by the discrimination index and position coordinates of pixel c, is the vector constructed by the discrimination index and position coordinates of the clustering center of the i-th cluster, and the i-th cluster does not include the cluster where pixel c is located, is the vector constructed by the discrimination index and position coordinates of the clustering center of the cluster where pixel c is located.

[0032] The p is greater than the number of drugs in the image. Here, it is considered that if p is less than or equal to the number of drugs in the image, then the pixels of each drug cannot be clustered into one class.

[0033] There are many drugs on the carrier plate. Using the discrimination index and position coordinates to cluster the pixels, the best clustering result can cluster the pixels of the same drug into one class as much as possible. Although the discrimination indices of the pixels included in different drugs are close, their position coordinates are far apart, so they will not affect each other.

[0034] In the calculation formula of the evaluation value w, represents the distance between pixel c and the clustering center of the nearest neighbor cluster, is the distance between pixel c and the clustering center of the cluster to which it belongs. Quantify the degree of separation of the pixel from its own cluster and other clusters. If the pixel is very close to the clustering center of its own cluster (tight within the cluster) and far from the clustering centers of other clusters, then this ratio will be much greater than 0; conversely, if the pixel is not compact enough within the cluster or the boundary with other clusters is not obvious, this value will be close to 0. Multiply it by the absolute value of the discrimination index of the pixel, which can make the pixels with a larger absolute value of the discrimination index, that is, the pixels that are clearly part of the drug or background, contribute more to the evaluation value of the clustering result. Finally, take the mean of all pixels to evaluate the clustering result as a whole.

[0035] S103. Calculate the drug uniformity according to the number of pixels included in each clustering cluster in the optimal clustering result, and give an alarm when the drug uniformity is not within the preset range.

[0036] The calculation of the drug uniformity is specifically as follows: According to the discrimination index of each pixel in each clustering cluster in the optimal clustering result, divide all clustering clusters into a background cluster and a drug cluster; calculate the drug uniformity , , where represents the number of pixels included in the smallest drug cluster, represents the number of pixels included in the largest drug cluster, represents the standard deviation of the number of pixels included in all drug clusters.

[0037] In some embodiments, the dividing all clustering clusters into a background cluster and a drug cluster according to the discrimination index of each pixel in each clustering cluster in the optimal clustering result includes: calculating the average discrimination index of all pixels in each clustering cluster, and using the Otsu threshold segmentation method to divide all clustering clusters into a background cluster and a drug cluster.

[0038] Specifically, for each clustering cluster, first calculate the average discrimination index of all its pixels. Regard the average discrimination indices of all clustering clusters as a set of data, and use the Otsu threshold segmentation method to find an optimal threshold. The clustering clusters with an average discrimination index less than this threshold are background clusters, and the clustering clusters greater than or equal to this threshold are drug clusters. The method of using the Otsu threshold segmentation method to find the optimal threshold is a well-known technology and will not be elaborated here.

[0039] Each drug cluster corresponds to one pill, and the number of pixels included in the drug cluster corresponds to the size of the pill. In the drug uniformity formula, reflects the gap between the smallest pill and the largest pill. The larger this value is, the more serious the non-compliant pills appear. It reflects the deviation of the sizes of all drugs in the image from the average size. The larger this value is, the more uneven the sizes of the drugs in the image are. The drug uniformity is calculated by a comprehensive index using the number of pixels in the smallest drug cluster and the largest drug cluster and the standard deviation of the number of pixels in all drug clusters, which objectively and accurately reflects the distribution of drugs in the image as a whole. The larger the drug uniformity is, the more uniform the size distribution of the drugs in the image is and the more compliant with the standard it is. On the contrary, if it is less compliant with the standard, an alarm needs to be triggered by the color of the alarm light and / or the sound of the alarm bell.

[0040] The present invention calculates the discrimination index through the drug subordination value and the background subordination value of pixel points, which increases the difference between the background and the drugs and reduces the possibility of interference and misjudgment in subsequent calculations; clustering is performed using the discrimination index and position information of pixel points, and the best clustering result can be obtained to accurately obtain each drug area. The drug uniformity is calculated, and when the calculated drug uniformity exceeds the preset range, the system can automatically trigger an alarm to promptly prompt an abnormal situation. This helps to quickly discover and handle potential problems during the production or quality control process and reduces the risk of unqualified products flowing into the market. The above solution solves the problem that the prior art is easily interfered by dust and background when detecting drugs and cannot accurately separate the drug area.

[0041] The present invention also provides a drug production quality information management and control system. As Figure 2 shown, the system includes a processor and a memory, and the memory stores computer program instructions. When the computer program instructions are executed by the processor, the drug production quality information management and control method of the present invention is implemented.

[0042] The system also includes other components well known to those skilled in the art such as a communication bus and a communication interface, and their settings and functions are known in the art, so they will not be elaborated here.

[0043] In the present invention, the aforementioned memory may be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory (RRAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), an enhanced dynamic random access memory (EDRAM), a high-bandwidth memory (HBM), a hybrid memory cube (HMC), etc., or any other medium that can be used to store the required information and can be accessed by an application program, a module, or both. Any such computer storage medium may be part of the workshop equipment or accessible or connectable to the workshop equipment. Any application or module described in the present invention may be implemented using computer-readable / executable instructions that can be stored or otherwise held by such a computer-readable medium.

[0044] In the description of this specification, the meanings of "a plurality of" and "several" are at least two, for example, two, three, or more, etc., unless otherwise specifically and clearly defined.

[0045] Although this specification has shown and described multiple embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will think of many changes, alterations, and alternative ways without departing from the spirit and concept of the present invention. It should be understood that various alternative inventions to the embodiments of the present invention described herein may be adopted in the practice of the present invention.

Claims

1. A method for informatization control of drug production quality, characterized in that: include: Collecting drug images and calculating the discrimination index of each pixel in the images; Cluster the pixels according to their discrimination index and position coordinates to obtain the best clustering result; According to the discrimination index of each pixel in each cluster in the best clustering result, all clusters are divided into background clusters and drug clusters; Calculate drug uniformity , ,in, Indicates the number of pixels contained in the smallest drug cluster, Indicates the number of pixels contained in the largest drug cluster, Indicates the standard deviation of the number of pixels contained in all drug clusters, and an alarm is triggered when the uniformity of the drug is not within the preset range; The calculating of the discrimination index of each pixel in the image specifically includes: calculating the drug subordination value of each pixel and background dependent values , ,in, Represents pixel RGB vector, represents the standard RGB vector of the drug, The standard RGB vector representing the background; Calculate the discrimination index , ,in, Represents pixel The drug dependency value of Represents pixel The background dependent value of .

2. The method for informatization control of drug production quality according to claim 1, characterized in that: The clustering of the pixels to obtain the best clustering result specifically includes: Constructing a pixel point vector, wherein the vector is composed of a distinguishing index and a position coordinate of the pixel point; According to the vector, all pixels are clustered using the K-means clustering algorithm, where the K value during clustering is Inner iteration, obtain the clustering result corresponding to each K value; calculate the evaluation value of each clustering result, and take the clustering result corresponding to the maximum evaluation value as the best clustering result; the evaluation value , , where T is the total number of pixels in the drug image, is the discrimination index of pixel c, v is the total number of clusters in the best clustering result, is a vector constructed from the discrimination index and position coordinates of pixel c, is a vector constructed by the distinguishing index and position coordinates of the cluster center of the ith cluster, wherein the ith cluster does not include the cluster where the pixel point c is located, is a vector constructed by the discrimination index and position coordinates of the cluster center of the cluster where the pixel c is located.

3. The method for informatization control of drug production quality according to claim 1, characterized in that: The collecting of drug images comprises: A high-definition camera is arranged at a position perpendicular to the medicine carrying plate.

4. The method for informatization control of drug production quality according to claim 1, characterized in that: The method of dividing all clusters into background clusters and drug clusters according to the discrimination index of each pixel in each cluster in the best clustering result includes: The average discrimination index of all pixels in each cluster was calculated, and all clusters were divided into background clusters and drug clusters using the Otsu threshold segmentation method.

5. The method for informatization control of drug production quality according to claim 2, characterized in that: Said Greater than the amount of medicine.

6. The method for informatization control of drug production quality according to claim 1, characterized in that: The method of giving an alarm when the uniformity of the medicine is not within a preset range includes: Alarms are given by warning light colors and / or alarm bell sounds.

7. A drug production quality information management and control system, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method for information management and control of drug production quality as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • A drug particle size detection and analysis method and system based on near infrared spectroscopy

    CN118150412B

  • Method for extracting liver region in ultrasound image

    CN106504239A

  • Data processing method for textile production

    CN115578388A