A medicine filling dose automatic identification method and system
By employing a lightweight learning model with multi-level adaptive compensation and dynamic fusion, the consistency and accuracy issues in traditional drug filling dosage detection are resolved. This enables high-precision automated monitoring and intelligent optimization in the drug production process, thereby improving production efficiency and drug quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional drug filling dosage testing methods cannot meet the requirements of consistency, accuracy and traceability in the production process, especially when faced with differences between different production batches, which leads to dosage deviations.
A lightweight learning model with multi-level adaptive compensation and dynamic fusion is adopted. By constructing a main learning model and a derived learning model, a lightweight learning model for each production batch is generated. Combined with cross-batch model collaboration and optimization, real-time monitoring and automatic identification of filling dosage are achieved.
It improves the accuracy and consistency of filling dosage identification, reduces dosage deviation caused by factors such as production environment and sensor drift, enhances the real-time processing capability of the production line and drug quality, reduces manual intervention, and ensures that the dosage of each bottle of medicine meets the standard.
Smart Images

Figure CN121436091B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of production automation technology, specifically to a method and system for automatic identification of drug filling dosage. Background Technology
[0002] As the pharmaceutical manufacturing industry demands higher levels of production efficiency, quality control, and automation, traditional methods for measuring filling dosages are no longer sufficient to meet increasingly stringent requirements. To improve consistency, accuracy, and traceability in the production process, more intelligent technologies are urgently needed. In recent years, deep learning and machine learning have been widely applied in industrial automation, particularly in image recognition, quality control, and process monitoring. These technologies can train models using large amounts of data to automatically identify and adapt to different production environments, operating conditions, and production batches, thereby improving production accuracy and efficiency.
[0003] However, various parameters in the drug filling process affect the accuracy of the filling dosage, and traditional methods often cannot fully take these differences into account, leading to dosage deviation. Furthermore, there may be certain differences between different production batches during the drug production process, and traditional methods are difficult to effectively deal with this difference.
[0004] Therefore, in order to address the above problems, there is an urgent need for an automatic drug filling dosage identification method and system. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides an automatic drug filling dosage identification method and system, which solves the problems of frequent manual intervention, low accuracy, and ineffective handling of batch differences in traditional drug filling dosage detection.
[0006] To achieve the above objectives, the present invention provides the following technical solution: an automatic drug filling dosage identification method, comprising the following steps: establishing a drug master database and a master learning model; storing standard physical characteristics and production parameters of various drugs in the drug master database; configuring the master learning model to learn the identification features of various drugs; and simultaneously, differentiating the master learning model into corresponding derived learning models based on drug type; generating a lightweight learning model for each production batch of various drugs based on the derived learning models of various drugs; the lightweight learning model is constructed in a multi-level manner, the multi-level including sequentially connected low-level modules and high-level modules; the parameters of each level are adaptively compensated and adjusted based on the difference information of the production batch; the adaptive compensation and adjustment specifically includes: detecting the difference information of the production batch relative to the initial basic model, and mapping the difference information to the multi-level according to the scope of influence; for system deviations at the level of raw data, in the low-level modules... Parameters are adjusted for compensation. For pattern differences, an adaptive correction factor is introduced in the higher-level module. Simultaneously, each level performs fusion by outputting corresponding dynamic fusion coefficients. Specific fusion analysis includes: each level of the lightweight learning model is equipped with a fusion coefficient output unit. Each level dynamically outputs its corresponding fusion coefficient based on its response characteristics and confidence level to the current input data, and performs weighted fusion according to its respective fusion coefficients to output the filling dose identification result of the lightweight learning model. The operation process of each lightweight learning model is monitored based on preset task trigger events. When a task trigger event is detected for a lightweight learning model, the communication connection between that lightweight learning model and other batches of lightweight learning models for the same drug is automatically triggered. The lightweight learning model is then retrained by sharing difference feature parameters, and the retrained lightweight learning model is used for real-time monitoring and identification of the filling dose.
[0007] Furthermore, the specific analysis of configuring the main learning model to learn the identification features of various drugs, and the main learning model to differentiate corresponding derived learning models according to drug type, is as follows: using multi-source data of different drug types in the drug master database, the main learning model is trained with general identification features, so that it learns general identification features that are not limited to drug form; based on the training of general identification features, the sub-model is specially adjusted according to the specific data of each drug type, and a learning model for that drug type is derived. Each derived learning model inherits the parameter base of the main learning model and incorporates the specific data of the drug type, thereby forming a derived learning model corresponding to the drug type, which is used to identify the filling dosage of that type of drug.
[0008] Furthermore, the specific analysis of generating lightweight learning models for each production batch of various drugs is as follows: A derived learning model corresponding to the drug type is used as the initial base model, and this model is replicated at the beginning of each new production batch; initial calibration data for that production batch is obtained, and the parameters of the initial base model are adjusted and simplified based on the differential characteristic parameters of each production batch to obtain a lightweight learning model for each production batch; the parameter adjustment process uses samples from that production batch for incremental training, enabling the model to compensate for sensor offsets and environmental condition changes present in that batch; the simplification and optimization process compresses the model size through model pruning and distillation to form a lightweight model that can run in real time on embedded devices.
[0009] Furthermore, the specific analysis of the adaptive compensation adjustment of the parameters at each level based on the difference information of the production batch is as follows: The lightweight learning model is divided into multiple sequentially connected hierarchical modules. Each level processes feature information at different levels of abstraction. The multiple hierarchical modules include low-level modules and high-level modules. The low-level modules are used for basic data processing and primary feature extraction, while the high-level modules are used for comprehensive discrimination and result output. During model generation or batch calibration, the difference information of the production batch relative to the initial basic model is detected, and these differences are mapped to each level of the model according to their impact range: For system biases at the level of raw data, parameters are adjusted in the low-level modules to compensate for them, and for pattern differences, adaptive correction factors are introduced in the high-level modules.
[0010] Furthermore, the specific analysis of the fusion by outputting corresponding dynamic fusion coefficients for each level is as follows: a fusion coefficient output unit is set for each level of the lightweight learning model. The fusion coefficient output unit dynamically outputs the fusion coefficient of the level according to the response characteristics and confidence of the level to the current input data. The fusion coefficient reflects the importance of each level under the current working condition in real time. Each level outputs the filling dosage identification result of the lightweight learning model by fusion according to its own fusion coefficient.
[0011] Furthermore, the preset task triggering event is used to monitor abnormal changes in model performance or operating conditions during the operation of the lightweight learning model, so as to determine when to trigger the model communication and retraining mechanism.
[0012] Furthermore, the specific analysis of retraining the lightweight learning model by sharing differential feature parameters is as follows: After a task triggering event occurs in a lightweight learning model, communication is established between the lightweight learning model and other batches of lightweight learning models for the same drug. The differential feature parameters of this batch are shared with other batches of lightweight learning models, and the differential feature parameters corresponding to other batches of lightweight learning models are obtained. The differential feature parameters of each lightweight learning model are compared, and a fault diagnosis algorithm is used to identify the degree of deviation between the output of each level of the lightweight learning model that has experienced the task triggering event and the output of other batches of lightweight learning models under the same input, thereby locating the target level where performance degradation has occurred. For the located target level, the level containing the newly added differential feature parameters of this batch is selected for training and updating, while the parameters provided by other batches of lightweight learning models are referenced as regularization constraints.
[0013] Furthermore, the specific analysis of using the retrained lightweight learning model for real-time monitoring and identification of filling dosage is as follows: the retrained and updated lightweight learning model is deployed back to the embedded device of the filling production line. The lightweight learning model is connected to the sensor interface of the filling equipment and performs real-time inference on the edge device. The lightweight learning model analyzes relevant data in real time and outputs dosage identification results during each filling, realizing automatic monitoring of filling dosage. When a filling dosage is detected to deviate from the preset range, a warning signal is generated in real time and fed back to the control system for adjustment.
[0014] An automatic drug filling dosage identification system, applying the aforementioned automatic drug filling dosage identification method, includes: a derived learning model differentiation module, used to establish a drug master database and a master learning model. The drug master database stores standard physical characteristics and production parameters of various drugs, and the master learning model is configured to learn the identification features of various drugs. Simultaneously, the master learning model differentiates into corresponding derived learning models based on drug type. A lightweight learning model generation module is used to generate a lightweight learning model for each production batch of various drugs based on the derived learning models. The lightweight learning model is constructed in a multi-level manner, comprising sequentially connected low-level modules and high-level modules. The parameters of each level are adaptively compensated and adjusted based on the difference information of the production batch. The adaptive compensation and adjustment specifically includes: detecting the difference information of the production batch relative to the initial basic model, and mapping the difference information to the multi-level according to its impact range; for system deviations at the level of raw data, in the low-level module... The module adjusts parameters for compensation, and for mode differences, an adaptive correction factor is introduced in the higher-level module. Simultaneously, each level performs fusion by outputting corresponding dynamic fusion coefficients. Specific fusion analysis includes: each level of the lightweight learning model is equipped with a fusion coefficient output unit. Each level dynamically outputs its corresponding fusion coefficient based on its response characteristics and confidence level to the current input data, and performs weighted fusion according to its respective fusion coefficients to output the filling dose identification result of the lightweight learning model. A cross-batch model collaboration and optimization module is used to monitor the operation of each lightweight learning model based on preset task trigger events. When a task trigger event is detected for a lightweight learning model, it automatically triggers communication between that lightweight learning model and other batches of lightweight learning models for the same drug. By sharing differential feature parameters, the lightweight learning model is retrained, and then the retrained lightweight learning model is used for real-time monitoring and identification of the filling dose.
[0015] The present invention has the following beneficial effects:
[0016] This invention relates to an automatic drug filling dosage identification method and system. Through multi-layered construction of a main learning model and derived learning models, it enables customized training based on the physical characteristics and production conditions of different drugs. The lightweight learning model generated for each production batch can accurately adapt to minor changes during the production process, thereby improving the accuracy of filling dosage identification and avoiding dosage deviations caused by factors such as the production environment and sensor drift. The system adaptively compensates and adjusts the learning model based on batch-specific differences. The lightweight learning model for each production batch automatically adjusts according to the specific differences of each batch, ensuring consistent model performance under different production conditions and preventing a decrease in identification accuracy due to changes in production conditions. The system employs a dynamic fusion coefficient design, allowing each learning model level to adaptively adjust its weight in the final identification result based on its response characteristics and confidence level during processing. This not only improves the accuracy of the identification results but also optimizes the allocation of computing resources, contributing to improved production efficiency. The system boasts real-time processing capabilities; by enabling cross-batch communication and collaboration between lightweight learning models under task-triggered events, sharing differential feature parameters and retraining, it ensures that the learning models remain up-to-date and optimal throughout the entire production process, preventing performance degradation in any batch and ensuring consistency and stability across batches. The retrained lightweight learning models are deployed on embedded devices for real-time inference, enabling real-time data analysis during filling and issuing warning signals when the filling dosage deviates from the preset range. Through real-time feedback and adjustment, production deviations can be quickly corrected, ensuring drug quality and safety. Automated identification and adjustment reduce the need for manual intervention, minimize human error, and improve production efficiency. Precise filling dosage monitoring and real-time adjustment ensure that the dosage of each bottle of medicine meets standards, thereby improving drug quality and consistency and reducing quality problems and patient safety risks caused by inaccurate dosage.
[0017] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0018] Figure 1 This is a flowchart of an automatic drug filling dosage identification method according to the present invention.
[0019] Figure 2 This is a structural diagram of an automatic drug filling dosage identification system according to the present invention. Detailed Implementation
[0020] This application provides an automatic drug filling dosage identification method and system, which realizes automated high-precision monitoring and intelligent optimization in the drug production process, thereby improving production efficiency and product quality.
[0021] The overall concept of this application's embodiments is as follows:
[0022] A three-tiered knowledge system consisting of a main model, derived models, and lightweight models is constructed, and knowledge transfer is achieved through parameter inheritance and incremental fine-tuning. A federated learning mechanism for cross-batch models is established, and distributed knowledge evolution is achieved through the sharing of differential feature parameters. Multi-level adaptive compensation and dynamic fusion coefficients are adopted to achieve real-time fine adjustment of model parameters. The algorithm is deployed to the production site through model pruning, distillation, and other techniques to build a computing architecture that coordinates the middle and edge.
[0023] Please see Figure 1 This invention provides a technical solution: an automatic drug filling dosage identification method, comprising the following steps: establishing a drug master database and a master learning model; storing standard physical characteristics and production parameters of various drugs in the drug master database; configuring the master learning model to learn the identification features of various drugs; simultaneously, the master learning model differentiates into corresponding derived learning models according to drug type; generating a lightweight learning model for each production batch of various drugs based on the derived learning models of various drugs; the lightweight learning model adopts a multi-level construction, and the parameters of each level are adaptively compensated and adjusted based on the difference information of production batches; simultaneously, each level is fused by outputting corresponding dynamic fusion coefficients; monitoring the operation process of each lightweight learning model based on preset task trigger events; when a task trigger event is detected for a certain lightweight learning model, automatically triggering the communication connection between the lightweight learning model and other lightweight learning models of the same drug batches; retraining the parameters of the lightweight learning model by sharing difference feature parameters; and then using the retrained lightweight learning model for real-time monitoring and identification of filling dosage.
[0024] Specifically, the main drug database stores the standard physical characteristics and production parameters of various drugs. Standard physical characteristics include quantifiable attributes such as density, viscosity, color, and morphology. Production parameters cover process parameters related to the filling process, such as filling speed, filling pressure, ambient temperature, humidity, and container specifications. The database adopts a distributed storage architecture, supporting real-time access and dynamic updates of multi-source data. To ensure data accuracy and consistency, the database establishes a data verification mechanism: for real-time data collected by sensors, a sliding window filtering method is used to remove noise interference; for manually entered standard characteristic data, a multi-level review process is used for verification. Simultaneously, the database supports multi-dimensional indexing by drug type, production time, batch number, etc., for quick querying and retrieval of relevant data.
[0025] The main learning model adopts a deep neural network architecture. Its input layer receives multi-source feature data of the drug, such as filling images, pressure signals, and flow data collected by sensors, and the output layer is the identification result of the filling dosage. The intermediate layers of the model include convolutional layers, pooling layers, and fully connected layers, which realize the extraction and mapping of complex features through multi-layer nonlinear transformation.
[0026] The training process of the master learning model includes: training general recognition features using multi-source data of different drug types in the drug master database. For example, for drugs in different forms such as oral liquids, injections, and powders, the model learns common features in their filling process, such as the relationship between dosage and container liquid level, and the pressure change pattern at the end of filling, to form a general recognition capability that is not limited to drug form. During the training process, the stochastic gradient descent algorithm is used to optimize the model parameters, and hyperparameters such as the number of network layers and neurons are adjusted through cross-validation to minimize the recognition error.
[0027] The specific analysis of differentiating the corresponding derived learning models is as follows: Based on the training of general recognition features, the main learning model is specially adjusted according to the specific data of each drug type to derive a learning model for that drug type. Each derived learning model inherits the parameter base of the main learning model and incorporates the specific data of that drug type, such as the influence of the viscosity characteristics of a certain oral liquid on the filling flow rate, the conversion relationship between the bulk density and the filling volume of a certain powder, etc.
[0028] In this implementation plan, a master drug database is established to achieve systematic management and efficient reuse of drug feature information. The hierarchical architecture of the master learning model and the derived learning model not only ensures the adaptability of the model to multiple drug types, but also improves the recognition accuracy of specific drug types, laying the foundation for subsequent batch-level model optimization.
[0029] Specifically, the lightweight learning model uses the derived learning model corresponding to the drug type as the initial base model. At the beginning of each new production batch, the derived learning model is automatically copied as the initial template. The initial calibration data of the production batch is obtained, including the manual inspection data of the first product and the initial calibration parameters of the sensors. Combined with the difference characteristic parameters of each production batch, such as drug density fluctuations caused by differences in raw material batches and filling pressure deviations caused by equipment wear, the parameters of the initial base model are adjusted and simplified for optimization.
[0030] The parameter adjustment process is achieved through incremental training using samples from the production batch. For example, for a batch of tablets being filled, the actual weight of the first 100 tablets and sensor detection data are collected as training samples. The model parameters are then fine-tuned using the backpropagation algorithm to compensate for sensor offsets and environmental condition changes in that batch, such as zero-point drift of the weighing sensor caused by increased room temperature.
[0031] The optimization process is simplified by compressing the model size through model pruning and distillation. Model pruning removes redundant neurons and connections from the network, such as deleting connections whose absolute weights are less than a threshold. Model distillation trains a small model to simulate the output distribution of the original model, significantly reducing the number of model parameters and computational load while maintaining recognition accuracy. The optimized lightweight learning model can run in real time on resource-constrained embedded devices, such as edge computing gateways and PLC controllers.
[0032] The lightweight learning model employs a multi-level modular structure, with each level sequentially connected to process feature information at different levels of abstraction. Lower-level modules include a data preprocessing layer and a primary feature extraction layer: the data preprocessing layer cleanses and standardizes raw sensor data, such as noise removal from images and filtering of pressure signals; the primary feature extraction layer extracts basic features from the data, such as liquid level height and filling time, through simple convolution operations or statistical analysis. Higher-level modules include a feature fusion layer and a comprehensive discrimination layer: the feature fusion layer integrates the multi-dimensional features extracted from the lower levels to form more representative composite features, such as the flow rate feature formed by combining liquid level height and filling speed; the comprehensive discrimination layer performs inference and judgment based on the composite features, outputting the identification result of the filling dosage.
[0033] During model generation or batch calibration, the differences between the production batch and the initial calibration data and process data of the standard batch are detected by comparing them. These differences are mapped to various levels of the model according to their impact: For systemic biases at the raw data level, such as image scaling distortion caused by changes in camera focal length, parameters are adjusted in lower-level modules to compensate, such as correcting the image scaling factor; for pattern differences, such as changes in the filling dosage and pressure relationship caused by changes in raw material particle size, adaptive correction factors are introduced in higher-level modules. For example, when the viscosity of a batch of oral liquid is higher than the standard value, lower-level modules adjust the time window parameters of the flow sensor data to adapt to changes in liquid flow rate; higher-level modules adjust the conversion relationship between liquid level and actual dosage through correction factors to ensure the accuracy of the recognition results.
[0034] A fusion coefficient output unit is set up for each layer of the lightweight learning model. This unit dynamically outputs the fusion coefficient based on the response characteristics and confidence level of that layer to the current input data. The value of the fusion coefficient ranges from 0 to 1, reflecting the importance of each layer under the current operating conditions in real time. For example, when the lighting in the filling environment is stable, the confidence level of the image feature extraction layer is high, and its fusion coefficient increases; when a sudden change in lighting causes the image features to become unreliable, the fusion coefficient of that layer automatically decreases, while the fusion coefficient of the pressure sensor feature layer increases accordingly.
[0035] The outputs from each level are weighted and fused according to their respective fusion coefficients to obtain the final filling dosage identification result of the lightweight learning model. This dynamic fusion mechanism enables the model to adaptively adjust the weights of each feature according to changes in operating conditions, thereby improving the robustness of the identification system.
[0036] In this implementation plan, the lightweight learning model achieves real-time operation on embedded devices through parameter adjustment and structural optimization, meeting the real-time requirements of the production site; the multi-level architecture and dynamic fusion mechanism enable the model to adapt to differences in production batches and changes in working conditions, improving the accuracy and stability of filling dosage identification.
[0037] Specifically, the preset task trigger events are used to monitor abnormal changes in model performance or operating conditions during the operation of the lightweight learning model. These mainly include the following types: the model recognition accuracy is lower than the preset threshold for multiple consecutive samples, such as the recognition error of 5 consecutive products exceeding ±2%; abnormal jumps in sensor data, such as pressure signals suddenly exceeding the normal range; significant changes in production environment parameters, such as temperature fluctuations exceeding ±5℃; and manually triggered model verification requests.
[0038] By collecting model outputs, sensor data, and environmental parameters in real time and comparing them with preset thresholds, real-time monitoring of task-triggered events is achieved. When a task-triggered event is detected in a lightweight learning model, the model communication and retraining mechanism is automatically activated.
[0039] When a task-triggered event occurs in a lightweight learning model, the system automatically establishes a communication connection between that model and other batches of lightweight learning models for the same drug. Communication employs a distributed communication protocol based on industrial Ethernet to ensure real-time and reliable data transmission.
[0040] During communication, the lightweight learning models in this batch share their differential feature parameters with other batches of lightweight learning models, while also receiving differential feature parameters from other batches of models. These differential feature parameters include sensor offsets, environmental correction coefficients, and output biases at each level of the model. For example, when the model in batch A exhibits recognition bias, it sends its own pressure sensor calibration parameters to the models in batches B and C, and obtains relevant parameters from these models as a reference.
[0041] The parameter retraining process mainly includes the following steps: comparing the differential feature parameters of each lightweight learning model, and using fault diagnosis algorithms, such as rule-based reasoning and neural network anomaly detection, to identify the degree of deviation between the output of each level of the current batch of models and the output of other batches of models under the same input. For the target level of localization, sample data containing the newly added differential feature parameters of the current batch, such as recently collected sensor data with accurate dose labels, are selected for training and updating of that level. During training, parameters provided by other batches of lightweight learning models are referenced as regularization constraints to prevent the model from overfitting to the abnormal data of the current batch. For example, when updating the weight parameters of high-level discriminative layers, the corresponding weight distribution of other batches of models is used as prior knowledge, and the update magnitude of the parameters is limited by the regularization term.
[0042] The retrained and updated lightweight learning model is redeployed back to the embedded devices on the filling production line, connecting to the sensors of the filling equipment through a standardized interface, and performing real-time inference on the edge device.
[0043] During each filling process, the model collects and analyzes sensor data in real time: for liquid drugs, it analyzes the liquid level in the filling image and the instantaneous flow rate of the flow sensor; for solid drugs, it analyzes the weight data from the weighing sensor and the frequency of the vibrating feeder. After the model outputs the dosage identification result, it compares it with the preset dosage standard range. When a filling dosage deviates from the preset range, a warning signal is generated in real time and fed back to the control system. The control system adjusts the filling parameters according to the warning signal, thereby realizing closed-loop control of the filling dosage.
[0044] In this implementation plan, the task-triggered event mechanism enables timely detection of model anomalies; cross-batch model collaboration and parameter retraining allow the model to optimize itself using experience from similar batches, improving the model's adaptability and long-term stability; and the combination of real-time monitoring and closed-loop control ensures the continuous qualification of filling dosage and reduces quality risks.
[0045] Please see Figure 2An automatic drug filling dosage identification system, applying the aforementioned automatic drug filling dosage identification method, includes: a derived learning model differentiation module, used to establish a drug master database and a master learning model. The master database stores standard physical characteristics and production parameters of various drugs, configures the master learning model to learn the identification features of various drugs, and simultaneously differentiates corresponding derived learning models according to drug type; a lightweight learning model generation module, used to generate a lightweight learning model for each production batch of various drugs based on the derived learning models of various drugs. The lightweight learning model adopts a multi-level construction, with parameters at each level adaptively compensated and adjusted based on the difference information of production batches, and each level is fused by outputting corresponding dynamic fusion coefficients; and a cross-batch model collaboration and optimization module, used to monitor the operation process of each lightweight learning model based on preset task trigger events. When a task trigger event is detected for a lightweight learning model, it automatically triggers communication connections between that lightweight learning model and other lightweight learning models of the same drug in other batches, retrains the lightweight learning model by sharing difference feature parameters, and then uses the retrained lightweight learning model for real-time monitoring and identification of filling dosage.
[0046] In summary, this application has at least the following effects:
[0047] Through a three-tier architecture of main model, derived model, and lightweight model, it can adapt to different drug types and production batch differences, solving the problem of insufficient generalization ability of traditional single models; the lightweight model achieves rapid response on embedded devices through multi-level dynamic fusion and parameter compression technology, meeting the needs of high-speed filling lines; cross-batch model collaboration enables individual batch models to learn from the experience of other batches, shortening anomaly recovery time and reducing maintenance costs.
[0048] Those skilled in the art will understand that embodiments of the present invention can be provided as methods or systems. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0049] This invention is described with reference to flowchart illustrations and structural diagrams of methods and systems according to embodiments of the invention. It should be understood that the combination of each process and module in the flowchart and structural diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the process. Figure 1One or more processes and structures Figure 1 A device for a function specified in one or more modules.
[0050] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and structures Figure 1 The function specified in one or more modules.
[0051] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and structures Figure 1 The steps of a specified function in one or more modules.
[0052] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0053] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for automatically identifying the dosage of a drug filling, characterized in that, Includes the following steps: Establish a drug master database and a master learning model. Store the standard physical characteristics and production parameters of various drugs in the drug master database, configure the master learning model to learn the identification characteristics of various drugs, and differentiate the master learning model into corresponding derived learning models according to the drug type. A lightweight learning model is generated for each production batch of various drugs based on derived learning models. This lightweight learning model is constructed in a multi-level structure, comprising sequentially connected low-level and high-level modules. Parameters at each level are adaptively compensated and adjusted based on the differences in production batches. Specifically, this adaptive compensation adjustment includes: detecting the differences in the production batch relative to the initial base model and mapping these differences to the multi-level modules according to their impact range; compensating for systemic biases at the raw data level by adjusting parameters in the low-level modules; and introducing adaptive correction factors in the high-level modules for pattern differences. Simultaneously, each level performs fusion by outputting corresponding dynamic fusion coefficients. The fusion analysis includes: each level of the lightweight learning model has a fusion coefficient output unit; each level dynamically outputs corresponding fusion coefficients based on its response characteristics and confidence level to the current input data through these fusion coefficient output units, and performs weighted fusion according to their respective fusion coefficients to output the filling dosage identification result of the lightweight learning model. Based on preset task trigger events, the operation process of each lightweight learning model is monitored. When a task trigger event is detected in a certain lightweight learning model, the communication connection between the lightweight learning model and other lightweight learning models of the same drug batch is automatically triggered. The lightweight learning model is retrained by sharing the difference feature parameters, and then the retrained lightweight learning model is used for real-time monitoring and identification of the canned dosage.
2. The method for automatic identification of drug filling dosage according to claim 1, characterized in that, The specific analysis of configuring the main learning model to learn the recognition features of various drugs, and the main learning model differentiating into corresponding derived learning models based on drug type, is as follows: By utilizing multi-source data of different drug types in the drug master database, the master learning model is trained with general recognition features, enabling it to learn general recognition features that are not limited to drug forms. Based on the training of general recognition features, the sub-model is specially adjusted according to the specific data of each drug type to derive a learning model for that drug type. Each derived learning model inherits the parameter base of the main learning model and incorporates the specific data of the drug type, thereby forming a derived learning model corresponding to the drug type to identify the filling dosage of that type of drug.
3. The method for automatic identification of drug filling dosage according to claim 1, characterized in that, The specific analysis of generating lightweight learning models for each production batch of various drugs is as follows: The derived learning model corresponding to the drug type is used as the initial base model, and the model is replicated at the beginning of each new production batch; The initial calibration data for the production batch is obtained, and the parameters of the initial basic model are adjusted and simplified by combining the difference characteristic parameters of each production batch to obtain a lightweight learning model for each production batch. The parameter adjustment process uses samples from the production batch for incremental training, enabling the model to compensate for sensor offsets and environmental condition changes present in that batch. The simplified optimization process compresses the model size through model pruning and distillation to form a lightweight model that can run in real time on embedded devices.
4. The method for automatic identification of drug filling dosage according to claim 1, characterized in that, The specific analysis of the adaptive compensation adjustment of parameters at each level based on the difference information of production batches is as follows: The lightweight learning model is divided into multiple sequentially connected hierarchical modules. Each level processes feature information at different levels of abstraction. The multiple hierarchical modules include low-level modules and high-level modules. The low-level modules are used for basic data processing and primary feature extraction, while the high-level modules are used for comprehensive discrimination and result output. During model generation or batch calibration, the differences between the production batch and the initial base model are detected, and these differences are mapped to various levels of the model according to their impact range: for system biases at the level of raw data, parameters are adjusted in lower-level modules to compensate for them, and for pattern differences, adaptive correction factors are introduced in higher-level modules.
5. The method for automatic identification of drug filling dosage according to claim 1, characterized in that, The specific analysis of the fusion of each level by outputting corresponding dynamic fusion coefficients is as follows: a fusion coefficient output unit is set for each level of the lightweight learning model. The fusion coefficient output unit dynamically outputs the fusion coefficient of the level according to the response characteristics and confidence of the level to the current input data. The fusion coefficient reflects the importance of each level under the current working condition in real time. Each level outputs the filling dosage identification result of the lightweight learning model by fusion according to its own fusion coefficient.
6. The method for automatic identification of drug filling dosage according to claim 1, characterized in that, The preset task triggering events are used to monitor abnormal changes in model performance or operating conditions during the operation of the lightweight learning model, so as to determine when to trigger the model communication and retraining mechanism.
7. The method for automatic identification of drug filling dosage according to claim 1, characterized in that, The specific analysis of retraining the lightweight learning model by sharing differential feature parameters is as follows: After a task triggering event occurs in a certain lightweight learning model, communication is established between the lightweight learning model and other batches of lightweight learning models of the same drug. The differential feature parameters of the batch are shared with other batches of lightweight learning models, and the differential feature parameters corresponding to other batches of lightweight learning models are obtained at the same time. By comparing the difference feature parameters of each lightweight learning model, the fault diagnosis algorithm is used to identify the degree of deviation between the output of each level of the lightweight learning model that has triggered the task event and the output of other batches of lightweight learning models under the same input, and to locate the target level where performance degradation has occurred. For the target level of the positioning, select parameters containing the newly added differential features of this batch to train and update this level, while referring to the parameters provided by the lightweight learning models of other batches as regularization constraints.
8. The method for automatic identification of drug filling dosage according to claim 1, characterized in that, The specific analysis of using the retrained lightweight learning model for real-time monitoring and identification of canned dosage is as follows: The retrained and updated lightweight learning model is deployed back to the embedded devices on the filling production line. This lightweight learning model performs real-time inference on the edge device by connecting to the sensor interface of the filling equipment. The lightweight learning model analyzes relevant data in real time and outputs dosage identification results during each filling, realizing automatic monitoring of the filling dosage. When a filling dosage is detected to deviate from the preset range, an early warning signal is generated in real time and fed back to the control system for adjustment.
9. An automatic drug filling dosage identification system, employing the automatic drug filling dosage identification method according to any one of claims 1-8, characterized in that, include: The derived learning model differentiation module is used to establish a drug master database and a master learning model. The drug master database stores the standard physical characteristics and production parameters of various drugs, and the master learning model is configured to learn the identification features of various drugs. At the same time, the master learning model differentiates into corresponding derived learning models according to the drug type. A lightweight learning model generation module is used to generate lightweight learning models for each production batch of various drugs based on derived learning models. The lightweight learning model is constructed in a multi-level manner, comprising sequentially connected low-level and high-level modules. Parameters at each level are adaptively compensated and adjusted based on the differences in production batches. Specifically, the adaptive compensation and adjustment includes: detecting the differences in the production batch relative to the initial base model and mapping these differences to the multi-level modules according to their impact range; compensating for systemic biases at the raw data level by adjusting parameters in the low-level modules; and introducing adaptive correction factors in the high-level modules for pattern differences. Simultaneously, each level performs fusion by outputting corresponding dynamic fusion coefficients. The fusion analysis includes: each level of the lightweight learning model has a fusion coefficient output unit; each level dynamically outputs corresponding fusion coefficients based on its response characteristics and confidence level to the current input data through the fusion coefficient output unit, and performs weighted fusion according to their respective fusion coefficients to output the filling dosage identification result of the lightweight learning model. The cross-batch model collaboration and optimization module is used to monitor the operation of each lightweight learning model based on preset task trigger events. When a task trigger event is detected for a certain lightweight learning model, the communication connection between that lightweight learning model and other batches of lightweight learning models of the same drug is automatically triggered. The lightweight learning model is retrained by sharing differential feature parameters, and then the retrained lightweight learning model is used for real-time monitoring and identification of canning dosage.
Citation Information
Patent Citations
Contrast learning-based dense object fine granularity detection and identification method and system
CN118334652A
Tax support device, device control device, tax support method, recording medium, learned model for making a computer function and method for generating the learned model
DE102019125775A1