Lens diopter detection method and system, intelligent terminal and storage medium

By constructing a lens diopter detection model and using image data to predict the diopter, the problem of low lens diopter detection efficiency in the prior art is solved, and efficient and accurate lens diopter detection is achieved.

CN118982819AActive Publication Date: 2024-11-19NINGBO MING SING OPTICAL R & D

Patent Information

Application Number
CN202410997380.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-19
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

The existing lens diopter detection methods require slow movement of the reticle, resulting in cumbersome detection steps, low efficiency, and precise control is required to measure the focal length of the lens, thereby affecting the detection efficiency.

Method used

By acquiring the image data set information of the lens, a diopter detection model is constructed, and the actual diopter of the lens is predicted using the image data information, avoiding the need to move the reticle to measure the focal length of the lens, and improving detection efficiency.

Benefits of technology

It realizes high efficiency of lens diopter detection, reduces manual operation steps, improves detection accuracy and efficiency, and simplifies the detection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982819A_ABST
    Figure CN118982819A_ABST
Patent Text Reader

Abstract

The invention relates to a lens diopter detection method and system, an intelligent terminal and a storage medium, and relates to the field of intelligent medical technology, and the method comprises the steps: obtaining the image data set information of a lens; constructing a diopter detection model according to the image data set information and a preset model algorithm; acquiring to-be-detected image data information of the lens; and inputting the data information of the image to be detected into the diopter detection model to predict the actual diopter information of the lens. The lens diopter detection method has the effect of improving the lens diopter detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent medical technology, and in particular to a lens diopter detection method, system, intelligent terminal and storage medium. Background Art

[0002] The diopter of a lens is a measure of the refractive power of a lens and is widely used in optics and ophthalmology. It is defined as the reciprocal of the focal length of the lens.

[0003] In the related art, the refractive power of the lens is detected by a focal meter. First, the collimation system is controlled to convert the light beam generated by the light source into a parallel light beam, so that the parallel light beam is irradiated onto the graticule through the lens. Then, the graticule is controlled to move, and the image on the graticule is observed through the observation system. When the image is clearly visible, it indicates that the graticule is at the focus of the lens. The focal length of the lens is obtained by measuring the distance between the graticule and the lens, and the reciprocal of the focal length is calculated to obtain the refractive power of the lens.

[0004] With regard to the above-mentioned related technologies, when measuring the refractive power of a lens, it is necessary to slowly move the graticule plate, so as to accurately control the graticule plate to move to the focal position of the lens, and then calculate the refractive power after measuring the focal length. This makes the detection steps of the refractive power of the lens too cumbersome, resulting in low efficiency in detecting the refractive power of the lens, and there is still room for improvement. Summary of the invention

[0005] In order to improve the detection efficiency of lens diopter, the present application provides a lens diopter detection method, system, intelligent terminal and storage medium.

[0006] In a first aspect, the present application provides a method for detecting the refractive power of a lens, which adopts the following technical solution: A method for detecting the diopter of a lens, comprising: Obtaining image dataset information of the lens; Constructing a diopter detection model based on image data set information and a preset model algorithm; Obtain the image data information of the lens to be tested; The image data information to be tested is input into the refractive power detection model to predict the actual refractive power information of the lens.

[0007] By adopting the above technical solution, a refractive power detection model is constructed according to the image data set information and model algorithm of the lens. Therefore, when the refractive power of the lens is subsequently detected, it is only necessary to input the image data information of the lens to be detected into the refractive power detection model to obtain the actual refractive power information of the lens, without the need for personnel to move the graticule to measure the focal length of the lens, thereby improving the detection efficiency of the refractive power of the lens.

[0008] Optionally, the step of obtaining the image dataset information of the lens includes: Obtaining original image information of the lens; Determining whether the original image information meets the requirements of the preset stain image information; If it is in compliance, the original image information is discarded, and the next original image information is obtained for cyclic judgment; If not, the original image information is preprocessed according to a preset image preprocessing method to generate processed image information; Obtaining diopter parameter information corresponding to the original image information; annotating the diopter parameter information on an image corresponding to the processed image information to generate annotated image information; The labeled image information is input into a preset data set to generate image data set information.

[0009] By adopting the above technical solution, when it is determined that the original image information meets the requirements of the stain image information, the original image information is discarded, thereby reducing the workload of subsequent image processing and improving the efficiency of image processing; when it meets the requirements, the original image information is preprocessed, and the corresponding refractive parameter information is annotated on the processed image information to generate annotated image information, and finally the annotated image information is input into the data set to generate image data set information, thereby ensuring the quality of the image data and improving the accuracy of the subsequently constructed model.

[0010] Optionally, the step of performing image preprocessing on the original image information according to a preset image preprocessing method to generate processed image information includes: Select the original image information according to the preset processing window sliding frame to generate feature information to be processed; Analyze the feature information to be processed to determine the gray value information; Grayscale processing is performed on the feature information to be processed according to the grayscale value information to generate grayscale feature information; Analyze the grayscale feature information to determine the median pixel information; Denoising the grayscale feature information according to the median pixel information to generate denoised feature information; Analyze the gray value information and the preset threshold constant information to determine the local threshold information; The denoising feature information is binarized according to the local threshold information to generate processed image information.

