Debris detection and removal device and method

By adjusting the frequency matching of high-definition cameras and vibration disks in the fragment detection system, and combining reticle projection and multi-dimensional data fusion technology, high-precision detection of complex tablets is achieved, solving the problem and frequency of detection of complex shape tablets in the prior art. Matching problems improve the accuracy and efficiency of detection.

CN118527377BActive Publication Date: 2024-11-22NANJING BISUNMIT INTELLIGENT TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411012501.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-11-22
Estimated Expiration
2044-07-26

AI Technical Summary

Technical Problem

Existing fragment detection technology is difficult to accurately identify tiny defects or deformations on tablets or capsules with complex shapes and rich surface textures, and how to achieve the precise matching of high-definition camera shooting frequency and vibration frequency of the vibration disk and effectively fusion of two-dimensional images on high-speed production lines. , three-dimensional point cloud data and multi-spectral information, there is no good solution yet.

Method used

By obtaining video images of high-definition cameras, adjusting their shooting frequency to match the vibration frequency of the vibration disk, combining reticle projection lighting technology to obtain image sequences, construct two-dimensional and three-dimensional data sets, perform image registration and fusion, and perform fine segmentation and texture Analyzing and spectral feature extraction, using an integrated learning module for fine classification and defect severity assessment, giving an overall quality score of the tablet, and issuing an exclusion instruction based on the score.

Benefits of technology

It realizes high-precision detection of tablets with complex shapes, improves the accuracy and efficiency of detection, can adapt to the needs of high-speed production lines, and significantly improves the accuracy and comprehensiveness of fragment detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118527377B_ABST
    Figure CN118527377B_ABST
Patent Text Reader

Abstract

The present invention discloses a device and method for detecting and rejecting debris, which includes obtaining an image sequence of a predetermined area from a high-definition camera illuminated by a mesh projection; preprocessing and preliminarily segmenting the image sequence to obtain a two-dimensional image mask of the segmented tablets, and constructing a two-dimensional and three-dimensional data set of the tablets in combination with the two-dimensional image mask; based on the two-dimensional and three-dimensional data sets, performing image registration and fusion, and performing fine segmentation, texture analysis, shape analysis, and spectral feature extraction to obtain a comprehensive data set of the tablets; reading the comprehensive data set, and calling a pre-configured comprehensive defect feature vector, using an integrated learning module to perform fine classification of the fine modules, and evaluating the severity of the defects according to the fine classification results, and giving an overall quality score of the tablets; if the overall quality score is less than a threshold, a rejection instruction is issued to the rejection mechanism. By rejecting debris purely visually, the problem that the photoelectric counter is easily blocked by dust, resulting in counting and detection errors, is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to industrial vision, and in particular to realizing debris detection and removal by processing video data acquired by an industrial camera. Background Art

[0002] In the modern pharmaceutical and food processing industries, the quality control of tablets and capsules is crucial, among which the detection and removal of debris is a key link to ensure product quality and safety. Debris not only affects the appearance and integrity of the product, but is also likely to lead to inaccurate dosage, which seriously threatens consumer health. Therefore, the development of an efficient and accurate debris detection and removal system has great economic and social significance. With the rapid development of industrial automation and artificial intelligence technology, traditional manual detection methods can no longer meet the high-speed and high-precision requirements of modern production lines, which has prompted researchers to continuously explore new automated detection technologies to improve production efficiency and product quality.

[0003] At present, there are two main methods used in the field of debris detection: photoelectric particle counting and weighing debris detection. Photoelectric particle counting technology uses photoelectric sensors and counters to count objects by detecting the changes in light signals generated when objects pass through the sensing area. This method is fast and suitable for mass production, but the detection effect is poor for debris with irregular shapes or large size differences. Affected by factors such as dust, the counting and detection effects are poor. Weighing debris detection measures the weight of tablets or capsules with a precision balance and compares the difference with the standard weight to determine whether there are debris. This method has high accuracy, but the detection speed is slow and is easily affected by environmental factors such as vibration. In addition, in recent years, detection methods based on machine vision have also been widely used. By collecting images with high-definition cameras and combining image processing algorithms for defect identification, significant progress has been made in improving detection accuracy and efficiency. The applicant has developed a fusion technology that combines video processing methods with optoelectronic technology and applied for a Chinese patent. The patent publication number is CN117022817B, which discloses some debris detection technologies. However, in actual use, the fusion of optoelectronics and images is still difficult, and the technology is difficult to promote.

[0004] If pure visual fragment detection and counting are to be achieved, there are still some urgent problems to be solved, including: for tablets or capsules with complex shapes and rich surface textures, the existing two-dimensional image analysis technology is difficult to accurately identify tiny defects or deformations. In addition, on high-speed production lines, there is currently no good solution for how to achieve accurate matching of the shooting frequency of high-definition cameras with the vibration frequency of the vibration plate to obtain a stable and clear image sequence. At the same time, how to effectively integrate two-dimensional images, three-dimensional point cloud data and multi-spectral information to construct a comprehensive defect feature description, and on this basis achieve high-precision defect classification and severity assessment, is also the focus and difficulty of current research.

[0005] Therefore, innovative research is needed. Summary of the invention

[0006] The purpose of the invention is to provide a debris detection and removal device and method, in order to solve the above-mentioned problems existing in the prior art.

[0007] A technical solution provides a method for detecting and removing debris, comprising the following steps:

[0008] Step S1, obtaining a video image of a predetermined time length, determining whether the shooting frequency of the high-definition camera matches the vibration frequency of the vibration plate, and if not, adjusting the parameters of the high-definition camera, the vibration plate and the reticulated projection unit until the shooting frequency of the high-definition camera matches the vibration frequency of the vibration plate;

[0009] Step S2, acquiring an image sequence of a predetermined area from a high-definition camera illuminated by a mesh projection; preprocessing and preliminarily segmenting the image sequence to obtain a two-dimensional image mask of the segmented tablet, and constructing a two-dimensional and three-dimensional data set of the tablet in combination with the two-dimensional image mask;

[0010] Step S3: Based on the two-dimensional and three-dimensional data sets, image registration and fusion are performed, and fine segmentation, texture analysis, shape analysis and spectral feature extraction are performed to obtain a comprehensive data set of pills;

[0011] Step S4, read the comprehensive data set, call the pre-configured comprehensive defect feature vector, use the integrated learning module to finely classify the fine modules, and evaluate the severity of the defects based on the fine classification results to give an overall quality score for the tablets; if the overall quality score is less than the threshold, issue a rejection instruction to the rejection mechanism.

[0012] According to another aspect of the present application, there is also provided a debris detection and rejection device, comprising a high-definition camera, a reticulated projection unit, a vacuum suction and rejection unit, and a debris detection and rejection control unit;

[0013] The debris detection and rejection control unit includes:

[0014] at least one processor; and,

[0015] a memory communicatively connected to at least one of the processors; wherein,

[0016] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the fragment detection and removal method described in any of the above technical solutions.

[0017] Beneficial effect: by removing debris purely visually, the problem of photoelectric counters being easily blocked by dust, resulting in counting and detection errors, is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a flow chart of the present invention.

