A drug release hole site image analysis method and system

By acquiring and calculating multi-dimensional features of the drug release orifice images of the controlled-release drug device in real time and dynamically adjusting algorithm parameters, the problem of image quality degradation caused by light source aging was solved, achieving high-precision and high-reliability drug release orifice image analysis, thus ensuring the accuracy and efficiency of product quality control.

CN120997213BActive Publication Date: 2026-01-06SHANDONG LUKANG PHARMACEUTICAL GROUP SAITE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511516185.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-23
Publication Date
2026-01-06
Estimated Expiration
2045-10-23

AI Technical Summary

Technical Problem

Due to the degradation of image quality caused by light source aging, existing image analysis programs are unable to achieve high-precision and high-reliability drug release orifice image analysis on high-speed production lines.

Method used

By acquiring images of the drug release orifice positions of the controlled-release drug device in real time, multi-dimensional image statistical features are calculated, such as global average gray value, contrast ratio, gray-level co-occurrence matrix energy value and gradient magnitude. Based on these features and preset rules, the algorithm parameters are dynamically adjusted to achieve accurate analysis of the drug release orifice positions images.

Benefits of technology

It significantly improves the accuracy and robustness of image analysis under light source aging conditions, avoids misjudgment and missed detection, and improves the efficiency and accuracy of product quality control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120997213B_ABST
    Figure CN120997213B_ABST
Patent Text Reader

Abstract

The application discloses a drug release hole position image analysis method and system, and relates to the technical field of image analysis; the method is used for analyzing the drug release hole position of a controlled-release drug device under the irradiation of a light source with a set wavelength and a set polarization degree, and comprises the following steps: collecting a drug release hole position image of the controlled-release drug device in real time, and calculating image statistical features of the drug release hole position image; calculating algorithm parameters for analyzing the drug release hole position image according to the image statistical features and preset rules; analyzing the drug release hole position image according to the algorithm parameters, and outputting an analysis result. The application can collect the drug release hole position image in real time and calculate statistical features of the drug release hole position image, then dynamically adjust algorithm parameters according to the features and preset rules, finally realize accurate analysis of the drug release hole position image, effectively solve the problem that existing technologies cannot accurately analyze the drug release hole position image when the image quality is reduced due to light source aging, and thus improve the accuracy and reliability of detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image analysis technology, and more specifically, to a method and system for analyzing drug release pore images. Background Technology

[0002] In modern industrial production, especially in the pharmaceutical field, precise control of product quality is crucial. Many advanced drug delivery devices, particularly those designed for precise drug release control, have extremely high requirements for the formation and detection of microstructures during their manufacturing process. For example, the inner walls of the release orifices in controlled-release drug delivery devices are coated with multiple layers of semi-transparent polymer materials with different functions. Each layer possesses unique swelling or degradation properties, controlling drug penetration and diffusion. To ensure that the thickness, uniformity, and integrity of each coating layer meet design requirements, a highly specialized quality inspection scheme has been introduced into the production line. This scheme uses a polarized light source of a specific wavelength to irradiate the release orifices, capturing clear boundaries between the layers.

[0003] However, during the long-term, uninterrupted operation of pharmaceutical production lines, this specific polarization light source used for imaging inevitably ages gradually. This aging manifests in two main ways: first, a slight drift occurs in the center wavelength emitted by the light source; second, the degree of polarization of the polarized light output by the light source decreases. When the center wavelength of the light source drifts slightly, it is no longer the optimal wavelength to maximize the optical contrast of each coating, causing the boundaries between coatings to become blurred. Simultaneously, the decrease in polarization increases previously suppressed stray reflections, which enter the image sensor as noise, further reducing the overall image contrast and significantly decreasing the clarity of the drug release orifice edges and internal layered structures.

[0004] Existing image analysis programs are struggling to cope with image quality degradation caused by aging light sources. These programs are typically designed for images with well-defined boundaries and high contrast, and their built-in edge detection algorithms and region segmentation functions rely on significant jumps in pixel grayscale values ​​to identify boundaries.

[0005] To address the aforementioned issues, existing technologies urgently need improvement. Summary of the Invention

[0006] This application discloses a drug release orifice image analysis method and system, which aims to solve the technical problem that the image quality deteriorates due to the aging of the light source during the production process of controlled-release drug devices, and that existing image analysis programs cannot achieve high-precision and high-reliability drug release orifice image analysis on high-speed production lines.

[0007] The technical solution of this application is as follows:

[0008] In a first aspect, this application discloses a drug release orifice image analysis method for analyzing the drug release orifice positions of a controlled-release drug device under illumination by a light source with a set wavelength and a set polarization degree. The method includes the following steps:

[0009] Real-time acquisition of images of the drug release orifice positions in controlled-release drug devices, and calculation of the image statistical characteristics of the drug release orifice positions images;

[0010] Based on image statistical features and preset rules, algorithm parameters for analyzing drug release pore images are calculated;

[0011] Based on the algorithm parameters, the drug release pore image is analyzed, and the analysis results are output.

[0012] Through this technical solution, this application can acquire drug release well images in real time and calculate their statistical characteristics. Then, based on these characteristics and preset rules, the algorithm parameters are dynamically adjusted to achieve accurate analysis of drug release well images. This effectively solves the problem that existing technologies cannot accurately analyze images when image quality deteriorates due to light source aging, thereby improving the accuracy and reliability of detection.

[0013] Furthermore, in some implementation schemes, the step of acquiring real-time images of the drug release orifice positions of the controlled-release drug device and calculating the image statistical features of the drug release orifice positions specifically includes:

[0014] Real-time acquisition of images of the drug release orifice positions in the controlled-release drug device, images of the drug release orifice positions in the first polarization direction, and images of the drug release orifice positions in the second polarization direction;

[0015] The following image statistical features of the drug release well site image were calculated: global average gray value, average gray value of a specific coating area, contrast ratio between bright and dark areas, gray co-occurrence matrix energy of a specific coating area, and average gradient magnitude in the edge area.

[0016] Calculate the pixel difference between the drug release aperture image in the first polarization direction and the drug release aperture image in the second polarization direction.

[0017] This technical solution, by acquiring images with different polarization directions and calculating multi-dimensional image statistical features, including grayscale values, contrast, texture and gradient information, as well as polarization difference values, can capture image degradation information more comprehensively and precisely. This provides a richer and more reliable data foundation for the precise adjustment of subsequent algorithm parameters, thereby improving the accuracy of the analysis.

[0018] Based on this, this application further proposes that the steps for calculating algorithm parameters for analyzing drug release pore images according to image statistical features and preset rules specifically include:

[0019] Based on the global average gray value, average gray value, contrast ratio, gray-level co-occurrence matrix energy value, average gradient magnitude, pixel difference value, and preset rules, calculate the current wavelength drift value and polarization degree decrease value of the light source;

[0020] Based on the wavelength drift value and the magnitude of the decrease in polarization, algorithm parameters for analyzing drug release pore images are calculated.

[0021] This technical solution, by comprehensively utilizing multiple image statistical features and polarization difference values, can accurately quantify the wavelength drift and polarization degree reduction of the light source. Based on these quantified values, the algorithm parameters are dynamically calculated and adjusted, enabling the image analysis algorithm to adaptively compensate for the effects of light source aging, significantly improving the analysis accuracy and robustness under light source degradation conditions.

[0022] As an optional solution, the drug release orifice image analysis method disclosed in this application, before the step of real-time acquisition of drug release orifice images of controlled-release drug devices and calculation of image statistical features of drug release orifice images, further includes:

[0023] Under conditions where the light source is not aged and the objective lens of the imaging system is not contaminated, an image of the reference drug release orifice position of the controlled-release drug device illuminated by the light source is acquired.

[0024] Calculate the baseline image statistical characteristics of the baseline drug release well site image;

[0025] The baseline drug release well image is divided into several non-overlapping baseline sub-regions, and the regional baseline image statistical characteristics of each baseline sub-region are calculated.

[0026] After the step of real-time acquisition of images of the drug release orifices of the controlled-release drug device and calculation of the image statistical features of the drug release orifice images, the following steps are also included:

[0027] The drug release orifice image is divided into several non-overlapping sub-regions, and the regional image statistical features of each sub-region are calculated.

[0028] Based on image statistical features and preset rules, the specific steps for calculating algorithm parameters used to analyze drug release well site images include:

[0029] Based on the statistical features of the reference image, the statistical features of the regional reference image, the statistical features of the image, the statistical features of the regional image, and the preset degradation source judgment rules, determine the type of degradation source;

[0030] Based on the degradation source type and preset rules, algorithm parameters for analyzing drug release pore images are calculated.

[0031] This technical solution, by introducing a reference image and region segmentation, and combining multi-level image statistical features, can accurately determine whether image degradation is due to light source aging, objective lens contamination, or both. This allows for targeted adjustment of algorithm parameters, achieving intelligent identification and adaptive compensation for different degradation sources, and significantly improving the versatility and accuracy of the analysis method.

[0032] In one embodiment, the step of acquiring real-time images of the drug release orifice positions of the controlled-release drug device and calculating the image statistical features of the drug release orifice positions specifically includes:

[0033] Real-time acquisition of images of the drug release orifice positions in the controlled-release drug device, images of the drug release orifice positions in the first polarization direction, and images of the drug release orifice positions in the second polarization direction;

