Associated imaging impurity detection method and system for drug production

By employing a correlation imaging impurity detection method, utilizing binary mask matrix projection and multilayer compressed sensing reconstruction technology, the problems of low efficiency and insufficient accuracy in impurity detection during drug production are solved, achieving efficient and accurate online impurity detection in the drug production process.

CN120971448AActive Publication Date: 2025-11-18NANTONG MEDICAL DEVICES

Patent Information

Application Number
CN202511497013.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-20
Publication Date
2025-11-18
Estimated Expiration
2045-10-20

AI Technical Summary

Technical Problem

The current drug manufacturing process suffers from low efficiency and insufficient accuracy in impurity detection, making it difficult to identify the risks of impurities generated during production in a timely manner, which can easily lead to batch delays or product scrapping.

Method used

The correlation imaging impurity detection method is adopted. By loading a binary mask matrix for projection and single-pixel detection, combined with multi-round iteration and multi-layer compressed sensing reconstruction, multi-level segmentation labels and detection feature sequence labels with entropy value as the attention target are generated. Finally, the impurity detection result is determined by matching in the impurity feature library.

Benefits of technology

It enables efficient and accurate online detection of impurities during drug production, allowing for real-time identification and feedback of impurity information during the production process, thus avoiding batch delays and product scrapping.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120971448A_ABST
    Figure CN120971448A_ABST
Patent Text Reader

Abstract

The invention discloses a correlated imaging impurity detection method and system for drug production, and relates to the technical field of drug impurity detection. The method comprises the following steps: loading a first binary mask matrix, projecting a target product area, controlling a single-pixel detector to detect, determining a first measurement value, and performing lightweight reconstruction to obtain a first preview; generating a second binary mask matrix and performing projection and detection reconstruction by pre-checking the first preview, and performing multi-round iteration until an Nth preview is determined; calling the first preview to the Nth preview from a temporary database of an online detection platform, executing multi-layer compressed sensing and reconstruction, and determining a reconstruction result; and aiming at a reconstruction result, matching in an impurity feature library, and determining an impurity verification result. The technical problems of low impurity detection efficiency and insufficient detection accuracy in the medicine production process in the prior art are solved, and the technical effect of efficient and accurate online detection of medicine impurities in the production link is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of drug impurity detection technology, and specifically to a method and system for detecting impurities through imaging in drug production. Background Technology

[0002] In modern pharmaceutical manufacturing, drug purity and impurity levels directly affect drug safety, efficacy, and compliance. Excessive impurities can not only affect drug stability and efficacy but also potentially cause side effects. Current drug impurity detection primarily relies on offline laboratory analytical methods, such as high-performance liquid chromatography (HPLC), gas chromatography (GC), mass spectrometry (MS), or nuclear magnetic resonance (NMR). While these methods offer advantages in accuracy, they often suffer from complex operation, cumbersome sample pretreatment steps, and long testing cycles. Because test results are typically only available after production is complete, it is difficult to promptly identify impurity risks generated during manufacturing, potentially leading to batch delays or even product spoilage. Summary of the Invention

[0003] This application provides a method and system for detecting impurities through imaging in drug production, which solves the technical problems of low efficiency and insufficient accuracy in impurity detection during drug production in the prior art.

[0004] A first aspect of this application provides a method for detecting correlated imaging impurities in drug production, the method comprising: A first binary mask matrix is ​​loaded, projected onto the target product area, and a single-pixel detector is controlled to detect and determine a first measurement value, which is then lightweighted and reconstructed into a first preview image. By pre-detecting the first preview image, a second binary mask matrix is ​​generated and projected and reconstructed using detection. This process is repeated multiple times until the Nth preview image is determined. The first preview image up to the Nth preview image is retrieved from the temporary database of the online detection platform, and multi-layer compressed sensing and reconstruction are performed to determine the reconstruction result. The reconstruction result contains multi-level segmentation identifiers and detection feature sequence identifiers with entropy values ​​as attention targets. The reconstruction result is then matched against an impurity feature library to determine the impurity detection result.

[0005] A second aspect of this application provides a correlation imaging impurity detection system for drug production, the system comprising: Projection Unit: Loads a first binary mask matrix, projects it onto the target product area, controls a single-pixel detector to detect, determines a first measurement value, and lightweight reconstructs it into a first preview image; Iteration Unit: Generates a second binary mask matrix by pre-detecting the first preview image and performs projection and detection reconstruction, iterating through multiple rounds until the Nth preview image is determined; Reconstruction Unit: Retrieves the first preview image up to the Nth preview image from the temporary database of the online detection platform, performs multi-layer compressed sensing and reconstruction, and determines the reconstruction result, wherein the reconstruction result contains multi-level segmentation identifiers and detection feature sequence identifiers with entropy values ​​as attention targets; Matching Unit: Matches the reconstruction result in the impurity feature library to determine the impurity detection result.