[0019] Figure 2 It is a flow chart of step S1 of the present invention.

[0020] Figure 3 It is a flow chart of step S2 of the present invention.

[0021] Figure 4 It is a flow chart of step S3 of the present invention.

[0022] Figure 5 It is a flow chart of step S4 of the present invention. DETAILED DESCRIPTION

[0023] like Figure 1 As shown, a method for detecting and removing debris is provided, comprising the following steps:

[0024] Step S1, obtaining a video image of a predetermined time length, determining whether the shooting frequency of the high-definition camera matches the vibration frequency of the vibration plate, and if not, adjusting the parameters of the high-definition camera, the vibration plate and the reticulated projection unit until the shooting frequency of the high-definition camera matches the vibration frequency of the vibration plate;

[0025] Step S2, acquiring an image sequence of a predetermined area from a high-definition camera illuminated by a mesh projection; preprocessing and preliminarily segmenting the image sequence to obtain a two-dimensional image mask of the segmented tablet, and constructing a two-dimensional and three-dimensional data set of the tablet in combination with the two-dimensional image mask;

[0026] Step S3: Based on the two-dimensional and three-dimensional data sets, image registration and fusion are performed, and fine segmentation, texture analysis, shape analysis and spectral feature extraction are performed to obtain a comprehensive data set of pills;

[0027] Step S4, read the comprehensive data set, call the pre-configured comprehensive defect feature vector, use the integrated learning module to finely classify the fine modules, and evaluate the severity of the defects based on the fine classification results to give an overall quality score for the tablets; if the overall quality score is less than the threshold, issue a rejection instruction to the rejection mechanism.

[0028] In this embodiment, the stability and clarity of image acquisition are ensured by accurately matching the shooting frequency of the high-definition camera with the vibration frequency of the vibration disk, laying the foundation for subsequent analysis. This matching mechanism can adapt to the speed requirements of different production lines and improve the versatility and flexibility of the system. The mesh projection illumination technology is used, combined with the construction of two-dimensional image masks and three-dimensional data sets, to achieve comprehensive capture of tablet shapes and surface features. This multi-dimensional data fusion method improves the accuracy of detection, especially for tablets with complex surface textures or irregular shapes. Through image registration and fusion technology, combined with fine segmentation, texture analysis, shape analysis and spectral feature extraction, a comprehensive tablet data set is constructed. This multi-angle and multi-scale feature extraction method can comprehensively characterize the various properties of tablets and provide a rich source of information for subsequent defect identification. Fine classification is performed through an integrated learning module, and combined with defect severity assessment, an overall quality score of the tablet is given. This comprehensive evaluation mechanism can not only accurately identify various defects, but also quantify the degree of impact of defects, thereby achieving more accurate quality control. In short, through a number of technological innovations, the accuracy, efficiency and comprehensiveness of fragment detection have been significantly improved, and it can effectively cope with complex detection requirements on high-speed production lines.

[0029] like Figure 2 As shown, the step S1 is specifically as follows:

[0030] Step S11, capturing a video clip of a predetermined length from the real-time video stream of the high-definition camera;

[0031] Step S12, obtaining a vibration plate control signal, applying fast Fourier transform to analyze the vibration signal, and determining the vibration frequency and vibration start time of the vibration plate;

[0032] Step S13, analyzing the captured video clips, calculating the number of frames per unit time, and obtaining the actual shooting frequency and shooting start time of the camera;

[0033] Step S14, comparing the vibration frequency of the vibration plate and the camera shooting frequency, calculating the frequency ratio and error, and obtaining the frequency matching degree;

[0034] Step S15, comparing the calculated frequency matching degree with a preset matching threshold to determine whether the frequencies match;

[0035] Step S16: If the judgment result shows that the frequency does not match, the required adjustment amount is calculated, and an adjustment instruction is sent to the camera and the reticulated projection unit to update the camera parameters and the reticulated projection unit parameters, including the adjustment frequency and the starting time;

[0036] Step S17, using the updated camera parameters and reticulated projection unit parameters, repeating steps S11 to S15 to verify the adjustment effect;

[0037] Step S18: Check the updated matching status to confirm whether the adjustment is completed. If completed, send an adjustment completion signal.

[0038] This embodiment achieves accurate matching between the shooting frequency of the high-definition camera and the vibration frequency of the vibration disk, greatly improving the quality and stability of image acquisition. By performing fast Fourier transform analysis on the vibration disk control signal, the vibration frequency and start time are accurately obtained, laying the foundation for subsequent frequency matching. This method can capture the working state of the vibration disk in real time and adapt to the frequency fluctuations that may occur during the production process. By analyzing the video clips, the actual shooting frequency and start time of the camera are calculated, and compared with the vibration disk parameters to obtain accurate frequency matching. This dynamic comparison mechanism ensures that the system can detect and correct frequency deviations in a timely manner. The preset matching threshold is used to determine whether the frequency matches, and the adjustment amount is automatically calculated when it does not match, and adjustment instructions are sent to the camera and the reticulated projection unit. This adaptive adjustment mechanism improves the stability and reliability of the system and can cope with changes in various production environments. By repeatedly verifying and adjusting until the expected matching effect is achieved, the continuous stability of image acquisition is ensured. This iterative optimization method greatly improves the robustness of the system. In short, this solution achieves high-precision synchronization between the high-definition camera and the vibration disk through precise frequency analysis, dynamic comparison, adaptive adjustment and iterative optimization, provides high-quality data input for subsequent image analysis and defect detection, and significantly improves the accuracy and reliability of debris detection.

[0039] like Figure 3 As shown, the step S2 is specifically as follows:

[0040] Step S21, generating a synchronous trigger signal to drive the dual high-definition cameras and the reticulated projection system to obtain an image sequence of a predetermined area;

[0041] Step S22, applying an adaptive histogram equalization algorithm to the acquired image sequence to enhance the image contrast and obtain a preprocessed image;

[0042] Step S23, using a Gaussian mixture model to perform foreground segmentation on the preprocessed image to obtain an initial segmentation result of the tablets;

[0043] Step S24, applying morphological operations to the initial segmentation results, including opening and closing operations, to optimize the segmentation boundaries and obtain an accurate tablet image mask;

[0044] Step S25, obtaining the reticulated projection image, applying the phase unwrapping algorithm, and reconstructing the three-dimensional surface model of the tablet;

[0045] Step S26: align the obtained two-dimensional image mask with the reconstructed three-dimensional surface model to preliminarily construct a complete two-dimensional and three-dimensional data set for each tablet.