[0034] Calculate the image statistical features of the drug release pore image and the pixel difference between the drug release pore image in the first polarization direction and the drug release pore image in the second polarization direction;

[0035] Based on the statistical features of the reference image, the statistical features of the regional reference image, the statistical features of the image, the statistical features of the regional image, and the preset degradation source judgment rules, the specific steps for determining the degradation source type include:

[0036] Based on the statistical features of the reference image, the statistical features of the regional reference image, the statistical features of the image, the pixel difference value, the statistical features of the regional image, and the preset degradation source judgment rules, the degradation source type is determined.

[0037] This technical solution, by introducing image acquisition and pixel difference values ​​with different polarization directions and combining them with multi-level image statistical features, can capture image degradation information more comprehensively and accurately. This results in higher accuracy and robustness in determining the type of degradation source, providing a more reliable basis for subsequent adaptive algorithm adjustments.

[0038] Furthermore, the steps for calculating the algorithm parameters used to analyze the drug release pore images, based on the degradation source type and preset rules, specifically include:

[0039] When the degradation source is light source aging, the current wavelength drift value and polarization degree decrease value of the light source are calculated based on the statistical features of the reference image, the statistical features of the image, the pixel difference value, and the preset rules; based on the wavelength drift value and polarization degree decrease value, the algorithm parameters used to analyze the drug release pore image are calculated.

[0040] When the degradation source is objective lens contamination, or when the degradation source is objective lens contamination and light source aging, a local degradation degree map is generated based on the statistical characteristics of the reference image, the statistical characteristics of the regional reference image, the image statistical characteristics, the pixel difference value, and the regional image statistical characteristics.

[0041] Calculate the region value corresponding to each sub-region in the local degradation map, and generate corresponding algorithm parameters based on the region value for the corresponding sub-region.

[0042] The specific steps for analyzing the drug release pore image based on the algorithm parameters and outputting the analysis results include:

[0043] Based on the algorithm parameters of each generated sub-region, the corresponding sub-region of the drug release well image is analyzed, and the analysis results are output.

[0044] This technical solution enables the application to intelligently select global or local adaptive algorithm parameter adjustment strategies based on the identified degradation source type. For light source aging, global parameter compensation is performed; for objective lens contamination or compound degradation, a local degradation map is generated and regional parameter adjustments are made, thereby achieving accurate and efficient compensation for different degradation modes and significantly improving the precision and accuracy of image analysis.

[0045] Based on the above, this application further proposes that the statistical features of the reference image include three or more of the following statistical features: the global average gray value of the reference drug release well image, the average gray value of a specific coating area in the reference drug release well image, the contrast ratio between bright and dark areas in the reference drug release well image, the gray co-occurrence matrix energy value of a specific coating area in the reference drug release well image, and the average gradient magnitude of potential edge areas in the reference drug release well image.

[0046] Image statistical features include three or more of the following statistical features: global average gray value of the drug release well image, average gray value of a specific coating region in the drug release well image, contrast ratio between bright and dark regions in the drug release well image, gray co-occurrence matrix energy value of a specific coating region in the drug release well image, and average gradient magnitude of potential edge regions in the drug release well image.

[0047] The statistical features of the regional benchmark image include three or more of the following statistical features: local high-frequency detail activity of each sub-region in the benchmark drug release well image, contrast and homogeneity of the local gray-level co-occurrence matrix of each sub-region in the benchmark drug release well image, blur uniformity index in the benchmark drug release well image, local detail loss heterogeneity index in the benchmark drug release well image, and spatial gradient of each sub-region in the benchmark drug release well image.

[0048] The regional image statistical features include three or more of the following statistical features: local high-frequency detail activity of each sub-region in the drug release well image, contrast and homogeneity of the local gray-level co-occurrence matrix of each sub-region in the drug release well image, blur uniformity index in the drug release well image, local detail loss heterogeneity index in the drug release well image, and spatial gradient of each sub-region in the drug release well image.

[0049] This technical solution defines multi-dimensional and multi-level image statistical features, including global, local, texture, edge, and blur indicators, which can more comprehensively and precisely quantify the degree and type of image degradation. This provides extremely rich and reliable data support for the accurate identification of degradation sources and the fine adjustment of algorithm parameters, thereby significantly improving the accuracy and robustness of the analysis method.

[0050] In some preferred embodiments, before the step of analyzing the corresponding sub-region of the drug release well site image based on the algorithm parameters of each generated sub-region and outputting the analysis results, the following steps are also included:

[0051] Key regions are identified in the drug release orifice image based on a preset strategy;

[0052] Find the first sub-region with a regional value higher than a preset value in the local degradation map;

[0053] Locate the local region in the drug release orifice image that belongs to the key region and corresponds to the first sub-region;

[0054] Perform contrast enhancement on a local area to improve the contrast of the corresponding local area.

[0055] This technical solution identifies key regions in an image and combines them with a local degradation level map to accurately locate the most severely degraded key regions and perform targeted contrast enhancement. This significantly improves the image quality and analysis accuracy of key regions without affecting the overall image processing efficiency, effectively avoiding the omission of important details.

[0056] To enhance functionality, a contrast enhancement operation is performed on a local area. Following the step of increasing the contrast of the corresponding local area, the following steps are also included:

[0057] For the local area after contrast enhancement, a micro-defect analysis sub-process is used to perform micro-defect analysis to ensure that weak defects in the drug release well sites are detected and to prevent defects from being missed.

[0058] Following the step of identifying key regions in the drug release well image according to a preset strategy, the following also includes:

[0059] Local high-frequency detail restoration processing is performed on key areas in the drug release well image to restore the true state of the key areas.

[0060] This technical solution, by performing micro-defect detection and high-frequency detail restoration on the enhanced local key areas, can restore the true state of the key areas to the greatest extent and ensure that even weak defects can be accurately identified, thereby significantly improving the sensitivity and accuracy of defect detection, effectively preventing missed defects, and further ensuring product quality.

[0061] Secondly, this application also discloses a drug release orifice image analysis system for analyzing the drug release orifice positions of a controlled-release drug device under illumination by a light source with a set wavelength and a set polarization degree. The system includes:

[0062] The acquisition module is used to acquire images of the drug release orifice positions of the controlled-release drug device in real time and calculate the image statistical features of the drug release orifice positions.

[0063] The calculation module is used to calculate the algorithm parameters for analyzing drug release orifice images based on image statistical features and preset rules.

[0064] The analysis module is used to analyze the drug release pore images based on algorithm parameters and output the analysis results.

[0065] This application provides a modular drug release well image analysis system. Through the collaborative work of each module, the system automates the process of image acquisition, parameter calculation, and image analysis. It can efficiently and accurately analyze drug release well images, effectively solving the problems of time-consuming and inaccurate manual intervention, and improving the efficiency and reliability of production line testing.

[0066] Beneficial effects

[0067] This application discloses a method for analyzing the orifice locations of controlled-release drugs under illumination by a light source with a set wavelength and polarization degree. The method involves real-time acquisition of orifice location images of the controlled-release drug device and calculation of their statistical features. Then, based on these statistical features and preset rules, algorithm parameters for analyzing the orifice location images are dynamically calculated. Finally, the images are analyzed based on these algorithm parameters, and the results are output. This approach effectively solves the problem in existing technologies where image quality deteriorates due to light source aging, making it difficult for image analysis programs to accurately identify coating boundaries and internal layered structures. By adaptively adjusting the algorithm parameters, this method compensates for the effects of light source wavelength drift and polarization degree reduction, thus achieving high-precision and high-reliability orifice location image analysis even on high-speed production lines. This avoids misjudgments and missed detections, significantly improving the efficiency and accuracy of product quality control. Attached Figure Description

[0068] Figure 1 This is a schematic flowchart of a drug release pore location image analysis method provided in this application.

[0069] Figure 2 This is a schematic diagram of the structure of a drug release pore location image analysis system provided in this application.

[0070] Figure 2 In the diagram: 1 is the data acquisition module, 2 is the calculation module, and 3 is the analysis module. Detailed Implementation

[0071] The technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0072] See Figure 1 This application proposes a drug release orifice image analysis method for analyzing the drug release orifice positions of a controlled-release drug device under illumination by a light source with a set wavelength and a set polarization degree, comprising the following steps:

[0073] S10. Real-time acquisition of images of the drug release orifices of the controlled-release drug device, and calculation of the image statistical features of the drug release orifice images;

[0074] S20. Calculate the algorithm parameters used to analyze the drug release pore images based on the image statistical features and preset rules.

[0075] S30. Analyze the drug release pore image according to the algorithm parameters and output the analysis results.

[0076] This application acquires drug release well images in real time and calculates their statistical features. Then, based on these features and preset rules, it dynamically calculates algorithm parameters, ultimately using these parameters to analyze the images and output the results. This method effectively addresses image quality degradation caused by factors such as light source aging, ensuring high-precision and high-reliability drug release well image analysis even in high-speed production environments.

[0077] To better understand the drug release well site image analysis method proposed in this application, some key terms involved will be explained first.

[0078] A "controlled-release drug delivery device" is a device that can release drugs at a predetermined rate and time. Its drug release orifices usually have a sophisticated structure and multi-layer coating, which play a key role in the drug release rate.

[0079] "Drug release orifice images" refer to visual data of drug release orifice positions in controlled-release drug delivery devices acquired through optical imaging systems. These images carry important information such as orifice structure and coating condition.