[0006] One or more technical solutions provided in this application have at least the following technical effects or advantages: First, a first binary mask matrix is ​​loaded, projected onto the target product area, and a single-pixel detector is controlled to detect and determine the first measurement value, which is then lightweightly reconstructed into a first preview image. Next, by pre-detecting the first preview image, a second binary mask matrix is ​​generated and projected and reconstructed using detection. This process is iterated through multiple rounds until the Nth preview image is determined. Then, the first to Nth preview images are retrieved from the temporary database of the online detection platform, and multi-layer compressed sensing and reconstruction are performed to determine the reconstruction result. The reconstruction result contains multi-level segmentation identifiers and detection feature sequence identifiers with entropy values ​​as attention targets. Finally, the reconstruction result is matched against an impurity feature library to determine the impurity detection result. This method solves the technical problems of low efficiency and insufficient accuracy of impurity detection in the drug production process in existing technologies, achieving efficient and accurate online detection of drug impurities in the production stage. Attached Figure Description

[0007] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0008] Figure 1 This is a schematic flowchart of a method for detecting impurities in drug production using correlation imaging, provided in an embodiment of this application. Figure 2 This is a schematic diagram of a correlation imaging impurity detection system for drug production provided in an embodiment of this application.

[0009] Explanation of reference numerals in the attached figures: Projection unit 11, Iteration unit 12, Reconstruction unit 13, Matching unit 14. Detailed Implementation

[0010] This application provides a correlation imaging impurity detection method and system for drug production, which solves the technical problems of low impurity detection efficiency and insufficient detection accuracy in the drug production process in the prior art.

[0011] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0012] It should be noted that the terms "comprising" and "having" are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to these processes, methods, products, or devices.

[0013] Example 1, as Figure 1 As shown, this application provides a method for detecting related imaging impurities in drug production, wherein the method includes: Load the first binary mask matrix, project it onto the target product area, control the single pixel detector to detect, determine the first measurement value, and reconstruct it into a first preview image using lightweight methods.

[0014] In this embodiment, a broadband light source is activated to globally illuminate the target product area. Subsequently, a first binary mask matrix is ​​loaded onto the light modulator. This binary mask matrix is ​​a randomly initialized mask, with its elements taking only two states: 0 and 1, used to control the on / off state of the projected light. Through the modulation effect of the light modulator, the broadband light is spatially modulated and projected onto the target product area, allowing different spatial regions to selectively pass through or block according to the distribution of the mask matrix. The modulated light signal enters a single-pixel detector, which acquires the spectral response of the projected target product area and outputs a corresponding first measurement value, which is a sequence of spectral signal intensity. After the first measurement value is transmitted back to the temporary database of the online detection platform, it is processed by a lightweight reconstructor. The lightweight reconstructor pairs the first measurement value with the first binary mask matrix as input, generates a low-resolution preview image based on a sparse reconstruction algorithm, obtains the first preview image, and stores it in the temporary database, providing a data foundation for subsequent pre-inspection and multiple iterations.

[0015] Furthermore, before projecting onto the target product area, an online inspection module is constructed, including: A lightweight reconstructor is trained using sample measurements paired with sample masks as input and sparse sample preview images as output. A lightweight generator is constructed by setting pre-detection conditions and performing adversarial network training. The pre-detection conditions include at least spatial region, spectral band information, and uncertainty. An image reconstructor is constructed by deploying network layers based on multi-level compressed sensing. The lightweight reconstructor, lightweight generator, and image reconstructor are integrated to generate an online detection module. The online detection module is embedded in the online detection platform, and a path interaction is established between the online detection module and the temporary database.

[0016] Before projecting the target product area, an online detection module for impurity detection is constructed. Specifically, several sets of sample data are collected, each set containing sample measurements and a corresponding sample mask. These two are used as input, and a sparse preview image is used as output. A lightweight reconstructor is trained using supervised training to enable it to quickly generate preview images under low sampling conditions. Based on this, pre-detection conditions are pre-set, including at least spatial region information thresholds, spectral band information thresholds, and uncertainty indices. By introducing an adversarial network structure during training, a lightweight generator is constructed, enabling it to dynamically output new mask matrices under different detection conditions. Subsequently, the network layers are deployed hierarchically according to the principle of multi-level compressed sensing to construct an image reconstructor. This allows the reconstructor to perform layer-by-layer sensing and reconstruction of sparsely collected multi-round measurement data, improving the accuracy and stability of the final image reconstruction. The trained lightweight reconstructor, lightweight generator, and image reconstructor are integrated to form a complete online detection module. The online detection module is deployed in an embedded manner on the online detection platform, and establishes a path interaction with the temporary database through a set data interface, so that the measured values, mask matrix and reconstructed preview image can flow between the module and the database in real time, realizing closed-loop interaction in the detection process.

