An artificial intelligence-based method for detecting defects in contact lens production

Through artificial intelligence-based methods, combined with environmental information and past detection data, multi-angle light source image acquisition and functional defect detection are solved, and the problem of low efficiency and low accuracy of contact lens production defect detection in the existing technology is achieved. Efficient and accurate defect detection.

CN119125008BActive Publication Date: 2025-02-14JILIN REALCON CONTACT LENS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411612615.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-02-14
Estimated Expiration
2044-11-13

AI Technical Summary

Technical Problem

The existing contact lens production defect detection methods are inefficient and have low accuracy, and have not fully considered environmental factors and functional defect detection.

Method used

Using an artificial intelligence-based method, we collect environmental information for environmental regulation, use multiple light sources of different angles and intensity to collect images, adjust image preprocessing schemes based on past detection data, build a defect detection model for functional defect detection, and integrate detection The result outputs a production defect report.

Benefits of technology

It significantly improves the accuracy and efficiency of contact lens production defect detection, ensures the effectiveness and reliability of the test results, and comprehensively detects the functional defects of contact lenses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119125008B_ABST
    Figure CN119125008B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of material production detection, and specifically discloses a contact lens production defect detection method based on artificial intelligence, including: collecting environmental information in the defect detection area; judging whether the detection environment matches or not, if it matches, executing the next step, otherwise, performing environmental control; collecting multiple images at different light source angles and different light source intensities; judging whether the image preprocessing method needs to be changed, if necessary, confirming the changed preprocessing scheme, otherwise, performing image preprocessing; building a defect detection model and training it; performing defect feature detection; performing functional defect detection and analysis on the contact lenses to be detected, and outputting a production defect report. The present invention effectively solves the current problem of insufficient attention to the image processing process, improves the adequacy, representativeness and detection efficiency of contact lens production defect detection, and ensures the effectiveness of subsequent detection results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of material production detection, and specifically, relates to a contact lens production defect detection method based on artificial intelligence. Background Art

[0002] As a medical device that directly contacts the eyes, the quality and safety of contact lenses are of vital importance. During the production process of contact lenses, various defects may occur, such as scratches, bubbles, impurities, deformation, etc. These defects not only affect the comfort of wearing, but may also cause serious harm to eye health, thus highlighting the importance of production defect detection.

[0003] Traditional contact lens production defect detection mainly relies on manual visual observation, which is inefficient, inaccurate, and easily affected by subjective factors of the inspectors.

[0004] Prior art, such as a contact lens defect detection method and system disclosed in a Chinese invention patent application with application number 202410393059.5, comprises: setting a contact lens defect detection system according to the characteristics of the contact lens to be detected, and then combining multiple illumination light sources through one or more beam splitters to form a synthetic light beam. Irradiate the synthetic light beam onto the surface of the contact lens to be detected and collect the lens image of the contact lens to be detected. Enhance the lens image according to a preset image enhancement algorithm. Perform image analysis on the enhanced lens image to determine the defects of the contact lens to be detected. This improves the efficiency and accuracy of contact lens defect detection, while also improving the production efficiency of contact lenses, saving time and cost.

[0005] Another example of prior art is a contact lens mold printing defect detection method and system disclosed in a Chinese invention patent application with application number 202410052836.X. The method obtains multiple contact lens mold color images collected at different light source heights, aligns the centroids of the multiple contact lens mold color images to obtain a contact lens mold fusion image, and coordinate-transforms the contact lens mold fusion image to obtain a transformed image, so that the transformed image adapts to a contact lens mold printing defect detection model, and performs defect detection on the transformed image through the contact lens mold printing defect detection model to obtain a defect detection result, thereby having the technical effect of reducing labor costs, saving time, and improving production yield.

[0006] Regarding the above two technical solutions, it is obvious that the current contact lens production defect detection is mainly carried out by processing the image acquisition to improve the detection efficiency and accuracy. Obviously, there are still the following deficiencies: 1. Insufficient attention is paid to the image processing process, which makes the subsequent detection results insufficiently effective.

[0007] 2. The factors considered are single and the impact of environmental factors is not taken into account, which affects the results of defect detection. For example, factors such as lighting conditions, temperature, and humidity may affect image acquisition and processing.

[0008] 3. Too much emphasis on visual inspection, but lack of inspection of functional defects of contact lenses. The current inspection methods mainly focus on the appearance defects of lenses, and the inspection of functional defects such as optical properties and oxygen permeability of contact lenses is relatively weak. Summary of the invention

[0009] In view of this, in order to solve the problems raised in the above background technology, a contact lens production defect detection method based on artificial intelligence is proposed.

[0010] The purpose of the present invention can be achieved through the following technical solutions: The present invention provides a contact lens production defect detection method based on artificial intelligence, the method comprising: collecting environmental information within the defect detection area, including the temperature, humidity and light intensity of each detection point.

[0011] Based on the humidity and temperature of each detection point, a judgment is made as to whether the detection environment is consistent. If it is consistent, the next step is executed; otherwise, the environment is adjusted.