[0080] "Image statistical features" refer to numerical values ​​extracted from an image that quantify its content and quality, such as grayscale values, contrast, and texture features. These features can reflect the overall brightness, detail richness, and structural uniformity of an image.

[0081] "Preset rules" refer to a series of logical judgment conditions or mathematical models that are pre-defined during the design of an image analysis system to guide the calculation of algorithm parameters and the image analysis process. These rules are usually optimized based on a large amount of experimental data and domain knowledge.

[0082] "Algorithm parameters" refer to the values ​​that need to be adjusted during the execution of image analysis algorithms. They directly affect the performance of the algorithm and the accuracy of the analysis results. For example, in edge detection algorithms, the threshold is an important algorithm parameter.

[0083] "Analysis results" refers to the conclusions about the state of drug release pores obtained after image analysis, such as coating thickness, defect location, and pore size. These results are used to guide production quality control.

[0084] The core of the drug release well site image analysis method proposed in this application lies in dynamically adjusting algorithm parameters to adapt to changes in image quality, thereby achieving high-precision analysis. The main features of this method will be described in detail below.

[0085] First, regarding the step of "real-time acquisition of images of the drug release orifices of the controlled-release drug delivery device and calculation of the image statistical features of the drug release orifice images," image acquisition is the starting point of the entire analysis process, and its quality directly affects the accuracy of subsequent analyses. Real-time acquisition can be achieved using a high-speed industrial camera in conjunction with an appropriate optical system, ensuring that clear images of the drug release orifices can be captured while the production line is running at high speed. For example, a CMOS or CCD sensor camera can be used, with a frame rate that meets the production line's cycle time requirements. Calculating image statistical features is crucial for quantifying image quality and content. One approach is to perform grayscale processing on the image after acquisition using image processing software, and then calculate the global average grayscale value of the image to reflect its overall brightness. Simultaneously, the average grayscale value of a specific coating region in the image can be calculated, which helps in evaluating the optical properties of the coating. Furthermore, the contrast ratio between bright and dark areas can be calculated to quantify the image's contrast level. To capture the image's texture information, the grayscale co-occurrence matrix energy value of a specific coating region can be calculated. Finally, to evaluate the image's sharpness and edge information, the average gradient magnitude in the edge regions can be calculated. The calculation of these statistical features can be achieved using functions in standard image processing libraries such as OpenCV.

[0086] Secondly, regarding the step of "calculating algorithm parameters for analyzing drug release well images based on image statistical features and preset rules," this step is one of the core innovations of this application. It enables the analysis system to dynamically adjust the analysis strategy according to real-time image quality. One implementation method is that the preset rules can be a set of mapping relationships established based on experience or machine learning models. For example, when the global average gray value is lower than a certain threshold, it indicates that the image is generally dark, and the brightness compensation parameters in the subsequent analysis algorithm can be adjusted. When the contrast ratio is lower than a preset value, it indicates that the image contrast is insufficient, and the threshold of the edge detection algorithm can be adjusted to make it more sensitive to weak edge signals. Specifically, the preset rules can be defined as a series of conditional statements, such as "if the global average gray value is less than X and the contrast ratio is less than Y, then set the edge detection threshold to Z1 and set the image enhancement parameter to P1." These rules can be trained and optimized based on a large amount of experimental data to ensure that the optimal algorithm parameters can be calculated under different image quality conditions.

[0087] Finally, regarding the step of "analyzing the drug release orifice image according to the algorithm parameters and outputting the analysis results," after obtaining the dynamically adjusted algorithm parameters, these parameters will be applied to the image analysis algorithm to achieve accurate analysis of the drug release orifice. One implementation is that if the algorithm parameters include an edge detection threshold, this dynamically calculated threshold will be used during edge detection, instead of a fixed value. For example, the Canny edge detection algorithm can be used, with the calculated threshold as its input parameter. If the algorithm parameters include image enhancement parameters, the image will be enhanced accordingly before image segmentation or feature extraction. The output of the analysis results can include various forms, such as outputting the geometric dimensions of the drug release orifice (e.g., orifice diameter, coating thickness), the location and type of defects, or directly outputting a pass / fail judgment result. These results can be displayed to the operator through a graphical user interface (GUI) or transmitted to the production line control system through a data interface.

[0088] The drug release orifice image analysis method proposed in this application works by constructing an adaptive image analysis process to address image quality degradation caused by factors such as light source aging. When the drug release orifices of the controlled-release drug device are illuminated in real time by a light source with a set wavelength and polarization degree, the system simultaneously calculates the image statistical features of these images. These features, such as the global average gray value, the average gray value of a specific coating area, the contrast ratio between bright and dark areas, the gray-level co-occurrence matrix energy value of a specific coating area, and the average gradient amplitude in edge areas, comprehensively reflect the current image quality and potential degree of degradation.

[0089] Subsequently, the system dynamically calculates algorithm parameters for analyzing drug delivery well images based on these real-time calculated image statistical features and preset rules. This step is crucial to this application, as it enables the image analysis system to self-adjust according to the actual image quality, rather than relying on fixed parameters. For example, when image statistical features indicate that the image is generally dark or has reduced contrast, preset rules guide the system to calculate algorithm parameters more suitable for processing low-contrast images, such as a lower edge detection threshold or stronger image enhancement parameters.

[0090] Ultimately, these dynamically calculated algorithm parameters are applied to the analysis of the drug release orifice images. For example, if the calculated algorithm parameters indicate the need for contrast enhancement, the image will undergo the corresponding enhancement process before edge detection or region segmentation. In this way, even when image quality deteriorates due to light source aging, the analysis algorithm can adaptively adjust its behavior to accurately identify key information such as coating boundaries and defects in the drug release orifices. The analysis results are then output to guide quality control on the production line. The entire process achieves closed-loop adaptive adjustment from image acquisition to result output, ensuring high-precision and high-reliability analysis of drug release orifices in high-speed production environments.

[0091] The core innovation of this application lies in the introduction of a mechanism for dynamically calculating algorithm parameters based on image statistical features and preset rules. This means that the analysis system no longer passively processes images, but can actively perceive changes in image quality and adjust its analysis strategy accordingly. For example, when the system detects a decrease in the global average grayscale value or a reduction in the contrast ratio of an image, it automatically adjusts the edge detection threshold or the intensity of image enhancement according to preset rules, thereby enabling the effective extraction of key structural information even in low-quality images. This adaptive capability is not found in existing technologies.

[0092] By employing this dynamic parameter adjustment, the method described in this application significantly improves the accuracy and robustness of drug release orifice image analysis under adverse conditions such as light source aging. It avoids the time-consuming manual parameter adjustment, meeting the real-time requirements of high-speed production lines. Furthermore, through a comprehensive consideration of image statistical features, this application can more precisely capture image quality degradation trends, thereby calculating more optimized algorithm parameters and ensuring the reliability of the analysis results. Therefore, this application provides an efficient, accurate, and adaptive solution to the problem of image quality degradation caused by light source aging, significantly improving the quality control level in the production process of controlled-release drug delivery devices.

[0093] Specifically, the steps of acquiring images of the drug release orifice positions of the controlled-release drug device in real time and calculating the image statistical features of the drug release orifice positions can be further refined as follows.

[0094] Real-time acquisition of images of the drug release orifice position, the drug release orifice position in the first polarization direction, and the drug release orifice position in the second polarization direction of the controlled-release drug device;

[0095] The following image statistical features of the drug release well site image were calculated: global average gray value, average gray value of a specific coating area, contrast ratio between bright and dark areas, gray co-occurrence matrix energy of a specific coating area, and average gradient magnitude in the edge area.

[0096] Calculate the pixel difference between the drug release aperture image in the first polarization direction and the drug release aperture image in the second polarization direction.

[0097] The real-time acquisition of images of the drug release orifice positions, the drug release orifice positions in the first polarization direction, and the drug release orifice positions in the second polarization direction of the controlled-release drug device aims to obtain image data under different polarization directions. This difference may reveal information such as the microstructure, surface stress, or defects of the material, which may not be obvious in images with a single polarization direction.

[0098] Furthermore, the image statistical features of the drug release well site images were calculated, including:

[0099] The global average gray value is used to characterize the overall brightness level of the entire drug release well image, and can reflect the light source intensity or the overall exposure of the image.

[0100] The average gray value of a specific coating area, which focuses on the brightness of the key coating area at the drug release pores, helps to assess the uniformity and integrity of the coating.

[0101] The contrast ratio between bright and dark areas quantifies the degree of difference between bright and dark areas in an image and is of great significance for identifying hole edges, defects, or foreign objects.

[0102] The gray-level co-occurrence matrix energy value of a specific coating area, as a texture feature, is used to describe the uniformity and regularity of gray-level distribution within a specific coating area, and can be used to detect minute texture changes or defects on the coating surface.

[0103] The average gradient magnitude in the edge region reflects the intensity and sharpness of the image edge, which helps to accurately define the boundaries of the drug release pores and detect damage or irregularities in the edge region.

[0104] Furthermore, the pixel difference between the drug release aperture images in the first polarization direction and the second polarization direction is calculated. The purpose is to highlight polarization-sensitive regions by comparing the pixel intensity differences between images with different polarization directions. These regions may correspond to birefringence properties of the material, variations in surface roughness, or microcracks, thus providing richer defect information.