[0046] This embodiment achieves high-quality tablet image acquisition and preliminary data processing. The use of synchronous trigger signals to drive dual high-definition cameras and a reticulated projection system ensures accurate synchronization of image acquisition, laying the foundation for subsequent three-dimensional reconstruction. This synchronization mechanism improves the accuracy of multidimensional data fusion. The application of an adaptive histogram equalization algorithm to enhance image contrast significantly improves image clarity and detail, creating favorable conditions for subsequent feature extraction. The Gaussian mixture model is used for foreground segmentation, and the segmentation boundary is optimized in combination with morphological operations to achieve accurate segmentation of tablets. This advanced segmentation method can effectively handle tablets with complex backgrounds and irregular shapes, improving the accuracy of subsequent analysis. The three-dimensional surface model of the tablet is reconstructed by reticulated projection and phase unwrapping algorithms, and the two-dimensional image mask is aligned with the three-dimensional surface model to construct a complete two-dimensional and three-dimensional data set. This method of multidimensional data fusion provides a rich source of information for comprehensively characterizing tablet features, improving the accuracy and comprehensiveness of defect detection. In summary, this solution significantly improves the quality and information richness of tablet images through high-precision synchronous acquisition, image enhancement, precise segmentation and multi-dimensional data fusion, laying a solid foundation for subsequent detailed analysis and defect identification, and effectively improving the accuracy and reliability of fragment detection.

[0047] like Figure 4 As shown, the step S3 is further as follows:

[0048] Step S31, obtaining a predetermined area image sequence and corresponding three-dimensional point cloud data taken by a high-definition camera, constructing a multi-resolution representation through discrete wavelet transform, calculating mutual information at each resolution level using an adaptive random sampling strategy, and iteratively optimizing transformation parameters using an L-BFGS optimization algorithm to achieve sub-pixel precision registration of the two-dimensional image and the three-dimensional point cloud, and obtaining a registered image;

[0049] Step S32: applying the SLIC algorithm to the registered image to generate multi-scale superpixels, performing region merging based on the similarity measurement of color and texture features, optimizing the segmentation boundaries using morphological post-processing, obtaining accurate segmentation masks for tablets of different sizes and shapes, and obtaining an accurately segmented image;

[0050] Step S33, design a set of Gabor filters of different scales and directions, filter the segmented tablet image, extract frequency domain texture features, calculate rotationally invariant local binary pattern features on the filtered image, reduce the dimension by principal component analysis, and obtain a compact multi-scale texture descriptor, which is recorded as a multi-scale texture feature vector;

[0051] Step S34, mapping the three-dimensional point cloud data of the tablet onto the unit sphere, calculating spherical harmonic coefficients of different orders to capture global shape features, calculating FPFH descriptors in local areas to describe local geometric structures, and obtaining three-dimensional shape features that can sensitively detect small deformations by weighted fusion of global and local features, which are recorded as three-dimensional shape feature vectors;

[0052] Step S35, applying adaptive Wiener filtering to the multispectral image data of the tablets for denoising and enhancement, using non-negative matrix decomposition to decompose the spectral data into basic components and abundance maps, calculating an improved standardized difference index, obtaining spectral features sensitive to material changes, and outputting a spectral feature vector and an improved standardized difference index;

[0053] Step S36: construct a comprehensive data set based on the multi-scale texture feature vector, the three-dimensional shape feature vector, the spectral feature vector and the improved normalized difference index.

[0054] This embodiment achieves high-precision analysis and comprehensive feature characterization of tablets. Using discrete wavelet transform and adaptive random sampling strategy, combined with limited memory Broyden-Fletcher-Goldfarb-Sarnot (L-BFGS) optimization algorithm, sub-pixel precision registration of two-dimensional images and three-dimensional point clouds is achieved. This high-precision registration technology significantly improves the accuracy of multi-dimensional data fusion and provides a data basis with strong consistency for subsequent analysis. Multi-scale superpixels are generated by simple linear iterative clustering (SLIC) algorithm, and regional merging is performed based on color and texture features to achieve accurate segmentation of tablets of different sizes and shapes. This adaptive segmentation method can effectively handle tablets with complex shapes and textures, and improves the accuracy of subsequent feature extraction. Multi-scale Gabor filters and rotationally invariant local binary pattern feature extraction methods are designed to capture subtle texture changes on the surface of tablets, providing an important basis for defect detection. At the same time, global and local shape features are captured by spherical harmonic coefficients and fast point feature histogram (FPFH) descriptors, realizing sensitive detection of small deformations. This multi-scale, multi-angle feature extraction method improves the system's ability to identify various defects. Adaptive Wiener filtering and non-negative matrix factorization were applied to the multispectral image data, and the improved normalized difference index was calculated to obtain spectral features that are sensitive to material changes. This spectral analysis method can detect material anomalies that are difficult to detect with the naked eye, further improving the comprehensiveness and accuracy of detection. In summary, through high-precision data registration, adaptive segmentation, multi-scale texture analysis, fine shape feature extraction and high-sensitivity spectral analysis, a comprehensive and accurate tablet feature characterization system was constructed, which significantly improved the accuracy, sensitivity and reliability of fragment detection.

[0055] like Figure 5 As shown, the step S4 is specifically as follows:

[0056] Step S41, reading the comprehensive data set, applying the multi-core local preservation projection algorithm, combining multiple kernel functions to capture the nonlinear structure of the comprehensive data, retaining the local neighborhood relationship between samples through local preservation projection, and generating a low-dimensional and highly discriminative comprehensive defect feature vector;

[0057] Step S42: construct an integrated learning framework based on random forest and adaptive boosting (AdaBoost), train multiple decision tree-based classifiers on randomly selected feature subsets, dynamically adjust sample weights and classifier weights through the AdaBoost algorithm, use the comprehensive defect feature vector as input data, finely classify the defects, obtain the classification results with expected accuracy, and output the defect category and classification confidence;

[0058] Step S43, construct a fuzzy rule base based on the Mamdani model, take the comprehensive defect feature vector, defect category and classification confidence as input, apply the fuzzy inference system and combine it with the particle swarm optimization algorithm, obtain the defect severity score through fuzzy inference, and use the particle swarm optimization (PSO) algorithm to optimize the member function parameters and rule weights;

[0059] Step S44, using the analytic hierarchy process to determine the weights of different quality indicators, combining the defect category and defect severity score, applying the topological order of successive ideal solutions (TOPSIS) method to comprehensively evaluate the distance between each tablet and the ideal solution and the negative ideal solution, and calculating the normalized overall quality score;

[0060] Step S45: compare the calculated overall quality score with a preset threshold. If the score is less than the threshold, generate and send a rejection instruction to a rejection mechanism.

[0061] This embodiment achieves high-precision defect classification and comprehensive quality assessment. The multi-core local preservation projection algorithm is used, combined with multiple kernel functions to capture the nonlinear structure of the data, and a highly discriminative comprehensive defect feature vector is generated. This feature extraction method can effectively capture complex defect patterns and lay the foundation for subsequent classification. An integrated learning framework based on random forest and AdaBoost is constructed, and high-precision defect classification is achieved by dynamically adjusting sample weights and classifier weights. This integrated learning method improves the accuracy and robustness of classification and can effectively handle various complex defect types. An adaptive defect severity assessment system is constructed using a fuzzy rule base based on the Mamdani model and a particle swarm optimization algorithm. This fuzzy reasoning method can flexibly handle the uncertainty in defect assessment and provide more objective and comprehensive assessment results. The quality indicator weights are determined by the hierarchical analysis method, and the tablet quality is comprehensively evaluated by the TOPSIS method, giving a normalized overall quality score. This multi-criteria decision-making method takes into account the combined impact of multiple quality factors and provides a more comprehensive and reliable quality evaluation. In summary, this solution builds an intelligent and high-precision tablet quality assessment system through highly discriminative feature extraction, precise ensemble learning classification, adaptive fuzzy reasoning evaluation and comprehensive multi-criteria decision-making, which significantly improves the accuracy, comprehensiveness and reliability of tablet residue detection and provides strong technical support for real-time quality control on the production line.