[0012] Use multiple light sources with different angles and intensities, combine the multiple light sources into a synthetic beam through a beam splitter, and irradiate the surface of the contact lens to be tested, and collect multiple images at different light source angles and different light source intensities.

[0013] Import the past inspection and verification data of the same model of contact lenses to be inspected, determine whether the image preprocessing method needs to be changed, and if so, confirm the changed preprocessing scheme; otherwise, perform image preprocessing according to the pre-set preprocessing scheme to obtain a preprocessed image set.

[0014] Build a defect detection model and input the preprocessed image set into the defect detection model for training.

[0015] The trained defect detection model is used to detect defect features on the input preprocessed image set and output the type, location and size of the defect.

[0016] Through the pre-installed testing equipment, the contact lenses to be tested are tested for functional defects, the index values ​​of various functional testing indicators are obtained, and functional defect analysis is performed.

[0017] Integrate the functional defect analysis results with the defect type, location and size output by the defect detection model to output a production defect report.

[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) The present invention effectively solves the current problem of single consideration factors by judging whether the detection environment is consistent and performing environmental control, fully considering the influence of environmental factors, and can significantly improve the accuracy of contact lens production defect detection results, thereby facilitating subsequent contact lens production defect detection and improving the reliability of subsequent production defect detection results as much as possible.

[0019] (2) The present invention combines past inspection and verification data and environmental information to determine the need for changing the preprocessing method, confirms the changed preprocessing scheme when needed, and performs corresponding preprocessing, thereby effectively solving the current problem of insufficient attention to the image processing process, greatly improving the efficiency of subsequent production defect detection, and also ensuring the effectiveness of subsequent inspection results and their consistency with actual conditions.

[0020] (3) The present invention introduces multiple indicators, such as the number of test batches before and after the middle position, the number of consecutive test batches, and the difference of test samples to set the missed detection assessment correction factor, thereby improving the reliability and accuracy of the past missed detection over-scale analysis results, breaking the limitation of relying solely on a single missed detection rate assessment indicator for analysis, and facilitating a comprehensive analysis of missed detection situations.

[0021] (4) The present invention avoids the shortcomings of the current excessive tendency to focus on visual level detection by performing functional defect detection and functional defect analysis on the contact lenses to be tested, fully combines the detection of functional defects of contact lenses, and then intuitively displays the functional defects of the contact lenses such as optical properties and oxygen permeability, thereby improving the adequacy and representativeness of contact lens production defect detection, while also ensuring the effect of production defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0023] Figure 1 The present invention is a schematic flow chart of the steps for implementing the method.

[0024] Figure 2 This is a flow chart for judging whether the detection environment is consistent with the present invention.

[0025] Figure 3 This is a flow chart for determining whether the image preprocessing method of the present invention needs to be changed.

[0026] Figure 4It is a schematic diagram of the structural composition of the defect detection model of the present invention. DETAILED DESCRIPTION

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

[0028] See also Figure 1 As shown, the present invention provides a contact lens production defect detection method based on artificial intelligence, the method comprising: S1, collecting environmental information in the defect detection area, including the temperature, humidity and light intensity of each detection point.

[0029] S2. Based on the humidity and temperature of each detection point, determine whether the detection environment is consistent. If it is consistent, execute the next step; otherwise, perform environmental control.

[0030] S3. Use multiple light sources with different angles and intensities, combine the multiple light sources into a synthetic light beam through a beam splitter, illuminate the surface of the contact lens to be tested, and collect multiple images at different light source angles and different light source intensities.

[0031] S4. Import the past inspection and verification data of the same model of contact lenses to be inspected, determine whether the image preprocessing method needs to be changed, and if so, confirm the changed preprocessing scheme; otherwise, perform image preprocessing according to the pre-set preprocessing scheme to obtain a preprocessed image set.

[0032] S5. Build a defect detection model and input the preprocessed image set into the defect detection model for training.

[0033] S6. Perform defect feature detection on the input preprocessed image set through the trained defect detection model, and output the type, location and size of the defect.

[0034] S7. Perform functional defect detection on the contact lens to be tested by using pre-installed testing equipment, obtain index values ​​of various functional test indexes, and perform functional defect analysis.

[0035] S8. Integrate the functional defect analysis results with the defect type, location and size output by the defect detection model, and output a production defect report.

[0036] Furthermore, it is necessary to add that in order to ensure the representativeness of the environmental detection data corresponding to the defect detection area, multiple temperature and humidity sensors can be deployed at key locations in the defect detection area to ensure coverage of the entire detection area. For example, sensors can be deployed at the entrance and exit, where the temperature is collected by the temperature sensor, the humidity is collected by the humidity sensor, and the light intensity is collected by the photoresistor sensor.

[0037] For further information, see Figure 2 As shown, in step S2, whether the detection environment is consistent or not is judged, including: S21, calculating the average temperature of each detection point to obtain an average detection temperature.

[0038] S22, calculating the standard deviation of the temperature of each detection point, and using the calculation result as the temperature distribution difference.

