Contact lens flaw detection method and system based on image recognition

By dividing material type and meshing of contact lenses, combining neural network model and acoustic characteristic data, the problem of insufficient detection accuracy and reliability in the existing technology is solved, efficient and accurate defect detection is achieved, and significantly improved Reliability of test results.

CN119206358AActive Publication Date: 2024-12-27GUANGDONG MEDICAL DEVICE QUALITY SUPERVISION & INSPECTION INST

Patent Information

Application Number
CN202411400423.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2024-12-27
Estimated Expiration
2044-10-09

AI Technical Summary

Technical Problem

The prior art lacks detection strategies for different material types in contact lens defect detection, resulting in the impact of the accuracy and reliability of the detection results, and the precise measurement of defect depth and size of the defect has limitations.

Method used

By dividing material type and surface meshing for contact lenses to be tested, calling pre-trained neural network model for image recognition, combining acoustic characteristic data to generate frequency selection coefficients, using calibrated ultrasonic probes for defect detection, and passing the comparison coefficients Fine-tune the results to provide targeted defect detection.

Benefits of technology

It significantly improves the accuracy and reliability of contact lens defect detection, provides an efficient and accurate automated inspection solution, ensuring the reliability of production quality control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119206358A_ABST
    Figure CN119206358A_ABST
Patent Text Reader

Abstract

The invention discloses a contact lens flaw detection method and system based on image recognition, and the method comprises the steps: carrying out the material type and surface mesh division of a to-be-detected contact lens, calling a trained neural network model to carry out flaw detection, obtaining the output result of flaw detection, carrying out the analysis and processing of acoustic characteristic data and expected detection depth, and carrying out the detection of the contact lens. The method comprises the following steps: generating a frequency selection coefficient, calibrating an ultrasonic probe, obtaining reference datum data, transmitting ultrasonic waves of a frequency selection coefficient selected frequency band, obtaining a detection intensity value and a detection time delay value of the ultrasonic waves, and analyzing and processing a datum intensity value and the detection intensity value to obtain a first comparison coefficient; and analyzing and processing the reference time delay value and the detection time delay value to obtain a second comparison coefficient, and combining analysis to obtain an output result fine tuning index. According to the invention, the accuracy and reliability of contact lens flaw detection can be remarkably improved while the detection efficiency is ensured, and an efficient and accurate automatic detection scheme is provided for production quality control of contact lenses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication circuits, and more specifically, to a contact lens defect detection method and system based on image recognition. Background Art

[0002] As one of the important tools for modern vision correction, contact lenses have become the first choice for many patients with vision problems such as myopia, hyperopia, and astigmatism with the advancement of manufacturing technology. They not only provide a more natural appearance, but also give the wearer greater convenience and comfort. However, various defects are inevitable in the manufacturing process of contact lenses, including but not limited to scratches, bubbles, foreign matter adhesion, optical zone distortion, uneven thickness, etc. on the lens surface. If these defects are not discovered and properly handled, they will directly threaten the user's eye health. Therefore, accurate and efficient detection of contact lens defects is particularly important. Traditional manual detection methods are limited by factors such as the resolution, fatigue, and subjective judgment of the human eye, and it is difficult to achieve ideal detection accuracy and efficiency. For this reason, detection technology based on image recognition has emerged. With the rise of deep learning technology, it has become possible to use pre-trained neural network models for image recognition and defect detection. This method can greatly improve the degree of automation and accuracy of detection; In the prior art, the publication number is CN115239663A, and the name is a contact lens defect detection method, which includes: obtaining a flawless contact lens image; preprocessing the flawless contact lens image; identifying a pattern area in the flawless contact lens image, where the pattern area is an area where the contact lens image has defects; generating multiple random defect blocks; repeatedly performing multiple executions to randomly place N random defect blocks into the pattern area of ​​the flawless contact lens image, and training a neural network model for contact lens defect detection; and performing defect detection on the contact lens to be tested; The existing technology often lacks targeted detection strategies when dealing with contact lenses of different material types, which affects the accuracy and reliability of the detection results. In addition, the existing technology also has certain limitations in the precise measurement of defect depth and size, which is mainly due to the lack of effective calibration and fine-tuning mechanisms. The above information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, so it may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention

[0003] The present invention aims to overcome at least one defect in the prior art and provide a contact lens defect detection method and system based on image recognition, which is used to solve the problem raised in the above background technology.

[0004] The technical solution adopted by the present invention is a contact lens defect detection method based on image recognition, and the specific steps include: Step S1: Classify the material type and surface mesh of the contact lens to be tested, wherein: The material type classification is to classify the contact lenses to be tested according to the material type to form a material type set. in, Indicates contact lenses of various materials, Indicates the total number of material types; The surface meshing is to divide the surface of the contact lens into a plurality of mesh regions to form a mesh region set. ,in, Indicates The grid area number, Represents the total number of grid divisions; Step S2: calling a pre-trained neural network model to perform defect detection on the contact lens to be tested; Step S3: Collect image data of the contact lens to be tested, and input the image data into the pre-trained neural network model for processing, and finally obtain the output result of defect detection, which includes the first Type of material contact lenses Defect depth value and defect size value in each grid area; Step S4: Collect The material type to be tested is contact lenses. Acoustic characteristic data in a grid area, and an expected detection depth, wherein the acoustic characteristic data includes sound velocity and acoustic impedance, and the expected detection depth is the maximum depth at which the ultrasonic probe penetrates the contact lens material and detects surface defects; Step S5: Acquire the acoustic characteristic data and the expected detection depth, perform analysis and processing, and generate a frequency selection coefficient, where the frequency selection coefficient is used to classify and select the frequency band of the ultrasonic probe within the frequency range of 5 MHz to 15 MHz; Step S6: Use the flawless contact lens sample to calibrate the selected ultrasonic probe, and use the calibrated ultrasonic probe to scan the flawless contact lens sample again to obtain reference benchmark data, which includes the first Type of material contact lenses The reference intensity value and reference time delay value in each grid area; Step S7: Using the calibrated ultrasonic probe, transmit ultrasonic waves of the frequency band selected by the frequency selection coefficient, so that the ultrasonic waves penetrate the first The contact lens of the material type to be tested and the ultrasound is focused on the The ultrasonic signal reflected from the surface of the grid area is then received and analyzed. The ultrasonic signal reflected from the grid area is obtained The detection intensity value and detection time delay value of each grid area; Step S8: Obtain a reference intensity value and a detection intensity value, and perform analysis and processing to obtain a first comparison coefficient. At the same time, obtain a reference time delay value and a detection time delay value, and perform analysis and processing to obtain a second comparison coefficient. Subsequently, the detection system combines the first comparison coefficient and the second comparison coefficient for analysis to obtain an output result fine-tuning index. The output result fine-tuning index is used to provide a fine-tuning strategy for the defect depth value and defect size value included in the output result.