[0011] By adopting the above technical scheme, the original image information is selected according to the processing window sliding frame to generate the feature information to be processed, and after the gray value information is determined according to the feature information to be processed, the pixels corresponding to the processing feature information are grayed to obtain the grayed feature information, so as to remove the interference of the color information on the subsequent processing; then the median pixel information is determined according to the grayed feature information, so as to adjust the grayed feature information to the median pixel information to eliminate the pulse interference and random noise in the image; finally, the noise reduction feature information is binarized according to the local threshold information to generate the processed image information, so as to segment the foreground target from the background, thereby improving the convenience of subsequent feature extraction.

[0012] Optionally, the step of inputting the labeled image information into a preset data set to generate image data set information includes: Input the labeled image information into the data set to generate basic data set information; Determine whether the basic data set information meets the requirements of the preset complete data set information; If it does not meet the requirements, continue to obtain the original image information to supplement the basic data set information; If it is consistent, it is determined that the basic data set information is image data set information.

[0013] By adopting the above technical solution, after the annotated image information is input into the data set to generate basic data set information, when it is determined that the basic data set information meets the requirements of the complete data set information, the basic data set information is determined to be the image data set information, thereby ensuring that the image data set information contains sufficient samples for subsequent training models, thereby improving the applicability of the image data set information.

[0014] Optionally, the step of constructing a diopter detection model according to the image data set information and a preset model algorithm includes: Select images one by one according to the image data set information to determine the training Hartmann diaphragm image information and the corresponding training diopter data information; Perform feature analysis based on the training Hartmann aperture image information to generate the spot centroid coordinate information; Construct a basic detection model based on the model algorithm and preset initial hyperparameter information; The basic detection model is trained according to the coordinate information of the centroid of the light spot and the corresponding training diopter data information to determine the detection model to be optimized; The hyperparameters of the detection model to be optimized are optimized according to a preset hyperparameter optimization method to determine the refractive power detection model.

[0015] By adopting the above technical scheme, the basic detection model is trained according to the spot centroid coordinate information and the training refractive data information to determine the detection model to be optimized, and the hyperparameter optimization method is used to perform hyperparameter optimization on the detection model to be optimized to determine the refractive detection model, thereby improving the detection performance of the refractive detection model.

[0016] Optionally, the step of performing hyperparameter optimization on the detection model to be optimized according to a preset hyperparameter optimization method to determine the diopter detection model includes: Obtaining the hyperparameter information to be optimized and the corresponding hyperparameter optimization space information of the detection model to be optimized; Select images one by one according to the image data set information to determine the verification data set information; According to the verification data set information, the preset objective function information and the preset hyperparameter optimization framework, the hyperparameter information to be optimized and the hyperparameter optimization space information are used to perform hyperparameter optimization on the detection model to be optimized to determine the optimal hyperparameter combination information; The detection model to be optimized is retrained according to the optimal hyperparameter combination information to determine the refractive power detection model.

[0017] By adopting the above technical solution, when the verification data set information is used to train the detection model to be optimized, the hyperparameter optimization framework uses the objective function information as the optimization target to optimize the hyperparameters of the detection model to be optimized within the hyperparameter optimization space information, thereby determining the optimal hyperparameter combination information, and retraining the detection model to be optimized with the optimal hyperparameter combination information to determine the refractive power detection model, thereby improving the convenience of hyperparameter optimization of the detection model to be optimized.

[0018] Optionally, the step of retraining the detection model to be optimized according to the optimal hyperparameter combination information to determine the diopter detection model includes: Optimizing the detection model to be optimized according to the optimal hyperparameter combination information to determine the optimized detection model; Select images one by one according to the image data set information to determine the test data set information; Evaluate the optimized detection model according to the test data set information to generate evaluation parameter information; Determine whether the evaluation parameter information meets the requirements of the preset demand evaluation parameter information; If it meets the requirements, the optimized detection model is determined to be a diopter detection model; If not, analyze the evaluation parameter information and the required evaluation parameter information to determine the adjustment hyperparameter information; The hyperparameters of the optimization detection model are optimized according to the hyperparameter adjustment information.

[0019] By adopting the above technical scheme, the optimized detection model is obtained after the detection model to be optimized is optimized according to the optimal hyperparameter combination information, and then the optimized detection model is evaluated according to the test data set information to generate evaluation parameter information. When it is determined that the evaluation parameter information does not meet the requirements of the required evaluation parameter information, the hyperparameter information is adjusted based on the two, so as to optimize the hyperparameters of the optimized detection model according to the adjusted hyperparameter information, thereby improving the accuracy of the refractive power detection model.

[0020] In a second aspect, the present application provides a lens diopter detection system, which adopts the following technical solution: A lens diopter detection system, comprising: An acquisition module is used to acquire image data set information and image data information to be detected; A memory for storing a program of a lens refractive power detection method as described in any one of the above items; The program in the memory can be loaded and executed by the processor to implement a lens refractive power detection method as described in any one of the above items.