[0062] According to one aspect of the present application, the step S12 further includes performing multi-resolution decomposition of the signal using wavelet packet decomposition, and finally applying an adaptive resonance theory network to adaptively identify the main frequency components to obtain an accurate vibration frequency of the vibration plate; specifically as follows:

[0063] Step S121, calling a preconfigured wavelet basis function, decomposing the signal into a predetermined number of decomposition layers, and calculating the energy of each frequency band at each layer to construct an energy distribution feature vector;

[0064] Step S122, calling the initialized ART network, setting the warning parameters and learning rate; taking the energy of each frequency band obtained by wavelet decomposition (WPD) as the input vector, for each input vector, calculating the similarity with the existing category; if the similarity is higher than the warning parameter, updating the weight of the most matching category; otherwise, creating a new category;

[0065] Step S123, analyzing the categories formed by the ART network to determine the dominant frequency category; inversely deduce the corresponding frequency range based on the category center vector; within this frequency range, accurately locate the peak frequency using the result of fast Fourier transform to obtain the main frequency component;

[0066] Step S124: dynamically adjust the number of decomposition layers and frequency band division of the WPD according to the identified main frequency components; and update the warning parameters of the ART network to adapt to the dynamic changes of the signal;

[0067] Step S125: output the precise vibration frequency of the vibration disk and store the frequency characteristic vector for subsequent frequency matching and adjustment.

[0068] This embodiment realizes high-precision measurement and dynamic tracking of the vibration frequency of the vibration plate. The multi-resolution decomposition of the signal by wavelet packet decomposition can effectively capture the energy distribution of the signal in different frequency ranges, and provide rich feature information for subsequent frequency identification. This multi-scale analysis method improves the accuracy and robustness of frequency identification, especially in complex signals with multiple frequency components. The adaptive resonance theory (ART) network is applied to adaptively identify the main frequency components, and dynamic learning and classification of frequency characteristics are realized. The self-organizing characteristics of the ART network enable the system to automatically adapt to the changes of the signal without presetting fixed frequency categories, which improves the flexibility and adaptability of the system. By analyzing the categories formed by the ART network and combining the results of the fast Fourier transform, the precise positioning of the dominant frequency is achieved. This method of combining coarse classification and precise positioning ensures both the efficiency of identification and the high accuracy of frequency measurement. By dynamically adjusting the parameters of the wavelet packet decomposition and the warning parameters of the ART network, real-time tracking of the dynamic changes of the signal is achieved. This adaptive mechanism enables the system to continuously maintain high-precision frequency measurement and can be adjusted quickly even when the working state of the vibration plate changes. In summary, this solution constructs a high-precision and high-reliability vibration frequency measurement system through multi-resolution signal decomposition, adaptive feature learning, precise frequency positioning and dynamic parameter adjustment, which provides key technical support for achieving precise matching between the shooting frequency of the high-definition camera and the vibration frequency of the vibration disk, and significantly improves the stability and accuracy of the entire debris detection system.

[0069] The step S22 is further as follows:

[0070] Step S221, obtaining the original image sequence, constructing the image diffusion equation, and initializing the diffusion coefficient to a constant; for each pixel, iteratively calculating its intensity value, and updating the diffusion coefficient according to the local gradient; repeating the iterative process until the preset conditions are met, and obtaining a preliminary denoised image;

[0071] Step S222, read a portion of the image that has been initially denoised, calculate the structure tensor of the image, then perform tensor voting in the neighborhood of each pixel, accumulate all voting results to obtain an optimized structure tensor; perform eigendecomposition on the optimized structure tensor to obtain eigenvalues ​​and eigenvectors; calculate anisotropy indicators based on the eigenvalues ​​and eigenvectors, and update the diffusion coefficient accordingly; use the updated diffusion coefficient to perform a second round of nonlinear diffusion on the image that has been initially denoised to obtain a refined image;

[0072] Step S223, read the fine image, and divide it into multiple overlapping small blocks; calculate the histogram and cumulative distribution function for each small block; for each pixel, calculate the weighted average transformation function based on the cumulative distribution function of all overlapping blocks in which it is located; apply the transformation function to perform grayscale mapping on each pixel; to prevent over-enhancement, introduce a contrast limitation mechanism, and recalculate the cumulative distribution function and transformation function; for color images, apply equalization processing only to the brightness channel in the HSV color space, and then convert the result back to the RGB color space to finally obtain the preprocessed image.

[0073] This embodiment achieves high-quality image preprocessing and lays a solid foundation for subsequent debris detection. The nonlinear diffusion equation is used for preliminary denoising, and adaptive noise suppression is achieved by iteratively updating the diffusion coefficient. This method can effectively retain the edge and detail information of the image, while significantly reducing the noise level and improving the overall quality of the image. Through structural tensor analysis and tensor voting technology, accurate description and optimization of the local structure of the image are achieved. This method can effectively enhance the edge and texture features of the image, providing a clearer basis for subsequent feature extraction. Adaptive histogram equalization technology based on overlapping blocks is used, combined with a contrast limitation mechanism, to achieve local adaptive enhancement of image brightness and contrast. This method can effectively handle the brightness difference in different regions, improve the overall visibility of the image, and avoid artifacts caused by over-enhancement. For color images, only the brightness channel is processed in the HSV color space, which retains the color information of the original image and avoids color distortion. In short, this scheme constructs a comprehensive and sophisticated image preprocessing system through technologies such as adaptive nonlinear diffusion denoising, structural tensor optimization, local adaptive histogram equalization, and color space conversion. This preprocessing method significantly improves the clarity, contrast and detail of the image, provides high-quality image data for subsequent debris detection and feature extraction, and improves the accuracy and reliability of the entire detection system.

[0074] The step S25 is specifically as follows:

[0075] Step S251, obtaining a reticulated projection image sequence, and applying a four-step phase shift method to calculate the wrapping phase;

[0076] Step S252, constructing an energy function based on L0 norm minimization, including a data fidelity term and an L0 norm regularization term of a phase gradient;

[0077] Step S253, using the alternating direction multiplier method to iteratively solve the energy function to obtain a preliminary unwrapped phase map;

[0078] Step S254, analyzing the statistical characteristics of the local phase gradient and adaptively adjusting the regularization parameter;

[0079] Step S255, repeat the optimization process of the alternating direction multiplier method to obtain a finely unwrapped phase map;

[0080] Step S256, calculating the three-dimensional coordinates corresponding to each pixel by triangulation principle according to the system calibration parameters and the unwrapped phase image;

[0081] Step S257, gridding the calculated three-dimensional point cloud data to construct a complete three-dimensional surface model of the tablet;