[0105] This application's solution acquires drug release pore images in real time across multiple polarization directions and combines various image statistical features and polarization difference values ​​for calculation, enabling a comprehensive and detailed characterization of drug release pores from multiple dimensions. The introduction of multi-polarization images enhances sensitivity to the internal structure and surface properties of materials, capturing subtle changes that are difficult to detect with traditional single images. Simultaneously, the comprehensive application of various statistical features, such as global, local, contrast, texture, and edge analysis, ensures effective quantification of both macroscopic and microscopic details in the drug release pore images, providing a richer and more accurate data foundation for subsequent algorithm parameter calculations.

[0106] The above technical solutions significantly improve the comprehensiveness and accuracy of drug release orifice image analysis. Specifically, by acquiring images in multiple polarization directions and calculating their pixel differences, it is possible to more effectively identify minute defects, material stresses, or surface heterogeneity in the drug release orifices of controlled-release drug delivery devices. These characteristics are crucial for the stability and safety of drug release. Simultaneously, combining various refined image statistical features allows for a more precise assessment of the orifice status, providing more reliable input for subsequent algorithm parameter calculations and ultimately improving the reliability and sensitivity of the orifice image analysis results.

[0107] This application further proposes a method for optimizing algorithm parameter calculation to address the impact of light source aging.

[0108] The steps described above for calculating the algorithm parameters used to analyze drug release well images based on image statistical features and preset rules specifically include:

[0109] Based on the global average gray value, the average gray value, the contrast ratio, the gray-level co-occurrence matrix energy value, the average gradient magnitude, the pixel difference value, and a preset rule, calculate the current wavelength drift value and polarization degree decrease value of the light source;

[0110] Based on the wavelength drift value and the decrease in polarization degree, algorithm parameters for analyzing drug release pore images are calculated.

[0111] Specifically, after real-time acquisition of images of drug release orifices, drug release orifices in the first polarization direction, and drug release orifices in the second polarization direction, and calculation of corresponding image statistical features (including global average gray value, average gray value of a specific coating area, contrast ratio between bright and dark areas, gray-level co-occurrence matrix energy value of a specific coating area, and average gradient amplitude in edge areas) and pixel difference values, these statistical features and pixel difference values ​​are used as inputs. The global average gray value reflects the overall brightness level of the image; the average gray value of a specific coating area focuses on the brightness information of key areas of the drug release orifices; the contrast ratio between bright and dark areas characterizes the distinction between bright and dark areas in the image; the gray-level co-occurrence matrix energy value of a specific coating area describes the uniformity or roughness of the image texture; the average gradient amplitude in edge areas reflects the sharpness and intensity of image edges; and the pixel difference value indirectly reflects the polarization state of the light source by comparing the differences between images in different polarization directions.

[0112] These image statistical features and pixel difference values, combined with preset rules, are used to calculate the current wavelength drift and polarization decrease of the light source. The preset rules can be a set of empirical thresholds, lookup tables, or machine learning models, built upon extensive experimental data, to correlate changes in image statistical features with the degree of wavelength drift and polarization decrease. For example, when the light source wavelength drifts, the overall color or brightness distribution of the image may change, affecting the global average gray value and the average gray value of a specific coating area; when the light source polarization decreases, the pixel difference between the drug release aperture images in the first polarization direction and the drug release aperture images in the second polarization direction will decrease. By analyzing these changes, the wavelength drift and polarization decrease of the light source can be quantified.

[0113] Furthermore, once the current wavelength drift and polarization decrease of the light source are obtained, these values ​​are used to calculate the algorithm parameters for analyzing the drug release orifice images. For example, if a wavelength drift is detected, the grayscale values ​​of the image may need to be corrected, in which case the brightness correction factor or color correction matrix in the algorithm parameters will be adjusted; if a decrease in polarization is detected, it may be necessary to adjust the contrast enhancement parameters in the image enhancement algorithm or the threshold in the defect detection algorithm to compensate for the loss of image information caused by the decrease in polarization. Thus, the calculation of algorithm parameters is no longer static, but dynamically adjusted according to the actual state of the light source.

[0114] This application's solution effectively addresses the issue of decreased analytical accuracy that may occur in traditional methods when the light source ages by introducing calculations of the wavelength drift and polarization reduction magnitude of the light source. Specifically, when a light source ages, its emission spectrum and polarization characteristics change, causing shifts in the grayscale distribution, contrast, and texture features of the acquired drug release pore images. By real-time monitoring and calculation of the global average grayscale value, the average grayscale value of a specific coating area, the contrast ratio between bright and dark areas, the grayscale co-occurrence matrix energy value of a specific coating area, the average gradient magnitude in edge areas, and pixel difference values, these changes in image features caused by light source aging can be captured. Given the inherent correlation between these image features and the wavelength drift and polarization reduction of the light source, this application can accurately quantify the current wavelength drift and polarization reduction magnitude of the light source according to preset rules. It is precisely because these light source degradation parameters are obtained that subsequent algorithm parameters can be specifically adjusted and optimized, thereby compensating for the impact of light source aging on image quality and feature extraction, ensuring accurate drug release pore image analysis results can still be obtained even under non-ideal light source conditions.

[0115] Through the above technical solution, this application can dynamically assess the health status of the light source and adaptively adjust the algorithm parameters for drug release orifice image analysis based on the wavelength drift and polarization degradation of the light source. This significantly improves the robustness of the image analysis method to light source aging phenomena and avoids inaccurate or misjudgment of analysis results due to light source performance degradation. Therefore, even under long-term operation or light source performance fluctuations, the accuracy and reliability of drug release orifice image analysis can be guaranteed, thereby improving the stability and effectiveness of controlled-release drug delivery device quality testing.

[0116] Furthermore, based on the calculated wavelength drift and polarization decrease, the system dynamically adjusts the algorithm parameters used for drug release well image analysis. For example, if a wavelength drift towards longer wavelengths is detected, the overall brightness of the image may need to be compensated for, so the brightness correction parameters of the image preprocessing module will be increased accordingly. If a decrease in polarization is detected, the gain factor of the contrast enhancement algorithm used for defect detection may be increased, or the defect identification threshold may be appropriately relaxed to ensure that even minor defects can be effectively identified despite weakened polarization information. Through this adaptive parameter adjustment, the image analysis system maintains high accuracy and reliability even if the light source performance degrades, ensuring accurate detection of drug release well defects.

[0117] This application further proposes a method for analyzing drug release orifice images, wherein the method includes, prior to the step of real-time acquisition of drug release orifice images of the controlled-release drug device and calculation of the image statistical features of the drug release orifice images, the following steps are also included:

[0118] Under conditions where the light source is not aged and the objective lens of the imaging system is not contaminated, an image of the reference drug release orifice position of the controlled-release drug device illuminated by the light source is acquired.

[0119] Calculate the baseline image statistical characteristics of the baseline drug release well site image;

[0120] The baseline drug release well image is divided into several non-overlapping baseline sub-regions, and the regional baseline image statistical characteristics of each baseline sub-region are calculated.

[0121] After the step of real-time acquisition of the drug release orifice images of the controlled-release drug device and calculation of the image statistical features of the drug release orifice images, the method further includes:

[0122] The drug release orifice image is divided into several non-overlapping sub-regions, and the regional image statistical features of each sub-region are calculated.

[0123] The step of calculating the algorithm parameters for analyzing the drug release well images based on image statistical features and preset rules specifically includes:

[0124] Based on the aforementioned baseline image statistical features, regional baseline image statistical features, image statistical features, regional image statistical features, and preset degradation source judgment rules, the degradation source type is determined;

[0125] Based on the degradation source type and preset rules, algorithm parameters for analyzing drug release pore images are calculated.

[0126] Specifically, under conditions where the light source is not aged and the imaging system's objective lens is uncontaminated, a baseline drug delivery well image is acquired. The purpose is to obtain image data under ideal operating conditions, serving as a reference for subsequent assessment of system degradation. The baseline drug delivery well image can be understood as an image sample acquired when the system performs optimally. Subsequently, this baseline drug delivery well image is processed to calculate its baseline image statistical characteristics. These characteristics can be global, such as overall brightness and contrast, used to characterize the overall visual properties of the image. Further, to capture the local characteristics of the image more precisely, the baseline drug delivery well image is divided into several non-overlapping baseline sub-regions. For each baseline sub-region, its regional baseline image statistical characteristics are calculated. These regional statistical characteristics reflect the detailed information of the image in different local areas, such as texture and edge distribution. After acquiring the real-time drug delivery well image, it is also necessary to divide it into several non-overlapping sub-regions and calculate the regional image statistical characteristics of each sub-region. This aims to obtain the local characteristics of the real-time image for comparison with the corresponding local characteristics of the baseline image. The degradation source identification rules are pre-defined and established based on in-depth research into the impact of different degradation sources (such as light source aging and objective lens contamination) on image statistical features. These rules can be a series of threshold judgments, pattern recognition algorithms, or machine learning models used to identify potential degradation source types in the current system based on the differences between baseline image statistical features, regional baseline image statistical features, real-time image statistical features, and regional image statistical features. For example, light source aging may cause a uniform decrease in overall image brightness, while objective lens contamination may cause blurring or the appearance of specific patterns in local image areas. Once the degradation source type is identified, algorithm parameters for analyzing drug release well images can be calculated based on that degradation source type and the pre-defined rules. This means that the calculation of algorithm parameters is no longer single and fixed, but can be adaptively adjusted according to the actual degradation situation of the system, thereby ensuring accurate analysis results can still be obtained under different degradation conditions.