[0017] Furthermore, the first binary mask matrix is ​​a random initial mask; a broadband light source is turned on, and the target product area is projected based on the light modulator by loading the first binary mask matrix, a single pixel detector is activated, and a first measurement value is determined, wherein the first measurement value is the spectral signal state; the first measurement value is transmitted back to the temporary database of the online detection platform.

[0018] The first binary mask matrix is ​​set to a random initial mask, and its matrix elements only take two states: 0 and 1. It is used to realize the on / off control of optical signals in the optical modulator.

[0019] During the detection process, a broadband light source is first activated to provide full-spectrum illumination to the target product area. Then, a first binary mask matrix is ​​loaded onto the light modulator. The light modulator spatially modulates the incident light according to the binary distribution of the matrix, selectively allowing light to pass through or block light in different spatial regions. The modulated beam is projected onto the target product area, and a single-pixel detector acquires the spectral signal. Once activated, the single-pixel detector converts the modulated light intensity of the target product area into an electrical signal, outputting a first measurement value. This first measurement value is spectral signal state data reflecting the spectral intensity distribution of the target product area. The acquired first measurement value is transmitted in real-time to the temporary database of the online detection platform via a communication interface. This allows the lightweight reconstructor to use this measurement value to pair with the first binary mask matrix, achieving a preliminary preview and reconstruction of the target product area.

[0020] Furthermore, determining the first measurement value and lightweight reconstructing it into a first preview image includes: As the single-pixel detector detects, the online detection module is activated; the lightweight reconstructor retrieves the first measurement value, pairs it with the first binary mask matrix as input, performs lightweight reconstruction, determines the first preview image, and adds it to the temporary database.

[0021] After the single-pixel detector completes spectral detection of the target product area, the detection platform simultaneously activates the online detection module to ensure that the measurement data can be accessed immediately. The lightweight reconstructor in the online detection module receives the first measurement value output by the detector and retrieves the corresponding first binary mask matrix from the temporary database, processing them as paired inputs. Based on sparse reconstruction and low-rank constraint algorithms, the lightweight reconstructor performs fast computation on the input data, reducing computational complexity while preserving key spatial and spectral features, thereby generating a low-resolution preview image, i.e., the first preview image. The first preview image visually reflects the spectral imaging characteristics of the target product area under the initial mask conditions. After reconstruction, the first preview image is automatically stored in the temporary database of the online detection platform.

[0022] By pre-examining the first preview image, a second binary mask matrix is ​​generated and projected and reconstructed using detection. This process is repeated through multiple iterations until the Nth preview image is determined.

[0023] By pre-detecting the first preview image, its spatial and spectral features are scanned and analyzed pixel by pixel. Regions with information content exceeding a set threshold and exhibiting uncertainty in the spatial area, and spectral bands with information content exceeding a set threshold and exhibiting fluctuations, are identified. Based on these identification results, corresponding spatial and spectral scanning threads are determined and fused together. A mask reconstruction operation is then performed to generate a second binary mask matrix. This second binary mask matrix can enhance sampling of key areas of the target product region, thereby improving the effectiveness and resolution of subsequent detection. The generated second binary mask matrix is ​​loaded into the optical modulator, and the target product region is projected and acquired again by a single-pixel detector to obtain the corresponding second measurement value. A second preview image is then generated by a lightweight reconstructor. After the second preview image is stored in a temporary database, it re-enters the pre-detection process. Through multiple iterations of the above "pre-detection-mask generation-projection acquisition-reconstruction" steps, the sampling area and spectral bands are gradually optimized until the Nth preview image is obtained. The Nth preview image maximizes the target impurity feature information while maintaining sampling efficiency.

[0024] Furthermore, by pre-examining the first preview image, a second binary mask matrix is ​​generated, including: The first preview image and the first measurement value are transferred to the lightweight generator; by scanning the first preview image, the spatial phase in the spatial region that is greater than the first information threshold and the first uncertainty threshold is located, and the first scanning thread is determined; by scanning the first measurement value, the spectral measurement quantity in the spectral band that is greater than the second information threshold and the second uncertainty threshold is located, and the second scanning thread is determined; the first scanning thread and the second scanning thread are fused, and mask reconstruction is performed to generate a second binary mask matrix.