[0082] Step S258: Smoothing the three-dimensional model and removing noise to obtain an accurate three-dimensional surface reconstruction result of the tablet.

[0083] This embodiment realizes high-precision three-dimensional reconstruction of the tablet surface. The four-step phase shift method is used to calculate the wrapped phase, which provides basic data for subsequent phase unwrapping. This method can effectively suppress ambient light interference and improve the accuracy of phase measurement. An energy function based on L0 norm minimization is constructed, and the alternating direction multiplier method is used for optimization and solution, so as to realize high-quality phase unwrapping. This method based on sparse optimization can effectively handle phase jumps and noise, and improve the accuracy and robustness of the unwrapping results. By analyzing the statistical characteristics of the local phase gradient, the adaptive adjustment of the regularization parameter is realized, and the accuracy of the unwrapping is further improved. This adaptive mechanism enables the system to adapt to tablets with different surface complexities and maintain high-quality reconstruction effects. Then, based on the system calibration parameters and the unwrapped phase map, the three-dimensional coordinates corresponding to each pixel are accurately calculated by the triangulation principle, and the generation of point cloud data is realized. This method can accurately capture the slight changes on the tablet surface and provide high-precision geometric information for subsequent defect detection. Through gridding and smoothing operations, a complete three-dimensional surface model is constructed, and noise is effectively removed. This post-processing technology further improves the quality and availability of the three-dimensional model. In summary, this solution builds a high-precision and high-reliability tablet 3D surface reconstruction system through high-precision phase measurement, sparse optimization unwrapping, adaptive parameter adjustment, accurate 3D coordinate calculation and high-quality post-processing. This 3D reconstruction technology can accurately capture the tiny defects and deformations on the tablet surface, improving the accuracy and comprehensiveness of fragment detection, especially for those tiny defects that are difficult to detect with only 2D images.

[0084] According to one aspect of the present application, step S41 is specifically:

[0085] S411, read the comprehensive data set, apply the multi-core local preservation projection algorithm, combine multiple kernel functions such as radial basis function kernel and polynomial kernel to capture the nonlinear structure of the data, retain the local neighborhood relationship between samples through local preservation projection, and generate an initial low-dimensional and highly discriminative comprehensive defect feature vector;

[0086] S412, calculating the mutual information matrix between each feature in the initial feature vector, quantifying the correlation and redundancy between the features; applying the maximum correlation minimum redundancy criterion, preliminarily screening feature subsets with high discrimination and low redundancy;

[0087] S413. Combine the conditional random field model to establish a probabilistic graph model for feature selection. Use the conditional random field model to capture the contextual dependencies between features and dynamically adjust feature weights based on the feature requirements of different types of defects. Iteratively optimize the conditional random field model parameters to ultimately select the most discriminative feature subset and generate an optimized comprehensive defect feature vector.

[0088] This embodiment realizes the generation of highly discriminative comprehensive defect feature vectors through feature extraction and selection technology. The multi-core local preservation projection algorithm is adopted, combined with multiple kernel functions such as radial basis function kernel and polynomial kernel, to effectively capture the nonlinear structure of data. This method not only reduces the dimension of the feature, but also retains the local neighborhood relationship between samples, and improves the discriminative ability of the feature. By calculating the mutual information matrix and applying the maximum correlation minimum redundancy criterion, preliminary feature screening is achieved. This information theory-based method can effectively remove redundant features, retain the most discriminative feature subset, and improve the efficiency and effectiveness of feature representation. The conditional random field model is introduced to establish a probabilistic graph model for feature selection. This method can capture the contextual dependency between features, consider the feature requirements of different types of defects, and realize the dynamic adjustment of feature weights. By iteratively optimizing the parameters of the conditional random field model, the most discriminative feature subset is finally selected, and the optimized comprehensive defect feature vector is generated. This dynamic feature selection method that considers the relationship between features improves the pertinence and effectiveness of feature representation. In summary, the scheme constructs a highly discriminative and low-redundant defect feature representation system through multi-core nonlinear mapping, information theory feature screening and probabilistic graph model dynamic optimization. This feature extraction and selection method can effectively capture the key features of various complex defects, significantly improve the accuracy and reliability of subsequent defect classification and identification, and provide strong technical support for high-precision debris detection.

[0089] According to one aspect of the present application, step S44 is specifically:

[0090] S441. Use the analytic hierarchy process to construct a quality evaluation system. Combine defect type, defect severity and quantity, determine the initial weight of each quality indicator through expert scoring and consistency test; use fuzzy measure to represent the interaction between decision criteria, identify fuzzy measure by solving quadratic programming problem, capture nonlinear relationship between indicators, and output weight and fuzzy measure;

[0091] S442. Based on the obtained weights and fuzzy measures, the TOPSIS method is applied to calculate the distance of each tablet from the ideal solution and the negative ideal solution in each indicator; at the same time, the Choquet integral is used to aggregate the scores of multiple quality indicators, considering the interaction between the indicators;

[0092] S443. The results of TOPSIS method and Choquet integration are integrated to calculate the final normalized overall quality score by weighted average method; according to the score results, the tablets or capsules are divided and ranked by quality grade, and the score results and quality grades are output.

[0093] This embodiment achieves a comprehensive and objective evaluation of tablet quality through multi-criteria decision-making and fuzzy comprehensive evaluation methods. The quality evaluation system is constructed by using the hierarchical analysis method, and the initial weights of each quality indicator are determined in combination with expert scoring and consistency testing. This method takes into account the relative importance of multiple quality factors and provides a scientific weight basis for subsequent comprehensive evaluation. The fuzzy measure is introduced to represent the interaction between decision criteria, and the fuzzy measure is identified by solving the quadratic programming problem to capture the nonlinear relationship between indicators. This method can more accurately reflect the complex quality evaluation system and overcome the limitation of the traditional weighted method that ignores the interaction between indicators. Furthermore, based on the obtained weights and fuzzy measures, the TOPSIS method is applied to calculate the distance between each tablet and the ideal solution and the negative ideal solution, and the Choquet integral is used to aggregate the scores of multiple quality indicators. This method combining TOPSIS and Choquet integrals takes into account both the degree of proximity to the ideal state and the interaction between indicators, providing a more comprehensive and objective evaluation result. The results of TOPSIS and Choquet integrals are combined by the weighted average method to calculate the final normalized overall quality score, and the quality grade is divided and sorted. This comprehensive evaluation method can balance the results of different evaluation angles and provide a more reliable and convincing quality assessment. In short, the scheme constructs a comprehensive, objective and flexible tablet quality evaluation system through multi-level weight determination, nonlinear indicator relationship modeling, multi-angle evaluation method integration and comprehensive quality scoring. This evaluation method can accurately reflect multiple aspects of tablet quality, provide a scientific basis for quality control decisions on the production line, and improve the efficiency and accuracy of residual tablet detection and quality management.

[0094] In another embodiment of the present application, the process of reticulate projection is as follows: generate a series of sinusoidal grating patterns with gradually increasing spatial frequencies; for each spatial frequency, generate at least 4 phase-shifted patterns (0°, 90°, 180°, 270°); use a digital light processing (DLP) projector to project the pattern sequence onto the tablet surface at a projection frequency of 120 Hz.