[0127] This application's solution effectively addresses the problem of decreased accuracy in traditional methods during system degradation by introducing baseline image acquisition and analysis, regional analysis of real-time images, and a degradation source identification mechanism. Specifically, when the system is in an ideal state, a reliable performance baseline is established by acquiring baseline drug release well images and calculating their global and regional baseline image statistical characteristics. During subsequent real-time acquisition of drug release well images, not only are global image statistical characteristics calculated, but regional image statistical characteristics are also divided and calculated. By comparing the statistical characteristics of the real-time images with the pre-established baseline image statistical characteristics, and combining this with preset degradation source identification rules, the system can accurately identify the types of degradation sources that may exist in the current imaging system, such as light source aging, objective lens contamination, or both. Once the degradation source type is determined, the calculation of algorithm parameters is no longer based on a static, idealized model, but can be dynamically adjusted according to the specific degradation type. For example, if it is determined to be light source aging, the image brightness compensation parameters can be adjusted; if it is determined to be objective lens contamination, the image sharpening or deblurring parameters can be adjusted. This adaptive parameter adjustment mechanism enables the image analysis algorithm to better adapt to changes in the system's working environment, thereby ensuring the accuracy and robustness of drug release pore image analysis under various actual working conditions.

[0128] Through the above technical solution, this application can effectively address the impact of degradation issues such as light source aging or objective lens contamination on the accuracy of drug release well image analysis. Compared to traditional methods that rely solely on single image statistical features for analysis, this application establishes benchmark data, performs multi-dimensional (global and local) image feature comparison, and introduces a degradation source judgment mechanism, enabling the algorithm parameters to be adaptively adjusted according to the actual degradation state of the system. This significantly improves the robustness and accuracy of the drug release well image analysis method, ensuring reliable drug release well analysis results even during long-term system operation or environmental changes, effectively avoiding misjudgments or missed detections caused by system degradation, thereby improving the reliability of quality control for controlled-release drug delivery devices.

[0129] This application further proposes to optimize the above-mentioned drug release pore image analysis method in order to make more comprehensive use of image information and improve the accuracy of degradation source identification.

[0130] Specifically, the steps of acquiring real-time images of the drug release orifice positions of the controlled-release drug device and calculating the image statistical features of the drug release orifice positions specifically include:

[0131] Real-time acquisition of images of the drug release orifice position, the drug release orifice position in the first polarization direction, and the drug release orifice position in the second polarization direction of the controlled-release drug device;

[0132] Calculate the image statistical features of the drug release pore image and the pixel difference between the drug release pore image in the first polarization direction and the drug release pore image in the second polarization direction;

[0133] The steps for determining the type of degradation source based on the aforementioned reference image statistical features, regional reference image statistical features, image statistical features, regional image statistical features, and preset degradation source judgment rules specifically include:

[0134] The degradation source type is determined based on the statistical features of the reference image, the statistical features of the regional reference image, the statistical features of the image, the pixel difference value, the statistical features of the regional image, and the preset degradation source judgment rules.

[0135] The phrase "real-time acquisition of images of the drug release orifice positions, the orifice positions in the first polarization direction, and the orifice positions in the second polarization direction of the controlled-release drug device" refers to the process of acquiring images of the drug release orifice positions in the first and second polarization directions, respectively, in addition to acquiring conventional orifice position images, by introducing polarization devices (such as polarizers) into the optical path. The first and second polarization directions are typically set to be orthogonal, such as horizontal and vertical polarization, or +45° and -45° polarization. These polarization images can capture information about the change in polarization state after the light interacts with the orifice surface, providing richer data dimensions for subsequent degradation source analysis.

[0136] "Calculating the image statistical features of the drug release pore images and the pixel difference between the drug release pore images in the first polarization direction and the second polarization direction" refers to, after acquiring the aforementioned images, first calculating the image statistical features of the conventional drug release pore images, such as the global average gray value, the average gray value of a specific coating area, and the contrast ratio between bright and dark areas. Simultaneously, for the drug release pore images in the first and second polarization directions, the pixel-by-pixel gray value difference or intensity difference is calculated. This pixel difference value can directly quantify the degree of difference in image response under different polarization directions, thus reflecting changes in factors such as the polarization degree of the light source, objective lens contamination, or the optical properties of the sample itself.

[0137] "Determining the degradation source type based on the baseline image statistical features, the regional baseline image statistical features, the image statistical features, the pixel difference value, the regional image statistical features, and the preset degradation source judgment rule" means using the calculated pixel difference value as an important input parameter, along with the baseline image statistical features, the regional baseline image statistical features, the real-time image statistical features, and the regional image statistical features, and inputting them into the preset degradation source judgment rule. This preset rule can be a multi-dimensional decision tree, a machine learning model, or a threshold-based logical judgment system. Its purpose is to comprehensively analyze all these features to more accurately identify the specific degradation source type that causes image quality degradation, such as light source aging or lens contamination.

[0138] This application's solution introduces polarization image acquisition during real-time image acquisition and calculates pixel difference values ​​between images with different polarization directions, thereby providing additional polarization-sensitive feature information for degradation source identification. Light source aging is often accompanied by a decrease in the degree of polarization of its emitted light or a shift in its polarization direction. These changes may not be obvious in conventional grayscale images, but they are significantly reflected in the pixel difference values ​​of images with different polarization directions. By incorporating this pixel difference value into the degradation source identification rule, the system can more sensitively capture subtle changes in the polarization characteristics of the light source, thus more accurately identifying light source aging as a degradation source. Furthermore, objective lens contamination may also scatter or absorb polarized light, thus affecting the pixel difference value. Therefore, combining multi-dimensional statistical features enables refined differentiation of degradation sources.

[0139] By explicitly incorporating polarization information as pixel difference values ​​into the degradation source identification process through the above technical solution, the system's ability to identify polarization-related degradation sources such as light source aging is significantly enhanced. This makes the identification of degradation sources more accurate and robust, avoiding misjudgments or omissions due to insufficient information. This provides a reliable basis for the precise adjustment of subsequent algorithm parameters, ultimately improving the overall accuracy and reliability of drug release well image analysis.

[0140] This application further proposes steps for calculating algorithm parameters for analyzing drug release pore images based on degradation source type and preset rules, and steps for analyzing drug release pore images based on algorithm parameters, specifically including:

[0141] When the degradation source is light source aging, the current wavelength drift value and polarization degree decrease value of the light source are calculated based on the reference image statistical features, the image statistical features, the pixel difference value, and the preset rules; and the algorithm parameters used to analyze the drug release pore image are calculated based on the wavelength drift value and polarization degree decrease value.

[0142] When the degradation source is objective lens contamination, or when the degradation source is objective lens contamination and light source aging, a local degradation degree map is generated based on the reference image statistical features, regional reference image statistical features, image statistical features, pixel difference values, and regional image statistical features.

[0143] Calculate the region value corresponding to each sub-region in the local degradation map, and generate corresponding algorithm parameters based on the region value for the corresponding sub-region.

[0144] The specific steps for analyzing the drug release well site image based on the algorithm parameters and outputting the analysis results include:

[0145] Based on the algorithm parameters of each generated sub-region, the corresponding sub-region of the drug release pore image is analyzed, and the analysis results are output.

[0146] Specifically, when the system determines that the degradation source is light source aging, the wavelength drift and polarization degree reduction of the light source are considered the main factors affecting image quality. At this point, by comparing the statistical features of the baseline image with those of the current image, and combining the pixel differences between the drug release aperture images in the first and second polarization directions, the wavelength drift and polarization degree reduction of the light source can be precisely quantified. For example, wavelength drift may cause changes in the overall tone or brightness of the image, while a decrease in polarization degree will affect the image's contrast and detail clarity. These quantified values ​​are then used to adjust the parameters of the image analysis algorithm to compensate for image degradation caused by light source aging.

[0147] Furthermore, when the degradation source is objective lens contamination, or when both objective lens contamination and light source aging are present simultaneously, image degradation often exhibits localized characteristics. In this case, the system generates a local degradation level map based on the statistical features of the baseline image, the statistical features of the regional baseline image, the image statistical features, pixel difference values, and the regional image statistical features. This map can intuitively reflect the degree of degradation in different regions of the drug delivery well image. For example, dust or stains on the objective lens may cause blurring, reduced contrast, or artifacts in specific areas of the image. By dividing the image into regions and calculating the regional image statistical features of each sub-region, it can be compared with the regional baseline image statistical features of the baseline sub-region, thereby identifying the localized degradation regions and their degree.

[0148] In this system, each sub-region in the local degradation map is assigned a region value that quantifies the degree of degradation in that sub-region. Based on these region values, the system can generate a set of customized algorithm parameters for each sub-region. For example, for sub-regions with a high degree of degradation, the algorithm parameters might be adjusted to stronger denoising, contrast enhancement, or sharpening parameters to compensate for the decrease in local image quality. Conversely, for sub-regions with a low degree of degradation, relatively milder parameters might be used to avoid overprocessing. Therefore, when analyzing drug release well images, instead of using uniform global algorithm parameters, the system analyzes the corresponding sub-regions of the drug release well image based on the generated algorithm parameters for each sub-region and outputs the analysis results.