[0039] S23, selecting the highest humidity and the lowest humidity from the humidity of each detection point, and obtaining the average humidity by averaging.

[0040] S24. Taking the average of the average humidity and the maximum humidity as the first analysis humidity, and taking the average of the minimum humidity and the average humidity as the second analysis humidity.

[0041] S25, taking the average detection temperature exceeding the upper limit of the appropriate detection temperature range corresponding to the contact lens to be detected or the temperature distribution difference being greater than the set reference temperature distribution difference as judgment condition 1.

[0042] S26, taking the first analysis humidity exceeding the upper limit of the suitable detection humidity interval corresponding to the contact lens to be tested or the second analysis humidity being lower than the lower limit of the suitable detection humidity interval corresponding to the contact lens to be tested as judgment condition 2.

[0043] S27, judging whether one of condition 1 and condition 2 is true or not, if so, taking it as the judgment result that it is consistent, if not, taking it as the judgment result that it is inconsistent.

[0044] It should be added that high humidity may cause blurred images or water mist, affecting the accuracy of image processing and analysis. It may also increase the noise in the image, affecting the accuracy of feature extraction and defect detection, and contact lens materials usually have a certain degree of water absorption. In a high humidity environment, contact lenses will absorb more water, causing changes in their thickness and shape, affecting the detection results, while temperature changes may cause changes in the brightness and contrast of the image, affecting the accuracy of image processing and analysis. At the same time, high temperatures may cause the contact lens materials to soften or deform, and low temperatures may cause the materials to become brittle. These changes will affect the shape and size of the contact lenses, thereby affecting the detection results, and temperature changes may affect the light transmittance of the contact lenses, especially at extreme temperatures, the light transmittance may change, affecting the accuracy of optical detection. Therefore, it is necessary to conduct advance analysis and processing of the temperature and humidity in the environment to facilitate subsequent image processing and functional defect detection, thereby maximizing the accuracy and efficiency of contact lens corresponding defect detection.

[0045] In a specific embodiment, the suitable detection temperature range for the contact lenses to be detected is 20°C-25°C, the suitable detection humidity range for the contact lenses is 40%-60%, and the reference temperature distribution difference can be set to a specific value of 5°C.

[0046] In another specific embodiment, the specific control process of performing environmental control is exemplified as follows: if judgment condition 1 is met, the absolute value of the difference between the average detection temperature and the set upper limit value of the appropriate detection temperature range corresponding to the contact lens to be detected is used as the control temperature value, and lowering control is used as the control method.

[0047] If the temperature distribution difference is less than or set as the reference temperature distribution difference, the default temperature reduction rate of the temperature control device is used as the control temperature rate. If the temperature distribution difference is greater than the set reference temperature distribution difference, the initial default temperature reduction rate of the temperature control device is recorded as , the temperature distribution difference and the set reference temperature distribution difference are recorded as and ,Will As the temperature rate is controlled, It is a natural constant. Based on the control temperature value, control method and control temperature rate, the corresponding temperature control device is started to perform corresponding temperature control.

[0048] If judgment condition 2 is met and the first analysis humidity exceeds the upper limit value of the suitable detection humidity range corresponding to the contact lens to be tested, dehumidification is used as the control method, and the absolute value of the difference between the analysis humidity and the upper limit value of the suitable detection humidity range corresponding to the contact lens to be tested is used as the dehumidification amount. Based on the control method and the dehumidification amount, the corresponding humidity control device is started to perform corresponding humidity control.

[0049] If judgment condition 2 is met and the second analysis humidity is lower than the lower limit of the appropriate detection humidity range corresponding to the contact lens to be tested, the absolute value of the difference between the two is used as the humidification amount, and humidification is used as the control method. Based on the control method and the humidification amount, the corresponding humidity control device is started to perform corresponding humidity control.

[0050] Understandably, when the temperature distribution is uneven, that is, when the temperature distribution difference is large, the temperature should be gradually reduced to prevent the temperature from changing too quickly and causing the contact lens material to deform. That is, the greater the temperature distribution difference, the slower the temperature drop rate, and the less interference it has on the contact lens material. Therefore, according to and The correction factor is set according to the situation, where , Represents the temperature rate control correction factor.

[0051] The embodiment of the present invention effectively solves the current problem of single consideration factors by judging whether the detection environment is consistent and performing environmental control, fully considers the influence of environmental factors, and can significantly improve the accuracy of contact lens production defect detection results, thereby facilitating subsequent contact lens production defect detection and improving the reliability of subsequent production defect detection results as much as possible.

[0052] For further information, see Figure 3 As shown, judging whether the image preprocessing method needs to be changed in step S4 includes: S41, extracting the inspection date of each inspection batch and the defect inspection list and verification defect list of each inspected contact lens in each inspection batch from the past inspection and verification data.

[0053] S42, calculating the defect missed detection rate and defect false detection rate of each inspection batch, and then calculating the past inspection accuracy of the contact lenses to be inspected.

[0054] S43, calculating the standard deviation of the light intensity at each layout point and using it as the light intensity distribution difference of the defect detection area.