[0021] By adopting the above technical solution, the processor loads and executes a program of a lens refractive power detection method stored in the memory, thereby controlling the acquisition module to obtain a series of data related to the lens refractive power detection, inputting the image data information of the lens to be detected into the refractive power detection model, predicting the actual refractive power information, and thus improving the detection efficiency of the lens refractive power.

[0022] In a third aspect, the present application provides a smart terminal, which adopts the following technical solution: An intelligent terminal comprises a memory and a processor, wherein the memory stores a computer program which can be loaded by the processor and executes a lens diopter detection method as described in any one of the above items.

[0023] By adopting the above technical solution and operating the intelligent terminal, the processor is made to load and execute a program of a lens refractive power detection method stored in the memory, so that the image data information of the lens to be detected is input into the refractive power detection model, and the actual refractive power information is predicted, thereby improving the detection efficiency of the lens refractive power.

[0024] In a fourth aspect, the present application provides a computer storage medium capable of storing a corresponding program, which has the characteristic of facilitating the improvement of the detection efficiency of the refractive power of lenses, and adopts the following technical solution: A computer-readable storage medium stores a computer program that can be loaded by a processor and execute any of the above-mentioned lens refractive power detection methods.

[0025] By adopting the above technical solution, a computer program for a lens refractive power detection method is stored in a computer-readable storage medium, so that a processor loads and executes the computer program stored in the storage medium, thereby inputting the image data information of the lens to be detected into a refractive power detection model, predicting the actual refractive power information, and thereby improving the detection efficiency of the lens refractive power.

[0026] In summary, the present application includes at least one of the following beneficial technical effects: 1. By building a diopter detection model based on the image data set information and model algorithm of the lens, when subsequently detecting the diopter of the lens, only the image data information of the lens to be detected needs to be input into the diopter detection model to obtain the actual diopter information of the lens, without the need for personnel to move the graticule to measure the focal length of the lens, thereby improving the detection efficiency of the diopter of the lens; 2. After generating basic data set information by inputting the annotated image information into the data set, when it is determined that the basic data set information meets the requirements of the complete data set information, the basic data set information is determined to be the image data set information, thereby ensuring that the image data set information contains sufficient samples for subsequent training models, thereby improving the applicability of the image data set information; 3. Determine the detection model to be optimized by training the basic detection model according to the spot centroid coordinate information and the training refractive data information, and perform hyperparameter optimization on the detection model to be optimized according to the hyperparameter optimization method to determine the refractive detection model, thereby improving the detection performance of the refractive detection model. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a flow chart of a lens diopter detection method in an embodiment of the present application.

[0028] Figure 2 It is a flowchart of the steps of obtaining image data set information of a lens in an embodiment of the present application.

[0029] Figure 3 It is a flowchart of the steps of performing image preprocessing on original image information according to a preset image preprocessing method to generate processed image information in an embodiment of the present application.

[0030] Figure 4 It is a flowchart of the steps of inputting the labeled image information into a preset data set to generate image data set information in an embodiment of the present application.

[0031] Figure 5 It is a flowchart of the steps of constructing a diopter detection model according to image data set information and a preset model algorithm in an embodiment of the present application.

[0032] Figure 6It is a flowchart of the steps of performing hyperparameter optimization on the detection model to be optimized according to a preset hyperparameter optimization method in an embodiment of the present application to determine a refractive power detection model.

[0033] Figure 7 It is a flowchart of the steps of retraining the detection model to be optimized according to the optimal hyperparameter combination information to determine the refractive power detection model in an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-Figure 7 It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0035] The embodiment of the present application discloses a method for quickly detecting the refractive power of a lens, and discloses a processing terminal. The processing terminal receives image data set information, and thus constructs a refractive power detection model based on the image data set information and a model algorithm. After receiving the image data information of the lens to be detected, the processing terminal inputs the image data information to be detected into the refractive power detection model, thereby predicting the actual refractive power information of the lens, without the need for personnel to move the graticule on the focal meter to measure the focal length of the lens to calculate the refractive power of the lens, thereby improving the refractive power detection efficiency of the lens.

[0036] Reference Figure 1 The present application discloses a method for detecting the diopter of a lens, comprising the following steps: Step S100: obtaining image data set information of the lens.

[0037] The image data set information refers to the Hartmann diaphragm images at different diopter levels, covering various diopter levels from myopia to hyperopia. It can be obtained by taking photos in actual optical experiments and input into the processing terminal. For specific methods, refer to Figure 2 steps.

[0038] Step S101: constructing a diopter detection model according to image data set information and a preset model algorithm.

[0039] Among them, the model algorithm refers to the core algorithm used to build a refractive power detection model. In this application, lightGBM (Light Gradient Boosting Machine) is used as the core algorithm for refractive power detection. LightGBM is a lightweight machine learning model based on a gradient boosting decision tree, and has excellent performance in processing structured data.