[0149] This application's solution effectively addresses the limitations of traditional methods in handling complex degradation scenarios by differentiating degradation source types and specifically calculating and applying algorithm parameters. When the degradation source is light source aging, precise quantification of wavelength drift and polarization reduction values ​​enables global and systematic compensation of the image analysis algorithm, ensuring the accuracy of the analysis results. When the degradation source involves objective lens contamination, due to the locality of contamination, this application generates a local degradation level map and customizes algorithm parameters for each sub-region, achieving refined compensation for local image degradation. This regional, adaptive analysis approach allows the image analysis algorithm to better adapt to local differences in image quality, thereby improving the detection capability of drug delivery well images, especially for minute defects.

[0150] In the above-mentioned drug release well image analysis method, the statistical features of the reference image include three or more of the following statistical features: the global average gray value of the reference drug release well image, the average gray value of a specific coating area in the reference drug release well image, the contrast ratio between bright and dark areas in the reference drug release well image, the gray co-occurrence matrix energy value of a specific coating area in the reference drug release well image, and the average gradient magnitude of potential edge areas in the reference drug release well image;

[0151] The image statistical features include three or more of the following statistical features: the global average gray value of the drug release well image, the average gray value of a specific coating area in the drug release well image, the contrast ratio between bright and dark areas in the drug release well image, the gray-level co-occurrence matrix energy value of a specific coating area in the drug release well image, and the average gradient magnitude of potential edge areas in the drug release well image.

[0152] The statistical features of the regional reference image include three or more of the following statistical features: local high-frequency detail activity of each sub-region in the reference drug release well image, contrast and homogeneity of the local gray-level co-occurrence matrix of each sub-region in the reference drug release well image, blur uniformity index in the reference drug release well image, local detail loss heterogeneity index in the reference drug release well image, and spatial gradient of each sub-region in the reference drug release well image.

[0153] The statistical features of the region image include three or more of the following statistical features: local high-frequency detail activity of each sub-region in the drug release well image, contrast and homogeneity of the local gray-level co-occurrence matrix of each sub-region in the drug release well image, blur uniformity index in the drug release well image, local detail loss heterogeneity index in the drug release well image, and spatial gradient of each sub-region in the drug release well image.

[0154] Specifically, the aforementioned baseline image statistical features and image statistical features aim to reflect the brightness, texture, contrast, and edge information of an image from a global perspective or the overall characteristics of a specific region. For example, the global average gray value is used to measure the overall brightness level of the image; the average gray value of a specific coated area focuses on the brightness performance of key parts of the drug delivery system; the contrast ratio between bright and dark areas reflects the dynamic range and sharpness of the image; the gray-level co-occurrence matrix energy value is used to characterize the coarseness and regularity of the image texture; and the average gradient magnitude is used to capture the edge strength and detail richness of the image. The combined use of these features can comprehensively characterize the macroscopic properties of the image.

[0155] Among these, the aforementioned regional baseline image statistical features and regional image statistical features focus on capturing image details and degradation information at the local region level. For example, local high-frequency detail activity is used to assess the sharpness and detail richness of local image regions; the contrast and homogeneity of the local gray-level co-occurrence matrix are used to analyze subtle variations in local texture; the blur uniformity index and the local detail loss heterogeneity index can quantify the degree of blur and the non-uniformity of detail loss in local image regions; and the spatial gradient is used to reflect the rate of brightness change and edge information in local regions. Through comprehensive analysis of these local features, the degradation patterns and degrees of images in different regions can be identified more precisely.

[0156] In practical applications, at least three of the aforementioned statistical features are required. This is to ensure that the collected and calculated features are sufficiently representative and informative, thereby comprehensively and accurately reflecting the overall state and local details of the image, and providing reliable data support for subsequent degradation source identification and algorithm parameter calculation. For example, when selecting statistical features, different features can be flexibly selected and combined according to the actual application scenario and the characteristics of the image degradation mode to achieve the best analysis results.

[0157] This application further proposes the above-mentioned drug release well image analysis method, wherein, before the step of analyzing the corresponding sub-region of the drug release well image according to the algorithm parameters of each generated sub-region and outputting the analysis results, the method further includes:

[0158] Key regions are identified in the drug release orifice image based on a preset strategy;

[0159] Find the first sub-region with a regional value higher than a preset value in the local degradation map;

[0160] Locate the local region in the drug release orifice image that belongs to the key region and corresponds to the first sub-region;

[0161] A contrast enhancement operation is performed on the local area to improve the contrast of the corresponding local area.

[0162] Specifically, "identifying key regions in drug delivery orifice images according to a preset strategy" refers to automatically identifying regions in drug delivery orifice images that significantly impact the function or quality of the controlled-release drug delivery device using pre-defined rules or models. For example, these key regions may include the central region of the orifice, the orifice edge region, or specific coating areas. The aim is to focus analytical resources and attention on the areas most requiring precise detection. The preset strategy can be defined based on expert experience, historical data analysis, or machine learning models to ensure the accuracy and robustness of the identification.

[0163] The phrase "finding the first sub-region with a region value higher than a preset value in the local degradation map" refers to filtering out sub-regions indicating severe or abnormal image degradation from the local degradation map generated by the above implementation method. The region values ​​in the local degradation map can quantify degradation indicators such as blurriness, noise level, and brightness unevenness in each sub-region. By setting a preset value, regions with significantly degraded image quality can be effectively identified, aiming to locate areas where information loss may occur due to degradation.

[0164] In practical applications, "finding a local region in the drug release well image that belongs to the critical region and corresponds to the first sub-region" refers to spatially matching and cross-locating the identified critical region with the first sub-region that has a high degree of degradation. This allows for the precise identification of specific local regions that are both important and severely degraded. The aim is to focus subsequent enhancement processing on the image regions that most need improvement, avoiding unnecessary processing of non-critical or undegraded regions.

[0165] Furthermore, "performing contrast enhancement on the local region to improve its contrast" refers to applying image processing techniques to increase the dynamic range of pixel grayscale values ​​in the identified local region, making bright areas brighter and dark areas darker, thereby improving the image's visual clarity and detail discernibility. For example, histogram equalization, adaptive histogram equalization (such as CLAHE), gamma correction, or local contrast stretching can be used. The aim is to compensate for image contrast loss caused by degradation sources such as light source aging or lens contamination, allowing minute features or defects in these critical and severely degraded areas to be presented more clearly, providing high-quality image input for subsequent precise analysis.

[0166] This application's solution effectively addresses the potential lack of analytical accuracy in handling critical and severely degraded areas in the aforementioned basic solutions by introducing key region identification and targeted contrast enhancement. Specifically, it first identifies key regions in the drug release well image, ensuring focus on important areas. Simultaneously, it identifies a first sub-region with a high degree of degradation using a local degradation map, locating areas with impaired image quality. Subsequently, it cross-matches these two types of regions to precisely pinpoint those critical local areas that are also severely degraded. Since the image quality of these local areas has the greatest impact on the final analysis results, contrast enhancement is performed on them to significantly improve the discernibility of details in these areas. This targeted preprocessing allows subsequent sub-region analysis to obtain clearer and more informative image data, thereby improving the detection capability of minute defects or subtle changes and avoiding missed detections or misjudgments due to image degradation.

[0167] This application further proposes a scheme to perform micro-defect analysis on local areas after contrast enhancement operation using an enhanced micro-defect detection and analysis sub-process, and to perform local high-frequency detail restoration processing on key areas in drug release well images, in order to solve the above problems.

[0168] After performing a contrast enhancement operation on the local area to increase the contrast of the corresponding local area, the method further includes:

[0169] For the local area after contrast enhancement, a micro-defect analysis sub-process is used to perform micro-defect analysis to ensure that weak defects in the drug release well sites are detected and to prevent defects from being missed.

[0170] Following the step of identifying key regions in the drug release orifice image according to a preset strategy, the method further includes:

[0171] Local high-frequency detail restoration processing is performed on key areas in the drug release well image to restore the true state of the key areas.

[0172] Specifically, after performing contrast enhancement on local areas, an enhanced micro-defect detection analysis sub-process can be employed to further improve the accuracy of defect detection, particularly the ability to identify subtle defects. This sub-process can be understood as a set of algorithms specifically designed to identify and classify extremely small, low-contrast, or irregular defects in images. For example, it may include a deep learning-based micro-defect recognition model, image segmentation techniques combined with multi-scale feature extraction, or refined detection using traditional image processing methods such as texture analysis and morphological operations. The aim is to ensure that even the faintest defects in drug release wells can be accurately detected through more advanced and sensitive analysis methods, thereby effectively preventing missed defects and improving the reliability of product quality control.

[0173] After identifying key regions in the drug release well images according to a preset strategy, local high-frequency detail restoration processing can be performed to restore the true state of these key regions. Local high-frequency detail restoration processing refers to enhancing or reconstructing the high-frequency components representing detail information in an image using specific image processing algorithms. For example, techniques such as wavelet transform-based detail enhancement, non-local mean denoising combined with detail sharpening, or super-resolution reconstruction based on prior image knowledge can be employed. The aim is to compensate for detail loss that may occur due to imaging system degradation or image processing, making the image information in key regions clearer and more realistic, providing a high-quality visual foundation for subsequent accurate analysis.