[0055] S44. If the past detection accuracy of the contact lens to be detected is lower than the set reference detection accuracy or the light intensity distribution difference of the defect detection area exceeds the set reference light intensity distribution difference, it will be taken as a judgment result.

[0056] S45. If the past detection accuracy of the contact lens to be detected is higher than or equal to the set reference detection accuracy and the light intensity distribution difference of the defect detection area is less than or equal to the set reference light intensity distribution difference, it will not be needed as a judgment result.

[0057] Among them, the defect missed detection rate and defect false detection rate of each inspection batch are calculated in step S42, including: E1, comparing the defect inspection list and the verification defect inspection list of the same inspection contact lens. If there is a defect item in the verification defect list that does not exist in the defect inspection list, the defect item is recorded as a type of missed detection defect item.

[0058] E2. If the number of inspection locations of a defect item in the defect inspection list is inconsistent with the number of inspection locations of the defect item in the verification defect list, the defect shall be recorded as a second-class missed inspection defect item.

[0059] E3. Count the number of first-category missed-detection defect items and the number of second-category missed-detection defect items, and take the sum of the two as the total number of missed-detection defect items.

[0060] E4. Divide the total number of missed defect items by the total number of defect items in the corresponding defect detection list to obtain the defect missed detection rate.

[0061] E5. Calculate the mean defect missed detection rate of each tested contact lens in each tested batch to obtain the defect missed detection rate of each tested batch.

[0062] E6. If the detection value of a defect item in the defect detection list is inconsistent with the detection value of the defect item in the verification defect list, and the difference between the two exceeds the preset reference detection value difference, the defect item is recorded as a false detection defect item.

[0063] E7. Count the number of falsely detected defect items and divide it by the total number of defect items in the corresponding defect detection list to obtain the false detection rate of the defect.

[0064] E8. Calculate the mean of the defect false detection rate of each tested contact lens in each tested batch to obtain the defect false detection rate of each tested batch.

[0065] In a specific embodiment, the defect items include scratches, bubbles, stains, deformation, burrs, etc., wherein the defect detection list will record the number of detection locations of scratches, the highest scratch length of scratches, the number of detection locations of bubbles, the maximum detection area of ​​bubbles, the number of detection locations of stains, the maximum detection area of ​​stains, the number of detection locations of burrs, the maximum detection area of ​​burrs, the maximum length of burrs, etc.

[0066] Wherein, the calculation of the past detection accuracy of the contact lens to be detected in step S42 includes: J1, taking the detection date as the horizontal coordinate and the defect missed detection rate as the vertical coordinate, constructing a defect missed detection rate change curve, extracting the slope of the curve as the defect missed detection growth rate, recorded as .

[0067] J2. Count the number of inspection batches whose defect missed detection rate is greater than the set permissible defect missed detection rate, and divide it by the number of inspection batches. The ratio is taken as the excess missed detection batch ratio, recorded as .

[0068] J3. Count the past missed detection and over-scale of the contact lenses to be tested, recorded as , , and They are the defect missed detection growth rate and the over-standard missed detection batch ratio for setting references respectively. Correction factor for missed detection evaluation set.

[0069] In a specific embodiment, when the slope of a curve refers to the slope of the curve corresponding to the regression line, and The value of is greater than 0, indicating that the defect missed detection rate is increasing. For example, The value can be 0.1, when contact lenses are used in high-risk medical scenarios, such as aviation, The value can be 0.05. When the contact lenses are used in ordinary scenes, The value can be 0.1.

[0070] J4. According to the setting method of defect missed detection growth rate and over-standard missed detection batch ratio, set the defect false detection growth rate, over-standard false detection batch ratio and false detection assessment correction factor, and then The statistical method is similar to the statistical method of the past false detection of the contact lenses to be tested. .

[0071] J5. Set the weights of defect missed detection and defect false detection, denoted as and , calculate the past detection accuracy of the contact lens to be tested , .

[0072] It should be added that missed defect detection refers to contact lenses that actually have defects being mistakenly judged as non-defective. Missed defect detection directly affects product quality and may cause unqualified products to enter the market, posing a threat to user health and safety. Missed defect detection directly affects product quality, while false defect detection refers to contact lenses that actually have no defects being mistakenly judged as defective or the actual defect situation is lower than the detection situation or the actual defect situation is higher than the detection situation. False detection will cause qualified products to be mistakenly rejected, increase unnecessary re-inspection and re-testing workload, affect production efficiency, and increase the probability of unqualified products entering the market or the probability of once qualified products being rejected. Since missed detection poses the greatest threat to user health and safety, the weight of missed defect detection is set higher than the weight of false defect detection. For example, and The values ​​can be 0.55 and 0.45 respectively.

[0073] It should also be added that the specific setting process of the missed detection assessment correction factor described in step J3 includes: sorting the inspection batches in chronological order of inspection date, and treating the inspection batches whose defect missed detection rate is greater than the set allowable defect missed detection rate as missed detection batches.

[0074] The number of missed detection batches before the middle position of the sorting position and the number of missed detection batches after the middle position of the sorting position are counted, respectively. and .