[0025] The first preview image and its corresponding first measurement value are input into the lightweight generator in the online detection module, serving as the input data source for mask generation. Upon receiving the input, the lightweight generator performs joint analysis of the spatial and spectral dimensions. Specifically, in the spatial dimension, the first preview image is scanned pixel by pixel, extracting the signal-to-noise ratio and feature information of each pixel region. This is then combined with an uncertainty index for judgment. When the feature information of a spatial region exceeds a preset first information threshold, and its uncertainty is higher than a first uncertainty threshold, the spatial phase corresponding to that region is marked as a key sampling region, thus forming the first scanning thread. Simultaneously, in the spectral dimension, each spectral band of the first measurement value is traversed, comparing the energy distribution and feature fluctuations of each band. When the spectral measurement of a certain band is greater than a second information threshold and its uncertainty is higher than a second uncertainty threshold, that band is marked as a key sampling band, thus forming the second scanning thread.

[0026] After obtaining the first scan thread in the spatial dimension and the second scan thread in the spectral dimension, the two are fused and calculated. Based on the fusion result, a mask reconstruction process is performed, enabling the generated mask to simultaneously cover key spatial regions and spectral bands. The final output reconstruction result is the second binary mask matrix. This matrix has a more concentrated and optimized information distribution than the initial random mask, which can improve the saliency of impurity features and reconstruction quality in subsequent optical modulation projection and detection processes.

[0027] The first preview image up to the Nth preview image are retrieved from the temporary database of the online detection platform. Multi-layer compressed sensing and reconstruction are performed to determine the reconstruction result. The reconstruction result contains multi-level segmentation identifiers and detection feature sequence identifiers with entropy values ​​as attention targets.

[0028] The system sequentially retrieves preview images from the temporary database of the online detection platform, from the first preview image to the Nth preview image, using all preview images obtained through multiple iterations as the reconstruction input dataset. First, data alignment is performed between the preview images, including spatial scale normalization and temporal series correction, to ensure consistency in pixel location and temporal dimensions across different preview images. Then, the preview images are further aligned with their corresponding measurements and mask vectors, uniformly normalized to spectral source data. For this spectral source data, an image reconstructor is invoked to perform multi-layer compressed sensing and reconstruction. Specifically, the input data is fed layer by layer into compressed sensing network layers of different modes, each layer employing a different sampling rate and sensing operator to extract low-frequency structural features and high-frequency detail features, respectively. Finally, a complete multi-layer sensing result is formed through cross-layer fusion.

[0029] An entropy-based attention mechanism is introduced during the reconstruction process to weight the results of each layer of perception. Entropy is used to measure the information content and uncertainty of different regions or bands. When the entropy value of a region or band is high, the system assigns it a higher attention weight, resulting in a clearer feature representation in the reconstructed image. The final reconstruction result not only includes the overall spectral image of the target product area but also carries two types of identification information: first, a multi-level segmentation identifier based on entropy as the attention target, used to distinguish the boundaries of regions with different information intensities and uncertainties; second, a detection feature sequence identifier, used to mark the feature sequence information related to impurities in each segmented region.

[0030] Furthermore, multi-layer compressed sensing and reconstruction are performed to determine the reconstruction results, including: According to the image reconstructor, the first preview image up to the Nth preview image is retrieved, the first data alignment between the preview images is performed, the second data alignment between the preview image and the measurement value and the mask vector is performed, and the data is normalized to the spectral source data; for the spectral source data, multilayer compressed sensing and reconstruction are performed to determine the reconstruction result.

[0031] According to the image reconstructor's invocation instructions, preview images are sequentially retrieved from the temporary database up to the Nth preview image, forming a set of preview images acquired through multiple iterations. The preview image set undergoes a first data alignment process, including unifying spatial resolution, normalizing the pixel matrix, and synchronizing temporal series data to ensure consistency across all preview images in both spatial and temporal dimensions. Subsequently, the preview image set is matched with the corresponding measurement data and mask vectors, performing a second data alignment operation. This establishes a correspondence between preview images, measurements, and masks within the same reference frame, and normalization processing yields spectral source data in a unified format.

[0032] After obtaining the spectral source data, it is input into the image reconstructor, which performs compressed sensing and reconstruction operations layer by layer. Specifically, the image reconstructor uses different compressed sensing modes and sensing operators in each network layer. Low sampling rate layers capture global low-frequency structural features, while high sampling rate layers extract local high-frequency detail features. The reconstruction results of each layer are fused and weighted to form the final multi-layer sensing reconstruction result.

[0033] Furthermore, for the spectral source data, multi-layer compressed sensing and reconstruction are performed, including: Each network layer receives the spectral source data, performs hierarchical orientation processing, and determines the multilayer perception result, wherein the compressed sensing modes of each network layer are different; based on the multilayer perception result, an attention mechanism based on entropy value is introduced for reconstruction, and the reconstruction result is determined, wherein the entropy value is defined by information content and uncertainty.

