Medical instrument intelligent defect detection method and system based on image processing
By employing high-resolution image acquisition, multi-scale feature enhancement, and multi-model cross-validation, the problems of insufficient accuracy and poor adaptability in medical device testing are solved, achieving efficient and accurate defect detection and trend prediction, and improving the robustness and practicality of the system.
Patent Information
- Application Number
- CN202511658256.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-02-06
AI Technical Summary
Existing technologies for detecting defects in medical devices suffer from insufficient detection accuracy, poor adaptability, high false alarm rate, and lack of collaborative analysis of multi-dimensional features and long-term trend prediction capabilities, making it difficult to meet the detection needs of complex and variable surface materials and minute defects.
High-resolution image acquisition and adaptive standardization processing are employed, combined with multi-scale convolutional filtering and feature enhancement to generate anomaly-sensitive maps. Defects are confirmed through multi-model cross-validation and dynamic weight fusion, and trends are predicted by combining autoregressive models to form a closed-loop feedback optimization system.
It significantly improves the accuracy and efficiency of medical device defect detection, enhances the spatial accuracy and robustness of detection, strengthens the practicality and robustness of the system in different application scenarios, and ensures the quality and safety of medical devices.
Smart Images

Figure CN121481986A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical device quality inspection technology, specifically to an intelligent defect detection method and system for medical devices based on image processing. Background Technology
[0002] Currently, with the continuous improvement of precision and safety requirements in medical device manufacturing, traditional manual visual inspection or simple image processing methods face many challenges in surface defect detection. Medical device surfaces are made of diverse materials and have complex structures, and the defects are varied in shape and small in size, which places higher demands on the sensitivity and accuracy of detection. With the rapid development of machine vision and artificial intelligence technologies, automated detection methods based on image processing have become an important research direction in this field. Existing technologies mostly use conventional image processing or single machine learning models for defect identification.
[0003] Chinese invention patent CN120013951B discloses a machine vision-based method for full-process defect detection of endoscopic sampling forceps. The method processes image data through a multi-scale geometric perception feature extractor to generate a feature map set, and uses a location-adaptive attention module to identify key parts. A defect-sensitive residual network is used to enhance relevant defect features, and a medical-grade precision segmentation module is used to segment defects. The method is combined with an expert knowledge-guided self-calibration mechanism and a defect ontology knowledge base.
[0004] However, when faced with the complex and varied surface materials, reflective properties, and minute defect characteristics of medical devices, some detection systems still have certain limitations, such as insufficient detection accuracy, poor adaptability, and high false alarm rate. They also lack the ability to conduct collaborative analysis of multi-dimensional defect characteristics and predict long-term trends. Therefore, it is urgent to study a medical device defect detection scheme that can integrate multi-scale feature analysis, multi-model collaborative decision-making, and intelligent prediction functions to further improve the accuracy, robustness, and intelligence of detection. Summary of the Invention
[0005] The purpose of this invention is to address the problems existing in the background technology by proposing an intelligent defect detection method and system for medical devices based on image processing.
[0006] The technical solution of this invention: an intelligent defect detection method for medical devices based on image processing, comprising the following specific implementation steps: S1. Acquire multi-angle images of medical devices using a high-resolution industrial camera, and adaptively adjust lighting conditions and camera parameters to achieve image standardization processing. S2. Divide the standardized image into several local patch units, perform multi-scale convolutional filtering on each patch unit to extract texture and edge features, and then perform adaptive enhancement and multi-scale weighted fusion based on feature variance to generate an anomaly-sensitive map. S3. Based on anomaly-sensitive mapping, an initial anomaly candidate region is generated by dynamically calculating the anomaly score of each patch and comparing it with a dynamic threshold. The region is aggregated and isolated regions are eliminated using an exponentially weighted neighborhood similarity measure. Boundary sensitivity factor analysis and boundary optimization are performed on connected candidate regions to generate the final set of candidate defect regions. S4. Re-extract multi-scale semantic features and geometric features from the candidate defect region, adopt a multi-model cross-validation strategy and calculate the comprehensive confidence based on the dynamic weight fusion mechanism of the historical accuracy of each model to confirm the existence of the defect and determine the defect level. S5. Combining historical defect level sequences and environmental factor information, the defect development trend is predicted using a weighted smoothing autoregressive model, and the detection priority is dynamically updated and the image acquisition frequency and local analysis parameters are adjusted based on the prediction results.
[0007] Preferably, the generation of the anomaly-sensitive map in step S2 specifically includes: The standardized image is divided into several local patch units; Multi-scale convolutional filtering is performed on each Patch unit to obtain texture and edge feature representations at different scales; Adaptive enhancement based on feature variance is performed on the multi-scale features of each patch unit to highlight local texture anomalies through the enhancement function; The enhanced multi-scale features are weighted and fused, and the anomaly sensitivity value of each patch unit is calculated to form a preliminary anomaly map; The anomaly sensitivity value of each patch unit is weighted and exchanged with the information of its neighboring patch units to generate the final anomaly sensitivity mapping.
[0008] Preferably, step S3 generates the final candidate defect region set, specifically including: The anomaly-sensitive mapping is divided into patches, the local anomaly score of each patch is calculated, and a preliminary anomaly judgment threshold is dynamically generated based on the mapping mean and standard deviation. Patches with scores higher than the threshold are marked as preliminary anomaly candidate regions. For each preliminary anomaly candidate region, calculate its exponentially weighted similarity with the neighboring patch, aggregate regions according to an adaptive similarity threshold to form connected candidate regions, and remove isolated regions with areas below a set threshold. For each connected candidate region, the average anomaly score, local texture complexity index and variance of the patch in the region are statistically analyzed, a boundary sensitivity factor is constructed, and the boundary shrinkage and expansion are dynamically executed by optimizing the objective function. A multi-dimensional index system is constructed based on the regional average anomaly score, anomaly score standard deviation, texture complexity, boundary curvature, and semantic matching degree. The joint priority score of each candidate region is calculated, and the final corrected candidate region set is output through density adaptive clustering and redundant region removal and merging.
[0009] Preferably, a multi-model cross-validation strategy is used in step S4, specifically as follows: Three types of heterogeneous detection models are constructed, including a local texture detection model based on convolutional neural networks, a global context detection model based on transform attention mechanism, and a feature distribution anomaly model based on statistical learning. Each model independently calculates the defect probability for each candidate region and calculates a consistency metric between models to evaluate the stability of the judgment.
[0010] Preferably, the dynamic weight fusion mechanism in step S4 is as follows: The weights are dynamically allocated based on the accuracy of each model on historical samples, and the defect probability outputs of each model are weighted and fused to calculate the overall confidence level. The overall confidence level is compared with a dynamic threshold that is adaptively adjusted based on the historical confidence level distribution within the sliding window to ultimately confirm the existence of the defect.
[0011] Preferably, in step S4, the defect level is determined as follows: A defect level function is constructed based on the comprehensive confidence level, the texture complexity of the defect region, and the geometric anomaly, and the comprehensive level index is calculated. Based on the initial grade range set for different types of medical devices, and combined with the difference between the current batch and the historical average grade, an adaptive threshold correction is performed to output the defect severity grade. For each defect region, generate a structured output cell containing a region mask, grade label, scoring information, geometric center coordinates, and area percentage.
[0012] Preferably, in step S5, the defect development trend is predicted using a weighted smoothed autoregressive model, specifically as follows: For each defect region, a time series of defect levels is constructed, and a weighted smoothed autoregressive model is used to fit the historical evolution pattern to predict future defect levels. An environmental feature vector, including temperature, humidity, storage conditions, and usage frequency, is introduced, and a gradient boosting tree model is used to establish the correlation between environmental factors and changes in defect levels.
[0013] Preferably, in step S5, the detection priority is dynamically updated and the image acquisition frequency and local analysis parameters are adjusted based on the prediction results. Specific steps include: Calculate new detection priorities based on predicted future defect levels, current defect levels, and multi-model consistency metrics; Based on the updated priority, the image acquisition frequency is adaptively adjusted, and the local enhancement parameters, filtering coefficients, and confidence thresholds are optimized.
[0014] Preferably, image normalization processing includes adaptive adjustments to lighting conditions, exposure time, and camera orientation to overcome interference caused by the diversity of surface materials and reflective properties of medical devices.
[0015] The technical solution of the present invention: A medical device intelligent defect detection system based on image processing, which is used to execute the above-mentioned medical device intelligent defect detection method based on image processing, comprising: The image acquisition and preprocessing module is used to acquire multi-angle surface images of medical devices using a high-resolution industrial camera and an adjustable light source, and adaptively adjust the lighting conditions, exposure time and camera posture to complete the standardized processing of the images. The multi-scale local feature enhancement and anomaly-sensitive mapping module is used to divide the standardized image into several local patch units, and generate anomaly-sensitive mappings that quantify the degree of local anomalies by performing multi-scale convolutional filtering, adaptive enhancement based on feature variance, and multi-scale weighted fusion. The intelligent anomaly reasoning and candidate defect region generation module is used to perform dynamic anomaly scoring and threshold determination on anomaly sensitive mapping to generate preliminary candidate regions. It performs region aggregation and elimination through exponentially weighted neighborhood similarity measurement, and performs dynamic boundary optimization of connected regions based on boundary sensitivity factors and optimization objective functions. Finally, it outputs a set of candidate defect regions after redundancy elimination and hierarchical sorting. The precise defect confirmation and multi-model cross-validation module is used to re-extract multi-scale semantic features and geometric features from candidate defect regions. It employs a multi-model system, including convolutional neural networks, attention mechanisms, and statistical learning models, for cross-validation. It also calculates the comprehensive confidence level through a dynamic weight fusion mechanism to confirm the existence of defects and determine their level. The adaptive defect trend prediction and feedback optimization module is used to predict the defect development trend based on historical defect level sequences and environmental factor information through a weighted smooth autoregressive model. Based on the prediction results, it dynamically updates the detection priority, adjusts the image acquisition frequency, and optimizes local analysis parameters to form a closed-loop feedback optimization system.
[0016] Compared with the prior art, the above-mentioned technical solution of the present invention has the following beneficial technical effects: This invention designs an intelligent defect detection method and system for medical devices based on image processing. The method effectively overcomes interference caused by the diversity of surface materials and reflective properties of medical devices through high-resolution multi-angle image acquisition and adaptive standardized preprocessing, laying a high-quality data foundation for subsequent accurate analysis. In the feature extraction stage, a multi-scale local perception and adaptive enhancement strategy, combined with an anomaly-sensitive mapping generation mechanism, significantly improves the detection capability of defects such as micro-cracks, scratches, and pores, while effectively suppressing noise interference. Intelligent candidate region generation and optimization technology achieves precise positioning and boundary optimization of defect regions, improving the spatial accuracy of detection. The introduction of multi-model cross-validation and dynamic weight fusion mechanisms greatly improves the reliability and stability of defect identification, avoiding the risk of misjudgment that may exist with a single model. Furthermore, defect trend prediction is performed based on historical data and environmental factors, and detection strategies and parameters are dynamically adjusted, forming an efficient closed-loop feedback optimization system, realizing the adaptive and intelligent nature of the detection process. This invention not only significantly improves the accuracy and efficiency of medical device defect detection but also enhances the robustness and practicality of the system in different application scenarios, which is of great value in ensuring the quality and safety of medical devices. Attached Figure Description
[0017] Figure 1 This is a flowchart of an intelligent defect detection method for medical devices based on image processing proposed in this invention. Figure 2 This is a system architecture diagram of an image processing-based intelligent defect detection system for medical devices proposed in this invention. Detailed Implementation
[0018] Example 1, as Figure 1 As shown, the present invention proposes an intelligent defect detection method for medical devices based on image processing, which includes the following specific implementation steps: S1. In the medical device production or quality inspection process, multi-angle image acquisition is performed on the device to be tested, using a high-resolution industrial camera and adjustable light source to obtain surface texture, edge and microstructure information. During the acquisition process, the lighting conditions, exposure time, and camera posture are adaptively adjusted to complete the image standardization processing of instruments with different materials and surface reflective properties.
[0019] S2. By dividing the standardized image output from step S1 into local patches, multi-scale feature extraction, local enhancement, and anomaly-sensitive mapping are used to highlight the defect features such as micro-cracks, scratches, and pores in the local image, forming a quantifiable anomaly-sensitive map. The specific implementation process is as follows: S21. Divide the standardized image into multiple local perceptual units (Patches), and perform multi-scale convolutional filtering on each Patch to extract texture and edge features at different scales, so that minute defects can be perceived at different scales. At the same time, the optimal scale can be adaptively selected according to the local illumination and material of the Patch. Specifically: Standardized image I s Divide into multiple patch units according to fixed or adaptive size. Each patch is represented as a Patch. i,j ; Multi-scale convolutional filtering is performed on each patch to obtain texture and edge feature representations at different scales: ; in, The image pixel matrix of the i-th patch is obtained by normalizing the image in step S1 and represents the brightness and texture information of the local region. This represents the Gaussian filter kernel with a standard deviation of . It originates from the theory of multi-scale image processing and is used to extract texture and edge features at different scales; The parameter that controls the filtering scale can be adaptively selected based on the local characteristics of the patch (such as texture density and brightness). Small values highlight minute textures, while large values highlight the global structure. This represents the extracted k-th scale feature; S22. Adaptively enhance the multi-scale features of each patch by using variance weighting to highlight local texture anomalies, making minor defects such as cracks and scratches more obvious, while preserving information from normal areas. That is, for multi-scale features... Enhancement is performed, and an adaptive feature enhancement function is introduced: ; in, This indicates enhanced local features, highlighting subtle textures and anomalies; The variance of the patch features represents the richness of local texture. The larger the variance, the richer the texture, and the more likely it is to contain defect information. This represents the maximum variance of all patches, used for normalization to ensure that the enhancement coefficient is within a reasonable range. This represents the enhancement coefficient, which is adaptively adjusted based on the local brightness or material characteristics of the patch. It is used to control the enhancement intensity and is derived from the theory of local adaptive feature enhancement. S23. The enhanced local features are fused using multi-scale weighting to calculate the anomaly sensitivity value for each patch, quantify the degree of local anomalies, and form a preliminary anomaly map, enabling adaptive detection of minor defects. ; in, This represents the patch-level anomaly sensitivity value, used to quantify the degree of anomaly in this local area; The weights for each scale represent the importance of features at different scales for anomaly assessment and can be dynamically adjusted based on local texture density and defect sensitivity. This represents the mean of the k-th scale feature, used for feature centering; Represents: the standard deviation of the k-th scale feature, used to normalize feature bias; This represents a small constant to avoid division by zero and to smooth the normalization process; K represents the total number of scales, used for multi-scale feature fusion. S24. Anomaly sensitivity value for each patch It performs weighted information exchange with its adjacent patches to generate the final anomaly-sensitive mapping. : ; in, This represents the final anomaly-sensitive mapping value, which, combined with local patch and neighborhood information, outputs a globally optimized anomaly graph. Represents the local-global fusion coefficient, which can be adaptively adjusted to balance local sensitivity and global smoothness, derived from the theory of image smoothing and local consistency; Indicates the number of neighboring patches, used for mean calculation; This represents the summation of outlier values in the neighborhood patch, used to calculate the global average and suppress isolated noise false alarms. Patch i,j A neighborhood patch set is used for local-global information exchange.
[0020] S3. Based on the anomaly-sensitive map generated in step S2, pixel-level anomaly information is transformed into an operable set of candidate defect regions through intelligent anomaly reasoning and candidate region generation. That is, through dynamic anomaly scoring, neighborhood similarity aggregation, candidate region boundary optimization, and multi-index hierarchical assignment, accurate identification and priority ranking of minute defects are achieved, providing high-precision input for subsequent defect verification and classification. The specific implementation process is as follows: S31. The anomaly-sensitive mapping output in step S2 is divided into patches. An anomaly score is calculated for each patch. A preliminary threshold is dynamically generated using the mapping mean and standard deviation. Patches with scores higher than the threshold are marked as preliminary anomaly candidate regions, forming a discrete candidate patch set. This provides the basic input for neighborhood aggregation, i.e.: Anomaly-sensitive mapping generated in step S2 Divide the data into patches and calculate the local anomaly score for each patch. : ; in, This represents the mean of the entire anomaly mapping; This represents the standard deviation of the mapping, used to normalize the patch anomaly intensity and reduce the impact of global illumination and material differences. Based on the mapping mean with standard deviation Dynamically generate preliminary anomaly detection thresholds : ; in, The coefficient represents the value, which in this embodiment can be adaptively adjusted within the range of 1.0 to 2.5, depending on the surface characteristics of the instrument and the requirements for defect sensitivity. For each patch, determine: if If so, the patch is marked as a preliminary exception candidate patch and added to the preliminary candidate set. ; S32. Using an exponentially weighted neighborhood similarity metric, the initial abnormal patch is aggregated with neighboring patches to form connected candidate regions. Isolated or low-similarity patches are eliminated. That is, by combining local anomaly intensity and neighborhood consistency, local-global feature fusion is achieved, improving the accuracy of identifying minor connectivity defects while suppressing false positives from isolated noise. Specifically: For each initial anomaly candidate Patch P i,j Define its local neighborhood Patch set N i,j ; For each candidate Patch P i,j Calculate its similarity with neighboring patches. : ; in, This represents the similarity smoothing coefficient, which is adaptively set according to the distribution of local anomalies to control the sensitivity of score differences to the impact on similarity. Set an adaptive similarity threshold T for each patch sim ,like If the patch is positive, it is aggregated with neighboring abnormal patches to form a connected candidate region; otherwise, the patch may be removed to reduce false alarms from isolated noise. Patches that meet the similarity criteria are aggregated and identified using region labels to form a preliminary set of candidate connected regions. Each candidate region contains multiple patch information, including but not limited to patch coordinates, average anomaly score, local variance, etc., providing basic data for subsequent region optimization; The initial connected regions are locally smoothed, and patch regions with areas below a set threshold or isolated regions are removed to ensure the continuity and reliability of candidate regions. S33, Targeting Connected Candidate Regions By jointly analyzing anomaly distributions and texture features, the boundary adaptively shrinks or expands, thereby generating a set of candidate regions C with more reasonable structure and more accurate defect boundaries. opt Specifically: For each candidate region The average anomaly score of the patch within the statistical region. Local texture complexity index and variance : ; Based on this, a boundary sensitivity factor is constructed. : ; in, Indicates the area The number of pixels; Indicates the area Variance of internal abnormality scores; P represents the variance of texture features within a local patch; i,j Represents the local texture feature vector of pixel (i,j); Sensitive factors for boundaries Construct the optimization objective function for candidate region boundary patches. : ; in, , and These represent the weighting coefficients for anomaly scoring, texture complexity, and boundary constraints, which are adaptively determined through experience or learning. This represents the boundary optimization objective function value of the pixel patch; According to the optimization objective Compared with the overall reference threshold of the region Dynamically perform shrinking or expanding: like Then the Patch is marked as a bounded expandable region; like Then the Patch is marked as a contraction area; in, and Representing regions All The mean and standard deviation; This represents the dynamic adjustment coefficient, used to control the sensitivity of boundary expansion; Therefore: through iterative updates, the region contour gradually approximates the edge of the actual defect; It should be noted that when the optimization objective is... Compared with the overall reference threshold of the region When they are equal, the boundary patch is considered to be in a balance between anomaly intensity and regional stability. That is, the position does not belong to the high anomaly region that needs to be expanded, nor to the low anomaly region that needs to be shrunk. At this time, the algorithm keeps the boundary unchanged and only records the local features of the patch as the reference value for subsequent smoothing constraints. In the next iteration, the state is re-evaluated based on the dynamic changes of adjacent patches, so as to ensure the continuity of the boundary adjustment process and the stable convergence of the overall contour. After multiple iterative adjustments, a smoothing correction is performed on the boundary using two-dimensional Gaussian filtering or the neighborhood median method to ensure the boundary is continuous and physically reasonable. Simultaneously, the overlap ratio of the regions before and after the correction is calculated. : ; when Stop iterating when the system achieves stable convergence. After optimization, the final candidate region set C is output. opt Each region includes, but is not limited to: precise boundary coordinates, anomaly intensity statistics, texture stability index, and boundary sensitivity factor; in, and These represent the region states before and after the optimization iteration, respectively; S34. Optimization candidate region set C based on output opt By constructing a multi-dimensional anomaly feature quantification index system, hierarchical division and dynamic priority assignment are performed on each candidate region. A three-dimensional joint scoring mechanism of anomaly credibility, structural saliency, and semantic relevance is established to complete the orderly stratification and priority detection ranking of defect regions. Specifically: For each candidate region Extract three core metrics: Indicator 1: Regional Average Anomaly Score Standard deviation of anomaly rating This reflects the degree of anomaly significance and local volatility; Indicator 2: Structural Dimension Features: Texture Complexity With boundary curvature It is used to characterize the complexity of the defect shape and the smoothness of the boundary; Indicator 3: Semantic matching degree with standard template region Calculated using cosine similarity in feature space: ; in, Indicates candidate region The deep feature description vector; This represents the feature vector of a reference health device image; Construct a joint priority scoring function P k : ; in, Indicates candidate region C k Overall priority score; , and Represents the weighting coefficients, satisfying It can be adaptively learned through training data or set based on experience; and This represents the maximum value used for normalization, ensuring that weighted fusion can be performed under different dimensions; Based on P of all candidate regions k The distribution is determined using the Adaptive Density Clustering method, which automatically generates three layers of candidate regions: high confidence, medium confidence, and low confidence. Cluster boundaries are automatically determined by the local density change rate, eliminating the need for manually setting thresholds; Spatial overlap rate R between regions within the same layer ij semantic relevance S ij Perform combined inhibition: ; ; in, Indicates candidate region C i and C j The number of intersections of the patches; and Representing candidate regions C respectively i and C j The number of patches in each region; , Representing candidate regions C respectively i and C j The feature vector consists of local texture, anomaly score, and boundary features; Set threshold R th and S th ,like and Then the candidate region C is determined. i and C j Redundancy exists; Calculate the joint priority P for each region i P jPerform the following operations based on the comparison results: , ; Where \ denotes the set difference operation, that is, from {C i C j Remove the retained ones from the} What remains is the area to be deleted; This indicates the reserved region, which is the candidate region that is retained during the redundancy judgment process; This indicates the region to be deleted, i.e., the candidate region that is removed during the redundancy check. If the proportion of the overlapping area of two regions to the total area of either region is less than the merging threshold, they are merged into a new candidate region, ensuring that adjacent but not completely overlapping regions can also be processed uniformly, keeping the regions sparse and complete. Traversing C opt All candidate regions are compared pairwise, and redundant regions are gradually eliminated or merged. When no new redundant regions are deleted or merged after one round of traversal, the iteration is considered to have converged, and the final corrected candidate region set C is output. final .
[0021] S4. A precise defect confirmation mechanism based on multi-model cross-validation constructs an intelligent decision-making closed loop through four stages: feature re-extraction, multi-model consistency assessment, confidence fusion, and defect level confirmation, based on candidate regions. This enables accurate identification and grading of surface or structural defects in medical devices, ensuring the reliability and repeatability of test results. Specifically: S41. Re-extract multi-scale semantic and geometric features from candidate defect regions, and generate comprehensive feature vectors through a multi-branch network to simultaneously preserve texture, structural, and morphological information. This provides a unified and highly discriminative input feature foundation for multi-model cross-validation. Specifically: By constructing a multi-layer convolutional neural network, the input image is subjected to layer-by-layer convolution, pooling, and feature mapping to obtain multi-scale convolutional features. and in multi-scale convolutional features Building re-encoding features based on : ; Texture consistency features are extracted using a dual-branch network. With morphological geometric features This forms a comprehensive semantic feature vector. : ; Branch 1, Texture Consistency Branch: Utilizes local similarity convolution and directional gradient statistics to extract surface textures, particle distribution, and local roughness patterns in the region. Branch 2, Geometric Morphology Branch: By calculating the edge curvature change rate, regional principal direction deviation, and structural integrity index through the contour gradient field, the abnormal characteristics of the morphological structure are reflected. in, The adaptive weights of the feature at scale s are represented; S represents the number of convolutional layers. This indicates a global pooling operation; S42. A multi-model detection system is constructed based on convolutional models, attention models, and statistical models. This system independently outputs the defect probability of each region and introduces a consistency metric coefficient to measure the stability of judgments among the models, thereby quantifying the reliability of the multi-model approach. Specifically: A multi-model cross-validation strategy was adopted to construct three types of heterogeneous detection models, namely: Model 1: A local texture detection model based on convolutional neural networks; Model 2: A global context detection model based on transformation attention mechanism; Model 3: Feature Distribution Anomaly Model Based on Statistical Learning; For each candidate region Each model calculates the defect probability independently: ; Calculate consistency metrics between models : ; in, This represents the i-th independent model, used to determine the probability of defects in candidate regions; Indicates candidate region The defect probability output for the i-th model takes a value between [0,1]. This represents a multi-model consistency metric used to quantify the stability of judgments made by different models. This represents the variance function, used to measure the degree of dispersion of the outputs of the three models; This represents the mean function, which calculates the average value of the model's output. This represents a small constant to prevent the denominator from being zero, thus ensuring computational stability. S43. Based on the multi-model output, a confidence fusion mechanism is introduced, which dynamically adjusts the weights by combining the model's historical accuracy, and uses an adaptive threshold for defect confirmation to ensure that the system can automatically adjust the judgment criteria according to changes in the environment and equipment. Specifically: The overall confidence level is calculated using a dynamic weight fusion strategy. : ; The model's accuracy is dynamically updated through continuous operation: ; Based on the overall confidence level With dynamic threshold Defect confirmation: ; in, The Acc represents the historical reliability weight of the i-th model, calculated based on the model's accuracy on real-world data. j This represents the accuracy of the j-th model on historical samples; Indicates candidate region The overall defect confidence level; This represents a dynamic threshold that is adaptively adjusted based on the historical confidence distribution of candidate regions within the sliding window, and is used to determine whether a defect exists. This indicates the final defect determination; 1 indicates that a defect exists, and 0 indicates that a defect does not exist. S44. Construct a defect level function based on the fused confidence level, texture complexity, and geometric anomaly, quantify the severity of defects, and output the level results and location information; Define the defect level function: ; ; ; in, Indicates candidate defect region The comprehensive rating index; , and Represents the weighting coefficients of the rank function; The texture complexity of the defective region is defined as the weighted average of the region's gray-level variance and edge density. This represents the geometric anomaly index, used to quantify the degree of irregularity in the shape of defect boundaries; It represents the grayscale variance, reflecting the degree of brightness variation; This indicates edge density, reflecting the degree of density of edge line segments; Indicates the area The image pixel set; and B represents the weighting coefficient; i s represents the two-dimensional coordinate vector of the i-th sampling point on the boundary; h This represents the boundary arc length parameter, used to describe the relative position of a point on the boundary; N represents the second derivative (rate of change of curvature) at the boundary; k Indicates the number of boundary sampling points; Based on the differences in surface characteristics of different types of detection targets (such as surgical forceps, catheters, implanted stents, etc.), an initial grade range is defined: ; in, Indicates the defect area The determination level; T H and T L These represent the initial high and low thresholds for defect level classification, respectively; To prevent the fixed threshold from failing in batch detection, an adaptive correction function is introduced: ; ; in, and These represent the actual thresholds after adaptive correction, used for the current testing batch; This represents the dynamic adjustment coefficient, which controls the sensitivity of the threshold to batch differences; This represents the difference between the current batch and the historical average grade, quantified as a relative change ratio. After completing the classification, for each defect area Spatial location labeling and information binding, including but not limited to: Generate region mask , used to mark the boundary range of defects; Binding level tags and rating information ( , ); Additional location information tuple , in, Candidate region The geometric center (centroid); Candidate region The area ratio, in this embodiment, is the ratio of the number of pixels in a region to the number of pixels in the entire image; The above information is encapsulated into a structured output unit R. k : .
[0022] S5. Based on the defect level and spatial annotation results output in step S4, combined with historical defect evolution sequences and environmental factor information, the development trend of medical device defects is predicted, and the detection priority and strategy are dynamically adjusted based on the prediction results. Specifically: S51, For each candidate defect region Constructing a time series of defect levels By fitting historical evolution patterns using a weighted autoregressive model, historical rates of change are extracted. and volatility characteristics ; Predicting future defect levels using an autoregressive model with weighted smoothing (ARW): ; in, Indicates candidate defect region The defect level index in the t-th inspection; T represents the total number of inspections. Indicates candidate defect region Historical volatility; The standard deviation function is used to calculate the dispersion of numerical values in a sequence. Indicates candidate defect region The rank sequence obtained from the past n tests; Indicates candidate defect region The predicted defect level for the next inspection; The intercept term of the model, i.e., the bias, is used to characterize the baseline contribution of the historical data mean to the prediction result; p represents the order of the autoregressive model, i.e. the number of historical time points referenced in the prediction. Represents the regression coefficient of the i-th historical level in the AR model; Indicates candidate defect region The defect level at the i-th time point in the past; This represents the time-weighted coefficient, which applies weighted smoothing to historical data, giving higher weight to recent data and lower weight to older data. S52. To enhance the accuracy of the prediction model, for each defect area... Introducing environmental feature vectors Establish the correlation between defect levels and environmental factors: ; in, Indicates candidate defect region The environmental feature vector at the t-th detection, including but not limited to temperature, humidity, storage conditions, and usage frequency; Indicates candidate defect region In the t-th inspection, the change in the defect level compared to the previous inspection, i.e. the trend of increase or decrease in defect level; This represents the environmental factor correlation function, used to model the impact of environmental characteristics on the change of defect level. In this embodiment, a gradient boosting tree is used, and the parameter is obtained by training through historical data. S53. Generate future defect level predictions for each candidate region. And dynamically update the priority. : ; in, Indicates candidate defect region New testing priorities; , and This represents the weights of each item in the priority calculation, corresponding to the contributions of the trend prediction level, the current level, and the multi-model consistency index, respectively. These weights are set through training with historical data to meet certain requirements. ; This represents the multi-model consistency metric in step S4; S54. Adaptively adjust the detection strategy according to the update priority, including but not limited to: Image acquisition frequency adjustment: Increase the image acquisition frequency for high-priority areas and decrease the acquisition frequency for low-priority areas to save computing and storage resources; Detection parameter optimization: Automatically adjust local enhancement parameters (such as wavelet scale, filter coefficients, and confidence threshold) based on predicted trends and environmental factors to enhance the ability to identify minute defects; Closed-loop feedback: Each detection result is updated to the historical database, forming a closed-loop system of detection-prediction-optimization-re-detection, enabling long-term adaptive learning.
[0023] Example 2, as Figure 2 As shown, the present invention proposes an intelligent defect detection system for medical devices based on image processing, which is used to execute an intelligent defect detection method for medical devices based on image processing proposed in Embodiment 1. The system includes: an image acquisition and preprocessing module, a multi-scale local feature enhancement and anomaly sensitive mapping module, an intelligent anomaly reasoning and candidate defect region generation module, an accurate defect confirmation and multi-model cross-validation module, and an adaptive defect trend prediction and feedback optimization module.
[0024] The image acquisition and preprocessing module is used to acquire high-resolution images of the surface or structure of medical devices. It supports data acquisition under multiple angles and lighting conditions. The module has built-in preprocessing functions such as image denoising, contrast enhancement, and geometric correction to improve the signal-to-noise ratio and structural clarity of subsequent analysis. Through image standardization and preprocessing, it achieves preliminary visualization of candidate defect areas and provides high-quality input for local feature extraction. The multi-scale local feature enhancement and anomaly-sensitive mapping module is responsible for multi-scale local feature extraction and enhancement of the preprocessed image. It identifies potential anomaly information through different scale filtering, edge detection and texture analysis methods; generates anomaly-sensitive mapping map, highlights areas in the image that may have defects, and quantifies the anomaly intensity. The intelligent anomaly reasoning and candidate defect region generation module comprehensively analyzes the anomaly sensitive mapping map. Through local anomaly scoring, candidate region patch feature statistics, and boundary dynamic adjustment, it generates preliminary defect regions. It then optimizes the candidate regions using regional correlation correction and redundancy elimination algorithms, retaining high-scoring regions and merging low-scoring overlapping regions to achieve preliminary defect spatial localization and region division, providing input for accurate defect confirmation. The precise defect identification and multi-model cross-validation module performs detailed analysis on candidate defect regions, improves identification accuracy through multi-model cross-validation, and confirms defect levels by combining a level interval adaptive adjustment method. It integrates the outputs of different feature models to determine the spatial range, morphological characteristics, and severity of defects, achieving highly reliable defect identification and outputting standardized defect data for trend prediction. The adaptive defect trend prediction and feedback optimization module establishes a historical time series model for each confirmed defect area and performs trend prediction in combination with environmental factors. Based on the prediction results, it dynamically adjusts the detection priority, collection frequency and local analysis parameters to achieve adaptive detection strategy optimization. Through a closed-loop feedback mechanism, the prediction results are used to update the detection database and parameter configuration, ensuring that the system can continuously and efficiently perform defect detection and risk prevention under different environmental and usage conditions.
[0025] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited thereto. Various changes can be made within the scope of knowledge possessed by those skilled in the art without departing from the spirit of the present invention.
Claims
1. A method for intelligent defect detection of medical devices based on image processing, characterized in that, The specific implementation steps include the following: S1. Acquire multi-angle images of medical devices using a high-resolution industrial camera, and adaptively adjust lighting conditions and camera parameters to achieve image standardization processing. S2. Divide the standardized image into several local patch units, perform multi-scale convolutional filtering on each patch unit to extract texture and edge features, and then perform adaptive enhancement and multi-scale weighted fusion based on feature variance to generate an anomaly-sensitive map. S3. Based on anomaly-sensitive mapping, an initial anomaly candidate region is generated by dynamically calculating the anomaly score of each patch and comparing it with a dynamic threshold. The region is aggregated and isolated regions are eliminated using an exponentially weighted neighborhood similarity measure. Boundary sensitivity factor analysis and boundary optimization are performed on connected candidate regions to generate the final set of candidate defect regions. S4. Re-extract multi-scale semantic features and geometric features from the candidate defect region, adopt a multi-model cross-validation strategy and calculate the comprehensive confidence based on the dynamic weight fusion mechanism of the historical accuracy of each model to confirm the existence of the defect and determine the defect level. S5. Combining historical defect level sequences and environmental factor information, the defect development trend is predicted using a weighted smoothing autoregressive model, and the detection priority is dynamically updated and the image acquisition frequency and local analysis parameters are adjusted based on the prediction results.
2. The intelligent defect detection method for medical devices based on image processing according to claim 1, characterized in that, Step S2 generates anomaly-sensitive mappings, specifically including: The standardized image is divided into several local patch units; Multi-scale convolutional filtering is performed on each Patch unit to obtain texture and edge feature representations at different scales; Adaptive enhancement based on feature variance is performed on the multi-scale features of each patch unit to highlight local texture anomalies through the enhancement function; The enhanced multi-scale features are weighted and fused, and the anomaly sensitivity value of each patch unit is calculated to form a preliminary anomaly map; The anomaly sensitivity value of each patch unit is weighted and exchanged with the information of its neighboring patch units to generate the final anomaly sensitivity mapping.
3. The intelligent defect detection method for medical devices based on image processing according to claim 2, characterized in that, Step S3 generates the final candidate defect region set, specifically including: The anomaly-sensitive mapping is divided into patches, the local anomaly score of each patch is calculated, and a preliminary anomaly judgment threshold is dynamically generated based on the mapping mean and standard deviation. Patches with scores higher than the threshold are marked as preliminary anomaly candidate regions. For each preliminary anomaly candidate region, calculate its exponentially weighted similarity with the neighboring patch, aggregate regions according to an adaptive similarity threshold to form connected candidate regions, and remove isolated regions with areas below a set threshold. For each connected candidate region, the average anomaly score, local texture complexity index and variance of the patch in the region are statistically analyzed, a boundary sensitivity factor is constructed, and the boundary shrinkage and expansion are dynamically executed by optimizing the objective function. A multi-dimensional index system is constructed based on the regional average anomaly score, anomaly score standard deviation, texture complexity, boundary curvature, and semantic matching degree. The joint priority score of each candidate region is calculated, and the final corrected candidate region set is output through density adaptive clustering and redundant region removal and merging.
4. The intelligent defect detection method for medical devices based on image processing according to claim 3, characterized in that, Step S4 employs a multi-model cross-validation strategy, specifically as follows: Three types of heterogeneous detection models are constructed, including a local texture detection model based on convolutional neural networks, a global context detection model based on transform attention mechanism, and a feature distribution anomaly model based on statistical learning. Each model independently calculates the defect probability for each candidate region and calculates a consistency metric between models to evaluate the stability of the judgment.
5. The intelligent defect detection method for medical devices based on image processing according to claim 4, characterized in that, The dynamic weight fusion mechanism in step S4 is as follows: The weights are dynamically allocated based on the accuracy of each model on historical samples, and the defect probability outputs of each model are weighted and fused to calculate the overall confidence level. The overall confidence level is compared with a dynamic threshold that is adaptively adjusted based on the historical confidence level distribution within the sliding window to ultimately confirm the existence of the defect.
6. The intelligent defect detection method for medical devices based on image processing according to claim 5, characterized in that, In step S4, the defect level is determined as follows: A defect level function is constructed based on the comprehensive confidence level, the texture complexity of the defect region, and the geometric anomaly, and the comprehensive level index is calculated. Based on the initial grade range set for different types of medical devices, and combined with the difference between the current batch and the historical average grade, an adaptive threshold correction is performed to output the defect severity grade. For each defect region, generate a structured output cell containing a region mask, grade label, scoring information, geometric center coordinates, and area percentage.
7. The intelligent defect detection method for medical devices based on image processing according to claim 6, characterized in that, In step S5, the defect development trend is predicted using a weighted smoothed autoregressive model, specifically as follows: For each defect region, a time series of defect levels is constructed, and a weighted smoothed autoregressive model is used to fit the historical evolution pattern to predict future defect levels. An environmental feature vector, including temperature, humidity, storage conditions, and usage frequency, is introduced, and a gradient boosting tree model is used to establish the correlation between environmental factors and changes in defect levels.
8. The intelligent defect detection method for medical devices based on image processing according to claim 7, characterized in that, Step S5 involves dynamically updating the detection priority and adjusting the image acquisition frequency and local analysis parameters based on the prediction results. Specific steps include: Calculate new detection priorities based on predicted future defect levels, current defect levels, and multi-model consistency metrics; Based on the updated priority, the image acquisition frequency is adaptively adjusted, and the local enhancement parameters, filtering coefficients, and confidence thresholds are optimized.
9. The intelligent defect detection method for medical devices based on image processing according to claim 1, characterized in that, Image normalization processing includes adaptive adjustments to lighting conditions, exposure time, and camera orientation to overcome interference caused by the diversity of surface materials and reflective properties of medical devices.
10. A medical device intelligent defect detection system based on image processing, used to execute the medical device intelligent defect detection method based on image processing according to any one of claims 1 to 9, characterized in that, include: The image acquisition and preprocessing module is used to acquire multi-angle surface images of medical devices using a high-resolution industrial camera and an adjustable light source, and adaptively adjust the lighting conditions, exposure time and camera posture to complete the standardized processing of the images. The multi-scale local feature enhancement and anomaly-sensitive mapping module is used to divide the standardized image into several local patch units, and generate anomaly-sensitive mappings that quantify the degree of local anomalies by performing multi-scale convolutional filtering, adaptive enhancement based on feature variance, and multi-scale weighted fusion. The intelligent anomaly reasoning and candidate defect region generation module is used to perform dynamic anomaly scoring and threshold determination on anomaly sensitive mapping to generate preliminary candidate regions. It performs region aggregation and elimination through exponentially weighted neighborhood similarity measurement, and performs dynamic boundary optimization of connected regions based on boundary sensitivity factors and optimization objective functions. Finally, it outputs a set of candidate defect regions after redundancy elimination and hierarchical sorting. The precise defect confirmation and multi-model cross-validation module is used to re-extract multi-scale semantic features and geometric features from candidate defect regions. It employs a multi-model system, including convolutional neural networks, attention mechanisms, and statistical learning models, for cross-validation. It also calculates the comprehensive confidence level through a dynamic weight fusion mechanism to confirm the existence of defects and determine their level. The adaptive defect trend prediction and feedback optimization module is used to predict the defect development trend based on historical defect level sequences and environmental factor information through a weighted smooth autoregressive model. Based on the prediction results, it dynamically updates the detection priority, adjusts the image acquisition frequency, and optimizes local analysis parameters to form a closed-loop feedback optimization system.
Citation Information
Patent Citations
Full-process Defect Detection Method for Endoscopic Sampling Forceps Based on Machine Vision
CN120013951B
Printing quality detection method and device based on machine learning
CN120765567A
Cited By
Intelligent historical relic image texture enhancement method and system
CN121921232A
Water supply pipeline defect detection method and system based on image processing
CN122156193A