[0075] Traverse each missed detection batch after the middle position, and count the number of missed detection batches whose sorting positions are continuous, recorded as .

[0076] The number of contact lenses tested in each test batch is counted, and the standard deviation is calculated to obtain the difference of the test samples of the test batch, which is recorded as .

[0077] Setting the Missed Detection Assessment Correction Factor , , is a natural constant, and The ratio of the batches before and after the reference leak detection and the ratio of the batches after the continuous leak detection are set respectively. To set the difference between the test samples of the reference.

[0078] It can be understood that continuous sorting positions mean that there is one position between sorting positions. For example, assuming that there are 12 missed detection batches in total, the sorting positions of the missed detection batches after the middle position are the 7th, 8th, 10th and 12th respectively, and the sorting position of the 7th and the sorting position of the 8th are continuous, that is, the number of missed detection batches with continuous sorting positions is 2.

[0079] Understandably, different test batches may have problems with the comparability of missed detection rates due to factors such as different sample sizes and different test conditions. The weights between different batches can be adjusted through correction factors to make the final statistical results more reasonable. At the same time, some batches are conducted earlier, and their testing technology and equipment may not be as advanced as those in later batches, so their missed detection rates may be higher. Correction factors can help adjust this time difference and make long-term trends clearer. Therefore, it is necessary to set a missed detection assessment correction factor when counting the past missed detection excesses of the contact lenses to be tested.

[0080] It should be explained that by counting the number of test batches before and after the middle position, the time distribution of batches with excessive missed detection rates can be understood. This helps to identify whether there are systemic problems within a specific time period. By counting the number of consecutive test batches after the middle position, it can be found whether there are multiple consecutive batches with excessive missed detection rates. The more consecutive, the greater the statistical deviation. Fluctuations in the number of test samples may affect the stability of the missed detection rate. By calculating the difference in the test samples, the sample fluctuations between different batches can be evaluated, thereby adjusting the evaluation of the missed detection rate. Therefore, the three indicators of the ratio of the number of test batches before and after the middle position, the number of consecutive test batches, and the difference in the test samples are used to set the missed detection evaluation correction factor.

[0081] In a specific embodiment, The specific value can be 2. The specific value can be 0.3. The number of contact lenses tested in each test batch is set according to the average number of contact lenses tested in each test batch. For example, the average number of contact lenses tested in each test batch is 1000. The value can be 100.

[0082] The embodiment of the present invention introduces multiple indicators, such as the number of inspection batches before and after the middle position, the number of continuous inspection batches, and the difference of inspection samples to set the missed detection assessment correction factor, thereby improving the reliability and accuracy of past missed detection and over-scale analysis results, breaking the limitation of relying solely on a single missed detection rate assessment indicator for analysis, and facilitating a comprehensive analysis of missed detection situations.

[0083] Furthermore, the step S4 of confirming the changed preprocessing scheme includes: H1, confirming preprocessing adjustment items, including local enhancement window size and local enhancement strength.

[0084] Among them, confirming the preprocessing adjustment item includes: if the light intensity distribution difference in the defect detection area exceeds the set reference light intensity distribution difference, using the local enhancement window size as the preprocessing adjustment item.

[0085] If the past detection accuracy of the contact lens to be detected is lower than the set reference detection accuracy, the local enhancement intensity is used as a preprocessing adjustment item.

[0086] H2. If the preprocessing adjustment item is a local enhancement window size, the pre-set local enhancement window size will be extracted from the preprocessing scheme.

[0087] H3. Compare the light intensity distribution difference of the defect detection area with the light intensity distribution difference range corresponding to the set magnifications to obtain the matching magnification, and enlarge the pre-set local enhancement window size to obtain the changed local enhancement window size.

[0088] H4. If the preprocessing adjustment item is local enhancement strength, set the local enhancement adjustment factor, recorded as , the preset local enhancement coefficient is recorded as ,Will As the local enhancement adjustment coefficient after the change.

[0089] H5. Based on the changed local enhancement window size and the local enhancement adjustment coefficient, the corresponding local enhancement window size and the corresponding local enhancement adjustment coefficient are replaced from the preprocessing scheme to generate a changed preprocessing scheme.

[0090] It should be added that uneven external illumination can cause some areas of the image to be too bright or too dark, affecting the overall quality of the image. This uneven illumination can make the effect of local enhancement unpredictable, and may cause some areas to be over-enhanced or under-enhanced. Uneven illumination may introduce more noise, affecting the clarity and details of the image.

[0091] It should also be added that if the false detection rate is high, the enhancement intensity can be appropriately reduced to reduce the risk of normal areas being misjudged as defects. If the missed detection rate is high, the enhancement intensity can be appropriately increased, especially for those defect types that are easy to miss, such as tiny bubbles and fine scratches. This can be achieved by increasing the enhancement coefficient or adjusting the local contrast.