[0005] By dividing contact lenses of different material types and their surfaces, images of different material types and different areas are obtained to make them more targeted; the collected image data is input into the model for processing to obtain the results of defect detection, which include the area where the defect is located, the defect depth value and the defect size value, and the acoustic characteristic data of the area where the defect is located and the expected detection depth are obtained, and analyzed and processed to generate a frequency selection coefficient for adjusting the frequency of the ultrasonic probe; the ultrasonic probe is calibrated to obtain reference benchmark data of defect-free contact lenses; ultrasonic waves of selected frequency are emitted to penetrate the defective area of ​​the contact lens to obtain the detection intensity value and the detection time delay value; the reference benchmark data, the detection intensity value and the detection time delay value are analyzed and processed to obtain the first comparison coefficient and the second comparison coefficient, which are combined and analyzed to obtain the output result fine-tuning index, which is used to provide a fine-tuning strategy for the defect depth value and the defect size value included in the output result.

[0006] Further, step S3 includes preprocessing the contact lens image to be tested to make it meet the model input requirements; inputting the preprocessed image into the trained neural network model; the model outputs predicted defect information, including defect depth value and defect size value; The material type of contact lenses is The defect depth values ​​and defect size values ​​in the grid areas are marked as , .

[0007] Further, in step S4, in the jth grid area of ​​the contact lens of the i-th material type, the acoustic velocity and acoustic impedance included in the acoustic characteristic data are marked as , , and the expected detection depth is marked as ,and The calculation formula is as follows;

[0008] in, is the threshold for judging the defect depth value, and ensures .

[0009] Furthermore, the acoustic characteristic data and expected detection depth of the defect area, that is, the contact lens of the i-th material type in the j-th grid area, are obtained, analyzed and processed, and a frequency selection coefficient is generated. The frequency selection coefficient is defined as , the calculation formula is as follows:

[0010] Where a, b, and c are all positive weight coefficients used to adjust the influence of each parameter on the frequency selection coefficient;

[0011] The formula for setting the frequency band selection is:

[0012] in, is the ultrasonic frequency selected for the contact lens of the ith material type in the jth grid area, The value range is between 5MHz and 15MHz; is the frequency selection coefficient; set up The value range is (0,1). The closer it is to 0, the frequency of selection The closer to 5MHz; when The closer it is to 1, the frequency of the selection The closer to 15MHz.

[0013] Furthermore, the step S6 of calibrating the ultrasonic probe includes preparing a flawless contact lens sample and performing distance amplitude calibration. , perform sensitivity adjustment and record the reference intensity value and reference time delay value; The recording of the reference intensity value and the reference time delay value is specifically performed by scanning the flawless sample again using the adjusted ultrasonic probe; Record the baseline intensity value for each grid area and the reference time delay value , The calculation formula is as follows;

[0014] in, It is Type of material contact lenses The baseline intensity value in each grid area; It is The amplitude value of the echo signal; is the total number of echo signals; The calculation formula is as follows;

[0015] in, It is The material type of contact lenses is The reference time delay value in the grid area, It is The time delay value of the echo signal.

[0016] Further, step S7 includes ultrasonic emission, ultrasonic reception, signal analysis, detection intensity value and detection time delay value calculation and data storage; The signal analysis is specifically to perform fast Fourier transform on the received ultrasonic signal , to extract the frequency component and intensity of the signal, the fast Fourier transform formula is as follows;

[0017] in, is the Fourier transform result of the received signal; The received signal sampling points; is the total number of sampling points; p is the imaginary unit; It is a complex exponential function, which is used to realize the transformation from time domain to frequency domain; Represents the frequency component.

[0018] Furthermore, the detection intensity value and the detection time delay value are calculated specifically as follows: As a result, the detection intensity value of the jth grid area is calculated and detection time delay value ;

[0019] in, is the detection intensity value of the contact lens of the i-th material type in the j-th grid area; yes The maximum amplitude of the result;

[0020] in, It is The material type of contact lenses is The detection time delay value in each grid area; yes The frequency corresponding to the maximum magnitude of the result.

[0021] Furthermore, The material type of contact lenses is The reference intensity values ​​and reference time delay values ​​in the grid areas are marked as , ; The first The material type of contact lenses is The detection intensity values ​​and detection time delay values ​​in the grid areas are marked as , ;; Define the first comparison coefficient as , the calculation formula is as follows:

[0022] is the detection intensity value of the contact lens of the i-th material type in the j-th grid area, is the reference intensity value of the contact lens of the ith material type in the jth grid area; The value range of is (0,1). The closer it is to 0, the greater the magnitude of the detection intensity below the reference intensity, and the greater the probability of a defect. The closer it is to 1, the closer the detection intensity is to the reference intensity, and the smaller the probability of defects. Define the second comparison coefficient as , the calculation formula is as follows:

[0023] is the detection time delay value of the contact lens of the i-th material type in the j-th grid area, is the reference time delay value of the contact lens of the ith material type in the jth grid area; The value range of is (0,1). The closer it is to 0, the greater the detection time delay is below the reference time delay, and the greater the probability of a defect. The closer it is to 1, the closer the detection time delay is to the reference time delay, and the smaller the probability of a defect.