[0034] Specifically, the normalized spectral source data is sequentially input into multiple network layers of the image reconstructor. Each network layer independently employs a different compressed sensing mode, including a low-sampling-rate global feature sensing mode, a medium-sampling-rate regional feature sensing mode, and a high-sampling-rate detail feature sensing mode. After completing the corresponding hierarchical orientation processing, each network layer outputs a local reconstruction result, forming a multi-layer sensing result. This multi-layer sensing result can capture the spectral features of the target product area from different levels, achieving a coarse-to-fine layer-by-layer reconstruction.

[0035] Based on the results of multilayer sensing, an entropy-based attention mechanism is introduced to perform weighted fusion of the multilayer sensing results. Specifically, by calculating the entropy value of each spatial region and spectral band, its information content and uncertainty are measured. When the entropy value of a certain region or band is high, it indicates that its information content is large and its volatility is significant, requiring higher attention weight in the reconstruction process; conversely, regions with lower entropy values ​​are assigned lower weights during fusion. Through this attention mechanism, regions and bands with potential impurity features can be highlighted in the final reconstruction result.

[0036] Furthermore, after determining the reconstruction result, the process includes: Attention levels based on attention targets are used as the segmentation criteria and as segmentation boundary markers. Based on the segmentation boundary markers, fitting based on multilayer perception results is performed on each segmentation region to determine a set of detection feature sequences, wherein each segmentation region corresponds to one detection feature sequence. The reconstruction results are marked according to the segmentation boundary markers and the set of detection feature sequences.

[0037] Entropy values ​​should remain relatively consistent under equilibrium conditions. Significant differences in entropy values ​​at different locations in the reconstruction result indicate variations in the spectral or spatial characteristics of that region, potentially due to increased signal complexity caused by different defects or impurities. Regions with higher entropy values ​​represent more mixed information and stronger uncertainty, corresponding to higher attention levels, meaning a greater likelihood of potential defects or impurities in that region. Therefore, different attention levels are assigned to each region based on entropy differences, dividing regions with different information levels and uncertainty into several hierarchical blocks. Each attention level is used as the segmentation criterion to generate corresponding segmentation boundary markers, which indicate the spatial range of regions with different information intensities in the reconstruction result.

[0038] Within each segmented region, the results of multilayer sensing are used for fitting. By weighted integration of the multilayer reconstruction features of the segmented region, spectral and spatial feature parameters related to impurities are extracted to form a detection feature sequence. Each segmented region generates an independent set of detection feature sequences, which can reflect the spectral fingerprint characteristics and spatial distribution patterns of potential impurities within that region. Finally, based on the segmentation boundary markers and the detection feature sequence sets, the reconstruction results are secondary labeled, i.e., segmentation boundaries and feature sequence labels are superimposed on the reconstructed image, so that each segmented region not only has a clear spatial division but also corresponding feature annotations that can be used for impurity identification.

[0039] Based on the reconstruction results, a matching process is performed in the impurity feature library to determine the impurity detection results.

[0040] The impurity feature library is constructed by collecting the spectral characteristics, spatial distribution patterns, and corresponding feature sequence information of different types of drug impurities, forming a mapping relationship between impurity spectral and spatial features.

[0041] During the detection process, the identified detection feature sequence groups in the reconstructed results are compared one by one with the known impurity features in the feature library. Similarity calculation, feature weight matching, and entropy weighting are used to determine the target impurity type present in the reconstructed results. For successfully matched impurities, spatial phase integration processing is further performed to merge the distribution information of the impurity in different segmentation regions, generating a complete impurity distribution result. The final output impurity detection result includes the impurity type, feature location, and content level, and is displayed visually and with alarm prompts on the terminal interface of the online detection platform, enabling real-time impurity monitoring and feedback in the drug production process.

[0042] Furthermore, matching is performed in the impurity feature library to determine the impurity detection results, including: For the target product, the mapping relationship between spectral features and impurity features is explored to construct an impurity feature library; the impurity feature library is traversed, and feature matching based on the detection feature sequence is performed on the reconstruction results to determine the detection impurities; the detection impurities are spatially phase integrated as the impurity detection results, which are displayed and alarmed on the terminal interface of the online detection platform.

[0043] For the target product, data on possible impurity types are collected during the system training and initialization phase. The performance characteristics of different impurities in the spectral and spatial domains are explored, and a mapping relationship between spectral features and impurity types is established. Thus, an impurity feature library is constructed. The impurity feature library contains feature templates for multiple impurity categories. Each template records typical spectral fingerprint information, spatial distribution characteristics, and corresponding detection feature sequences.