[0092] In summary, the uniformity of external illumination will affect the setting of the window size for local enhancement. For example, a larger window can be used in areas with high illumination unevenness to smooth illumination changes. A smaller window can be used in areas with uniform illumination to retain more details. Past detection results will affect the setting of the enhancement intensity. Image adjustment analysis is performed based on the external environment and past detection results.

[0093] Among them, the local enhancement adjustment factor is set in step H4, including: ,Will As the local enhancement adjustment factor, denoted as , To set the reference missed over-scale, This is the past missed detection and over-standard degree of the aforementioned contact lenses to be tested.

[0094] If only ,Will As the local enhancement adjustment factor, denoted as , To set the reference false detection over-scale, It is the past false detection over-scale of the aforementioned contact lens to be tested.

[0095] like and ,Will As the local enhancement adjustment factor, denoted as , is the weight of the aforementioned defect omission, The weight of the aforementioned defect false detection is used to set the local enhancement adjustment factor , The value is or or , .

[0096] It should be added that when the previous test accuracy of the contact lens to be tested is lower than the set reference test accuracy, it indicates that or The value of is larger, so the local enhancement adjustment factor is set according to different situations, and in a specific embodiment, The value can be 0.02. The value can be 0.05.

[0097] The embodiment of the present invention combines past inspection and verification data and environmental information to determine the need for changing the preprocessing method, confirms the changed preprocessing scheme when needed, and performs corresponding preprocessing, thereby effectively solving the current problem of insufficient attention to the image processing process, greatly improving the efficiency of subsequent production defect detection, and also ensuring the effectiveness of subsequent inspection results and their consistency with actual conditions.

[0098] Furthermore, before building the defect detection model in step S5, it also includes selecting an artificial intelligence algorithm and model architecture based on the characteristics and requirements of contact lens defect detection, and then building an artificial intelligence defect detection model based on the selected algorithm.

[0099] In a specific embodiment, the characteristics and requirements of contact lens defect detection are pre-set and provided by the contact lens manufacturer, and the selected artificial intelligence algorithm and model architecture can use convolutional neural networks, deep neural networks, or region-based convolutional neural networks and other algorithms in specific scenarios, which can ensure good effects and efficiency in image recognition and target detection.

[0100] In another specific embodiment, Figure 4 As shown, the structure of the defect detection model includes an input layer, a hidden layer and an output layer, wherein the hidden layer can be composed of multiple convolutional layers, pooling layers and fully connected layers for feature extraction and classification of images.

[0101] Furthermore, it should be added that in step S5, the training process also includes continuously adjusting the parameters of the defect detection model so that the defect detection model can accurately identify the defects of the contact lens. The training process can adopt a batch training method, input a batch of image data each time, and use a back propagation algorithm and an optimizer to update the weights and biases of the defect detection model, wherein the back propagation algorithm is such as stochastic gradient descent, Adam, etc.

[0102] Exemplarily, adjusting the parameters of the production defect detection model includes adjusting the learning rate, regularization parameter, network structure parameter, batch size, etc., and the adjustment method can use the optimization algorithm to automatically search for the best parameter combination. For example, grid search or random search can be used to perform an exhaustive search within a given parameter range to find the parameter combination with the best performance. The examples given in the present invention are not fixed processing methods, and corresponding adjustments can be made according to needs in actual scenarios.

[0103] It should also be added that during the training process, the defect detection model is also regularly evaluated, and the accuracy and generalization ability of the defect detection model are tested using a verification image set or a test image set. The evaluation indicators may include accuracy, recall, F1 value, etc., and the defect detection model is adjusted and optimized according to the evaluation results. The test image set is the preprocessed image set described in the present invention, and in a specific embodiment, the defect detection model is evaluated by accuracy, recall, F1 value, etc. as a relatively mature model evaluation method, and the defect detection model is adjusted and optimized according to the evaluation results as a relatively mature means. The detailed process of its specific adjustment and optimization will not be shown here. At the same time, the defect detection model is an existing model, and its specific recognition process will not be described.

[0104] Furthermore, it should be added in step S6 that the functional detection indicators include multiple indicators such as oxygen permeability coefficient, oxygen permeability, aberration and moisture content.

[0105] Understandably, in a specific embodiment, the oxygen permeability coefficient can be calculated by measuring the amount of electricity generated on the electrode after oxygen passes through the contact lens material using a coulometer in a pre-installed detection device. The oxygen permeability can be calculated by placing the contact lens in a device simulating an eye environment and measuring the amount of oxygen passing through the contact lens within a certain period of time using a gas sensor in the detection device. Aberration is part of the optical performance index and can be measured using an aberrometer in the detection device. Water content is part of the somatosensory performance index and can be measured using a moisture meter and other equipment.

[0106] Furthermore, the functional defect analysis performed in step S7 includes: marking the functional detection index whose index value exceeds the set corresponding functional detection index reference index value interval as a deviation functional index.

[0107] Calculate the difference between the index value of each deviation function index and its reference index value interval, take the absolute value of the difference, and divide it by the index value of each deviation function index to obtain the deviation degree of each deviation function index.

[0108] Each deviation function index and the deviation degree of the deviation function index are taken as the functional defect analysis results.