[0095] The process of calculating the phase is as follows: for each set of 4 phase-shifted images at each spatial frequency, for each pixel, extract the grayscale values ​​I1, I2, I3, I4 at the 4 phases; calculate the phase value: φ = arctan((I4 - I2) / (I1 - I3)); use a lookup table (LUT) to accelerate the calculation of the inverse tangent function (arctan); output the phase map for each spatial frequency.

[0096] The process of phase unwrapping is as follows: obtain phase diagrams of multiple spatial frequencies, start from the lowest spatial frequency, and gradually unwrap to high frequencies, use a hierarchical phase unwrapping algorithm, calculate the phase difference between adjacent frequencies, detect 2π jump points, accumulate or subtract appropriate multiples of 2π, use consistency checks to eliminate noise and ambiguity, and output the unwrapped continuous phase diagram.

[0097] The process of data fusion is as follows: obtain dual-view images, segmentation masks, and 3D data of the reticulated projection system.

[0098] Use a rigid body transformation algorithm to accurately align dual-view 2D images with 3D point cloud data; use S13's segmentation mask to extract accurate 3D models of each tablet / capsule from the 3D point cloud; and map 2D image information (such as color and texture) to the 3D model.

[0099] In another embodiment of the present application, step S25 also includes calculating the marginal distribution of each modal feature using kernel density estimation. Then, an appropriate copula function (such as Clayton or Gumbel copula function) is selected to model the dependency structure between features. Finally, a fusion feature is generated from the joint distribution through the Monte Carlo sampling method to capture the complex nonlinear relationship between different modalities.

[0100] In another embodiment of the present application, the process of wavelet decomposition is as follows: decomposing the signal into approximation coefficients (low frequency) and detail coefficients (high frequency);

[0101] The approximate and detail components are further decomposed to form a complete binary tree structure;

[0102] Calculate the energy for each terminal node (leaf node): use the sum of the squares of the node coefficients as the energy index of the frequency band; normalize the energy value for subsequent processing; in other words, at each level of decomposition, divide the signal into approximate coefficients (low frequency) and detail coefficients (high frequency), and then further decompose both coefficients. This process is recursive and eventually forms a complete binary tree structure.

[0103] Construct energy distribution feature vector: organize the normalized energy values ​​of each leaf node into a vector; this vector will be used as the input of the subsequent ART network;

[0104] Save the complete WPD decomposition structure and coefficients: This information can be used for subsequent signal reconstruction or more detailed frequency analysis.

[0105] In another embodiment of the present application, step S22 is specifically as follows:

[0106] S221. Preliminary denoising using a nonlinear diffusion model based on partial differential equations:

[0107] a) Construct the image diffusion equation: ΨI / Ψt = div(c(x, y, t)▽I), where I is the image intensity, c is the diffusion coefficient, Ψ represents the partial derivative, and t represents time;

[0108] b) Initialize the diffusion coefficient c(x, y, 0) to a constant;

[0109] c) For each pixel (x, y), iteratively calculate:

[0110] I(x,y,t+1) = I(x,y,t) + λ[cN·▽NI + cS·▽SI + cE·▽EI + cW·▽WI],

[0111] Where λ is the time step, ▽NI, ▽SI, ▽EI, ▽WI are the gradients in the north, south, east, and west directions respectively;

[0112] d) Update the diffusion coefficient every fixed number of iterations: c(x, y, t) = g(||▽I||),

[0113] Where g is a decreasing function, such as g(x) = 1 / (1 + (x / K) 2 ), K is the edge threshold parameter;

[0114] e) Repeat steps c) and d) until the preset number of iterations or convergence condition is reached.

[0115] S222. Optimize local structure by combining tensor voting technology:

[0116] a) Calculate the structure tensor for the output image of S221: S = ▽I·▽I T ;

[0117] b) For each pixel, perform a tensor vote within its neighborhood:

[0118] Define the voting field kernel function: K(x, y) = exp(-x 2 / σx 2 -y 2 / σy 2 ), where exp represents the exponential function;

[0119] For each point p in the neighborhood, calculate its vote for the center point: V(p) = K(p)·S(p);

[0120] Cumulative all votes: S' = Σ V(p);

[0121] c) Perform eigendecomposition on the optimized structure tensor S' to obtain eigenvalues ​​λ1, λ2 and corresponding eigenvectors e1, e2;

[0122] d) Calculate the anisotropy index based on the eigenvalues ​​and eigenvectors: R = (λ1 - λ2) / (λ1 + λ2);

[0123] e) Update the diffusion coefficient: c(x, y) = α·exp(-R / k), where α and k are adjustment parameters;

[0124] f) Using the updated diffusion coefficient, repeat steps c) to e) in S221 to perform a second round of nonlinear diffusion.

[0125] S223, applying adaptive histogram equalization to enhance image contrast:

[0126] a) Split the image into overlapping small blocks, typically 8x8 pixels in size, with an overlap ratio of 50%;

[0127] b) Calculate the histogram and cumulative distribution function (CDF) for each small block;

[0128] c) For each pixel, a weighted average transformation function is calculated based on the CDF of all overlapping blocks in which it is located:

[0129] f(i) = Σ wk·CDFk(i), where wk is the weight, which is inversely proportional to the distance from the pixel to the center of the block;

[0130] d) Apply the transformation function f(i) to grayscale each pixel;

[0131] e) To prevent over-enhancement, introduce contrast limitation:

[0132] Calculate the slope of each small block histogram and evenly distribute the part exceeding the threshold to other areas;

[0133] Recalculate CDF and transformation function;

[0134] f) For RGB images, apply equalization only to the V channel in HSV color space and then convert back to RGB space.

[0135] In this embodiment, the characters are explained as follows: div is a divergence operator, ▽ is a gradient operator, λ (lambda) is a time step parameter, cN, cS, cE, cW are diffusion coefficients representing the north, south, east, and west directions, respectively, ||▽I|| is the norm of the image gradient, K is an edge threshold parameter, S is a structure tensor, ▽I T is the transpose of the image gradient, σx, σy are the standard deviations of the Gaussian kernel function in the x and y directions, Σ is the summation symbol, λ1, λ2 are the eigenvalues ​​of the structure tensor, e1, e2 are the eigenvectors of the structure tensor, R is the anisotropy index, α (alpha) is the diffusion coefficient adjustment parameter, k is the scaling parameter of the anisotropy index, CDF is the cumulative distribution function, f(i) is the grayscale mapping transformation function, wk is the weight in the weighted average, HSV is the hue (Hue), saturation (Saturation), brightness (Value) color space, RGB is the red (Red), green (Green), blue (Blue) color space.

[0136] In another embodiment of the present application, the following steps may be used to assess the severity of a defect:

[0137] The Hierarchical Attention Residual Network (HARN) is used to evaluate the severity of defects. The network adaptively focuses on defect features of different scales through a multi-level attention mechanism, combines residual learning to improve the model's expressiveness, and outputs continuous severity scores and uncertainty estimates.