[0174] This application's solution introduces an enhanced micro-defect detection and analysis sub-process. Building upon local area contrast enhancement, it further utilizes a specially designed algorithm to perform in-depth analysis of minute, low-contrast defects. It is precisely because this sub-process can capture subtle features that are difficult to identify using traditional methods that the detection of weak defects in drug release wells becomes possible, effectively solving the problem of missed defects that may arise from contrast enhancement alone. Simultaneously, by performing local high-frequency detail restoration processing on key areas, this application can compensate for image detail loss caused by various degradation sources (such as objective lens contamination), restoring the true texture and structural information of key areas. This not only improves the visual quality of the image, but more importantly, provides a more accurate and reliable data foundation for subsequent precise measurements and analysis, avoiding misjudgments or decreased analytical accuracy due to blurred details.

[0175] Through the above technical solutions, this application can significantly improve the accuracy and reliability of drug release well image analysis. Specifically, by employing an enhanced micro-defect detection and analysis sub-process, even the weakest defects in the drug release wells can be effectively identified, thereby greatly reducing the risk of missed defects and ensuring the quality control level of the controlled-release drug delivery device. Furthermore, by performing local high-frequency detail restoration processing on key areas, image detail loss caused by degradation can be effectively restored, making the image information in key areas clearer and more realistic. This provides a high-quality visual foundation for subsequent accurate analysis, further improving the accuracy of the analysis results. These improvements work together to enable the method of this application to provide high-precision and high-reliability drug release well image analysis results even in complex degradation environments.

[0176] In some preferred embodiments, assuming that when analyzing the orifice image of a controlled-release drug delivery device, the above steps identify a local area with decreased contrast and perform contrast enhancement, an enhanced micro-defect detection and analysis sub-process can be initiated to ensure that no minute defects are missed. This sub-process can first apply multi-scale Gaussian filtering to the enhanced local area to highlight potential defects of different sizes, and then use a pre-trained convolutional neural network model to classify the filtered image to determine whether micro-defects exist and their types. For example, the model can identify fine cracks or foreign particles with a diameter of less than 50 micrometers with high confidence.

[0177] Meanwhile, for regions identified as critical areas in the image, such as the edges of drug release orifices or specific coating areas, high-frequency details may still be lost even after contrast enhancement. In such cases, local high-frequency detail restoration processing can be applied. Specifically, a denoising algorithm based on non-local means (NLM) can be used to remove noise, combined with an adaptive sharpening filter to enhance edge and texture clarity. For example, by analyzing the local gradient information of critical regions and dynamically adjusting the sharpening intensity, the image's detail information can be effectively restored, thus more accurately reflecting the true morphology and state of the drug release orifices, providing a more reliable basis for subsequent drug release performance evaluation.

[0178] See Figure 2This application proposes a drug release orifice image analysis system for analyzing the drug release orifice positions of a controlled-release drug device under illumination by a light source with a set wavelength and a set polarization degree. The system includes: an acquisition module 1, a calculation module 2, and an analysis module 3. The acquisition module 1 is used to acquire real-time images of the drug release orifice positions of the controlled-release drug device and calculate the image statistical features of the orifice positions. The calculation module 2 is used to calculate algorithm parameters for analyzing the drug release orifice positions based on the image statistical features and preset rules. The analysis module 3 is used to analyze the drug release orifice positions based on the algorithm parameters and output the analysis results.

[0179] This application effectively integrates image acquisition, feature calculation, algorithm parameter calculation, and final image analysis functions through a modular design. Acquisition module 1 is responsible for acquiring real-time images of drug release orifices and extracting key image statistical features, providing a data foundation for subsequent analysis. Calculation module 2 intelligently adjusts and generates algorithm parameters adapted to the current image quality based on these statistical features and preset rules. Finally, analysis module 3 uses these dynamically adjusted parameters to perform precise image analysis and output reliable analysis results. This system architecture effectively addresses image quality degradation caused by factors such as light source aging, ensuring high-precision and high-reliability analysis of drug release orifices in controlled-release drug delivery devices even in high-speed production environments.

[0180] To better understand the drug release well site image analysis system proposed in this application, the various modules involved will be described in detail below.

[0181] First, regarding the acquisition module 1. The acquisition module 1 is configured to acquire images of the drug release orifice positions of the controlled-release drug delivery device in real time and calculate the image statistical features of the drug release orifice positions. The specific details of real-time acquisition of drug release orifice positions and calculation of image statistical features have been described in the above embodiments and will not be repeated here. It should be emphasized that the implementation of the acquisition module 1 can be diversified. For example, the acquisition module 1 can consist of one or more image sensors (such as high-speed industrial cameras) and an image preprocessing unit. The image sensor is responsible for converting optical signals into electrical signals to form raw image data. The image preprocessing unit can be a dedicated image signal processor (ISP) or a general-purpose processor, which is programmed to perform tasks such as image grayscale conversion, noise filtering, and extraction of image statistical features. These statistical features may include the global average grayscale value, the average grayscale value of a specific coating area, the contrast ratio between bright and dark areas, the grayscale co-occurrence matrix energy value of a specific coating area, and the average gradient magnitude in the edge area.

[0182] Secondly, regarding the calculation module 2. The calculation module 2 is configured to calculate algorithm parameters for analyzing drug release well images based on image statistical features and preset rules. The specific details of calculating algorithm parameters based on image statistical features and preset rules have already been described in the above embodiments and will not be repeated here. It is important to emphasize that the implementation of the calculation module 2 may include one or more processors (e.g., microcontrollers, digital signal processors, or field-programmable gate arrays) configured to execute preset algorithm logic. This algorithm logic can be based on an empirical rule base, lookup table, or machine learning model, dynamically generating or adjusting the algorithm parameters required for subsequent image analysis based on the image statistical features output by the acquisition module 1. For example, when a decrease in image contrast is detected, the calculation module 2 may output a lower edge detection threshold or a stronger image enhancement parameter.

[0183] Finally, regarding analysis module 3. Analysis module 3 is configured to analyze the drug release orifice image according to the algorithm parameters and output the analysis results. The specific content of analyzing the drug release orifice image according to the algorithm parameters and outputting the analysis results has been described in the above embodiments and will not be repeated here. It should be emphasized that the implementation of analysis module 3 may include one or more processors configured to execute image analysis algorithms. These algorithms may include edge detection, region segmentation, feature extraction, defect identification, etc. Analysis module 3 receives the dynamic algorithm parameters output by calculation module 2 and applies them to the image analysis process to ensure accurate analysis results under different image quality conditions. The analysis results can be output in various forms, for example, presented to the operator through a display or transmitted to the production line control system through a communication interface for automated decision-making.

[0184] The drug release orifice image analysis system proposed in this application works by constructing an adaptive image analysis process to address image quality degradation caused by factors such as light source aging. When the drug release orifice of the controlled-release drug device is illuminated in real time by a light source with a set wavelength and polarization degree, the acquisition module 1 simultaneously calculates the image statistical features of these images. These features, such as the global average gray value, the average gray value of a specific coating area, the contrast ratio between bright and dark areas, the gray-level co-occurrence matrix energy value of a specific coating area, and the average gradient amplitude in the edge areas, comprehensively reflect the current image quality and potential degree of degradation.

[0185] Subsequently, the calculation module 2 dynamically calculates the algorithm parameters for analyzing the drug release well images based on these real-time calculated image statistical features and preset rules. This step is crucial to this application, as it enables the image analysis system to self-adjust according to the actual image quality, rather than relying on fixed parameters. For example, when image statistical features indicate that the image is generally dark or has reduced contrast, preset rules guide the calculation module 2 to calculate algorithm parameters more suitable for processing low-contrast images, such as a lower edge detection threshold or stronger image enhancement parameters.

[0186] Finally, analysis module 3 applies these dynamically calculated algorithm parameters to the analysis process of the drug release orifice images. For example, if the calculated algorithm parameters indicate the need for contrast enhancement, the image will undergo corresponding enhancement processing before edge detection or region segmentation. In this way, even when image quality deteriorates due to light source aging, analysis module 3 can adaptively adjust its behavior to accurately identify key information such as coating boundaries and defects in the drug release orifices. The analysis results are then output to guide quality control on the production line. The entire system achieves closed-loop adaptive adjustment from image acquisition to result output, ensuring high-precision and high-reliability analysis of drug release orifices in high-speed production environments.

[0187] Compared with existing technologies, the drug release pore image analysis system proposed in this application represents a significant advancement. Traditional image analysis systems typically employ fixed algorithm parameters. While these parameters perform well under ideal image quality conditions, their performance deteriorates drastically once light source aging leads to image quality degradation, resulting in misjudgments or missed detections. For example, when the light source wavelength shifts and polarization decreases, image contrast decreases, and coating boundaries become blurred. Existing systems, unable to adapt to these changes, often struggle to accurately identify boundaries, leading to increased measurement errors.

[0188] The core innovation of this application lies in constructing an adaptive image analysis system through the collaborative work of acquisition module 1, calculation module 2, and analysis module 3. This system can proactively sense changes in image quality and dynamically adjust its analysis strategy accordingly. Acquisition module 1 acquires images in real time and extracts statistical features; calculation module 2 intelligently calculates optimal algorithm parameters based on these features and preset rules; and analysis module 3 uses these dynamic parameters for precise analysis. This modularity and adaptability are not found in existing technologies. Through this dynamic parameter adjustment, the system of this application can significantly improve the accuracy and robustness of drug release orifice image analysis under adverse conditions such as light source aging. It avoids the time-consuming operation of manual parameter adjustment, meeting the real-time requirements of high-speed production lines. Furthermore, by comprehensively considering the statistical features of the image, the system of this application can more precisely capture the degradation trend of image quality, thereby calculating more optimized algorithm parameters and ensuring the reliability of the analysis results. Therefore, this application provides an efficient, accurate, and adaptive system solution for addressing the problem of image quality degradation caused by light source aging, significantly improving the quality control level in the production process of controlled-release drug delivery devices.