[0109] It should be added that when the indicator value is less than the lower limit of the reference indicator value interval, the difference between the indicator value and the lower limit of the reference indicator value interval is calculated; when the indicator value is greater than the upper limit of the reference indicator value interval, the difference between the indicator value and the upper limit of the reference indicator value interval is calculated.

[0110] The embodiments of the present invention perform functional defect detection and functional defect analysis on the contact lenses to be inspected, thereby avoiding the shortcomings of the current excessive tendency to focus on visualization-level detection, fully combining the detection of functional defects of contact lenses, and further intuitively displaying the functional defects of the contact lenses such as optical properties and oxygen permeability, thereby improving the adequacy and representativeness of contact lens production defect detection, while also ensuring the effectiveness of production defect detection.

[0111] The above contents are merely examples and explanations of the concept of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the concept of the invention or exceed the scope defined by the present invention, they shall all fall within the protection scope of the present invention.

Claims

1. A method for detecting defects in contact lens production based on artificial intelligence, characterized in that: The method includes: Collect environmental information within the defect detection area, including temperature, humidity and light intensity at each detection point; Based on the humidity and temperature of each detection point, determine whether the detection environment is consistent or not. If it is consistent, execute the next step, otherwise, perform environmental control; Using multiple light sources with different angles and intensities, combining the multiple light sources into a composite light beam through a beam splitter, irradiating the surface of the contact lens to be tested, and collecting multiple images at different light source angles and different light source intensities; Import the past inspection and verification data of the same type of contact lenses to be inspected, determine whether the image preprocessing method needs to be changed, and if so, confirm the changed preprocessing scheme; otherwise, perform image preprocessing according to the pre-set preprocessing scheme to obtain a preprocessed image set; Build a defect detection model and input the preprocessed image set into the defect detection model for training; The trained defect detection model is used to detect defect features on the input preprocessed image set, and the defect type, location and size are output; Through the pre-installed testing equipment, the contact lenses to be tested are tested for functional defects, the index values ​​of various functional testing indicators are obtained, and functional defect analysis is performed; Integrate the functional defect analysis results with the defect type, location and size output by the defect detection model to output a production defect report; The determining whether the image preprocessing method needs to be changed includes: Extracting the test date of each test batch and the defect test list and the verified defect list of each test contact lens in each test batch from the past test verification data; Calculate the defect missed detection rate and defect false detection rate of each inspection batch, and then calculate the past inspection accuracy of the contact lenses to be inspected; Calculate the standard deviation of the light intensity at each layout point and use it as the difference in light intensity distribution in the defect detection area; If the past detection accuracy of the contact lens to be detected is lower than the set reference detection accuracy or the difference in light intensity distribution in the defect detection area exceeds the set reference light intensity distribution difference, it will be taken as the judgment result; If the past detection accuracy of the contact lens to be detected is higher than or equal to the set reference detection accuracy and the light intensity distribution difference of the defect detection area is less than or equal to the set reference light intensity distribution difference, it will not be used as a judgment result; The confirmed changed pretreatment plan includes: Confirm preprocessing adjustments, including local enhancement window size and local enhancement strength; If the preprocessing adjustment item is a local enhancement window size, the pre-set local enhancement window size is extracted from the preprocessing scheme; The light intensity distribution difference of the defect detection area is compared with the light intensity distribution difference interval corresponding to each set magnification to obtain a matching magnification, and the preset local enhancement window size is enlarged to obtain a changed local enhancement window size; If the preprocessing adjustment item is the local enhancement strength, set the local enhancement adjustment factor, denoted as , the preset local enhancement coefficient is recorded as ,Will As the local enhancement adjustment coefficient after the change; Based on the changed local enhancement window size and the local enhancement adjustment coefficient, a corresponding local enhancement window size and a corresponding local enhancement adjustment coefficient are replaced from the preprocessing scheme to generate a changed preprocessing scheme; The confirmation preprocessing adjustment items include: If the difference in light intensity distribution in the defect detection area exceeds the set reference light intensity distribution difference, the local enhancement window size is used as a preprocessing adjustment item; If the past detection accuracy of the contact lens to be detected is lower than the set reference detection accuracy, the local enhancement intensity is used as a preprocessing adjustment item.

2. The method for detecting defects in contact lens production based on artificial intelligence as claimed in claim 1, characterized in that: The determining whether the detection environment is consistent or not includes: Calculate the average temperature of each detection point to obtain the average detection temperature; The standard deviation of the temperature at each detection point is calculated, and the calculation result is used as the temperature distribution difference; The highest humidity and the lowest humidity are selected from the humidity of each detection point, and the average humidity is obtained by averaging. The average of the average humidity and the maximum humidity is taken as the first analysis humidity, and the average of the minimum humidity and the average humidity is taken as the second analysis humidity; The average detection temperature exceeds the upper limit of the appropriate detection temperature range corresponding to the contact lens to be detected or the temperature distribution difference is greater than the set reference temperature distribution difference as judgment condition 1; The first analysis humidity exceeds the upper limit of the suitable detection humidity interval corresponding to the contact lens to be tested or the second analysis humidity is lower than the lower limit of the suitable detection humidity interval corresponding to the contact lens to be tested as judgment condition 2; Determine whether one of condition 1 and condition 2 is true or not. If so, the result of judgment is consistent. If not, the result of judgment is inconsistent.