[0044] During the detection process, the detection feature sequences extracted from the reconstruction results are compared one by one with the feature templates in the feature library. Through steps such as feature similarity calculation, weight matching, and threshold determination, the detection impurities present in the reconstruction results are identified. Specifically, cosine similarity or Euclidean distance is used to compare the spectral fingerprint vectors of the detection feature sequences and feature templates to obtain a similarity score. For different spectral bands and spatial parameters, weight coefficients are pre-set to weight and correct the similarity scores to highlight the bands and regions where key impurity features are located. The weighted and corrected similarity scores are compared with a preset matching threshold. When the similarity is greater than the threshold (e.g., 0.85 or 90%), the detection feature sequence is determined to have successfully matched the corresponding impurity template.

[0045] After completing impurity feature matching and identifying the detected impurities, the detection results in different segmented regions are further processed by spatial phase integration. Specifically, the system acquires the information of successfully matched impurities in each segmented region, including the spatial coordinates, spectral intensity, and local distribution characteristics of the impurities in that region. Then, the results belonging to the same impurity category in different segmented regions are registered according to their spatial coordinates, and their spatial phases are aligned to eliminate overlaps or omissions caused by segmentation boundaries. After registration, the system performs weighted superposition of the spectral intensities of each segmented region. The weighting coefficients are set according to the attention level or information content of the segmented region, thereby ensuring that information-rich regions have a higher weight in the integrated results. Next, interpolation and smoothing algorithms are used to process the boundary transition regions to generate a continuous impurity distribution map. The final complete impurity detection results include: the global distribution range of impurities, the relative intensity levels of different regions, and the overall spatial distribution characteristics.

[0046] The integrated impurity detection results are uniformly presented on the terminal interface of the online detection platform, and can be visualized through color coding, heat maps or contour maps. At the same time, the alarm module is triggered to prompt abnormal impurity distribution.

[0047] In summary, the embodiments of this application have at least the following technical effects: First, a first binary mask matrix is ​​loaded, projected onto the target product area, and a single-pixel detector is controlled to detect and determine the first measurement value, which is then lightweightly reconstructed into a first preview image. Next, by pre-detecting the first preview image, a second binary mask matrix is ​​generated and projected and reconstructed using detection. This process is iterated through multiple rounds until the Nth preview image is determined. Then, the first to Nth preview images are retrieved from the temporary database of the online detection platform, and multi-layer compressed sensing and reconstruction are performed to determine the reconstruction result. The reconstruction result contains multi-level segmentation identifiers and detection feature sequence identifiers with entropy values ​​as attention targets. Finally, the reconstruction result is matched against an impurity feature library to determine the impurity detection result. This method solves the technical problems of low efficiency and insufficient accuracy of impurity detection in the drug production process in existing technologies, achieving efficient and accurate online detection of drug impurities in the production stage.

[0048] Example 2, based on the same inventive concept as the correlation imaging impurity detection method for drug production in the foregoing examples, such as... Figure 2 As shown, this application provides a correlation imaging impurity detection system for drug production, wherein the system includes: Projection Unit 11: Loads a first binary mask matrix, projects it onto the target product area, controls a single-pixel detector to detect, determines a first measurement value, and lightweight reconstructs it into a first preview image; Iteration Unit 12: Generates a second binary mask matrix by pre-detecting the first preview image and performs projection and detection reconstruction, iterating through multiple rounds until the Nth preview image is determined; Reconstruction Unit 13: Retrieves the first preview image up to the Nth preview image from the temporary database of the online detection platform, performs multi-layer compressed sensing and reconstruction, and determines the reconstruction result, wherein the reconstruction result contains multi-level segmentation identifiers and detection feature sequence identifiers with entropy values ​​as attention targets; Matching Unit 14: Matches the reconstruction result in the impurity feature library to determine the impurity detection result.

[0049] Furthermore, the projection unit 11 is used to perform the following method: A lightweight reconstructor is trained using sample measurements paired with sample masks as input and sparse sample preview images as output. A lightweight generator is constructed by setting pre-detection conditions and performing adversarial network training. The pre-detection conditions include at least spatial region, spectral band information, and uncertainty. An image reconstructor is constructed by deploying network layers based on multi-level compressed sensing. The lightweight reconstructor, lightweight generator, and image reconstructor are integrated to generate an online detection module. The online detection module is embedded in the online detection platform, and a path interaction is established between the online detection module and the temporary database.