[0024] Furthermore, the output result fine-tuning index is defined as , the calculation formula is as follows:

[0025] in, The fine-tuning index for outputting the result is the fine-tuning strategy for the contact lens of the i-th material type in the j-th grid area; is the maximum value of the first comparison coefficient in all grid areas; is the maximum value of the second comparison coefficient in all grid areas; u 1 and u 2 are the positive weight coefficients of the first comparison coefficient and the second comparison coefficient, respectively, and u 1+ u 2=1,0.14≤ u 1≤0.78,0.08≤ u 2≤0.89; The value range of is (0,1). The closer it is to 0, the higher the probability of defect. The closer it is to 1, the lower the probability of defects; Set the output result fine-tuning index The comparison threshold is Q1; 1) When the output result is fine-tuned index When it is greater than the threshold Q1, the fine-tuning strategy is not to perform fine-tuning; Defect Depth Value and defect size value remain unchanged; 2) When the output result is fine-tuned index When the threshold Q1 is equal, the fine-tuning strategy is to adjust the defect depth value and defect size value Make minor adjustments; 3) When the output result is fine-tuned index When it is less than the threshold Q1, the fine-tuning strategy includes: 3.1) When the first comparison coefficient Less than 0.3, the second comparison coefficient When greater than or equal to 0.8: like u 1≥ u 2, the fine-tuning strategy is A medium adjustment strategy based on like u 1< u 2. Fine-tuning strategy is based on Minor adjustments to the strategy; 3.2) When the first comparison coefficient Greater than or equal to 0.8, the second comparison coefficient When less than 0.3: like u 1≥ u 2, the fine-tuning strategy is Minor adjustments to the strategy; like u 1< u 2. Fine-tuning strategy is based on A medium adjustment strategy based on the current market conditions.

[0026] Furthermore, the present invention provides a contact lens defect detection system based on image recognition, which is used to execute the above-mentioned contact lens defect detection method based on image recognition, comprising: Division module: used to divide the material type and surface mesh of the contact lens to be tested; Neural network model calling module: used to call the pre-trained neural network model for defect detection of contact lenses to be tested; Output result generation module: used to collect image data of the contact lens to be tested, and input the image data into the pre-trained neural network model for processing, and finally obtain the output result of defect detection, which includes the defect depth value and defect size value of the contact lens of the i-th material type in the j-th grid area; Data acquisition module: used to collect acoustic characteristic data of the contact lens of the i-th material type to be tested in the j-th grid area, as well as the expected detection depth. The acoustic characteristic data includes sound velocity and acoustic impedance. The expected detection depth is the maximum depth at which the ultrasonic probe penetrates the contact lens material and detects surface defects. Frequency band classification and selection module: used to obtain acoustic characteristic data and expected detection depth, and perform analysis and processing to generate a frequency selection coefficient, which is used to classify and select the frequency band of the ultrasonic probe within the frequency range of 5 MHz to 15 MHz; Reference value generation module: used to calibrate the selected ultrasonic probe using a flawless contact lens sample, and use the calibrated ultrasonic probe to scan the flawless contact lens sample again to obtain reference reference data. The reference reference data includes the first Type of material contact lenses The reference intensity value and reference time delay value in each grid area; Detection value generation module: used to use the calibrated ultrasonic probe to transmit ultrasonic waves of the frequency band selected by the frequency selection coefficient, so that the ultrasonic waves penetrate the first of the contact lenses to be tested and focus on The ultrasonic signal reflected from the surface of the grid area is then received and analyzed. The ultrasonic signal reflected from the grid area is obtained The detection intensity value and detection time delay value of each grid area; Fine-tuning strategy generation module: used to obtain the reference intensity value and the detection intensity value, and perform analysis and processing to obtain the first comparison coefficient. At the same time, it obtains the reference time delay value and the detection time delay value, and performs analysis and processing to obtain the second comparison coefficient. Subsequently, the detection system combines the first comparison coefficient and the second comparison coefficient for analysis to obtain the output result fine-tuning index. The output result fine-tuning index is used to provide a fine-tuning strategy for the defect depth value and defect size value included in the output result.

[0027] Compared with the prior art, the present invention has the following beneficial effects: By finely gridding the surface of the contact lens, targeted defect detection can be performed according to different material types, the defect area, defect depth value and defect size value can be obtained, the acoustic characteristic data of the defect area and the expected detection depth can be obtained and processed, and a frequency selection coefficient can be generated. The frequency selection coefficient is used to classify and select the frequency band of the ultrasonic probe within the frequency range of 5MHz to 15MHz; calibrate the ultrasonic probe to obtain reference benchmark data; transmit ultrasonic waves with selected frequencies to obtain detection intensity values ​​and detection time delay values; analyze and process the reference benchmark data, the detection intensity value and the detection time delay value to obtain a first comparison coefficient and a second comparison coefficient, and perform combined analysis to obtain an output result fine-tuning index. The output result fine-tuning index is used to provide a fine-tuning strategy for the defect depth value and defect size value included in the output result. The present invention can significantly improve the accuracy and reliability of contact lens defect detection while ensuring detection efficiency, and provides an efficient and accurate automated detection solution for contact lens production quality control. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The drawings of the present invention are only used for illustrative purposes and should not be construed as limiting the present invention. In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for describing the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0029] Figure 1 It is a schematic diagram of the overall method flow of the present invention.

[0030] Figure 2 It is a system module block diagram of the present invention. DETAILED DESCRIPTION

[0031] 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.

[0032] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0033] Example 1 like Figure 1 As shown, this embodiment provides a contact lens defect detection method and system based on image recognition, and the specific steps include: Step S1, the detection system classifies the contact lens to be tested into material types and surface grids, including: Step S11: Material type classification is to classify the contact lenses to be tested according to material type to form a material type set. ,in, Indicates contact lenses of various materials, Indicates the total number of material types. The operation steps are as follows: Step S111: using a spectrum analyzer to perform spectrum scanning on the contact lens to be tested to obtain its spectrum characteristics; Step S112: Compare the acquired spectral features with the pre-established standard material spectral database and determine the material type using the following formula:

[0034] in, Indicates the value of the spectral characteristic of the contact lens to be tested at wavelength l; It represents the standard spectrum value of the kth material at wavelength l, where L represents the total number of wavelengths in the spectrum; Indicated in Find the k value that minimizes the function value in the function; Step S113: Determine the material type i of the contact lens to be tested according to the comparison result.

[0035] Step S12: Surface meshing is to divide the surface of the contact lens into multiple mesh regions to form a mesh region set. ,in, Indicates The grid area number, Indicates the total number of grid divisions. The operation steps are as follows: Step S121: using a high-resolution camera to collect images of the contact lens to be tested, and obtaining a surface image thereof; Step S122: preprocessing the surface image, including denoising and contrast enhancement operations, to improve the accuracy of subsequent meshing; Step S123: Use an image processing algorithm to perform grid division on the pre-processed image. Specifically, the image is divided into rectangular grid regions of equal area, each grid region is numbered From 1 to .

[0036] Step S124: Calculate the center coordinates of each grid area using the following formula:

[0037] in, and Respectively represent The relative horizontal and vertical positions of the center coordinates of each grid area in the image; Indicates the number of rows and columns of the grid. represents the modular operation, and The calculation is Divide by The remainder is then divided by , thus obtaining a value in the interval [0,1).

[0038] Step S125: Determine the boundary of each grid area and store it as reference data for subsequent detection.

[0039] Step S2: calling a pre-trained neural network model to detect defects in the contact lens to be tested, wherein building the neural network model specifically includes the following contents: Step S21: Acquire a flawless contact lens image; Step S22: pre-processing the flawless contact lens image; Step S23: identifying a pattern region in the flawless contact lens image, where the pattern region is a region where a defect occurs in the contact lens image; Step S24: generating a plurality of random defect blocks; Step S25: repeatedly performing the process of randomly placing the N random defect blocks into the pattern area of ​​the defect-free contact lens image to obtain a plurality of defective contact lens images, wherein N≥1 and N is a random integer; Step S26: training a neural network model for contact lens defect detection based on the plurality of defective contact lens images, specifically comprising: Step S261: Data segmentation: dividing the data set into a training set, a validation set, and a test set; Step S262: Model construction: Use CNN to extract features and build a neural network architecture, followed by a fully connected layer to predict defect depth and defect size values; Step S263: Model training: using the training set to train the model, adjusting the network weights so that the model can accurately predict the defect depth value and defect size value; Step S264: Model validation: Use the validation set to evaluate the performance of the model and adjust the hyperparameters and model structure; Step S265: Model testing: Use the test set to evaluate the final model and verify the generalization ability of the model; Step S3: The detection system collects image data of the contact lens to be tested, and inputs the image data into the pre-trained neural network model for processing, and finally obtains the output result of the defect detection, which includes the defect depth value and defect size value of the contact lens of the i-th material type in the j-th grid area, specifically including the following contents: Based on the trained neural network model, the defect detection of the contact lenses to be tested is carried out. Step S31: pre-process the contact lens image to be tested to make it meet the model input requirements. Step S32: inputting the preprocessed image into the trained neural network model; Step S33: The model outputs predicted defect information, including defect depth value and defect size value, and marks the defect depth value and defect size value of the i-th material type contact lens in the j-th grid area as , .

[0040] Step S4, collecting acoustic characteristic data of the contact lens of the i-th material type to be tested in the j-th grid area, and the expected detection depth, wherein the acoustic characteristic data includes the speed of sound and the acoustic impedance, and the expected detection depth is the maximum depth at which the ultrasonic probe penetrates the contact lens material and detects surface defects, specifically including the following contents: In the jth grid area of ​​the contact lens of the i-th material type to be tested, the acoustic characteristic data including the sound velocity and acoustic impedance are marked as , , and the expected detection depth is marked as , and the calculation formula is as follows;

[0041] in, is the judgment threshold of the defect depth value, Determined by the expert group through experimental data to ensure .

[0042] Step S5, obtaining acoustic characteristic data and expected detection depth, and performing analysis and processing to generate a frequency selection coefficient, wherein the frequency selection coefficient is used to classify and select the frequency band of the ultrasonic probe within the frequency range of 5 MHz to 15 MHz, and specifically includes the following contents: Step S51: Define the frequency selection coefficient as , the calculation formula is as follows:

[0043] Among them, a, b, c are all positive weight coefficients, which are determined by experimental data and statistical methods and are used to adjust the influence of each parameter on the frequency selection coefficient.

[0044] Step S52: Setting the frequency band selection formula to:

[0045] in, is the ultrasonic frequency selected for the contact lens of the ith material type in the jth grid area (in MHz); The value range is between 5MHz and 15MHz; is the frequency selection coefficient; set up The value range is (0,1). The closer it is to 0, the frequency of selection The closer to 5MHz; when The closer it is to 1, the frequency of the selection The closer to 15MHz.

[0046] The frequency range of 5MHz to 15MHz is divided into 10 equally spaced frequency segments, each with a width of 1MHz, and each interval is numbered sequentially. These frequency segments are represented as follows: Number 1 means 5MHz-6MHz; Number 2 means 6MHz-7MHz; Number 3 means 7MHz-8MHz; Number 4 means 8MHz-9MHz; Number 5 means 9MHz-10MHz; Number 6 indicates 10MHz-11MHz; Number 7 indicates 11MHz-12MHz; Number 8 represents 12MHz-13MHz; Number 9 means 13MHz-14MHz; Number 10 means 14MHz-15MHz; Step S53: and define the frequency segment number selection function as , the calculation formula is as follows:

[0047] in, represents the ceiling function; when When it is close to 0, the selected frequency When it is close to 5MHz, FB is rounded up to 1, and the value "1" represents 5MHz-6MHz represented by number 1; when When it is close to 1, the selected frequency When approaching 15MHz, FB is rounded up to 10, and the value "10" represents 14MHz-15MHz represented by number 10.

[0048] Step S6, the detection system uses a flawless contact lens sample to calibrate the selected ultrasonic probe, the calibration content includes distance amplitude calibration (DAC) and sensitivity adjustment, and uses the calibrated ultrasonic probe to scan the flawless contact lens sample again to obtain reference benchmark data, the reference benchmark data includes the benchmark intensity value and benchmark time delay value of the i-th material type contact lens in the j-th grid area; wherein, for the i-th material type contact lens, a flawless contact lens sample of the same material type is selected, and the flawless contact lens sample is divided into the same m areas, and the flawless contact lens sample is scanned again using the calibrated ultrasonic probe, the intensity value of the flawless contact lens in the j-th area is the benchmark intensity value of the i-th material type contact lens in the j-th grid area, and the measured time delay value is the benchmark time delay value of the i-th material type contact lens in the j-th grid area. Specifically including the following contents: Calibrate the ultrasonic probe Step S61: preparing a flawless contact lens sample, that is, selecting a flawless sample with the same material and thickness as the contact lens to be tested, and ensuring that the surface of the sample is clean and free of any impurities or damage; Step S62: Perform distance amplitude calibration ( ): Distance Amplitude Calibration ( ) is a technology used to compensate for the attenuation of the amplitude of sound waves due to the increase in the distance they propagate in the material. In ultrasonic testing, the sound waves will gradually attenuate during the propagation process due to factors such as absorption and scattering of the material, which means that the amplitude of the reflected signal will decrease as the detection distance increases. , you can set different gains for different distances to correct for the natural attenuation of sound waves during propagation, ensuring consistent signal strength at various distances; Use an ultrasonic probe to scan a flawless sample and record the echo signal strength at different depths. Based on the recorded data, draw a distance amplitude curve, which is Curve, the curve formula is as follows:

[0049] in, Is Depth The normalized amplitude value at ; Is Depth The actual amplitude value at ; is the maximum amplitude value.

[0050] Step S63: Sensitivity adjustment: according to Curve, adjust the sensitivity of the ultrasonic probe so that the echo signal strength at different depths is consistent. The sensitivity adjustment formula is as follows:

[0051] in, is the adjusted sensitivity; is the sensitivity before adjustment; It is a reference value; It is actually measured value; Step S64: Record the reference intensity value and reference time delay value: Use the adjusted ultrasonic probe to scan the flawless sample again; Record the baseline intensity value for each grid area and the reference time delay value , The calculation formula is as follows;

[0052] in, is the reference intensity value of the contact lens of the ith material type in the jth grid area; It is The amplitude value of the echo signal; is the total number of echo signals; The calculation formula is as follows;

[0053] in, is the reference time delay value of the contact lens of the ith material type in the jth grid area, It is The time delay value of the echo signal.

[0054] Step S65: Save reference benchmark data: The baseline intensity value to be recorded and the reference time delay value Save as reference benchmark data. Mark the detection intensity value and detection time delay value of the i-th material type contact lens in the j-th grid area as , .

[0055] Step S7, using the calibrated ultrasonic probe, transmitting ultrasonic waves of a frequency band selected by the frequency selection coefficient, so that the ultrasonic waves penetrate the contact lens of the i-th material type to be tested, and focusing the ultrasonic waves on the j-th grid area, then receiving the ultrasonic signal reflected from the surface of the area, and analyzing the ultrasonic signal reflected from the j-th grid area, to obtain the detection intensity value and the detection time delay value of the j-th grid area, the specific steps include: Step S71: Ultrasonic emission: Using a calibrated ultrasonic probe, determine the frequency selectivity according to the procedure , select the appropriate frequency The ultrasonic wave is emitted, and the ultrasonic wave is precisely focused on the jth grid area through the focusing lens; Step S72: Ultrasonic wave reception: The ultrasonic wave penetrates the contact lens to be tested and is reflected back from the surface of the jth grid area; Receive the reflected ultrasonic signal and use a high-sensitivity receiver to collect the signal;

[0056] in, is the received signal strength; is the transmitted signal strength; is the reflection coefficient; is the attenuation coefficient; is the distance the ultrasound wave propagates; Step S73: Signal analysis: Perform fast Fourier transform on the received ultrasonic signal , to extract the frequency component and intensity of the signal, the fast Fourier transform formula is as follows;

[0057] in, is the Fourier transform result of the received signal; The received signal sampling points; is the total number of sampling points; is an imaginary unit; It is a complex exponential function, which is used to realize the transformation from time domain to frequency domain; represents the frequency component; Step S74: Calculation of detection intensity value and detection time delay value: according to As a result, the detection intensity value of the jth grid area is calculated and detection time delay value ;

[0058] in, is the detection intensity value of the contact lens of the i-th material type in the j-th grid area, yes The maximum amplitude of the result;

[0059] in, is the detection time delay value of the contact lens of the i-th material type in the j-th grid area, yes The frequency corresponding to the maximum value of the result; When using the Fourier transform ( ) When performing signal analysis, time delay is inferred from phase information. The relationship between phase, frequency and time delay is expressed by the formula Indicates that is the frequency The corresponding phase, is the time delay, in this embodiment, represent , represent ; By finding the frequency corresponding to the maximum amplitude , use the phase of this frequency component to calculate the time delay, the calculation formula is as follows:

[0060] Step S75: Data preservation: The calculated detection intensity value and detection time delay value Save for subsequent defect detection and analysis. It should be noted that the detection value is limited to be less than or equal to the reference value. If the contact lens has defects, the detection intensity value or the detection time delay value will be reduced, resulting in a ratio less than 1. If the contact lens has no defects, the detection value will be close to the reference value, resulting in a ratio close to 1.