3. The method for detecting defects in contact lens production based on artificial intelligence as claimed in claim 1, characterized in that: The calculation of the defect missed detection rate and defect false detection rate of each inspection batch includes: Compare the defect detection list and the verification defect detection list of the same tested contact lens. If there is a defect item in the verification defect list that does not exist in the defect detection list, record the defect item as a type of missed defect item; If the number of inspection locations of a defect item in the defect inspection list is inconsistent with the number of inspection locations of the defect item in the verification defect list, the defect shall be recorded as a second-class missed inspection defect item; Count the number of first-category missed defect items and the number of second-category missed defect items, and take the sum of the two as the total number of missed defect items; The total number of missed defect items is divided by the total number of defect items in the corresponding defect detection list to obtain the missed defect rate; Calculate the mean of the defect missed detection rate of each tested contact lens in each tested batch to obtain the defect missed detection rate of each tested batch; If the detection value of a defect item in the defect detection list is inconsistent with the detection value of the defect item in the verification defect list, and the difference between the two exceeds the preset reference detection value difference, the defect item is recorded as a false detection defect item; Count the number of falsely detected defects and divide it by the total number of defect items in the corresponding defect detection list to obtain the false detection rate of defects. The defect false detection rate of each tested contact lens in each tested batch is averaged to obtain the defect false detection rate of each tested batch.

4. The method for detecting defects in contact lens production based on artificial intelligence according to claim 1, characterized in that: The calculating of the past detection accuracy of the contact lens to be detected comprises: With the inspection date as the horizontal axis and the defect missed detection rate as the vertical axis, a defect missed detection rate change curve is constructed, and the slope of the curve is extracted as the defect missed detection growth rate, which is recorded as ; The number of inspection batches with defect missed detection rate greater than the set permissible defect missed detection rate is counted and divided by the number of inspection batches. The ratio is taken as the excess missed detection batch ratio, which is recorded as ; The past missed detection and over-scale of the contact lenses to be tested are counted and recorded as , , and They are the defect missed detection growth rate and the over-standard missed detection batch ratio for setting references respectively. Evaluate correction factors for missed detections set; According to the setting method of defect missed detection growth rate and over-standard missed detection batch ratio, set the defect false detection growth rate, over-standard false detection batch ratio and false detection assessment correction factor, and then The statistical method is similar to the statistical method of the past false detection of the contact lenses to be tested. ; Set the weights of defect missed detection and defect false detection, denoted as and , calculate the past detection accuracy of the contact lens to be tested , .

5. The method for detecting defects in contact lens production based on artificial intelligence as claimed in claim 4, characterized in that: The specific setting process of the missed detection assessment correction factor includes: Sort the inspection batches in the order of inspection date, and take the inspection batches whose defect missed detection rate is greater than the set permissible defect missed detection rate as missed detection batches; The number of missed detection batches before the middle position of the sorting position and the number of missed detection batches after the middle position of the sorting position are counted, respectively. and ; Traverse each missed detection batch after the middle position, and count the number of missed detection batches whose sorting positions are continuous, recorded as ; The number of contact lenses tested in each test batch is counted, and the standard deviation is calculated to obtain the difference of the test samples of the test batch, which is recorded as ; Setting the Missed Detection Assessment Correction Factor , , is a natural constant, and The ratio of the batches before and after the reference leak detection and the ratio of the batches after the continuous leak detection are set respectively. To set the difference between the test samples of the reference.

6. The method for detecting defects in contact lens production based on artificial intelligence as claimed in claim 1, characterized in that: The setting of the local enhancement adjustment factor includes: If only ,Will As the local enhancement adjustment factor, denoted as , To set the reference missed detection over-scale; If only ,Will As the local enhancement adjustment factor, denoted as , To set the false detection over-scale of the reference; like and ,Will As the local enhancement adjustment factor, denoted as , to set the local enhancement adjustment factor , The value is or or , .

7. The method for detecting defects in contact lens production based on artificial intelligence as claimed in claim 1, characterized in that: The functional defect analysis comprises: The functional detection index whose index value exceeds the set reference index value interval of the corresponding functional detection index is marked as a deviation functional index; Calculate the difference between the index value of each deviation function index and its reference index value interval, take the absolute value of the difference, and divide it by the index value of each deviation function index to obtain the deviation degree of each deviation function index; Each deviation function index and the deviation degree of the deviation function index are taken as the functional defect analysis results.

Citation Information

Patent Citations

  • A contact lens casting mold printing defect detection method and system

    CN117849072B

  • Contact lens defect detection method and system

    CN118275443A

  • PCBA appearance defect intelligent detection method

    CN117664990A

  • Method apparatus for online contact lens evaluation

    CN1886690A