[0040] The diopter detection model refers to a machine learning model used to predict the diopter of a lens. The processing terminal trains the model algorithm based on the correspondence between the centroid coordinates of the light spot in the Hartmann diaphragm image and the diopter according to the image data set information. For specific methods, refer to Figure 5 steps.

[0041] Step S102: Obtaining image data information of the lens to be inspected.

[0042] The image data information to be detected refers to the Hartmann diaphragm image of the refractive lens to be detected, which is obtained by the operator through the Hartmann-Shack sensor and uploaded to the processing terminal. The processing terminal performs image preprocessing on the image. The image preprocessing method is referred to Figure 3 The logic of the steps will not be elaborated here.

[0043] Step S103: inputting the image data information to be detected into the diopter detection model to predict the actual diopter information of the lens.

[0044] Among them, the actual refractive power information refers to the actual refractive power of the refractive lens to be detected. After the operator uploads the image data information to be detected to the processing terminal, the processing terminal uses the connected domain to extract the contour and calculate the area according to the Hartmann diaphragm image corresponding to the image data information to be detected, and obtains the geometric features of the light spot. Then, the moments calculation method is used to calculate the centroid coordinates of the light spot in combination with the pixel grayscale distribution in the light spot area. Since the grayscale size reflects the distribution of light intensity, the grayscale-weighted centroid coordinates can more accurately describe the position information of the light spot on the image plane. Therefore, the centroid coordinates of the light spot extracted from the image data information to be detected are input as features into the refractive power detection model, so that the refractive power detection model can accurately predict the refractive power associated with the centroid coordinates of the light spot based on the centroid coordinates of the light spot.

[0045] Reference Figure 2 , the steps of obtaining the image dataset information of the lens include: Step S200: obtaining original image information of the lens.

[0046] The original image information refers to the unprocessed Hartmann aperture image of the lens, which is captured by the operator through a Hartmann-Shack sensor and uploaded to the processing terminal.

[0047] Step S201: determining whether the original image information meets the preset stain image information requirement.

[0048] The stain image information refers to an image with stain features, which is stored in the processing terminal by an operator. The requirement for the stain image information refers to the presence of stain features corresponding to the stain image information.

[0049] By determining whether the image features corresponding to the original image information contain stain features such as those corresponding to the stain image information, the processing terminal can determine whether the Hartmann diaphragm image of the lens is clean and free of stains without interfering with feature extraction of subsequent images.

[0050] Step S2011: If it is in compliance, the original image information is discarded, and the next original image information is obtained to repeat the judgment.

[0051] Among them, if the processing terminal determines that the image features corresponding to the original image information contain stain features such as those corresponding to the stain image information, it indicates that there are stain features in the Hartmann aperture image of the lens, and the stain features will interfere with the feature extraction in the subsequent feature extraction process. Therefore, the original image information is discarded and the next original image information is continued to be detected.

[0052] Step S2012: If not, perform image preprocessing on the original image information according to a preset image preprocessing method to generate processed image information.

[0053] Among them, if the processing terminal determines that the image features corresponding to the original image information do not contain stain features such as those corresponding to the stain image information, it means that there are no stain features in the Hartmann aperture image of the lens, so there will be no stains to interfere with feature extraction, and thus the original image information is preprocessed according to the image preprocessing method to generate processed image information, which is convenient for subsequent feature extraction of the image.

[0054] Image preprocessing method refers to the method of making the image more suitable for feature extraction after preprocessing, which is stored in the processing terminal by the operator. Processing image information refers to the image corresponding to the original image information preprocessed to facilitate subsequent feature extraction. The image is obtained by the processing terminal according to the image preprocessing method. For specific methods, refer to Figure 3 steps.

[0055] Step S20121: Obtain the refractive parameter information corresponding to the original image information.

[0056] The refractive power parameter information refers to the refractive power corresponding to the original image information, and when the operator inputs the original image information of the lens, the refractive power of the lens is simultaneously input into the processing terminal to obtain the information.

[0057] Step S20122: marking the diopter parameter information on the image corresponding to the processed image information to generate marked image information.

[0058] The annotated image information refers to a Hartmann diaphragm image that has been preprocessed and annotated with diopter, and is obtained by the processing terminal annotating the diopter corresponding to the diopter parameter information in the image corresponding to the processed image information.

[0059] Step S20123: input the annotated image information into a preset data set to generate image data set information.

[0060] The data set refers to a blank image data set used to store the Hartmann diaphragm image of the lens to form image data set information. The image data set information in this step is consistent with the image data set information in step S100. The processing terminal inputs the annotated image information and stores it in the data set. For specific methods, refer to Figure 4 steps.

[0061] Reference Figure 3 The step of performing image preprocessing on the original image information according to a preset image preprocessing method to generate processed image information includes: Step S300: Sliding and selecting the original image information according to the preset processing window to generate feature information to be processed.

