Intelligent detection method and system for section ovality of medical wire
Through intelligent detection methods, image processing and elliptic scoring model are used to realize automated and accurate detection of the ellipticity of medical wire cross-sections, solving the problem of low accuracy of detection results in traditional methods.
Patent Information
- Application Number
- CN202510142952.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-03-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional physical measurement and visual inspection methods rely on sampling inspection and cannot guarantee the consistency of quality of all medical wires, resulting in low accuracy of the detection results.
Intelligent detection method is adopted to obtain wire cross-sectional images, contour extraction, ellipse fitting, ellipse scoring model evaluation and abnormal detection, and automatic and accurate detection of the ellipse of medical wire cross-sectional areas.
It improves the accuracy and consistency of cross-sectional ellipticity detection of medical wires, ensures that the quality of all wires meets the standards, and reduces the uncertainty of the detection results.
Smart Images

Figure CN119600086A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent detection technology, and in particular to an intelligent detection method and system for the cross-sectional ovality of a medical wire. Background Art
[0002] As an important part of medical equipment, the performance of medical wires directly affects the reliability and safety of medical equipment. In hospitals, clinics and other medical institutions, from electrocardiographs, ultrasonic equipment to complex magnetic resonance imaging systems, high-quality wires are indispensable to ensure accurate signal transmission and power supply. Due to the particularity of the medical environment, the requirements for these wires are not limited to conventional electrical performance, but also include biocompatibility, resistance to chemical corrosion, and stability in long-term use. Therefore, compared with ordinary household or industrial electrical wires, medical wires must follow more stringent quality control standards to ensure that they can adapt to various complex and changeable medical application scenarios. The ellipticity affects the electrical properties of wires and cables, including conductor resistance and insulation resistance. Wires with larger ellipticity produce uneven stress distribution in the conductor and insulation layer, which affects the resistance value of the wire and the quality of signal transmission. Therefore, it is very important to detect the cross-sectional ellipticity of hospital wires.
[0003] In one prior art, in order to ensure that the cross-sectional ovality of medical wires meets the specified requirements, a method is adopted that combines physical measurement and visual inspection. First, the wires are sampled and inspected during the manufacturing process. A certain number of samples are selected and the cross-sections of the samples are measured using precision instruments such as optical microscopes or laser rangefinders. Then, the obtained data is compared and analyzed with the pre-set standard values. If the ovality of any sample is found to be outside the allowable range, the batch of products needs to be further reviewed or even recalled. In addition, some manufacturers also use automated testing equipment to quickly scan each wire at the end of the production line to ensure the consistency and reliability of the products leaving the factory.
[0004] However, traditional physical measurement and visual inspection rely on sampling inspection, which means that only a portion of the products will be strictly inspected. This method cannot guarantee the quality consistency of all products, because the defects of wires that are not sampled are not discovered, resulting in low accuracy of the final inspection results. Summary of the invention
[0005] The present invention provides an intelligent detection method and system for the cross-sectional ovality of a medical wire, so as to improve the detection accuracy of the cross-sectional ovality of the medical wire.
[0006] In a first aspect, in order to solve the above technical problems, the present invention provides an intelligent detection method for the cross-sectional ellipticity of a medical wire, comprising: Acquire wire cross-section images; Performing contour extraction according to the wire cross-section image to obtain a wire contour image; Performing ellipse fitting according to the wire contour image to calculate the optimal ellipse parameters; Inputting the optimal ellipse parameters into a pre-trained ellipse scoring model, and outputting an ellipse score and a confidence level; Perform anomaly detection according to the ellipticity score and the confidence level, and calculate an anomaly evaluation score; According to the abnormal evaluation score and a preset evaluation threshold, the cross-sectional ovality detection result of the wire is output.
[0007] In an optional implementation, extracting a contour according to the wire cross-section image to obtain a wire contour image includes: grayscale the wire cross-section image to obtain a first grayscale wire cross-section image; Performing noise reduction processing on the first grayscale wire cross-section image to obtain a second grayscale wire cross-section image; Edge detection is performed based on the second grayscale wire cross-section image to obtain a wire contour image.
[0008] In an optional implementation, performing ellipse fitting according to the wire contour image to calculate optimal ellipse parameters includes: Sampling is performed according to the wire contour image to obtain the coordinates of the wire contour points; Randomly initialize the ellipse parameters; The mean square error is calculated using the following formula: in, is the mean square error, for i The horizontal coordinate of the wire contour point, for i The ordinate of the wire contour point, i Number the wire outline points, n is the total number of wire contour points, is the semi-major axis of the ellipse, b is the semi-minor axis of the ellipse, is the rotation angle of the ellipse, is the horizontal coordinate of the ellipse center, is the ordinate of the ellipse center coordinate; The ellipse parameters include: the semi-major axis, the semi-minor axis, the rotation angle, and the center coordinates of the ellipse; The ellipse parameters corresponding to the minimum mean square error are taken as the optimal ellipse parameters.
[0009] In an optional implementation, the training process of the elliptical scoring model includes: An ellipse scoring model is constructed based on historical ellipse parameters, the model is trained, and the training is determined to be complete after the loss function of the detection model meets the conditions, thereby obtaining a trained ellipse scoring model; The optimal ellipse parameters are input into the trained ellipse scoring model to obtain the ellipse score and confidence.
[0010] In an optional implementation, performing anomaly detection based on the ellipticity score and the confidence level to calculate an anomaly evaluation score includes: The normalized confidence is calculated by the following formula: The abnormal evaluation score is calculated using the following formula: in, is the abnormal evaluation score, is the total number of wire cross-sections, is the wire cross-section number, for m The ovality score corresponding to the wire cross section is is the average value of the ellipticity score, D is the normalized confidence, is the confidence level, is the preset confidence threshold.
[0011] In an optional implementation, outputting the cross-sectional ovality detection result of the wire according to the abnormal evaluation score and a preset evaluation threshold value includes: When the abnormal evaluation score is higher than the preset evaluation threshold, the ovality test result of the wire is unqualified; When the abnormal evaluation score is lower than the evaluation threshold, the ovality detection result of the electric wire is qualified.
[0012] In an optional implementation, before extracting the contour according to the wire cross-section image to obtain the wire contour image, the method further includes: Performing noise evaluation on the wire cross-section image to obtain an image noise ratio; When the image noise ratio is greater than a preset noise threshold, the wire cross-section image is removed and no subsequent operation is performed; When the image noise ratio is less than a preset noise threshold, subsequent operations are continued on the wire cross-section image.
[0013] In a second aspect, the present invention provides an intelligent detection system for the cross-sectional ovality of a medical wire, comprising: A data acquisition module, used for acquiring a cross-sectional image of the wire; A contour extraction module, used for performing contour extraction based on the wire cross-section image to obtain a wire contour image; An ellipse fitting module, used for performing ellipse fitting according to the wire contour image, and calculating the optimal ellipse parameters; An ellipticity scoring module, used to input the optimal ellipticity parameters into a pre-trained ellipticity scoring model and output an ellipticity score and a confidence level; A comprehensive scoring module, used to perform anomaly detection based on the ellipticity score and the confidence level, and calculate an anomaly evaluation score; The result output module is used to output the cross-sectional ovality detection result of the wire according to the abnormal evaluation score and the preset evaluation threshold.
[0014] In a third aspect, the present invention also provides an electronic device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the intelligent detection method for the cross-sectional ellipticity of the medical wire described in any one of the above is implemented.
[0015] In a fourth aspect, the present invention further provides a computer-readable storage medium, the computer-readable storage medium comprising a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned intelligent detection methods for the cross-sectional ellipticity of the medical wire.
[0016] Compared with the prior art, the present invention has the following beneficial effects: the present invention discloses an intelligent detection method and system for the cross-sectional ellipticity of medical wires, the method comprising obtaining a cross-sectional image of the wire; performing contour extraction according to the cross-sectional image of the wire to obtain a wire contour image; performing ellipse fitting according to the wire contour image to calculate the optimal ellipse parameters; inputting the optimal ellipse parameters into a pre-trained ellipse scoring model to output an ellipse score and a confidence level; performing anomaly detection according to the ellipse score and the confidence level to calculate an anomaly evaluation score; and outputting the cross-sectional ellipticity detection result of the wire according to the anomaly evaluation score and a preset evaluation threshold. The present method can improve the accuracy of the ellipticity detection of medical wires.
[0017] Specifically, in order to accurately calculate the best fitting ellipse parameters of the wire contour. The specific process is to extract a series of contour points from the wire contour image as basic data. Then, set some initial ellipse parameters, which are used to describe the shape, size, rotation angle and center position of the ellipse. In order to evaluate the degree of match between the assumed ellipse and the actual wire contour, an error measurement standard is defined. Through this standard, the deviation between the ellipse model and the actual data can be quantitatively expressed. Next, the optimization algorithm is used to continuously adjust the ellipse parameters in order to minimize this error. Finally, the set of ellipse parameters corresponding to the minimum error is determined as the optimal parameters. This method can effectively extract a concise and representative ellipse model from a complex wire contour image, thereby improving the accuracy and reliability of ellipticity measurement. This method realizes the automated detection of the cross-sectional shape of the wire.
[0018] Furthermore, in the intelligent detection method of the cross-sectional ellipticity of medical wires, in order to ensure the quality control of the wires, an elliptic scoring model obtained by training based on historical data is used to evaluate the ellipticity and confidence. This process first involves building an elliptic scoring model, which is established by analyzing the elliptic parameters in past records. This model is iteratively trained multiple times until the preset number of training times is reached or the loss function meets certain conditions, thereby obtaining a fully trained elliptic scoring model. After the above elliptic scoring model is trained, the previously determined optimal elliptic parameters can be input into this model to obtain the ellipticity score corresponding to each wire cross section and its corresponding confidence. Next, an anomaly detection step is performed based on the ellipticity score and confidence, which is intended to calculate the anomaly evaluation score to determine whether each wire cross section meets the quality standard. For the calculation of the normalized confidence, a binary judgment rule is introduced here, that is, if the confidence exceeds the set threshold, the normalized confidence takes 1; otherwise, the normalized confidence takes 0. This approach emphasizes that the prediction result is considered valid only when the model prediction has a sufficiently high confidence. The calculation of the abnormal evaluation score combines the absolute value of the difference between the ovality score of all wire sections and their average value and multiplies it by the normalized confidence. This not only takes into account the degree to which the ovality score of a single section deviates from the overall level, but also takes into account the reliability of the model's prediction results. By averaging the differences in the scores of all sections, an indicator that reflects the consistency of the cross-sectional shape of the entire wire can be obtained.
[0019] Finally, the cross-sectional ovality test result of the wire is output based on the comparison between the abnormal evaluation score and the pre-set evaluation threshold. If the abnormal evaluation score is higher than the threshold, it means that the ovality of the wire does not meet the requirements and is marked as unqualified; conversely, if it is lower than or equal to the threshold, the wire is considered qualified. This method provides an objective and quantitative means to judge the cross-sectional ovality of the wire, which helps to improve the accuracy of the cross-sectional ovality detection of medical wires. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a schematic flow chart of an intelligent detection method for the cross-sectional ovality of a medical wire provided by the first embodiment of the present invention; Figure 2 It is a schematic diagram of the structure of an intelligent detection system for the cross-sectional ovality of a medical wire provided by the second embodiment of the present invention. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] As an important part of medical equipment, the performance of medical wires directly affects the reliability and safety of medical equipment. In medical institutions such as hospitals and clinics, from electrocardiographs, ultrasound equipment to complex magnetic resonance imaging systems, high-quality wires are indispensable to ensure accurate signal transmission and power supply. Due to the particularity of the medical environment, the requirements for these wires are not limited to conventional electrical performance, but also include biocompatibility, chemical corrosion resistance, and stability in long-term use. Therefore, compared with ordinary household or industrial electrical wires, medical wires must follow more stringent quality control standards to ensure that they can adapt to various complex and changing medical application scenarios. In terms of ensuring the performance of medical wires, there are many factors that need to be considered in its design and manufacturing process. For example, the conductivity of the wire must meet the needs of accurate transmission of medical device signals, while its insulation material must ensure safety when used inside the human body. In addition, medical wires also need to be flexible enough to adapt to different medical devices and operating environments, while maintaining durability in long-term and repeated use. The ellipticity affects the electrical properties of wires and cables, including conductor resistance and insulation resistance. Wires with large ovality produce uneven stress distribution in the conductor and insulation layer, which affects the resistance value and signal transmission quality of the wire. Therefore, it is very important to detect the cross-sectional ovality of hospital wires.
[0023] In one prior art, in order to ensure that the cross-sectional ovality of medical wires meets the specified requirements, a method is adopted that combines physical measurement and visual inspection. First, the wires are sampled and inspected during the manufacturing process. A certain number of samples are selected and the cross-sections of the samples are measured using precision instruments such as optical microscopes or laser rangefinders. Then, the obtained data is compared and analyzed with the pre-set standard values. If the ovality of any sample is found to be outside the allowable range, the batch of products needs to be further reviewed or even recalled. In addition, some manufacturers also use automated testing equipment to quickly scan each wire at the end of the production line to ensure the consistency and reliability of the products leaving the factory.
[0024] However, traditional physical measurement and visual inspection rely on sampling inspection, which means that only a portion of the products will be strictly inspected. This method cannot guarantee the quality consistency of all products, because the defects of wires that are not sampled are not discovered, resulting in low accuracy of the final inspection results.
[0025] To solve the above problems, refer to Figure 1 The first embodiment of the present invention provides an intelligent detection method for the cross-sectional ellipticity of a medical wire, comprising the following steps: S11, obtaining a cross-sectional image of the wire; S12, performing contour extraction according to the wire cross-section image to obtain a wire contour image; S13, performing ellipse fitting according to the wire contour image to calculate optimal ellipse parameters; S14, inputting the optimal ellipse parameters into a pre-trained ellipse scoring model, and outputting an ellipse score and a confidence level; S15, performing anomaly detection according to the ellipticity score and the confidence level, and calculating an anomaly evaluation score; S16, outputting the cross-sectional ovality detection result of the wire according to the abnormality evaluation score and the preset evaluation threshold.
[0026] In step S11 , a wire cross-sectional image is acquired.
[0027] In one embodiment, an embodiment of obtaining a cross-sectional image of a wire may include the following sub-steps: First, a sample of medical wire to be tested needs to be prepared. The wire sample is cut to expose its cross section. The processed wire cross section is fixed on an appropriate platform to ensure that it remains stationary during the entire image acquisition process. At the same time, the position is adjusted so that the cross section can be fully captured by an imaging device such as a camera or scanner. The wire cross section is photographed or scanned using a selected imaging device to obtain an original cross-sectional image. After the initial image is obtained, a preliminary inspection is performed to confirm whether the image meets the analysis requirements. If the image is found to be blurred or lacks contrast, it is necessary to adjust the device parameters for re-acquisition, or pre-process the existing image (such as enhancing contrast, sharpening, etc.) to improve its quality.
[0028] In step S12, contour extraction is performed based on the wire cross-section image to obtain a wire contour image.
[0029] In one implementation, the wire cross-section image is grayed to obtain a first gray-scale wire cross-section image; the first gray-scale wire cross-section image is denoised to obtain a second gray-scale wire cross-section image; and edge detection is performed based on the second gray-scale wire cross-section image to obtain a wire contour image.
[0030] It is worth noting that the purpose of grayscale processing is to convert the color wire cross-section image into a grayscale image. The grayscale conversion formula is used to convert the color information of each pixel from RGB The three-channel values are converted into a single brightness value. The grayscale conversion formula used in this method is: in, is the gray value of the pixel, R, G, B Represents the three color components red, green and blue respectively.
[0031] The purpose of noise reduction is to reduce or eliminate noise in the image and improve image quality. A Gaussian blur filter algorithm is applied to the first grayscale wire cross-section image to remove noise. After noise reduction, a second grayscale wire cross-section image is obtained, which is characterized by a reduced noise level and a clearer wire contour. The purpose of edge detection is to detect and highlight the wire contour to facilitate the subsequent ellipse fitting operation. The Canny edge detection algorithm is applied to the second grayscale wire cross-section image. Including: calculating the gradient magnitude (i.e., gradient strength) at each pixel and the direction of the gradient. Compare the current pixel with other pixels in its neighborhood along the gradient direction. If the current pixel is not a local maximum, it is suppressed (set to zero), otherwise it is retained. This method can help eliminate non-edge responses and make the final edge more slender and smooth. Finally, the Canny algorithm uses a dual threshold strategy to distinguish strong edges from weak edges. Specifically, two thresholds are set - a high threshold TH and a low threshold TL. When the gradient strength of a pixel exceeds TH, it is marked as a strong edge; if it is between TL and TH, it is regarded as a weak edge; and pixels below TL are considered to be part of the background. For those pixels marked as weak edges, they will be retained as true edge parts only if there is at least one strong edge pixel in the connected area. At this point, the wire contour image is retained.
[0032] In step S13, an ellipse fitting is performed according to the wire contour image to calculate the optimal ellipse parameters.
[0033] In one implementation, sampling is performed based on the wire contour image to obtain the wire contour point coordinates; Randomly initialize the ellipse parameters; The mean square error is calculated using the following formula: in, is the mean square error, for i The horizontal coordinate of the wire contour point, for i The ordinate of the wire contour point, i Number the wire outline points, n is the total number of wire contour points, is the semi-major axis of the ellipse, b is the semi-minor axis of the ellipse, is the rotation angle of the ellipse, is the horizontal coordinate of the ellipse center, is the ordinate of the ellipse center coordinate; The ellipse parameters include: the semi-major axis, the semi-minor axis, the rotation angle, and the center coordinates of the ellipse; The ellipse parameters corresponding to the minimum mean square error are taken as the optimal ellipse parameters.
[0034] It is worth noting that, first, a series of discrete points are extracted from the wire contour image as the coordinates of the wire contour points. The initialization method can constrain the range of parameter values by setting ranges or boundary conditions to ensure that the initial guess is reasonable and close to the actual situation. For example, for the center coordinates, it can be estimated based on the approximate distribution of the contour points; and for the major and minor semi-axes, a preliminary estimate can be made based on the maximum and minimum distances of the contour. This formula actually measures the sum of the squares of the distances from each contour point to the ideal ellipse boundary, reflecting the degree of difference between the current ellipse model and the actual contour. The last step is to iteratively update the ellipse parameters until the set of parameters that minimize the mean square error is found.
[0035] In one embodiment, the random sampling consensus algorithm constructs a hypothetical model by randomly selecting a subset and testing whether other points in the entire data set conform to this model, thereby screening out "inliers", that is, those data points that are most likely to belong to the true ellipse. A minimum number of sample points are randomly selected from a data set containing potential noise and outliers, and the number of these points depends on the type of model to be fitted. For example, for a straight line fit, at least two points are required; for a plane fit, at least three non-collinear points are required; and for an ellipse fit, five points are selected. All remaining data points are brought into the newly established model for verification. If the distance from a point to the model is less than a preset threshold, it is considered an inlier; otherwise, it is considered an outlier. When the predetermined maximum number of iterations is reached, or the inlier rate of the current optimal model reaches the set threshold, it means that a sufficiently good model has been found.
[0036] In another embodiment, the ellipse parameters are iterated using the gradient descent method. In order to update the parameters, it is necessary to calculate the partial derivative of the objective function with respect to each parameter, i.e., the gradient. For gradient descent in multidimensional parameter space, this means solving the mean square error with respect to is the semi-major axis of the ellipse, b is the semi-minor axis of the ellipse, is the rotation angle of the ellipse, is the horizontal coordinate of the ellipse center, is the partial derivative of the ordinate of the ellipse center coordinate; Update the ellipse parameters according to the following rules: in, is the iteration value, is the old value, is the learning rate is the partial derivative. For the above or ; The above process of calculating gradients and updating parameters is repeated until the change in the objective function is lower than a preset threshold or a predetermined maximum number of iterations is reached.
[0037] In step S14, the optimal ellipse parameters are input into a pre-trained ellipse scoring model, and the ellipse score and confidence are output.
[0038] In one embodiment, an ellipse scoring model is constructed based on historical ellipse parameters, the model is trained, and the training is determined to be completed after the loss function of the detection model meets the conditions, thereby obtaining a trained ellipse scoring model; the optimal ellipse parameters are input into the trained ellipse scoring model to obtain the ellipse score and confidence.
[0039] It is worth noting that in the process of model training, first of all, a series of known ellipse instances and their corresponding ellipse scores and confidence labels need to be collected as training data. In the field of image processing, each detected ellipse can be assigned an ellipse score (a measure of the quality of the ellipse shape) and a confidence level (indicating the probability that the ellipse belongs to the target category) by manual annotation. In addition, the training set can be expanded using synthetic data augmentation technology. Training is performed based on historical ellipse parameters and historical ellipse scores.
[0040] In one embodiment, the elliptical scoring model is trained based on the DNN model. The historical data set is reduced in dimension using the principal component analysis method. For the elliptical scoring model, considering the number and complexity of the input features, a fully connected network containing 2 to 3 hidden layers can be selected. Each hidden layer in each layer contains 64 to 256 neurons. For the elliptical scoring model, since the output is a continuous value, it is more suitable to use a linear activation function; the output includes probability distributions such as confidence, and the Softmax probability activation function is used. In terms of the choice of loss function, for classification tasks or prediction tasks with uncertainty (such as confidence estimation in this example), the cross entropy loss function is a better option because it can better capture the difference in probability distribution between different categories. The optimizer is responsible for updating the network weights to minimize the loss function. Adam has become a widely used default choice because it combines the advantages of momentum method and adaptive learning rate. It can not only converge quickly in the early stage, but also maintain good generalization performance in the later stage. Finally, the hyperparameters are set to complete the training of the model. When the number of model training is greater than or equal to the preset maximum number of training times, or the loss function value of the model is less than the preset loss threshold, the model training is determined to be completed.
[0041] In step S15, anomaly detection is performed based on the ellipticity score and the confidence level, and an anomaly evaluation score is calculated.
[0042] In one implementation, the normalized confidence is calculated using the following formula: The abnormal evaluation score is calculated using the following formula: in, is the abnormal evaluation score, is the total number of wire cross-sections, is the wire cross-section number, for m The ovality score corresponding to the wire cross section is is the average value of the ellipse score, D is the normalized confidence, is the confidence level, is the preset confidence threshold.
[0043] It is worth noting that the logic here is that only when the model is very confident in the prediction of the elliptical shape (i.e., the confidence is high), will its ellipticity score be considered for subsequent comprehensive evaluation. Otherwise, those results with low confidence will be ignored to prevent them from affecting the quality of the overall evaluation. Specifically, the function of this formula is to calculate the degree to which the ellipticity score of each wire section deviates from the average value and multiply it by the corresponding normalized confidence. Then these weighted deviations are summed and averaged to obtain the abnormal evaluation score. This approach can effectively highlight those elliptical features that are both in line with the expected shape and have a high degree of confidence, while weakening the influence of those uncertain factors. For example: there are five wire sections, whose ellipticity scores are 0.8, 0.7, 0.9, 0.6, and 0.5, respectively, and the confidence levels are 0.9, 0.6, 0.8, 0.7, and 0.4, respectively. At the same time, the confidence threshold is 0.7. Then the final score calculation result is 0.111. The weighted deviation between the ellipticity score representing the wire section and the average value is small, which means that the wire section shape is more consistent and reliable overall. Wire cross-section 5 and wire cross-section 2 were not included in the calculation because their confidence levels were too low.
[0044] After step S16, the cross-sectional ovality detection result of the wire is output according to the abnormality evaluation score and the preset evaluation threshold.
[0045] In one implementation, when the abnormal evaluation score is higher than a preset evaluation threshold, the ovality detection result of the wire is unqualified; when the abnormal evaluation score is lower than the evaluation threshold, the ovality detection result of the wire is qualified.
[0046] In order to facilitate the understanding of the present invention, some preferred embodiments of the present invention are further described below.
[0047] In one embodiment, before performing contour extraction based on the wire cross-section image to obtain the wire contour image, it also includes: performing noise evaluation on the wire cross-section image to obtain an image noise ratio; when the image noise ratio is greater than a preset noise threshold, removing the wire cross-section image and not performing subsequent operations; when the image noise ratio is less than the preset noise threshold, continuing to perform subsequent operations on the wire cross-section image.
[0048] It is worth noting that the image noise ratio calculation formula is as follows: in, is the image noise ratio, is the signal variance, is the noise variance. If the image noise ratio (i.e. SNR) is greater than this noise threshold, the image quality is considered good enough to proceed to the next step; otherwise, if the image noise ratio is less than the noise threshold, the subsequent analysis is unreliable due to excessive noise, so these images are discarded. When it is detected that the noise level of a wire cross-section image is too high, the simplest and most effective strategy is to exclude it directly and no longer participate in the subsequent processing flow. Doing so can not only avoid misjudgments caused by noise, but also save unnecessary computing resources and improve overall work efficiency.
[0049] In summary, the present invention discloses an intelligent detection method for the cross-sectional ellipticity of medical wires, which aims to provide a technical solution that can accurately and automatically evaluate the cross-sectional ellipticity of medical wires. Specifically, the method first involves a process of obtaining a cross-sectional image of the wire, which can be performed by cutting the wire sample and using an imaging device such as a camera or a scanner to capture a high-resolution image of its cross section. In order to ensure the quality of subsequent processing, the obtained original image needs to be preliminarily inspected and preprocessed if necessary to optimize the image quality. Then, contour extraction is performed based on the obtained cross-sectional image of the wire to obtain a wire contour image. This process includes converting a color image into a grayscale image and highlighting the contour features of the wire through technical means such as noise reduction and edge detection. Grayscale processing helps to simplify data, while noise reduction processing can reduce unnecessary interference information and make the wire contour clearer. Edge detection uses technologies such as the Canny algorithm to identify the true edge points by calculating the gradient strength and direction, and finally generates a wire contour image. After obtaining the wire contour image, the system performs ellipse fitting to calculate the optimal ellipse parameters. In this stage, a series of discrete points are extracted from the contour image as the coordinates of the wire contour points, and the ellipse parameters are randomly initialized. Subsequently, the mean square error formula is used to quantify the degree of difference between the ellipse model and the actual contour, and the ellipse parameters are iteratively adjusted until the set of parameters that minimize the error is found. In this process, optimization strategies such as the random sampling consensus (RANSAC) algorithm or the gradient descent method are used to ensure that the fitting result is as close to the actual situation as possible. In this way, a concise and representative ellipse model can be effectively extracted from a complex wire contour image even in the presence of noise or other uncertain factors.
[0050] Then, the optimal ellipse parameters determined above are input into a pre-trained ellipse scoring model, which outputs the corresponding ellipse score and confidence. This ellipse scoring model is built based on historical ellipse parameters and trained with a large amount of data. It can evaluate the ellipse corresponding to each wire section and the reliability of its prediction results. The ellipse score reflects the quality of the ellipse shape, while the confidence indicates the probability that the ellipse belongs to the target category. When these parameters are input into a fully trained model, an objective and quantitative evaluation index can be obtained to guide the next step of anomaly detection.
[0051] Next, the anomaly detection step is performed based on the ovality score and confidence, and the anomaly evaluation score is calculated. A binary judgment rule is introduced here: if the confidence exceeds the set threshold, the normalized confidence is 1; otherwise, it is 0. This emphasizes that the prediction result is only considered valid when the model prediction has a high enough confidence. The anomaly evaluation score combines the absolute value of the difference between the ovality score of all wire sections and its average value and multiplies it by the normalized confidence. This method not only takes into account the degree to which the ovality score of a single section deviates from the overall level, but also takes into account the reliability of the model prediction results. By averaging the differences in the scores of all sections, an indicator reflecting the consistency of the cross-sectional shape of the entire wire can be obtained.
[0052] Finally, the cross-sectional ovality detection result of the wire is output based on the comparison between the abnormal evaluation score and the preset evaluation threshold. If the abnormal evaluation score is higher than the threshold, it means that the ovality of the wire does not meet the requirements and is marked as unqualified; conversely, if it is lower than or equal to the threshold, the wire is considered qualified. This method provides an objective and quantitative means to judge the cross-sectional ovality of the wire, which helps to improve the accuracy and consistency of the detection results. In addition, before the start of the entire process, a noise evaluation link for the cross-sectional image of the wire is added, that is, the image noise ratio is calculated and compared with the preset threshold to decide whether to continue the subsequent operation. This design further improves the robustness of the system and avoids the problem of misjudgment due to low-quality images.
[0053] The intelligent detection method and system for the cross-sectional ellipticity of medical wires provided by the present invention realizes efficient and accurate detection of the cross-sectional shape of wires through a series of intelligent processing steps such as acquisition of wire cross-sectional images, contour extraction, ellipse fitting, ellipse scoring, abnormality detection, and result output. This method not only overcomes the limitations of traditional physical measurement and visual detection that rely on sampling inspection, but also improves the detection accuracy of the cross-sectional ellipticity of medical wires.
[0054] Reference Figure 2 The second embodiment of the present invention provides an intelligent detection system for the cross-sectional ellipticity of a medical wire, comprising: A data acquisition module, used for acquiring a cross-sectional image of the wire; A contour extraction module, used for performing contour extraction based on the wire cross-section image to obtain a wire contour image; An ellipse fitting module, used for performing ellipse fitting according to the wire contour image, and calculating the optimal ellipse parameters; An ellipticity scoring module, used to input the optimal ellipticity parameters into a pre-trained ellipticity scoring model and output an ellipticity score and a confidence level; A comprehensive scoring module, used to perform anomaly detection based on the ellipticity score and the confidence level, and calculate an anomaly evaluation score; The result output module is used to output the cross-sectional ovality detection result of the wire according to the abnormal evaluation score and the preset evaluation threshold.
[0055] Preferably, the data acquisition module is used to: Acquire wire cross-section images.
[0056] Preferably, the contour extraction module is used to: Performing contour extraction according to the wire cross-section image to obtain a wire contour image includes: grayscale the wire cross-section image to obtain a first grayscale wire cross-section image; Performing noise reduction processing on the first grayscale wire cross-section image to obtain a second grayscale wire cross-section image; Edge detection is performed based on the second grayscale wire cross-section image to obtain a wire contour image.
[0057] Preferably, the ellipse fitting module is used for: Performing ellipse fitting according to the wire contour image and calculating optimal ellipse parameters include: Sampling is performed according to the wire contour image to obtain the coordinates of the wire contour points; Randomly initialize the ellipse parameters; The mean square error is calculated using the following formula: in, is the mean square error, for i The horizontal coordinate of the wire contour point, for i The ordinate of the wire contour point, i Number the wire outline points, n is the total number of wire contour points, is the semi-major axis of the ellipse, b is the semi-minor axis of the ellipse, is the rotation angle of the ellipse, is the horizontal coordinate of the ellipse center, is the ordinate of the ellipse center coordinate; The ellipse parameters include: the semi-major axis, the semi-minor axis, the rotation angle, and the center coordinates of the ellipse; The ellipse parameters corresponding to the minimum mean square error are taken as the optimal ellipse parameters.
[0058] Preferably, the ellipse scoring module is used to: Inputting the optimal ellipse parameters into a pre-trained ellipse scoring model, and outputting an ellipse score and a confidence level; The training process of the elliptical scoring model includes: An ellipse scoring model is constructed based on historical ellipse parameters, the model is trained, and the training is determined to be complete after the loss function of the detection model meets the conditions, thereby obtaining a trained ellipse scoring model; The optimal ellipse parameters are input into the trained ellipse scoring model to obtain the ellipse score and confidence.
[0059] Preferably, the comprehensive scoring module is used to: Anomaly detection is performed according to the ellipticity score and the confidence level, and an anomaly evaluation score is calculated, including: The normalized confidence is calculated by the following formula: The abnormal evaluation score is calculated using the following formula: in, is the abnormal evaluation score, is the total number of wire cross-sections, is the wire cross-section number, for m The ovality score corresponding to the wire cross section is is the average value of the ellipticity score, D is the normalized confidence, is the confidence level, is the preset confidence threshold.
[0060] Preferably, the result output module is used to: According to the abnormal evaluation score and the preset evaluation threshold, the cross-sectional ovality detection result of the wire is output, including: When the abnormal evaluation score is higher than the preset evaluation threshold, the ovality test result of the wire is unqualified; When the abnormal evaluation score is lower than the evaluation threshold, the ovality detection result of the electric wire is qualified.
[0061] Preferably, before extracting the contour according to the wire cross-section image to obtain the wire contour image, the method further comprises: Performing noise evaluation on the wire cross-section image to obtain an image noise ratio; When the image noise ratio is greater than a preset noise threshold, the wire cross-section image is removed and no subsequent operation is performed; When the image noise ratio is less than a preset noise threshold, subsequent operations are continued on the wire cross-section image.
[0062] It should be noted that the intelligent detection system for the cross-sectional ovality of a medical wire provided in an embodiment of the present invention is used to execute all the process steps of the intelligent detection method for the cross-sectional ovality of a medical wire in the above-mentioned embodiment. The working principles and beneficial effects of the two correspond one to one, and thus will not be described in detail.
[0063] The embodiment of the present invention also provides an electronic device. The electronic device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a data acquisition program. When the processor executes the computer program, the steps in the above-mentioned intelligent detection method for the cross-sectional ellipticity of each medical wire are implemented, such as Figure 1 Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are realized, such as the data acquisition module.
[0064] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the electronic device.
[0065] The electronic device may be a computing device such as a desktop computer, a notebook, a PDA, and a smart tablet. The electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above components are merely examples of electronic devices and do not constitute a limitation on the electronic device. The electronic device may include more or fewer components than the above components, or may combine certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0066] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device.
[0067] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the electronic device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0068] Wherein, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0069] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0070] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. An intelligent detection method for the cross-sectional ellipticity of a medical wire, characterized in that: include: Acquire wire cross-section images; Perform contour extraction based on the wire cross-section image to obtain a wire contour image; Performing ellipse fitting according to the wire contour image to calculate the optimal ellipse parameters; Inputting the optimal ellipse parameters into a pre-trained ellipse scoring model, and outputting an ellipse score and a confidence level; Perform anomaly detection according to the ellipticity score and the confidence level, and calculate an anomaly evaluation score; According to the abnormal evaluation score and a preset evaluation threshold, the cross-sectional ovality detection result of the wire is output.
2. The intelligent detection method for the cross-sectional ovality of medical wire according to claim 1, characterized in that: The step of extracting the contour according to the wire cross-section image to obtain the wire contour image comprises: grayscale the wire cross-section image to obtain a first grayscale wire cross-section image; Performing noise reduction processing on the first grayscale wire cross-section image to obtain a second grayscale wire cross-section image; Edge detection is performed based on the second grayscale wire cross-section image to obtain a wire contour image.
3. The intelligent detection method for cross-sectional ovality of medical wire according to claim 1, characterized in that: The step of performing ellipse fitting according to the wire contour image and calculating optimal ellipse parameters includes: Sampling is performed according to the wire contour image to obtain the coordinates of the wire contour points; Randomly initialize the ellipse parameters; The mean square error is calculated using the following formula: in, is the mean square error, for i The horizontal coordinate of the wire contour point, for i The ordinate of the wire contour point, i Number the wire outline points, n is the total number of wire contour points, is the semi-major axis of the ellipse, b is the semi-minor axis of the ellipse, is the rotation angle of the ellipse, is the horizontal coordinate of the ellipse center, is the ordinate of the ellipse center coordinate; The ellipse parameters include: the semi-major axis, the semi-minor axis, the rotation angle, and the center coordinates of the ellipse; The ellipse parameters corresponding to the minimum mean square error are taken as the optimal ellipse parameters.
4. The intelligent detection method for cross-sectional ovality of medical wire according to claim 1, characterized in that: The training process of the elliptical scoring model includes: An ellipse scoring model is constructed based on historical ellipse parameters, the model is trained, and the training is determined to be complete after the loss function of the detection model meets the conditions, thereby obtaining a trained ellipse scoring model; The optimal ellipse parameters are input into the trained ellipse scoring model to obtain the ellipse score and confidence.
5. The intelligent detection method for cross-sectional ovality of medical wire according to claim 1, characterized in that: The performing of anomaly detection according to the ellipticity score and the confidence level to calculate an anomaly evaluation score includes: The normalized confidence is calculated by the following formula: The abnormal evaluation score is calculated using the following formula: in, is the abnormal evaluation score, is the total number of wire cross-sections, is the wire cross section number, for m The ovality score corresponding to the wire cross section is is the average value of the ellipticity score, D is the normalized confidence, is the confidence level, is the preset confidence threshold.
6. The intelligent detection method for cross-sectional ovality of medical wire according to claim 1, characterized in that: Outputting the cross-sectional ovality detection result of the wire according to the abnormal evaluation score and the preset evaluation threshold value includes: When the abnormal evaluation score is higher than the preset evaluation threshold, the ovality test result of the wire is unqualified; When the abnormal evaluation score is lower than the evaluation threshold, the ovality detection result of the electric wire is qualified.
7. The intelligent detection method for cross-sectional ovality of medical wire according to claim 1, characterized in that: Before extracting the contour according to the wire cross-section image to obtain the wire contour image, the method further includes: Performing noise evaluation on the wire cross-section image to obtain an image noise ratio; When the image noise ratio is greater than a preset noise threshold, the wire cross-section image is removed and no subsequent operation is performed; When the image noise ratio is less than a preset noise threshold, subsequent operations are continued on the wire cross-section image.
8. An intelligent detection system for the cross-sectional ovality of medical wires, characterized in that: include: A data acquisition module, used for acquiring a cross-sectional image of the wire; A contour extraction module, used for performing contour extraction based on the wire cross-section image to obtain a wire contour image; An ellipse fitting module, used for performing ellipse fitting according to the wire contour image, and calculating the optimal ellipse parameters; An ellipticity scoring module, used to input the optimal ellipticity parameters into a pre-trained ellipticity scoring model and output an ellipticity score and a confidence level; A comprehensive scoring module, used to perform anomaly detection based on the ellipticity score and the confidence level, and calculate an anomaly evaluation score; The result output module is used to output the cross-sectional ovality detection result of the wire according to the abnormal evaluation score and the preset evaluation threshold.
9. An electronic device, characterized in that: The invention comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the intelligent detection method for the cross-sectional ovality of the medical wire according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the intelligent detection method for the cross-sectional ellipticity of the medical wire according to any one of claims 1 to 7.
Citation Information
Patent Citations
A multi-angle object detection method and system
CN109785298A
Solar cell defect detection method and system based on graphite boat visual image
CN116740073A
Vehicle-mounted screen structural member ellipse feature detection method and device, and medium
CN118212205A
Ore area measurement method based on rotating ellipse target detection and related device
CN118968002A
Intelligent detection method and system for concentricity of medical wires and cables
CN119394221A
Cited By
Intelligent visual assembly guidance system and method for wire harness
CN119937292A