[0189] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for analyzing the drug release hole site of a controlled drug delivery device under the irradiation of a light source with a set wavelength and a set degree of polarization, characterized in that, The method comprises the following steps: real-time acquisition of the release hole site image of the controlled-release drug device, calculation of the image statistical features of the release hole site image; According to the image statistical features and the preset rules, the algorithm parameters for analyzing the release hole site image are calculated; According to the algorithm parameters, the release hole site image is analyzed, and the analysis result is output; The step of real-time acquisition of the release hole site image of the controlled-release drug device, calculation of the image statistical features of the release hole site image specifically comprises: Real-time acquisition of the release hole site image, the first polarization direction release hole site image and the second polarization direction release hole site image of the controlled-release drug device; The following image statistical features of the release hole site image are calculated: global average gray value, average gray value of specific coating area, contrast ratio value between highlight area and dark area, gray level co-occurrence matrix energy value of specific coating area and average gradient amplitude value in edge area; The pixel difference value of the first polarization direction release hole site image and the second polarization direction release hole site image is calculated; The step of calculating the algorithm parameters for analyzing the release hole site image according to the image statistical features and the preset rules specifically comprises: According to the global average gray value, the average gray value, the contrast ratio value, the gray level co-occurrence matrix energy value, the average gradient amplitude value, the pixel difference value and the preset rules, the wavelength drift value and the polarization degree drop amplitude value of the light source are calculated; According to the wavelength drift value and the polarization degree drop amplitude value, the algorithm parameters for analyzing the release hole site image are calculated.

2. The image analysis method of drug release orifice sites according to claim 1, wherein, Before the step of real-time acquisition of the release hole site image of the controlled-release drug device, calculation of the image statistical features of the release hole site image, the following steps are further included: In the state that the light source is not aged and the objective lens of the imaging system is not contaminated, the reference release hole site image of the controlled-release drug device irradiated by the light source is acquired; The reference image statistical features of the reference release hole site image are calculated; The reference release hole site image is divided into a plurality of non-overlapping reference sub-regions, and the regional reference image statistical features of each reference sub-region are calculated; After the step of real-time acquisition of the release hole site image of the controlled-release drug device, calculation of the image statistical features of the release hole site image, the following steps are further included: The release hole site image is regionally divided into a plurality of non-overlapping sub-regions, and the regional image statistical features of each sub-region are calculated; The step of calculating the algorithm parameters for analyzing the release hole site image according to the image statistical features and the preset rules specifically comprises: According to the reference image statistical features, the regional reference image statistical features, the image statistical features, the regional image statistical features and the preset degradation source judgment rule, the degradation source type is judged; According to the degradation source type and the preset rule, the algorithm parameters for analyzing the release hole site image are calculated.

3. The image analysis method of drug release orifice sites according to claim 2, wherein, The step of real-time acquisition of the release hole site image of the controlled-release drug device, calculation of the image statistical features of the release hole site image specifically comprises: Real-time acquisition of the release hole site image, the first polarization direction release hole site image and the second polarization direction release hole site image of the controlled-release drug device; calculate an image statistical feature of the drug release hole site image, a pixel difference value between the first polarized direction drug release hole site image and the second polarized direction drug release hole site image; the step of judging the degradation source type according to the reference image statistical feature, the region reference image statistical feature, the image statistical feature, the region image statistical feature and the preset degradation source judgment rule specifically comprises: the step of judging the degradation source type according to the reference image statistical feature, the region reference image statistical feature, the image statistical feature, the pixel difference value, the region image statistical feature and the preset degradation source judgment rule.

4. The image analysis method of drug release orifice sites according to claim 3, wherein, the step of calculating the algorithm parameter for analyzing the drug release hole site image according to the degradation source type and the preset rule specifically comprises: when the degradation source is light source aging, the wavelength drift value and the polarization degree drop amplitude value of the current light source are calculated according to the reference image statistical feature, the image statistical feature, the pixel difference value and the preset rule; the algorithm parameter for analyzing the drug release hole site image is calculated according to the wavelength drift value and the polarization degree drop amplitude value; when the degradation source is objective lens pollution, or the degradation source is objective lens pollution and light source aging, the local degradation degree atlas is generated according to the reference image statistical feature, the region reference image statistical feature, the image statistical feature, the pixel difference value and the region image statistical feature; the region value corresponding to each sub region in the local degradation degree atlas is calculated, and the corresponding algorithm parameter is generated for the corresponding sub region according to the region value; the specific step of analyzing the drug release hole site image according to the algorithm parameter and outputting the analysis result comprises: the corresponding sub region of the drug release hole site image is analyzed according to the algorithm parameter of each sub region generated, and the analysis result is outputted.

5. The image analysis method of drug release orifice sites according to any one of claims 2 to 4, characterized in that, the reference image statistical feature comprises three or more of the following statistical features: the global average gray value of the reference drug release hole site image, the average gray value of the specific coating area in the reference drug release hole site image, the contrast ratio between the highlight area and the dark area in the reference drug release hole site image, the gray level co-occurrence matrix energy value of the specific coating area in the reference drug release hole site image and the gradient amplitude average value of the potential edge area in the reference drug release hole site image; the image statistical feature comprises three or more of the following statistical features: the global average gray value of the drug release hole site image, the average gray value of the specific coating area in the drug release hole site image, the contrast ratio between the highlight area and the dark area in the drug release hole site image, the gray level co-occurrence matrix energy value of the specific coating area in the drug release hole site image and the gradient amplitude average value of the potential edge area in the drug release hole site image; the region reference image statistical feature comprises three or more of the following statistical features: the local high frequency detail activity of each sub region in the reference drug release hole site image, the contrast and homogeneity of the local gray level co-occurrence matrix of each sub region in the reference drug release hole site image, the blur uniformity index in the reference drug release hole site image, the local detail loss heterogeneity index in the reference drug release hole site image and the spatial gradient of each sub region in the reference drug release hole site image; The regional image statistical features include more than three of the following statistical features: local high-frequency detail activity of each sub-region in the drug release hole site image, local gray level co-occurrence matrix contrast and homogeneity of each sub-region in the drug release hole site image, blur uniformity index in the drug release hole site image, local detail loss heterogeneity index in the drug release hole site image, and spatial gradient of each sub-region in the drug release hole site image.

6. The image analysis method of drug release orifice sites according to claim 4, wherein, The step of analyzing the corresponding sub-region of the drug release hole site image according to the generated algorithm parameter of each sub-region and outputting the analysis result further comprises the following steps: Identifying a key region in the drug release hole site image according to a preset strategy; Finding a first sub-region with a regional value higher than a preset value in the local degradation degree atlas; Finding a local region in the drug release hole site image that belongs to the key region and corresponds to the first sub-region; Performing a contrast enhancement operation on the local region to improve the contrast of the corresponding local region.

7. The image analysis method of drug release orifice sites according to claim 6, wherein, The step of performing a contrast enhancement operation on the local region to improve the contrast of the corresponding local region further comprises the following steps: Performing micro-defect analysis on the local region after the contrast enhancement operation using an enhanced micro-defect detection and analysis sub-process to ensure that weak defects in the drug release hole site are detected and prevent defect omission; The step of identifying a key region in the drug release hole site image according to a preset strategy further comprises the following steps: Performing local high-frequency detail restoration processing on the key region in the drug release hole site image to restore the true state of the key region.

8. A drug release hole site image analysis system for analyzing a drug release hole site of a controlled drug delivery device under irradiation of a light source of a set wavelength and a set degree of polarization, characterized by, It comprises: An acquisition module for acquiring real-time drug release hole site images of the controlled-release drug device and calculating image statistical features of the drug release hole site images; A calculation module for calculating algorithm parameters for analyzing the drug release hole site images according to the image statistical features and preset rules; An analysis module for analyzing the drug release hole site images according to the algorithm parameters and outputting the analysis results; The acquisition module is further used for: Acquiring real-time drug release hole site images, first polarization direction drug release hole site images, and second polarization direction drug release hole site images of the controlled-release drug device; Calculating the following image statistical features of the drug release hole site images: global average gray value, average gray value of a specific coating region, contrast ratio between highlight and dark regions, gray level co-occurrence matrix energy value of the specific coating region, and average gradient amplitude value in the edge region; Calculating pixel difference values of the first polarization direction drug release hole site images and the second polarization direction drug release hole site images; The calculation module is further used for: According to the global average gray value, the average gray value, the contrast ratio, the gray level co-occurrence matrix energy value, the average gradient amplitude value, the pixel difference value, and the preset rules, calculating the wavelength drift value and the polarization degree drop amplitude value of the current light source; According to the wavelength drift value and the polarization degree drop amplitude value, calculating the algorithm parameters for analyzing the drug release hole site images.

Citation Information

Patent Citations

  • Endoscope image processing method based on photodynamic imaging and endoscope imaging system

    CN119523396A

  • Iron stick yam intelligent system and method based on image recognition

    CN120388226A