[0062] The processing window refers to a window used to capture the local range of image features, and the size of the window is an odd number. The feature information to be processed refers to the image features to be preprocessed, which are obtained by sliding the processing window on the image corresponding to the original image information under the control of the processing terminal. After each selected feature is processed, it continues to slide to the next range to continue processing until the entire image is processed.

[0063] Step S301: Analyze the feature information to be processed to determine the gray value information.

[0064] The gray value information refers to the gray value used to gray each pixel corresponding to the feature information to be processed. The processing terminal identifies the three-color value of the pixel and then calculates the average value of the three-color value to obtain the gray value of the pixel.

[0065] Step S302: grayscale the feature information to be processed according to the grayscale value information to generate grayscale feature information.

[0066] Among them, the grayscale feature information refers to the image features corresponding to the feature information to be processed after being grayscaled. After obtaining the grayscale value information of the pixel in the feature information to be processed, the processing terminal replaces the three-color value of the pixel with the grayscale value corresponding to the grayscale value information, thereby removing the image color and preventing subsequent interference with feature extraction.

[0067] Step S303: Analyze the grayscale feature information to determine the median pixel information.

[0068] The median pixel information refers to the middle value of pixels within the range corresponding to the grayscale feature information. The processing terminal identifies the pixel values ​​of the pixels corresponding to the grayscale feature information, sorts and selects the middle values ​​to obtain the median pixel information.

[0069] Step S304: De-noising the grayscale feature information according to the median pixel information to generate de-noised feature information.

[0070] The noise reduction feature information refers to the image feature after the grayscale feature information is denoised. The processing terminal replaces all pixel values ​​of pixels corresponding to the grayscale feature information with pixel values ​​corresponding to the median pixel information, thereby eliminating pulse interference and random noise in the image.

[0071] Step S305: Analyze the gray value information and the preset threshold constant information to determine the local threshold information.

[0072] The threshold constant information refers to the offset for adaptive grayscale mean binarization of image features, and the specific value is determined by the operator according to the actual situation. The local threshold information refers to the threshold value compared with the pixel value of the pixel in the image feature, which is obtained by adding the constant corresponding to the threshold constant information to the grayscale value corresponding to the grayscale value information by the processing terminal.

[0073] Step S306: binarizing the noise reduction feature information according to the local threshold information to generate processed image information.

[0074] Among them, the processed image information in this step is consistent with the processed image information in step S2012. The processing terminal compares the pixel value of the pixel in the noise reduction feature information with the local threshold information. When the pixel value is greater than the threshold corresponding to the local threshold information, the pixel value of the pixel is replaced with the numerical value corresponding to white, that is, 225. If the pixel value is not greater than the threshold corresponding to the local threshold information, the pixel value of the pixel is replaced with the numerical value corresponding to black, that is, 0, thereby generating processed image information, segmenting the foreground and background of the image, and facilitating subsequent feature extraction.

[0075] Reference Figure 4 The step of inputting the labeled image information into a preset data set to generate image data set information includes: Step S400: inputting the annotated image information into the data set to generate basic data set information.

[0076] Among them, the basic data set information refers to an image data set that stores image data that has not been verified whether it can be used as a training sample, and is generated by the processing terminal inputting the image data corresponding to the labeled image information into the data set.

[0077] Step S401: determine whether the basic data set information meets the preset requirements of the complete data set information.

[0078] The complete data set information refers to an image data set storing a sufficient amount of image data, which is stored in the processing terminal by the operator. The requirement for the complete data set information refers to the amount of data not less than that corresponding to the complete data set information.

[0079] The processing terminal determines whether the amount of data corresponding to the basic data set information is not less than the amount of data corresponding to the complete data set information, thereby determining whether the amount in the data set is sufficient to support model training.

[0080] Step S4011: If not, continue to obtain original image information to supplement the basic data set information.

[0081] Among them, if the processing terminal determines that the amount of data corresponding to the basic data set information is less than the amount of data corresponding to the complete data set information, it means that training the model with the data of the current basic data set information is likely to result in low model accuracy. Therefore, the original image information continues to be detected to supplement the basic data set information.

[0082] Step S4012: If it is in compliance, then determine that the basic data set information is image data set information.

[0083] Among them, if the processing terminal determines that the data quantity corresponding to the basic data set information is not less than the data quantity corresponding to the complete data set information, it means that the data quantity of the current basic data set information meets the training requirements of the model, so the basic data set information is determined to be image data set information.

[0084] Reference Figure 5 , the steps of constructing a diopter detection model according to the image data set information and the preset model algorithm include: Step S500: Select images one by one according to the image data set information to determine the training Hartmann aperture image information and the corresponding training diopter data information.

[0085] The training Hartmann diaphragm image information refers to the data samples used for training the model algorithm, which are called by the processing terminal in the image data set information in sequence. The training diopter data information refers to the diopter corresponding to the training Hartmann diaphragm image. When the training Hartmann diaphragm image information is called by the processing terminal as the target training model algorithm, the diopter is obtained by identifying the annotation of the image.

[0086] Step S501: Perform feature analysis based on the training Hartmann aperture image information to generate spot centroid coordinate information.