[0061] Step S8: The detection system obtains the reference intensity value and the detection intensity value, and performs analysis and processing to obtain the first comparison coefficient. At the same time, the reference time delay value and the detection time delay value are obtained, and then the detection system combines the first comparison coefficient and the second comparison coefficient for analysis to obtain the output result fine-tuning index, which is used to provide a fine-tuning strategy for the defect depth value and defect size value included in the output result. Specifically, it includes the following contents: Step S81: define the first comparison coefficient as , the calculation formula is as follows:

[0062] It is The material type of contact lenses is The detection intensity value in the grid area, It is The material type of contact lenses is The baseline intensity value in each grid area; The value range of is (0,1). The closer it is to 0, the greater the magnitude of the detection intensity below the reference intensity, and the greater the probability of a defect. The closer it is to 1, the closer the detection intensity is to the reference intensity, and the smaller the probability of defects.

[0063] Step S82: define the second comparison coefficient as , the calculation formula is as follows:

[0064] It is The material type of contact lenses is The detection time delay value in the grid area, It is The material type of contact lenses is The reference time delay value in the grid area; The value range of is (0,1). The closer it is to 0, the greater the detection time delay is below the reference time delay, and the greater the probability of a defect. The closer it is to 1, the closer the detection time delay is to the reference time delay, and the smaller the probability of a defect.

[0065] Step S83: define the output result fine-tuning index as , the calculation formula is as follows:

[0066] in, Fine-tune the index for the output result, used for The material type of contact lenses is Fine-tuning strategies in grid regions; is the maximum value of the first comparison coefficient in all grid areas, which is used for normalization processing; is the maximum value of the second comparison coefficient in all grid areas, which is used for normalization processing; and are the positive weight coefficients of the first comparison coefficient and the second comparison coefficient, respectively, and + =1,0.14≤ ≤0.78,0.08≤ ≤0.89, and Determined by experimental data and statistical methods.

[0067] The value range of is (0,1). The closer it is to 0, the higher the probability of defect. The closer it is to 1, the lower the probability of defects; Step S84: Setting the output result fine-tuning index The comparison threshold Q1; 1) When the output result is fine-tuned index When the defect depth value is greater than the threshold Q1, the fine-tuning strategy is not to perform fine-tuning. and defect size value Remain unchanged.

[0068] 2) When the output result is fine-tuned index When it is equal to the threshold Q1, 0.47≤Q1≤0.78. The specific value of Q1 is determined by the expert group through experimental data and will not be elaborated here. The fine-tuning strategy is to adjust the defect depth value. and defect size value Minor adjustments, including: 2.1) When and When both are greater than or equal to 0.8, the defect depth value Increase by 3%, defect size value Increase by 2%; 2.2) When and When any one of the values ​​is less than 0.8, the defect depth value Reduce the defect size by 2%. A decrease of 4%.

[0069] 3) When the output result is fine-tuned index When it is less than the threshold Q1, the fine-tuning strategy includes: 3.1) When the first comparison coefficient Less than 0.3, the second comparison coefficient When greater than or equal to 0.8: like ≥ When the fine-tuning strategy is The main medium adjustment strategy is to adjust the defect depth value. Increase 7.5%, defect size value Increased by 5.5%; like < , the fine-tuning strategy is based on The main slight adjustment strategy is to adjust the defect depth value. Increased by 3.6%, defect size value An increase of 4.8%.

[0070] 3.2) When the first comparison coefficient Greater than or equal to 0.8, the second comparison coefficient When less than 0.3: like ≥ When the fine-tuning strategy is The main slight adjustment strategy is to adjust the defect depth value. Increased by 4.6%, defect size value 3.5% reduction; like < , the fine-tuning strategy is based on The main medium adjustment strategy, the defect depth value Reduced defect size by 5.4% A decrease of 7.6%.

[0071] Example 2 See also Figure 2 , a contact lens defect detection system based on image recognition, the system is used to execute the contact lens defect detection method based on image recognition described in Example 1, comprising: Division module: used to divide the material type and surface mesh of the contact lens to be tested, including: Material type classification is to classify the contact lenses to be tested according to material type. The material type set is represented as ,in, Indicates contact lenses of various materials, Indicates the total number of material types; Surface meshing is to divide the surface of the contact lens into multiple mesh regions. The mesh region set is represented as ,in, Indicates The grid area number, Represents the total number of grid divisions; Neural network model calling module: used to call the pre-trained neural network model for defect detection of contact lenses to be tested; Output result generation module: used to collect image data of the contact lens to be tested, and input the image data into the pre-trained neural network model for processing, and finally obtain the output result of defect detection. The output result includes the first The material type of contact lenses is Defect depth value and defect size value in each grid area; Data acquisition module: used to collect The material type to be tested is contact lenses. The acoustic characteristic data in each grid area, and the expected detection depth, the acoustic characteristic data including the acoustic velocity and acoustic impedance, the expected detection depth being the maximum depth at which the ultrasonic probe penetrates the contact lens material and detects surface defects; Frequency band classification and selection module: used to obtain acoustic characteristic data and expected detection depth, and perform analysis and processing to generate a frequency selection coefficient, which is used to classify and select the frequency band of the ultrasonic probe within the frequency range of 5 MHz to 15 MHz; Reference value generation module: used to calibrate the selected ultrasonic probe using a flawless contact lens sample. The calibration content includes distance amplitude calibration and sensitivity adjustment. The calibrated ultrasonic probe is used to scan the flawless contact lens sample again to obtain reference reference data. The reference reference data includes the first The material type of contact lenses is The reference intensity value and reference time delay value in each grid area; Detection value generation module: used to use the calibrated ultrasonic probe to transmit ultrasonic waves of the frequency band selected by the frequency selection coefficient, so that the ultrasonic waves penetrate the first of the contact lenses to be tested and focus on The ultrasonic signal reflected from the surface of the grid area is then received and analyzed. The ultrasonic signal reflected from the grid area is obtained The detection intensity value and detection time delay value of each grid area; Fine-tuning strategy generation module: used to obtain the reference intensity value and the detection intensity value, and perform analysis and processing to obtain the first comparison coefficient. At the same time, it obtains the reference time delay value and the detection time delay value, and performs analysis and processing to obtain the second comparison coefficient. Subsequently, the detection system combines the first comparison coefficient and the second comparison coefficient for analysis to obtain the output result fine-tuning index. The output result fine-tuning index is used to provide a fine-tuning strategy for the defect depth value and defect size value included in the output result.