[0138] When calculating the overall quality score of a tablet or capsule, the following steps can also be used:

[0139] A multi-criteria decision-making model based on graph attention network (GAT-MCDM) is used to calculate the overall quality score. A quality feature map of tablets or capsules is constructed, and the complex interactions between features are captured through the graph attention layer. The fuzzy integral method is combined to aggregate multidimensional quality indicators to generate a comprehensive quality score and an explainable evaluation basis.

[0140] In another embodiment of the present application, the process of generating the defect feature vector may also adopt the following steps:

[0141] A comprehensive defect feature vector is generated using a multimodal feature fusion variational autoencoder (MM-FVAE); the model simultaneously encodes image, shape, and spectral information, learns shared representations between modalities by maximizing mutual information, and generates a highly compact and information-rich feature vector.

[0142] According to another aspect of the present application, there is also provided a debris detection and rejection device, comprising a high-definition camera, a reticulated projection unit, a vacuum suction and rejection unit, and a debris detection and rejection control unit;

[0143] The debris detection and rejection control unit includes:

[0144] at least one processor; and,

[0145] a memory communicatively connected to at least one of the processors; wherein,

[0146] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the fragment detection and removal method described in any of the above technical solutions.

[0147] In this device, purely visual counting and debris detection are used to eliminate the need for photoelectric counting and weighing debris detection equipment. After debris is found, the debris can be directly removed by the vacuum suction removal unit.

[0148] It should be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not further describe various possible combinations.

Claims

1. A debris detection and removal method, characterized in that: The steps include: Step S1, obtaining a video image of a predetermined time length, determining whether the shooting frequency of the high-definition camera matches the vibration frequency of the vibration plate, and if not, adjusting the parameters of the high-definition camera, the vibration plate and the reticulated projection unit until the shooting frequency of the high-definition camera matches the vibration frequency of the vibration plate; Step S2, acquiring an image sequence of a predetermined area from a high-definition camera illuminated by a reticulated projection; Preprocess and preliminarily segment the image sequence to obtain the segmented two-dimensional image mask of the tablet, and construct the two-dimensional and three-dimensional data sets of the tablet by combining the two-dimensional image mask; Step S3: Based on the two-dimensional and three-dimensional data sets, image registration and fusion are performed, and fine segmentation, texture analysis, shape analysis and spectral feature extraction are performed to obtain a comprehensive data set of pills; Step S4, reading the comprehensive data set, calling the pre-configured comprehensive defect feature vector, using the integrated learning module to finely classify the fine modules, and evaluating the severity of the defects according to the fine classification results, giving an overall quality score for the tablets; if the overall quality score is less than the threshold, issuing a rejection instruction to the rejection mechanism; The step S2 is specifically as follows: Step S21, generating a synchronous trigger signal to drive the dual high-definition cameras and the reticulated projection system to obtain an image sequence of a predetermined area; Step S22, applying an adaptive histogram equalization algorithm to the acquired image sequence to enhance the image contrast and obtain a preprocessed image; Step S23, using a Gaussian mixture model to perform foreground segmentation on the preprocessed image to obtain an initial segmentation result of the tablets; Step S24, applying morphological operations to the initial segmentation results, including opening and closing operations, to optimize the segmentation boundaries and obtain an accurate tablet image mask; Step S25, obtaining the reticulated projection image, applying the phase unwrapping algorithm, and reconstructing the three-dimensional surface model of the tablet; Step S26, registering the obtained two-dimensional image mask with the reconstructed three-dimensional surface model to preliminarily construct a complete two-dimensional and three-dimensional data set for each tablet; The step S3 is further as follows: Step S31, obtaining a predetermined area image sequence and corresponding three-dimensional point cloud data taken by a high-definition camera, constructing a multi-resolution representation through discrete wavelet transform, calculating mutual information at each resolution level using an adaptive random sampling strategy, and iteratively optimizing transformation parameters using an L-BFGS optimization algorithm to achieve sub-pixel precision registration of the two-dimensional image and the three-dimensional point cloud, and obtaining a registered image; Step S32: applying the SLIC algorithm to the registered image to generate multi-scale superpixels, performing region merging based on the similarity measurement of color and texture features, optimizing the segmentation boundaries using morphological post-processing, obtaining accurate segmentation masks for tablets of different sizes and shapes, and obtaining an accurately segmented image; Step S33, design a set of Gabor filters of different scales and directions, filter the segmented tablet image, extract frequency domain texture features, calculate rotationally invariant local binary pattern features on the filtered image, reduce the dimension by principal component analysis, and obtain a compact multi-scale texture descriptor, which is recorded as a multi-scale texture feature vector; Step S34, mapping the three-dimensional point cloud data of the tablet onto the unit sphere, calculating spherical harmonic coefficients of different orders to capture global shape features, calculating FPFH descriptors in local areas to describe local geometric structures, and obtaining three-dimensional shape features that can sensitively detect small deformations by weighted fusion of global and local features, which are recorded as three-dimensional shape feature vectors; Step S35, applying adaptive Wiener filtering to the multispectral image data of the tablets for denoising and enhancement, using non-negative matrix decomposition to decompose the spectral data into basic components and abundance maps, calculating an improved standardized difference index, obtaining spectral features sensitive to material changes, and outputting a spectral feature vector and an improved standardized difference index; Step S36: construct a comprehensive data set based on the multi-scale texture feature vector, the three-dimensional shape feature vector, the spectral feature vector and the improved normalized difference index.

2. The debris detection and elimination method according to claim 1, characterized in that: The step S1 is specifically as follows: Step S11, capturing a video clip of a predetermined length from the real-time video stream of the high-definition camera; Step S12, obtaining a vibration plate control signal, applying fast Fourier transform to analyze the vibration signal, and determining the vibration frequency and vibration start time of the vibration plate; Step S13, analyzing the captured video clips, calculating the number of frames per unit time, and obtaining the actual shooting frequency and shooting start time of the camera; Step S14, comparing the vibration frequency of the vibration plate and the camera shooting frequency, calculating the frequency ratio and error, and obtaining the frequency matching degree; Step S15, comparing the calculated frequency matching degree with a preset matching threshold to determine whether the frequencies match; Step S16: If the judgment result shows that the frequency does not match, the required adjustment amount is calculated, and an adjustment instruction is sent to the camera and the reticulated projection unit to update the camera parameters and the reticulated projection unit parameters, including the adjustment frequency and the starting time; Step S17, using the updated camera parameters and reticulated projection unit parameters, repeating steps S11 to S15 to verify the adjustment effect; Step S18: Check the updated matching status to confirm whether the adjustment is completed. If completed, send an adjustment completion signal.