[0087] The centroid coordinate information of the light spot refers to the position of the light spot in the image corresponding to the training Hartmann aperture image information. As a feature training model algorithm, the processing terminal uses the connected domain to perform contour extraction and area calculation based on the image corresponding to the training Hartmann aperture image information to obtain the geometric features of the light spot. The centroid coordinates of the light spot are calculated by the moments calculation method combined with the pixel grayscale distribution in the light spot area. Since the grayscale size reflects the distribution of light intensity, the grayscale-weighted centroid coordinates can more accurately describe the position information of the light spot on the image plane.

[0088] Step S502: construct a basic detection model according to the model algorithm and preset initial hyperparameter information.

[0089] Among them, the initial hyperparameter information refers to the items and values ​​of machine learning hyperparameters, including the maximum input depth, which is used to control the complexity of the model. Reasonable selection can improve the generalization ability; the minimum number of samples of leaf nodes to prevent overfitting and ensure the robustness of the model; the learning rate, which controls the step size of each iteration and balances the speed and accuracy of model convergence; it also includes the regularization coefficient and feature sub-sampling rate, etc. The specific values ​​are determined by the operator according to the actual situation.

[0090] The basic detection model refers to a model algorithm that has been initialized with hyperparameters, and is obtained by adjusting the model algorithm by the processing terminal according to the items and values ​​corresponding to the initial hyperparameter information.

[0091] Step S503: training the basic detection model according to the light spot centroid coordinate information and the corresponding training diopter data information to determine the detection model to be optimized.

[0092] Among them, the detection model to be optimized refers to the basic detection model after training. The processing terminal inputs the coordinates corresponding to the coordinate information of the center of mass of the light spot into the basic detection model as features to calculate the predicted output, and uses the loss function to compare the refractive power corresponding to the training refractive power data information with the predicted output as the target to obtain the quantization error, and then calculates the gradient of the loss function with respect to the model parameters, and uses gradient descent to update the parameters of the basic detection model according to the gradient until the model converges, thereby obtaining the detection model to be optimized.

[0093] Step S504: performing hyperparameter optimization on the detection model to be optimized according to a preset hyperparameter optimization method to determine a diopter detection model.

[0094] The hyperparameter optimization method refers to the method for optimizing the hyperparameters of the model, which is stored in the processing terminal by the operator. Figure 6 The diopter detection model in this step is obtained by optimizing the hyperparameters of the detection model to be optimized by the processing terminal according to the hyperparameter optimization method. For specific methods, refer to Figure 6 steps.

[0095] Reference Figure 6 , the steps of performing hyperparameter optimization on the detection model to be optimized according to the preset hyperparameter optimization method to determine the diopter detection model include: Step S600: Obtain the hyperparameter information to be optimized and the corresponding hyperparameter optimization space information of the detection model to be optimized.

[0096] Among them, the hyperparameter information to be optimized refers to the hyperparameters that need to be optimized, such as the maximum depth of the tree, the learning rate, the regularization strength, the minimum number of samples of the leaf nodes and the feature sub-sampling rate, etc. The hyperparameter optimization space information refers to the reasonable value range of different hyperparameters, both of which are input into the processing terminal by the operator.

[0097] Step S601: Select images one by one according to the image data set information to determine the verification data set information.

[0098] Among them, the verification data set information refers to a data set including the spot centroid coordinates and the corresponding refractive power as verification data samples. The processing terminal selects the Hartmann diaphragm image and the corresponding refractive power data one by one from the data corresponding to the image data set information, and then extracts the spot centroid coordinates of the Hartmann diaphragm image and the corresponding refractive power to form a verification data set, thereby providing training samples for the subsequent optimization of the detection model to be optimized.

[0099] Step S602: According to the verification data set information, the preset objective function information and the preset hyperparameter optimization framework, the hyperparameter information to be optimized and the hyperparameter optimization space information are used to perform hyperparameter optimization on the detection model to be optimized to determine the optimal hyperparameter combination information.

[0100] Among them, the objective function information refers to the goal of model hyperparameter optimization. In this application, the hyperparameter optimization uses the mean absolute error of the model on the validation set as the optimization objective function. The mean absolute error can reflect the deviation between the model prediction result and the actual value, which is an important indicator for evaluating the accuracy of diopter detection. The hyperparameter optimization framework refers to a hyperparameter optimization library used to explore the best hyperparameter combination. In this application, Optuna is used as the hyperparameter optimization framework.

[0101] The optimal hyperparameter combination information refers to the hyperparameter combination with the smallest deviation between the model prediction and the actual value. The hyperparameter optimization framework explores the hyperparameter space within the hyperparameter optimization space information corresponding to the hyperparameter information to be optimized. After multiple rounds of iterative optimization, the search range is narrowed down so that when the detection model to be optimized is trained on the explored hyperparameter combination with the verification data set information, when the mean absolute error corresponding to the objective function information is minimized, the hyperparameter combination at this time is determined to be the optimal solution.