[0072] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0073] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0074] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0075] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to specific implementation methods. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A contact lens defect detection method based on image recognition, characterized in that: The specific steps include: Step S1: Classify the material type and surface mesh of the contact lens to be tested, wherein: The material type classification is to classify the contact lenses to be tested according to the material type to form a material type set. in, Indicates contact lenses of various materials, Indicates the total number of material types; The surface meshing is to divide the surface of the contact lens into a plurality of mesh regions to form a mesh region set. ,in, Indicates The grid area number, Represents the total number of grid divisions; Step S2: calling a pre-trained neural network model to perform defect detection on the contact lens to be tested; Step S3: Collect image data of the contact lens to be tested, and input the image data into the pre-trained neural network model for processing, and finally obtain the output result of defect detection, which includes the first The material type of contact lenses is Defect depth value and defect size value in each grid area; Step S4: Collect the The material type to be tested is contact lenses. Acoustic characteristic data in each grid area, and an expected detection depth, wherein the acoustic characteristic data includes sound velocity and acoustic impedance, and the expected detection depth is the maximum depth at which the ultrasonic probe penetrates the contact lens material and detects surface defects; Step S5: Acquire the acoustic characteristic data and the expected detection depth, perform analysis and processing, and generate a frequency selection coefficient, where the frequency selection coefficient is used to classify and select the frequency band of the ultrasonic probe within the frequency range of 5 MHz to 15 MHz; Step S6: Use the flawless contact lens sample to calibrate the selected ultrasonic probe, and use the calibrated ultrasonic probe to scan the flawless contact lens sample again to obtain reference benchmark data, which includes the first The material type of contact lenses is The reference intensity value and reference time delay value in each grid area; Step S7: Using the calibrated ultrasonic probe, transmit ultrasonic waves of the frequency band selected by the frequency selection coefficient, so that the ultrasonic waves penetrate the first The contact lens of the material type to be tested and the ultrasound is focused on the The ultrasonic signal reflected from the surface of the grid area is then received and analyzed. The ultrasonic signal reflected from the grid area is obtained The detection intensity value and detection time delay value of each grid area; Step S8: Obtain a reference intensity value and a detection intensity value, and perform analysis and processing to obtain a first comparison coefficient. At the same time, obtain a reference time delay value and a detection time delay value, and perform analysis and processing to obtain a second comparison coefficient. Subsequently, the detection system combines the first comparison coefficient and the second comparison coefficient for analysis to obtain an output result fine-tuning index. The output result fine-tuning index is used to provide a fine-tuning strategy for the defect depth value and defect size value included in the output result.

2. The method for detecting contact lens defects based on image recognition according to claim 1, characterized in that: The step S3 includes preprocessing the contact lens image to be tested to make it meet the model input requirements; inputting the preprocessed image into the trained neural network model; the model outputs predicted defect information, including defect depth value and defect size value; The material type of contact lenses is The defect depth values ​​and defect size values ​​in the grid areas are marked as , .

3. The method for detecting contact lens defects based on image recognition according to claim 2, characterized in that: In step S4, Type of material for contact lenses In each grid area, the acoustic characteristic data including the sound velocity and acoustic impedance are marked as , , and the expected detection depth is marked as ,and The calculation formula is as follows: in, is the threshold for judging the defect depth value, and ensures .

4. The method for detecting contact lens defects based on image recognition according to claim 3, characterized in that: The frequency selection coefficient is defined in step S5 as: , the calculation formula is as follows: Where a, b, and c are all positive weight coefficients used to adjust the influence of each parameter on the frequency selection coefficient; The formula for setting the frequency band selection is: in, It is The material type of contact lenses is The ultrasonic frequency is selected in each grid area. The value range is between 5MHz and 15MHz; is the frequency selection coefficient; set up The value range is (0,1). The closer it is to 0, the frequency of selection The closer to 5MHz; when The closer it is to 1, the frequency of the selection The closer to 15MHz.

5. The method for detecting contact lens defects based on image recognition according to claim 4, characterized in that: The step S6 of calibrating the ultrasonic probe includes preparing a flawless contact lens sample and performing distance amplitude calibration. , perform sensitivity adjustment and record the reference intensity value and reference time delay value; The recording of the reference intensity value and the reference time delay value is specifically performed by scanning the flawless sample again using the adjusted ultrasonic probe; Record the baseline intensity value for each grid area and the reference time delay value , The calculation formula is as follows; in, It is The material type of contact lenses is The baseline intensity value in each grid area; It is The amplitude value of the echo signal; is the total number of echo signals; The calculation formula is as follows; in, It is The material type of contact lenses is The reference time delay value in the grid area, It is The time delay value of the echo signal.

6. The method for detecting contact lens defects based on image recognition according to claim 5, characterized in that: The step S7 includes ultrasonic emission, ultrasonic reception, signal analysis, detection intensity value and detection time delay value calculation and data storage; The signal analysis is specifically to perform fast Fourier transform on the received ultrasonic signal , to extract the frequency component and intensity of the signal, the fast Fourier transform formula is as follows; in, is the Fourier transform result of the received signal; The received signal sampling points; is the total number of sampling points; p is the imaginary unit; It is a complex exponential function, which is used to realize the transformation from time domain to frequency domain; Represents the frequency component.

7. The method for detecting contact lens defects based on image recognition according to claim 6, characterized in that: The detection intensity value and the detection time delay value are calculated as follows: As a result, calculate the The detection strength value of the grid area and detection time delay value ; in, It is The material type of contact lenses is The detection intensity value in the grid area, yes The maximum amplitude of the result; in, It is The material type of contact lenses is The detection time delay value in the grid area, yes The frequency corresponding to the maximum amplitude of the result.