3. The debris detection and elimination method according to claim 2, characterized in that: The step S4 is specifically as follows: Step S41, reading the comprehensive data set, applying the multi-core local preservation projection algorithm, combining multiple kernel functions to capture the nonlinear structure of the comprehensive data, retaining the local neighborhood relationship between samples through local preservation projection, and generating a low-dimensional and highly discriminative comprehensive defect feature vector; Step S42: construct an integrated learning framework based on random forest and AdaBoost, train multiple decision tree-based classifiers on randomly selected feature subsets, dynamically adjust sample weights and classifier weights through the AdaBoost algorithm, use the comprehensive defect feature vector as input data, finely classify the defects, obtain the classification results with expected accuracy, and output the defect category and classification confidence; Step S43, construct a fuzzy rule base based on the Mamdani model, take the comprehensive defect feature vector, defect category and classification confidence as input, apply the fuzzy inference system and combine it with the particle swarm optimization algorithm, obtain the defect severity score through fuzzy inference, and use the PSO algorithm to optimize the member function parameters and rule weights; Step S44, using the analytic hierarchy process to determine the weights of different quality indicators, combining the defect category and defect severity score, applying the TOPSIS method to comprehensively evaluate the distance between each tablet and the ideal solution and the negative ideal solution, and calculating the normalized overall quality score; Step S45: compare the calculated overall quality score with a preset threshold. If the score is less than the threshold, generate and send a rejection instruction to a rejection mechanism.

4. The debris detection and elimination method according to claim 3, characterized in that: The step S12 also includes using wavelet packet decomposition to perform multi-resolution decomposition of the signal, and finally applying an adaptive resonance theory network to adaptively identify the main frequency components to obtain an accurate vibration frequency of the vibration plate; specifically as follows: Step S121, calling a preconfigured wavelet basis function, decomposing the signal into a predetermined number of decomposition layers, and calculating the energy of each frequency band at each layer to construct an energy distribution feature vector; Step S122, calling the initialized ART network, setting the warning parameters and learning rate; taking the energy of each frequency band obtained by WPD as the input vector, and calculating the similarity with the existing category for each input vector; If the similarity is higher than the warning parameter, update the weight of the best matching category; otherwise, create a new category; Step S123, analyzing the categories formed by the ART network to determine the dominant frequency category; inversely deduce the corresponding frequency range based on the category center vector; within this frequency range, accurately locate the peak frequency using the result of fast Fourier transform to obtain the main frequency component; Step S124: dynamically adjust the number of decomposition layers and frequency band division of the WPD according to the identified main frequency components; and update the warning parameters of the ART network to adapt to the dynamic changes of the signal; Step S125: output the precise vibration frequency of the vibration disk and store the frequency characteristic vector for subsequent frequency matching and adjustment.

5. The debris detection and elimination method according to claim 3, characterized in that: The step S22 is further as follows: Step S221, obtaining the original image sequence, constructing the image diffusion equation, and initializing the diffusion coefficient to a constant; for each pixel, iteratively calculating its intensity value, and updating the diffusion coefficient according to the local gradient; repeating the iterative process until the preset conditions are met, and obtaining a preliminary denoised image; Step S222, read a portion of the image that has been initially denoised, calculate the structure tensor of the image, and then perform tensor voting in the neighborhood of each pixel, accumulate all voting results to obtain an optimized structure tensor; perform feature decomposition on the optimized structure tensor to obtain eigenvalues ​​and eigenvectors; calculate anisotropy indicators based on the eigenvalues ​​and eigenvectors, and update the diffusion coefficient accordingly; Using the updated diffusion coefficient, a second round of nonlinear diffusion is performed on the initially denoised image to obtain a refined image; Step S223, read the fine image, and divide it into multiple overlapping small blocks; calculate the histogram and cumulative distribution function for each small block; for each pixel, calculate the weighted average transformation function based on the cumulative distribution function of all overlapping blocks in which it is located; apply the transformation function to perform grayscale mapping on each pixel; to prevent over-enhancement, introduce a contrast limitation mechanism, and recalculate the cumulative distribution function and transformation function; for color images, apply equalization processing only to the brightness channel in the HSV color space, and then convert the result back to the RGB color space to finally obtain the preprocessed image.

6. The debris detection and elimination method according to claim 3, characterized in that: The step S25 is specifically as follows: Step S251, obtaining a reticulated projection image sequence, and applying a four-step phase shift method to calculate the wrapping phase; Step S252, constructing an energy function based on L0 norm minimization, including a data fidelity term and an L0 norm regularization term of a phase gradient; Step S253, using the alternating direction multiplier method to iteratively solve the energy function to obtain a preliminary unwrapped phase map; Step S254, analyzing the statistical characteristics of the local phase gradient and adaptively adjusting the regularization parameter; Step S255, repeat the optimization process of the alternating direction multiplier method to obtain a finely unwrapped phase map; Step S256, calculating the three-dimensional coordinates corresponding to each pixel by triangulation principle according to the system calibration parameters and the unwrapped phase image; Step S257, gridding the calculated three-dimensional point cloud data to construct a complete three-dimensional surface model of the tablet; Step S258: Smoothing the three-dimensional model and removing noise to obtain an accurate three-dimensional surface reconstruction result of the tablet.

7. The debris detection and elimination method according to claim 3, characterized in that: The step S41 is specifically as follows: S411, read the comprehensive data set, apply the multi-core local preservation projection algorithm, combine multiple kernel functions such as radial basis function kernel and polynomial kernel to capture the nonlinear structure of the data, retain the local neighborhood relationship between samples through local preservation projection, and generate an initial low-dimensional and highly discriminative comprehensive defect feature vector; S412, calculating the mutual information matrix between each feature in the initial feature vector, quantifying the correlation and redundancy between the features; applying the maximum correlation minimum redundancy criterion, preliminarily screening feature subsets with high discrimination and low redundancy; S413. Combine the conditional random field model to establish a probabilistic graph model for feature selection; use the conditional random field model to capture the contextual dependencies between features and dynamically adjust feature weights according to the feature requirements of different types of defects; By iteratively optimizing the parameters of the conditional random field model, the most discriminative feature subset is finally selected to generate the optimized comprehensive defect feature vector; The step S44 is specifically as follows: S441. Use the analytic hierarchy process to construct a quality evaluation system, combine the defect type, defect severity and quantity, and determine the initial weight of each quality indicator through expert scoring and consistency testing; Use fuzzy measures to represent the interaction between decision criteria, identify fuzzy measures by solving quadratic programming problems, capture nonlinear relationships between indicators, and output weights and fuzzy measures; S442. Based on the obtained weights and fuzzy measures, the TOPSIS method is applied to calculate the distance of each tablet from the ideal solution and the negative ideal solution in each indicator; at the same time, the Choquet integral is used to aggregate the scores of multiple quality indicators, considering the interaction between the indicators; S443, combining the results of TOPSIS method and Choquet integration, and calculating the final normalized overall quality score by weighted average method; According to the scoring results, the tablets or capsules are divided and sorted by quality grade, and the scoring results and quality grades are output.

8. A debris detection and removal device, characterized in that: It includes a high-definition camera, a screen projection unit, a vacuum suction and rejection unit, and a debris detection and rejection control unit; The debris detection and rejection control unit includes: at least one processor; and, a memory communicatively connected to at least one of the processors; wherein, The memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the debris detection and removal method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Drug particle intelligent detection system and method based on image processing

    CN120235871A

  • Intelligent detection system and method for pharmaceutical particles based on image processing

    CN120235871B