[0102] Step S603: retraining the detection model to be optimized according to the optimal hyperparameter combination information to determine the diopter detection model.

[0103] Among them, the refractive power detection model in this step is determined by the processing terminal passing the hyperparameters corresponding to the optimal hyperparameter combination information to the model through hard coding or configuration files, and then retraining the detection model to be optimized with the changed hyperparameters. The specific method is as follows Figure 7 steps.

[0104] Reference Figure 7 , the steps of retraining the detection model to be optimized according to the optimal hyperparameter combination information to determine the diopter detection model include: Step S700: Optimize the detection model to be optimized according to the optimal hyperparameter combination information to determine the optimized detection model.

[0105] The optimized detection model refers to a model that has undergone hyperparameter optimization, which is obtained by the processing terminal passing the hyperparameters corresponding to the optimal hyperparameter combination information to the model through hard coding or configuration files.

[0106] Step S701: Select images one by one according to the image data set information to determine the test data set information.

[0107] Among them, the test data set information refers to a data set including the centroid coordinates of the spot and the corresponding refractive power as the test data sample. The processing terminal selects the Hartmann diaphragm image and the corresponding refractive power data one by one from the data corresponding to the image data set information, and then extracts the centroid coordinates of the Hartmann diaphragm image and the corresponding refractive power to form a test data set, thereby providing training samples for the subsequent retraining and optimization of the detection model.

[0108] Step S702: Evaluate the optimized detection model according to the test data set information to generate evaluation parameter information.

[0109] The evaluation parameter information refers to parameters such as accuracy, robustness and inference speed of the optimized detection model, which are obtained by retraining the optimized detection model by using the data corresponding to the test data set information as training samples by the processing terminal.

[0110] Step S703: Determine whether the evaluation parameter information meets the requirements of the preset demand evaluation parameter information.

[0111] The demand assessment parameter information refers to the corresponding goals that need to be achieved by different assessment projects, and the goals corresponding to specific projects are determined by operators according to actual needs. The requirements of the demand assessment parameter information refer to achieving the goals corresponding to the demand assessment parameter information.

[0112] By judging whether the parameters corresponding to the evaluation parameter information have reached the goals corresponding to the required evaluation parameter information, it is determined whether the model after optimizing the hyperparameters meets the usage requirements.

[0113] Step S7031: If it meets the requirements, the optimized detection model is determined to be a refractive power detection model.

[0114] Among them, if the processing terminal determines that the parameters corresponding to the evaluation parameter information reach the targets corresponding to the required evaluation parameter information, it means that the accuracy, inference speed and robustness of the model meet the requirements of use, and therefore the optimized detection model is determined to be a refractive power detection model.

[0115] Step S7032: If not, analyze the evaluation parameter information and the required evaluation parameter information to determine the adjustment hyperparameter information.

[0116] Among them, if the processing terminal determines that the parameters corresponding to the evaluation parameter information do not reach the goals corresponding to the required evaluation parameter information, it indicates that there are items in the accuracy, inference speed and robustness of the model that do not meet the usage requirements. Therefore, the adjustment hyperparameter information is determined based on the evaluation parameter information and the required evaluation parameter information to provide data support for subsequent adjustment of the hyperparameters.

[0117] Adjusting the hyperparameter information refers to the hyperparameters that need to be adjusted, which are determined by the processing terminal comparing the hyperparameters in the evaluation parameter information that do not reach the target corresponding to the required evaluation parameter information. For example, if the accuracy is low, the maximum depth and regularization strength of the tree need to be adjusted, and if the inference speed is low, the learning rate needs to be adjusted.

[0118] Step S70321: Optimize the hyperparameters of the optimization detection model according to the hyperparameter adjustment information.

[0119] Among them, after the processing terminal determines the adjustment of the hyperparameter information, the optimization detection model is optimized again according to the hyperparameters corresponding to the adjustment of the hyperparameter information. The specific logic is the same as Figure 6 The steps are the same as those of , which will not be repeated here, until all the evaluation parameters finally meet the goals of the required evaluation parameters, and the model is determined as a refractive power detection model.

[0120] Based on the same inventive concept, an embodiment of the present invention provides a lens diopter detection system, comprising: An acquisition module is used to acquire image data set information, image data information to be detected, original image information, diopter parameter information, hyperparameter information to be optimized, and hyperparameter optimization space information; A memory for storing a program of a lens diopter detection method; The program in the memory can be loaded and executed by the processor to implement a lens diopter detection method.

[0121] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0122] An embodiment of the present invention provides a computer-readable storage medium storing a computer program that can be loaded by a processor and execute a lens diopter detection method.

[0123] Computer storage media include, for example, various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.

[0124] Based on the same inventive concept, an embodiment of the present invention provides an intelligent terminal, including a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute a lens diopter detection method.

[0125] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0126] The above are all preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Any feature disclosed in this specification (including the abstract and drawings), unless otherwise stated, can be replaced by other equivalent or alternative features with similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.

Claims