8. The method for detecting contact lens defects based on image recognition according to claim 7, characterized in that: The first The material type of contact lenses is The reference intensity values ​​and reference time delay values ​​in the grid areas are marked as , ; The material type of contact lenses is The detection intensity values ​​and detection time delay values ​​in the grid areas are marked as , ; Define the first comparison coefficient as , the calculation formula is as follows: It is The material type of contact lenses is The detection intensity value in the grid area, It is The material type of contact lenses is The baseline intensity value in each grid area; The value range of is (0,1). The closer it is to 0, the greater the magnitude of the detection intensity below the reference intensity, and the greater the probability of a defect. The closer it is to 1, the closer the detection intensity is to the reference intensity, and the smaller the probability of defects. Define the second comparison coefficient as , the calculation formula is as follows: It is The material type of contact lenses is The detection time delay value in the grid area, It is The material type of contact lenses is The reference time delay value in the grid area; The value range of is (0,1). The closer it is to 0, the greater the detection time delay is below the reference time delay, and the greater the probability of a defect. The closer it is to 1, the closer the detection time delay is to the reference time delay, and the smaller the probability of a defect.

9. The method for detecting contact lens defects based on image recognition according to claim 8, characterized in that: Define the output result fine-tuning index as , the calculation formula is as follows: in, Fine-tune the index for the output result, used for The material type of contact lenses is Fine-tuning strategies in grid regions; is the maximum value of the first comparison coefficient in all grid areas; is the maximum value of the second comparison coefficient in all grid areas; u 1 and u 2 are the positive weight coefficients of the first comparison coefficient and the second comparison coefficient, respectively, and u 1+ u 2=1,0.14≤ u 1≤0.78,0.08≤ u 2≤0.89; The value range of is (0,1). The closer it is to 0, the higher the probability of defect. The closer it is to 1, the lower the probability of defects; Set the output result fine-tuning index The comparison threshold is Q1; 1) When the output result is fine-tuned index When the defect depth value is greater than the threshold Q1, the fine-tuning strategy is not to perform fine-tuning. and defect size value remain unchanged; 2) When the output result is fine-tuned index When the threshold Q1 is equal, the fine-tuning strategy is to adjust the defect depth value and defect size value Make minor adjustments; 3) When the output result is fine-tuned index When it is less than the threshold Q1, the fine-tuning strategy includes: 3.1) When the first comparison coefficient Less than 0.3, the second comparison coefficient When greater than or equal to 0.8: like u 1≥ u 2, the fine-tuning strategy is A medium adjustment strategy based on like u 1< u 2. Fine-tuning strategy is based on Minor adjustments to the strategy; 3.2) When the first comparison coefficient Greater than or equal to 0.8, the second comparison coefficient When less than 0.3: like u 1≥ u 2, the fine-tuning strategy is Minor adjustments to the strategy; like u 1< u 2. Fine-tuning strategy is based on A medium adjustment strategy based on the current market conditions.

10. A contact lens defect detection system based on image recognition, characterized in that: The system is used to execute the contact lens defect detection method based on image recognition according to any one of claims 1 to 9, comprising: Division module: used to divide the material type and surface mesh of the contact lens to be tested; Neural network model calling module: used to call the pre-trained neural network model for defect detection of contact lenses to be tested; Output result generation module: used to collect image data of the contact lens to be tested, and input the image data into the pre-trained neural network model for processing, and finally obtain the output result of defect detection. The output result includes the first The material type of contact lenses is Defect depth value and defect size value in each grid area; Data acquisition module: used to collect The material type to be tested is contact lenses. The acoustic characteristic data in each grid area, and the expected detection depth, the acoustic characteristic data including the acoustic velocity and acoustic impedance, the expected detection depth being the maximum depth at which the ultrasonic probe penetrates the contact lens material and detects surface defects; Frequency band classification and selection module: used to obtain acoustic characteristic data and expected detection depth, and perform analysis and processing to generate a frequency selection coefficient, which is used to classify and select the frequency band of the ultrasonic probe within the frequency range of 5 MHz to 15 MHz; Reference value generation module: used to calibrate the selected ultrasonic probe using a flawless contact lens sample, and use the calibrated ultrasonic probe to scan the flawless contact lens sample again to obtain reference reference data. The reference reference data includes the first The material type of contact lenses is The reference intensity value and reference time delay value in each grid area; Detection value generation module: used to use the calibrated ultrasonic probe to transmit ultrasonic waves of the frequency band selected by the frequency selection coefficient, so that the ultrasonic waves penetrate the first of the contact lenses to be tested and focus on The ultrasonic signal reflected from the surface of the grid area is then received and analyzed. The ultrasonic signal reflected from the grid area is obtained The detection intensity value and detection time delay value of each grid area; Fine-tuning strategy generation module: used to obtain the reference intensity value and the detection intensity value, and perform analysis and processing to obtain the first comparison coefficient. At the same time, it obtains the reference time delay value and the detection time delay value, and performs analysis and processing to obtain the second comparison coefficient. Subsequently, the detection system combines the first comparison coefficient and the second comparison coefficient for analysis to obtain the output result fine-tuning index. The output result fine-tuning index is used to provide a fine-tuning strategy for the defect depth value and defect size value included in the output result.

Citation Information

Patent Citations

  • Contact lens edge defect detection method based on deep learning

    CN111062961A

  • Contact lens flaw detection method and system, electronic equipment and storage medium

    CN115239663A

  • Profile defect visual inspection method based on image processing

    CN117152119A

  • Method for predicting defects of OLED (Organic Light Emitting Diode) device

    CN117269333A

  • Bio sensor device

    KR1020220001892A

Cited By

  • Process feedback system of contact lens production line

    CN120931633A

  • Digital projection measurement system and method for detecting tiny transparent sample

    CN121558774A

  • A digital projection measurement system and method for micro transparent sample detection

    CN121558774B