[0050] Furthermore, the projection unit 11 is used to perform the following method: The first binary mask matrix is ​​a random initial mask; a broadband light source is turned on, and the target product area is projected based on the light modulator by loading the first binary mask matrix, a single pixel detector is activated, and a first measurement value is determined, wherein the first measurement value is the spectral signal state; the first measurement value is transmitted back to the temporary database of the online detection platform.

[0051] Furthermore, the projection unit 11 is used to perform the following method: As the single-pixel detector detects, the online detection module is activated; the lightweight reconstructor retrieves the first measurement value, pairs it with the first binary mask matrix as input, performs lightweight reconstruction, determines the first preview image, and adds it to the temporary database.

[0052] Furthermore, the iteration unit 12 is used to perform the following method: The first preview image and the first measurement value are transferred to the lightweight generator; by scanning the first preview image, the spatial phase in the spatial region that is greater than the first information threshold and the first uncertainty threshold is located, and the first scanning thread is determined; by scanning the first measurement value, the spectral measurement quantity in the spectral band that is greater than the second information threshold and the second uncertainty threshold is located, and the second scanning thread is determined; the first scanning thread and the second scanning thread are fused, and mask reconstruction is performed to generate a second binary mask matrix.

[0053] Furthermore, the reconstruction unit 13 is used to perform the following method: According to the image reconstructor, the first preview image up to the Nth preview image is retrieved, the first data alignment between the preview images is performed, the second data alignment between the preview image and the measurement value and the mask vector is performed, and the data is normalized to the spectral source data; for the spectral source data, multilayer compressed sensing and reconstruction are performed to determine the reconstruction result.

[0054] Furthermore, the reconstruction unit 13 is used to perform the following method: Each network layer receives the spectral source data, performs hierarchical orientation processing, and determines the multilayer perception result, wherein the compressed sensing modes of each network layer are different; based on the multilayer perception result, an attention mechanism based on entropy value is introduced for reconstruction, and the reconstruction result is determined, wherein the entropy value is defined by information content and uncertainty.

[0055] Furthermore, the reconstruction unit 13 is used to perform the following method: Attention levels based on attention targets are used as the segmentation criteria and as segmentation boundary markers. Based on the segmentation boundary markers, fitting based on multilayer perception results is performed on each segmentation region to determine a set of detection feature sequences, wherein each segmentation region corresponds to one detection feature sequence. The reconstruction results are marked according to the segmentation boundary markers and the set of detection feature sequences.

[0056] Furthermore, the matching unit 14 is used to perform the following method: For the target product, the mapping relationship between spectral features and impurity features is explored to construct an impurity feature library; the impurity feature library is traversed, and feature matching based on the detection feature sequence is performed on the reconstruction results to determine the detection impurities; the detection impurities are spatially phase integrated as the impurity detection results, which are displayed and alarmed on the terminal interface of the online detection platform.

[0057] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.

[0058] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

[0059] This specification and accompanying drawings are merely illustrative examples of this application and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from its scope. Therefore, if such modifications and modifications fall within the scope of this application and its equivalents, this application intends to include such modifications and modifications.

Claims

1. A method for detecting impurities in drug production using correlation imaging, characterized in that, The method includes: Load the first binary mask matrix, project the target product area, control the single pixel detector to detect, determine the first measurement value and reconstruct it into the first preview image in a lightweight manner; By pre-examining the first preview image, a second binary mask matrix is ​​generated and projected and reconstructed using detection. This process is repeated through multiple iterations until the Nth preview image is determined. Retrieve the first preview image up to the Nth preview image from the temporary database of the online detection platform, perform multi-layer compressed sensing and reconstruction, and determine the reconstruction result. The reconstruction result contains multi-level segmentation identifiers and detection feature sequence identifiers with entropy values ​​as attention targets. Based on the reconstruction results, a matching process is performed in the impurity feature library to determine the impurity detection results.

2. The method for detecting impurities in drug production using correlation imaging as described in claim 1, characterized in that, Before projecting onto the target product area, an online inspection module is built, including: A lightweight reconstructor is trained by using sample measurements paired with sample masks as sample inputs and sparse sample preview images as sample outputs. By setting pre-detection conditions and performing adversarial network training, a lightweight generator is constructed. The pre-detection conditions include at least the information content of spatial region and spectral band, and uncertainty. An image reconstructor is built by deploying network layers based on multi-level compressed sensing. The lightweight reconstructor, lightweight generator, and image reconstructor are integrated to generate an online detection module. The online detection module is then embedded and deployed on the online detection platform, and a path interaction is established between the online detection module and the temporary database.

3. The method for detecting impurities in drug production using correlation imaging as described in claim 2, characterized in that, The first binary mask matrix is ​​a randomly initialized mask; Turn on the broadband light source, load the first binary mask matrix, project the target product area based on the light modulator, activate the single pixel detector, and determine the first measurement value, wherein the first measurement value is the spectral signal state; The first measured value is transmitted back to the temporary database of the online detection platform.