1. A method for detecting the refractive power of a lens, characterized in that: include: Obtaining image dataset information of the lens; Construct a diopter detection model based on image dataset information and a preset model algorithm; Obtain the image data information of the lens to be tested; The image data information to be tested is input into the refractive power detection model to predict the actual refractive power information of the lens.

2. The method for detecting the refractive power of a lens according to claim 1, wherein: The steps of obtaining the image dataset information of the lens include: Obtaining original image information of the lens; Determining whether the original image information meets the requirements of the preset stain image information; If it meets the requirements, the original image information is discarded and the next original image information is obtained for cyclic judgment; If not, the original image information is preprocessed according to a preset image preprocessing method to generate processed image information; Obtaining diopter parameter information corresponding to the original image information; marking the diopter parameter information on an image corresponding to the processed image information to generate marked image information; The labeled image information is input into a preset data set to generate image data set information.

3. The method for detecting the refractive power of a lens according to claim 2, wherein: The steps of performing image preprocessing on the original image information according to a preset image preprocessing method to generate processed image information include: Slide and select the original image information according to the preset processing window to generate feature information to be processed; Analyze the feature information to be processed to determine the gray value information; grayscale processing is performed on the feature information to be processed according to the grayscale value information to generate grayscale feature information; Analyze the grayscale feature information to determine the median pixel information; Denoising the grayscale feature information according to the median pixel information to generate denoised feature information; Analyze the grayscale value information and the preset threshold constant information to determine the local threshold information; The denoising feature information is binarized according to the local threshold information to generate processed image information.

4. The method for detecting the refractive power of a lens according to claim 2, wherein: The steps of inputting the labeled image information into a preset data set to generate image data set information include: Input the labeled image information into the data set to generate basic data set information; Determine whether the basic data set information meets the requirements of the preset complete data set information; If it does not meet the requirements, continue to obtain the original image information to supplement the basic data set information; If it is consistent, the basic data set information is determined to be image data set information.

5. The method for detecting the refractive power of a lens according to claim 1, wherein: The steps of constructing a diopter detection model based on image dataset information and a preset model algorithm include: Select images one by one according to the image data set information to determine the training Hartmann diaphragm image information and the corresponding training diopter data information; Perform feature analysis based on the training Hartmann aperture image information to generate the coordinate information of the center of mass of the light spot; Build a basic detection model based on the model algorithm and preset initial hyperparameter information; The basic detection model is trained according to the coordinate information of the center of mass of the light spot and the corresponding training diopter data information to determine the detection model to be optimized; The hyperparameters of the detection model to be optimized are optimized according to a preset hyperparameter optimization method to determine the refractive power detection model.

6. The method for detecting the refractive power of a lens according to claim 5, wherein: The steps of performing hyperparameter optimization on the detection model to be optimized according to a preset hyperparameter optimization method to determine the refractive power detection model include: Obtain the hyperparameter information to be optimized and the corresponding hyperparameter optimization space information of the detection model to be optimized; Select images one by one according to the image dataset information to determine the verification dataset information; According to the verification data set information, the preset objective function information and the preset hyperparameter optimization framework, the hyperparameter information to be optimized and the hyperparameter optimization space information are used to perform hyperparameter optimization on the detection model to be optimized to determine the optimal hyperparameter combination information; The detection model to be optimized is retrained according to the optimal hyperparameter combination information to determine the refractive index detection model.

7. The method for detecting the refractive power of a lens according to claim 6, wherein: The steps of retraining the detection model to be optimized based on the optimal hyperparameter combination information to determine the diopter detection model include: Optimizing the detection model to be optimized based on the optimal hyperparameter combination information to determine the optimized detection model; Select images one by one according to the image dataset information to determine the test dataset information; Evaluate the optimized detection model based on the test data set information to generate evaluation parameter information; Determine whether the evaluation parameter information meets the requirements of the preset demand evaluation parameter information; If it meets the requirements, the optimized detection model is determined to be the diopter detection model; If not, analyze the evaluation parameter information and the required evaluation parameter information to determine the adjustment hyperparameter information; Perform hyperparameter optimization on the optimization detection model based on the hyperparameter adjustment information.

8. A lens diopter detection system, characterized in that: include: An acquisition module is used to obtain image data set information and image data information to be detected; A memory for storing a program of a lens refractive power detection method according to any one of claims 1 to 7; The program in the memory can be loaded and executed by the processor to implement a lens refractive power detection method as claimed in any one of claims 1 to 7.

9. An intelligent terminal, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executes a lens refractive power detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The device stores a computer program that can be loaded by a processor and executes a lens refractive power detection method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for measuring back vertex power of lens

    CN103512731A

  • Determination of at least one optical parameter of a spectacle lens

    CN113678055A

  • Method and apparatus for optimizing spectacle lenses, in particular for wearers of implanted intraocular lenses

    CN114051389A

  • Method and device for optimizing spectacle lens, in particular spectacle lens for wearer of implanted intraocular lens

    CN114173635A

  • Diopter measuring system and method and computer optometry unit

    CN115414000A

Cited By

  • Diopter detection model training method and system

    CN120747671A