4. The method for detecting impurities in drug production using correlation imaging as described in claim 3, characterized in that, Determine the first measurement value and reconstruct it in a lightweight manner as a first preview image, including: The online detection module is activated as the single-pixel detector detects. The lightweight reconstructor retrieves the first measurement value, pairs it with the first binary mask matrix as input, performs lightweight reconstruction, determines the first preview image, and adds it to the temporary database.

5. The method for detecting impurities in drug production using correlation imaging as described in claim 2, characterized in that, By pre-examining the first preview image, a second binary mask matrix is ​​generated, including: The first preview image and the first measurement value are transferred to the lightweight generator; By scanning the first preview image, the spatial phase in the spatial region that is greater than the first information threshold and the first uncertainty threshold is located, and the first scanning thread is determined. By scanning the first measurement value, the spectral measurement quantity that is greater than the second information content threshold and the second uncertainty threshold in the spectral band is located, and the second scanning thread is determined. The first and second scanning threads are merged to perform mask reconstruction and generate a second binary mask matrix.

6. The method for detecting impurities in drug production using correlation imaging as described in claim 2, characterized in that, Perform multi-layer compressed sensing and reconstruction, and determine the reconstruction results, including: Based on the image reconstructor, the first preview image up to the Nth preview image is retrieved, the first data alignment between the preview images is performed, the second data alignment between the preview images and the measured values ​​and mask vectors is performed, and the data is normalized to the spectral source data. For the spectral source data, perform multilayer compressed sensing and reconstruction, and determine the reconstruction result.

7. The method for detecting impurities in drug production using correlation imaging as described in claim 6, characterized in that, For the spectral source data, perform multilayer compressed sensing and reconstruction, including: Each network layer receives the spectral source data, performs hierarchical orientation processing, and determines the multi-layer sensing result, wherein the compressed sensing modes of each network layer are different; Based on the multi-layer perception results, an entropy-based attention mechanism is introduced for reconstruction, and the reconstruction result is determined, wherein the entropy value is defined by information content and uncertainty.

8. The method for detecting impurities in drug production using correlation imaging as described in claim 7, characterized in that, After determining the reconstruction result, the following is included: Attention levels based on attention objectives are used as the segmentation criteria and as the segmentation boundary markers; Based on the segmentation boundary markers, a fitting based on multilayer sensing results is performed on each segmentation region to determine the detection feature sequence set, wherein each segmentation region corresponds to one detection feature sequence; The reconstruction result is identified based on the segmentation boundary identifier and the detection feature sequence group.

9. The method for detecting impurities in drug production using correlation imaging as described in claim 1, characterized in that, The impurity detection results are determined by matching the impurity feature library, including: For the target product, explore the mapping relationship between spectral features and impurity features, and construct an impurity feature library; Traverse the impurity feature library and perform feature matching based on the detection feature sequence on the reconstruction results to determine the detection impurities; The detected impurities are spatially phase integrated and used as the impurity detection result, which is then displayed and alarmed on the terminal interface of the online detection platform.

10. A correlation imaging impurity detection system for drug production, characterized in that, For implementing the correlation imaging impurity detection method for drug production according to any one of claims 1-9, the system comprises: Projection unit: Loads the first binary mask matrix, projects the target product area, controls the single pixel detector to detect, determines the first measurement value, and lightweight reconstructs it into the first preview image; Iterative Unit: By pre-examining the first preview image, a second binary mask matrix is ​​generated and projected and reconstructed using detection. This process is repeated through multiple iterations until the Nth preview image is determined. Reconstruction Unit: Retrieves the first preview image up to the Nth preview image from the temporary database of the online detection platform, performs multi-layer compressed sensing and reconstruction, and determines the reconstruction result. The reconstruction result contains multi-level segmentation identifiers and detection feature sequence identifiers with entropy values ​​as attention targets. Matching unit: Based on the reconstruction result, it performs matching in the impurity feature library to determine the impurity detection result.

Citation Information

Patent Citations

  • Slurry quality real-time detection and analysis method based on ultrasonic image

    CN118362635A

  • High-sensitivity drug impurity analysis and detection method and system

    CN118967668A

  • Impurity real-time monitoring method and computer program product

    CN119169356A

  • High-resolution remote sensing image compression method and system based on block modulation imaging

    CN119383355A

  • A drug detection image processing method and processing device

    CN119762470A

Cited By

  • Adaptive video snapshot compression imaging method and system based on inter-group correlation, medium and computer device

    CN122179675A